Create and configure devices programmatically via fctl

You can use fctl to create scripts which automatically create and configure devices in your Formant organization.

Prerequisites

Install fctl

Follow the steps in fctl overview and installation to install the fctl command-line tool.

Step 1: Create and configure a device

To create a device, use the create device command with the following syntax:

fctl create device <device-name> --upsert --configuration <configuration-template> --tags <tags>

...where the paramters are used as follows:

ParameterUsage
<device-name>Enter your desired device name.
--upsertThis flag indicates that you want to apply a configuration template and/or tags to the device.
--configurationThis flag indicates that the following entry will be the name of the configuration template you want to apply to this device.
<configuration-template>Enter the name of the configuration template you want to apply to this device. Must match an existing configuration template in your Formant organization. For more information, see Configuration templates.
--tagsThis flag indicates that the following entry will be a list of tags you want to apply to this device.
<tags>Enter a list of tags you want to apply to this device. Must be in the following syntax: 'key1: value1; key2: value2'. For more information, see Configure access levels.

A successful operation will return a message of the form:

Updated device <formant-device-id> (<device-name>)

Example

Suppose you want to create a device called my-device, apply the configuration template tractor-template, and apply the following set of tags: make: acme and robot: true. You would run the following command:

fctl create device my-device --upsert --configuration tractor-template --tags 'make: acme; robot: true'

...and receive the following result:

Updated device 5f23ff87-d11c-4cf0-bb66-7ab122f72992 (my-device)

👋

If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [email protected].