No Results
Editing Settings using Command-line

Overview

Editing connection settings involves a couple of steps. First, the name of the endpoint must be determined. A foolproof way is to enable failover and see what name is set. By default, connections created prior to v3.0 have a default endpoint named “Primary”, while connections created in v3.0 or later have a default endpoint named “Endpoint1”.

Once the endpoint name is known, the next step is to determine the name of the property to be set.  The display name in the UI will not match. The easiest way to get the name is to inspect the label in the UI, which you can access in the Chrome browser, for example, by right click and then selecting “inspect”. The HTML element will have an attribute “for” with the value matching the name of the property. Below is an example for finding the property name of a MySQL database:

The last step is to determine the value. For most fields, this is pretty easy. Numbers are unencoded, while strings can be if there are no spaces, but use double-quotes around the value if there are spaces. Credential values are unique in that they require the JSON representation of the value. The following is the basic template for such a value:

"{\"doClass\":\"CredentialSetDO\",\"credentials\":[{\"doClass\":\"CredentialPairDO\",\"key\":\"Username\",\"value\":{\"doClass\":\"SpStringValueDO\",\"primitiveValue\":\"yourUserName\"}},{\"doClass\":\"CredentialPairDO\",\"key\":\"Password\",\"value\":{\"doClass\":\"SpEncryptedStringValueDO\",\"plainValue\":\"yourPassword\"},\"hidden\":true}]}"

The plain value for the password is passed in, but it will be encrypted when stored in the database.

Example Use Cases

Below are example use cases for editing the settings of connections, datasets, and account adapters using edge.sh. Starting in edgeCore v3.9.2, the edit command has been ported to the new Edge CLI, thus allowing users to edit the settings using es-cli.sh. The syntax is nearly identical to that of the edit command in edge.sh, with the main change being the addition of any necessary login credentials. While edge.sh edit was a fire-and-forget operation, es-cli.sh edit waits for and processes feedback from the edgeCore server. This change in functionality allows users to confirm that the operation worked, and to read the current value of a given property by omitting -v VALUE from the command arguments, e.g. bin/es-cli.sh edit -s connection -n secDB -e Endpoint1 -p databasename. Users may, of course, continue to use edge.sh, however edge.sh edit is among the commands that are planned for deprecation in edgeCore v4.0 as part of the transition to Edge CLI.

Examples of setting connection values

Set database port for a v2.x created MySQL connection:

bin/edge.sh edit -s connection -n telco -e Primary -p port -v 3306

Set database name for a v3.0 created MySQL connection:

bin/edge.sh edit -s connection -n secDB -e Endpoint1 -p databasename -v s1.lotus.internal

Set credentials for a database:

bin/edge.sh edit -s connection -n telco -e Endpoint1 -p credentials -v "{\"doClass\":\"CredentialSetDO\",\"credentials\":[{\"doClass\":\"CredentialPairDO\",\"key\":\"Username\",\"value\":{\"doClass\":\"SpStringValueDO\",\"primitiveValue\":\"telco\"}},{\"doClass\":\"CredentialPairDO\",\"key\":\"Password\",\"value\":{\"doClass\":\"SpEncryptedStringValueDO\",\"plainValue\":\"telco\"},\"hidden\":true}]}

Examples of setting feed/transform (dataset) values

Set web data JSON Feed’s start URL:

bin/edge.sh edit -s dataset -n alerts_status -p start -v "/startingurl?start=test&value=test"

Set query for SQL transform:

bin/edge.sh edit -s dataset -n Incidents -p query -v "select * from incidents"

Examples of setting account adapter values

Set user search filter for LDAP domain:

bin/edge.sh edit -s accountAdapter -n testLdap -p userSearchFilter -v "(&(objectCategory=person){USER_SEARCH_CLAUSE})"


Terms | Privacy