tlm-cli pms provisioning¶
Commands for managing the full provisioning lifecycle of manufacturing devices.
Provisioning registers a device in the Product Management System (PMS), assigns it to a customer tenant, and writes an agent configuration file to disk. The configuration file is needed by the device's on-board agent to connect to the platform.
provision¶
Provision a device and write its agent configuration file.
| Argument / Option | Type | Required | Description |
|---|---|---|---|
SERIAL_NUMBER |
string | yes | Device serial number. |
--customer TEXT |
string | yes | Customer code to assign the device to. |
--output-dir PATH |
path | no | Base directory for the config file. Defaults to the current working directory. |
--dry-run |
flag | no | Validate inputs without provisioning. |
The configuration file is written to <output-dir>/<serial-number>/agent.env.
Example
# Provision a device
tlm-cli pms provisioning provision SN-001234 --customer ACME
# Write config to a specific directory
tlm-cli pms provisioning provision SN-001234 --customer ACME --output-dir /opt/device-configs
# Validate inputs without making changes
tlm-cli pms provisioning provision SN-001234 --customer ACME --dry-run
What provisioning does:
- Checks the device does not already exist in PMS.
- Resolves the customer code to its tenant ID.
- Calls the bulk provisioning API.
- Fetches the ConnHex ID assigned to the device.
- Retrieves the init key from the IoT API.
- Writes the
agent.envconfiguration file.
See Provisioning Workflow for a detailed explanation.
unprovision¶
Permanently remove all provisioning records for a device.
Danger
This operation cannot be undone. Use --dry-run to inspect the device state first.
| Argument / Option | Type | Required | Description |
|---|---|---|---|
SERIAL_NUMBER |
string | yes | Device serial number. |
--dry-run |
flag | no | Show the device state and planned action without making changes. |
--yes / -y |
flag | no | Skip the confirmation prompt. |
Example
# Inspect the device state first
tlm-cli pms provisioning unprovision SN-001234 --dry-run
# Unprovision with confirmation prompt
tlm-cli pms provisioning unprovision SN-001234
# Skip the prompt
tlm-cli pms provisioning unprovision SN-001234 --yes
get-certificate¶
Retrieve the agent configuration file for an already-provisioned device.
Use this to retrieve the agent configuration file for a device that is already provisioned. The content of agent.env is
stable — it will not change between calls unless the device is unprovisioned and reprovisioned. This is the recommended
way to recover the configuration file if it has been lost or to deploy it to a replacement device.
| Argument / Option | Type | Required | Description |
|---|---|---|---|
SERIAL_NUMBER |
string | yes | Device serial number. |
--output-dir PATH |
path | no | Base directory for the config file. Defaults to the current working directory. |
The configuration file is written to <output-dir>/<serial-number>/agent.env.
Example
# Retrieve to the current directory
tlm-cli pms provisioning get-certificate SN-001234
# Write to a specific directory
tlm-cli pms provisioning get-certificate SN-001234 --output-dir /opt/device-configs