Skip to main content

Bootstrap

Add configuration

To create a config:

magistrala-cli bootstrap create '{"external_id": "myExtID", "external_key": "myExtKey", "name": "myName", "content": "myContent"}' <domain_id> <user_auth_token>

View configuration

To retrieve a specific config:

magistrala-cli bootstrap get <client_id> <domain_id> <user_auth_token>

Retrieve all configurations

To get a list of all configs:

magistrala-cli bootstrap get all <domain_id> <user_auth_token>

Update Bootstrap

Update configuration

To update the editable fields of a provided config:

magistrala-cli bootstrap update config '{"magistrala_id":"<client_id>", "name": "newName", "content": "newContent"}' <domain_id> <user_auth_token>

Update connection

To update the channel list corresponding Client is connected to:

magistrala-cli bootstrap update connection <id> <channel_ids> <domain_id> <user_auth_token>

Update certs

To update the bootstrap config certificates:

magistrala-cli bootstrap update certs <id>   <id> <client_cert> <client_key> <ca> <domain_id> <user_auth_token>

Remove configuration

To remove a config:

magistrala-cli bootstrap remove <client_id> <domain_id> <user_auth_token>

Bootstrap configuration

To return a config to the Client with provided external ID using an external key:

magistrala-cli bootstrap bootstrap [<external_id> <external_key> | secure <external_id> <external_key> <crypto_key> ]

Whitelist Configuration

To update the client state config with a given id from the authenticated user:

magistrala-cli bootstrap whitelist <JSON_config> <domain_id> <user_auth_token>

Config

Magistrala CLI tool supports configuration files that contain some of the basic settings so you don't have to specify them through flags. Once you set the settings, they remain stored locally.

magistrala-cli config <parameter> <value>

The response should look like this:

  ok

This command is used to set the flags to be used by CLI in a local TOML file. The default location of the TOML file is in the same directory as the CLI binary. To change the location of the TOML file you can run the command:

  magistrala-cli config <parameter> <value> -c "cli/file_name.toml"

The possible parameters that can be set using the config command are:

FlagDescriptionDefault
bootstrap_urlBootstrap service URLbootstrap_url
certs_urlCerts service URLcerts_url
http_adapter_urlHTTP adapter URLhttp_adapter_url
msg_content_typeMessage content type"application/senml+json"
reader_urlReader URLreader_url
clients_urlClients service URLclients_url
tls_verificationDo not check for TLS cert
users_urlUsers service URLusers_url
stateBootstrap state query parameter
statusUser status query parameter
topicSubscription topic query parameter
contactSubscription contact query parameter
emailUser email query parameter
limitLimit query parameter10
metadataMetadata query parameter
nameName query parameter
offsetOffset query parameter
raw_outputEnables raw output mode for easier parsing of output