server - Management command

List servers

ngsi server list [options]

Options

Options Description
--host VALUE, -h VALUE server host alias
--json, -j JSON format (default: false)
--pretty, -P pretty format (default: false)
--clearText show obfuscated items as clear text (default: false)
--singleLine, -1 list one file per line (default: false)
--help show help (default: true)

Example 1

ngsi server list
comet

Get server

ngsi server get [options]

Options

Options Description
--host VALUE, -h VALUE server host alias (required)
--json, -j JSON format (default: false)
--pretty, -P pretty format (default: false)
--clearText show obfuscated items as clear text (default: false)
--help show help (default: true)

Example 1

ngsi server list --host comet
serverType comet
serverHost http://localhost:8666
FIWARE-Service openiot
FIWARE-ServicePath /

Example 2

ngsi server get --host comet--json
{"serverType":"comet","serverHost":"http://localhost:8666","tenant":"openiot","scope":"/"}

Add server

ngsi server add [options]

Options

Options Description
--host VALUE, -h VALUE server host alias (required)
--serverHost VALUE server host address or alias
--serverType VALUE serverType (comet, ql)
--idmType VALUE, -t VALUE token type
--idmHost VALUE, -m VALUE identity manager host
--apiPath VALUE, -a VALUE API path
--username VALUE, -U VALUE username
--password VALUE, -P VALUE password
--clientId VALUE, -I VALUE client id
--clientSecret VALUE, -S VALUE client secret
--headerName VALUE header name for apikey
--headerValue VALUE header value for apikey
--headerEnvValue VALUE name of environment variable for apikey
--tokenScope VALUE scope for token
--token VALUE token VALUE
--service VALUE, -s VALUE FIWARE Service VALUE
--path VALUE, -p VALUE FIWARE ServicePath VALUE
--safeString VALUE use safe string (VALUE: on/off)
--overWrite, -O overwrite server alias (default: false)
--help show help (default: true)

Note: Orion interprets the FIWARE Service name (tenant name) in lowercase. To use a coherent FIWARE Service name, NGSI Go allows only lowercase letters in FIWARE Service name. Please have a look at MULTI TENANCY section in Orion documentation.

Example 1

Add QuantumLeap as an alias.

ngsi server add --host ql \
  --serverType quantumleap \
  --serverHost http://quantumleap:8668

Example 2

Add STH-Comet with Keyrock as an alias.

ngsi server add \
  --host comet \
  --serverType comet \
  --serverHost http://comet:8666 \
  --idmType keyrock \
  --idmHost https://keyrock \
  --username keyrock001@letsfiware.jp \
  --password 0123456789 \
  --clientId 00000000-1111-2222-3333-444444444444 \
  --clientSecret 55555555-6666-7777-8888-999999999999

Server type

Specify the following value to --serverType option when you add an alias for FIWARE GE and other servers.

FIWARE GE serverType
STH-Comet comet
QuantumLeap quantumleap
IoT Agent iota
Perseo FE perseo
Perseo Core perseo-core
Keyrock keyrock
WireCloud wirecloud
NGSI Go serverType
regstration proxy regproxy
token proxy tokenproxy
geo proxy queryproxy

Example 3

The following example is how to add Keyrock as a server type. Specify an admin user name of Keyrock to --username option.

ngsi server add \
  --host fiware-idm \
  --serverType keyrock \
  --serverHost https://idm.letsfiware.jp \
  --username admin@letsfiware.jp \
  --password 1234567

Example 4

The following example is how to add WireCloud as a server type with Keyrock.

ngsi server add \
  --host wirecloud \
  --serverType wirecloud \
  --serverHost https://wirecloud \
  --idmType keyrock \
  --idmHost https://keyrock/oauth2/token \
  --username wirecloud-admin@letsfiware.jp \
  --password 0123456789 \
  --clientId 00000000-1111-2222-3333-444444444444 \
  --clientSecret 55555555-6666-7777-8888-999999999999

Parameters for Identity Managers

idmType Required parameters Description
basic username, password Basic authentication
password idmHost, username, password, clientId, clientSecret This type is for Password Credentials.
keyrock idmHost, username, password, clientId, clientSecret This type is for Password Credentials of Keyrock.
KeyrockTokenProvider idmHost, username, password It provides auth token from Keyrock.
tokenproxy idmHost, username, password It provides auth token from Keyrock.
ThinkingCities idmHost, username, password It provides auth token from Keystone.
Keycloak idmHost, username, password, clientId, clientSecret It provides auth token from Keycloak.
WSO2 idmHost, username, password, clientId, clientSecret It provides auth token from WSO2.
Kong (client credentials) idmHost, clientId, clientSecret It provides auth token from Kong.
apikey headerName, either headerValue or headerEnvValue It allows you to set a header name and a header value.

FIWARE Service and FIWARE ServicePath

Specify the --service and/or --path parameter when adding a new alias.

Example 5

ngsi server add \
  --host sth \
  --serverHost http://comet:8666 \
  --serverType comet \
  --service open \
  --path /iot

You can add a new alias using an exising alias. Specify an existing alias to the --serverHost parameter when adding a new alias.

Example 6

ngsi server add \
  --host sht \
  --serverHost comet \
  --service open \
  --path /iot

API Path

The NGSI Go assumes that the root of FIWARE Open APIs is a root of URL.

https://quantumleap.letsfiware.jp/v2/entities

You should use the --apiPath parameter if your server has a special URL.

If the root of the NGSI API is in a sub-directory:

https://fiware-server/quantumleap/v2/entities

You should set the --apiPath parameter to as shown:

--apiPath "/,/quantumleap"

If the path of NGSI API is changed to a special path:

https://fiware-server/quantumleap/v2.0/entities

You should set the --apiPath parameter to as shown:

--apiPath "/v2,/quantumleap/v2.0"

Update server

ngsi server upadte [options]

Options

Options Description
--host VALUE, -h VALUE server host alias (required)
--serverHost VALUE server host address or alias
--idmType VALUE, -t VALUE token type
--idmHost VALUE, -m VALUE identity manager host
--apiPath VALUE, -a VALUE API path
--username VALUE, -U VALUE username
--password VALUE, -P VALUE password
--clientId VALUE, -I VALUE client id
--clientSecret VALUE, -S VALUE client secret
--headerName VALUE header name for apikey
--headerValue VALUE header value for apikey
--headerEnvValue VALUE name of environment variable for apikey
--tokenScope VALUE scope for token
--token VALUE token VALUE
--service VALUE, -s VALUE FIWARE Service VALUE
--path VALUE, -p VALUE FIWARE ServicePath VALUE
--safeString VALUE use safe string (VALUE: on/off)
--help show help (default: true)

Example 1

ngsi server update --host comet --serverHost http://sth-comet:8666

Delete server

ngsi server upadte [options]

Options

Options Description
--host VALUE, -h VALUE server host alias (required)
--help show help (default: true)

Example 1

ngsi server delete --host comet