Device Resource

Danger

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

A Device instance represents a single Microvisor-empowered IoT device. For clarity, device (no cap) refers to physical hardware. Device (initial cap) refers to a Device API resource.

Device resources are accessed at this endpoint:

https://microvisor.com/v1/Devices

Make a GET request to the endpoint to receive a list (in JSON) of all Device resources.

Every Device instance can be referenced in the API either by its unique ID or a user-defined unique name:

https://microvisor.com/v1/Devices/{id}
https://microvisor.com/v1/Devices/{uniqueName}

The Device instance representing a real device is used to deploy uploaded code to that device.

Status Values

The table below describes the available status values of a Device instance:

Status

Description

up-to-date

The device has received with the most recent application code deployed to it

scheduled

Application code has been marked for deployment but has yet to be installed on
the device

error

Application code marked for deployment could not be downloaded for some reason

Get all Devices

Action

Request a list of all Device resources

Path

https://microvisor.com/v1/Devices

Method

GET

Get a Device

Action

Request a single Device resource

Path

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

Method

GET

Parameters

Name: id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Update a Device

Action

Give a Device a memorable name

Path

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

Method

POST

Parameters

Name: unique_name Value: {memorable device name}

Note

Remember, a Device can be identified either by is ID, or by its unique name, if you have applied one.

Deploy to a Device

Action

Deploy an App to the Device

Path

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

Method

POST

Parameters

Name: target_app Value: KAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Enable Logging from a Device

Action

Enable application code logging

Path

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

Method

POST

Parameters

Name: id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Name: logging_enabled Value: true

Note

Application code logging is currently enabled by default.

Restart a Device’s App

Action

Restart an App on a Device

Path

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

Method

POST

Parameters

Name: id Value: UVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Name: restart_app Value: true

Restarting an app using this call will instruct Microvisor to start the loaded application afresh. This can be a useful call to make during remote debugging, particularly if your application is experiencing unexpected behavior right after it starts.