View Source NervesHubCLI.CLI.Device (nerves_hub_cli v2.1.0)
Manage your NervesHub devices.
create
Create a new NervesHub device. The shell will prompt for information about the device. This information can be passed by specifying one or all of the command line options.
nerves_hub device createCommand-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"--identifier- (Optional) The device identifier--description- (Optional) The description of the device--tag- (Optional) Multiple tags can be set by passing this key multiple times
bulk_create
Create many NervesHub devices via a csv file.
nerves_hub device bulk_createThe CSV file should be formated as:
identifier,tags,descriptionWhere tags is a double-quoted string, containing comma delimited tags.
Example CSV file:
identifier,tags,description
00000000d712d174,"tag1,tag2,tag3",some useful description of the device
00000000deadb33f,"qa,region1",this device should only be used with QACommand-line options
--csv- Path to a CSV file--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"
update
Update values on a device.
Examples
List all devices
nerves_hub device listCommand-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"--identifier- (Optional) Only show device matching an identifier--description- (Optional) Only show devices matching a description--tag- (Optional) Only show devices matching tags. Multiple tags can be supplied.--status- (Optional) Only show devices matching status--version- (Optional) Only show devices matching version
Update device tags
nerves_hub device update 1234 tags dev qadelete
Delete a device on NervesHub
nerves_hub device delete DEVICE_IDENTIFIERburn
Combine a firmware image with NervesHub provisioning information and burn the result to an attached MicroSD card or file. This requires that the device was already created. Calling burn without passing command-line options will generate a new cert pair for the device. The command will end with calling mix firmware.burn.
nerves_hub device burn DEVICE_IDENTIFIERCommand-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"--cert- (Optional) A path to an existing device certificate--key- (Optional) A path to an existing device private key--path- (Optional) The path to put the device certificates--firmware- (Optional) The path to the fw file to use. Defaults to<image_path>/<otp_app>.fw
cert list
List all certificates for a device.
nerves_hub device cert list DEVICE_IDENTIFIERCommand-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"
cert create
Creates a new device certificate pair. The certificates will be placed in the current working directory if no path is specified.
nerves_hub device cert create DEVICE_IDENTIFIERYou must take on the role of the CA by providing your own signer certificate
and key and using the --signer-cert and --signer-key options.
These will be used with a NervesHub-defined certificate template to sign the
generated device certificate locally.
Command-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"--path- (Optional) A local location for storing certificates--signer-cert- (required) Path to the signer certificate--signer-key- (required) Path to signer certificate's private key--validity- (Optional) Time in years a certificate should be valid. Defaults to 31.
cert import
Import a trusted certificate for authenticating a device.
nerves_hub device cert import DEVICE_IDENTIFIER CERT_PATHCommand-line options
--product- (Optional) The product name. This defaults to the NERVES_HUB_PRODUCT environment variable (if set) or the global configuration vianerves_hub config set product "product_name"