Secret Sub-resource

Danger

This is historical documentation, and tooling and console operations are no longer available.

You can provide configuration data for specific Microvisor-empowered IoT devices using the Secret sub-resource. Secrets are intended as a way to upload data such as PKI keys and other confidential items to the Microvisor Cloud so they need not be baked into application code. Instead, the application code running on the device retrieves the Secret when it needs the information.

Unlike Device Configs, Device Secrets’ values cannot be accessed via the API once they have been created. The retrieval actions listed below will return Secrets’ metadata, not their values.

Each Secret is a key:value pair which your application code can access using Microvisor System Calls.

Keys are text identifiers of up to 100 characters in length. They must be unique for a given device. For example, devices A and B can both have Secret with the key wifi_password, but each device can have only one Secret with that key.

Values must also be supplied as text, of up to 4096 characters in length. If you wish to make binary data available to your devices, you will need to encode it as text before creating the Secret. For example, you might used base64 encoding. Your application must decode the value back to binary after acquiring it from the Microvisor Cloud.

Secret sub-resources are accessed at these endpoints:

https://microvisor.com/v1/Devices/{Id}/Secrets
https://microvisor.com/v1/Devices/{UniqueName}/Secrets

Device Configs are accessible only by the specified device. For Secrets that are made available to all devices associated with a given account, please see Account-level Secrets.

Warning

Secrets can’t yet be updated. If you need to change a Secret’s value, delete it first, and then create a new Secret with the same key.

Create a Device Secret

Action

Create a device-level Secret

Path

https://microvisor.com/v1/Devices/{DeviceId}/Secrets

Method

POST

Parameters

Name: device_id Value: {secret‘s name as a string}
Name: value Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Read a Device Secret’s Metadata

Action

Retrieve a device-level Secret‘s metadata

Path

https://microvisor.com/v1/Devices/{DeviceId}/Secrets/{Key}

Method

GET

Parameters

Name: device_id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Name: key Value: {key_name}

List All of a Device’s Secrets

Action

List all of a device’s Secrets

Path

https://microvisor.com/v1/Devices/{DeviceId}/Secrets

Method

GET

Parameters

Name: device_id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Delete a Device Secret

Action

Delete a device-level Secret

Path

https://microvisor.com/v1/Devices/{DeviceId}/Secrets/{Key}

Method

DELETE

Parameters

Name: device_id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Name: key Value: {key_name}