list devices.md
List Devices
Fleets API · Devices
GET https://app.mk.io/api/v1/projects/{project_name}/fleet/devices
List devices on the specified project. To learn more about devices, read Device Concept.
Listing, Sorting and Filtering Devices
This endpoint returns the list of devices in the specified project.
Sorting
The results from this endpoint can be ordered using the $orderby query parameter. Specify a list of field names, separated by commas where each one can optionally specify asc or desc.
Sorting is valid on the following fields: created, createdBy, displayName, id, labels, metadata/created, metadata/displayName, metadata/name, name, status/alarmSeverity, status/beamHA/activeControllerDeviceName, status/beamHA/roles, status/currentSoftwareVersion, status/lastContact, status/model, status/rollbackSoftwareVersion, status/serialNumber, updated, updatedBy
Filtering
There are two ways to filter the set of returned devices from this endpoint - the first is to use the $filter query parameter, the second is to use the $label_key and $label query parameters.
The $filter query parameter allows for devices to be filtered on the basis of fields in the schema using OData query syntax. See this document for more details on the syntax used.
Filters are valid on the following fields: created, createdBy, createdByEmail, createdByName, displayName, id, labels, metadata/created, metadata/displayName, metadata/name, name, spec/siteName, status/alarmSeverity, status/beamHA/activeControllerDeviceName, status/beamHA/roles, status/currentSoftwareVersion, status/lastContact, status/model, status/rollbackSoftwareVersion, status/serialNumber, updated, updatedBy, updatedByEmail, updatedByName
$label_key and $label are specific to querying devices based on their labels. Labels are a set of key-value pairs that can be used to identify devices with any arbitrary metadata you want, specifically for the purpose of retrieving relevant subsets of devices.
Examples:
?$top=10 - Returns only the first 10 devices from the list.
?$orderby=name desc - Sorts devices by name in descending order.
?$filter=name eq 'descriptive name' - Returns devices that match the provided name.
?$orderby=created desc - Sorts devices by creation date in descending order.
?$filter=created ge 2021-01-01T00:00:00Z - Returns devices created after January 1, 2021.
?$label=studio=paravalley - Returns devices with the label studio set to paravalley.
?$label=release-date~2023 - Returns devices with the label release-date set to a value that contains 2023.
?$label_key=studio&label_key=release-date - Returns devices with any value set for the studio label and the release-date label.
RBAC Capability Required: fleet.device.get
Authentication
Authorizationheader — Bearer authentication of the formBearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_name |
string | Yes | — |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
$orderby |
string | No | Specifies the key by which the result collection should be ordered. |
$filter |
string | No | Restricts the set of items returned. |
$top |
string | No | Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. |
$skiptoken |
string | No | Specifies a start offset to support paginated results. Use @odata.nextLink in the result object to enumerate the collection - it will be present only if there's more than one page of entities. |
$label_key |
string | No | Filters the set to the specified label key. If multiple $label_keys are specified, matching items must have all labels. |
$label |
string | No | Filters the set to the specified label key/value pair. Supports equality, inequality, and inexact matching. If multiple values are provided for the same key, items matching either value will be returned. |
Example request
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/fleet/devices" \
-H "Authorization: Bearer <token>"
Responses
200 — A list of devices
@odata.nextLink· string · Optional — @odata.nextLink URL if the page length and number of items match.supplemental· object · Required — Supplemental infocount· integer · Required — Number of items returnedkind· string · Required — Type of items in the listoperation· string · Required — Operation type. Should always say 'list'pagination· object · Required — Pagination infoend· integer · Required — Position of the last item in the listrecords· integer · Required — Total number of items returned in the liststart· integer · Required — Position of the first item in the listtotal· integer · Required — Total number of items in the project
subscription· object · Optional — Project infoid· string · Required — Project IDname· string · Required — Project name
value· list of objects · Required — A list of devices.- Array items (object):
kind· string · Required — The kind of record.metadata· object · Required — Device metadata.created· string · Optional · format: date-time — The time when the resource was createdcreatedBy· string · Optional · format: uuid — ID of the user who created the resourcecreatedByEmail· string · Optional — Email of the user who created the resourcedisplayName· string · Optional — The display name of the resourceid· string · Required · format: uuid — The ID of the resourcelabels· map from strings to string · Optional — A dictionary of labels associated with the resource[any key]· string — map of additional properties
name· string · Optional — The name of the resourceupdated· string · Optional · format: date-time — The time when the resource was last updatedupdatedBy· string · Optional · format: uuid — ID of the user who last updated the resourceupdatedByEmail· string · Optional — Email of the user who last updated the resource
spec· object · Required — Device specification.autoPreloadLatestSoftware· boolean · Optional · Defaults to false — Whether the device should automatically preload the latest available software version.availableNetworks· list of objects · Required — The list of <glossary:network>s available to the device and, optionally, the interfaces they are connected to. Leave the available networks list empty to give the device access to all of the networks with routes to the device's <glossary:site>. Read Available networks to learn more.- Array items (object):
interfaceName· string · Required · pattern: [^\s/]{1,16} — The name of the <<glossary:device interface>> that will be connected to the network.networkName· string · Required · pattern: ^a-z0-9?$ — The name of the <glossary:network> that will be made available to this device.
- Array items (object):
desiredSoftwareVersion· string · Optional · <=255 characters — The desired version of software that should be running on the device.geolocation· object · Optional — Optional geolocation data for the device.coordinates· list of doubles · Required · 0-2 items — Co-ordinates that describe the geolocation (ISO 6709), an array of two floating point numbers [latitude(North - South), longitude(East - West)]. Set an empty array to clear the geolocation.- Array items (double):
locationId· string · Optional · pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ — The location id is the identity of the actual device that will be associated with this record. This can be used instead of theshortCodefield when registering an on-prem device. The location id does not change so this can be a simpler approach for large scale system administration.preloadSoftwareVersion· string · Optional · <=255 characters — A version of the software that should be preloaded on the device.shortCode· string · Optional · 8-8 characters — The short code from a device's web user interface, used to on-board the device. The short code expires quickly, so it should be used immediately after it is generated. Read On-board fleet devices to learn more about on-boarding devices.siteName· string · Optional · pattern: ^(a-z0-9?)?$ — The name of the <glossary:site> where the device is located.
status· object · Required — Device status.alarmSeverity· enum · Optional — The most severe alarm level last reported by the device. - 0 - Clear - 1 - Info - 2 - Warning - 3 - Error - 4 - Critical- Allowed values:
0,1,2,3,4
- Allowed values:
assignedFlows· list of objects · Optional — The a list of the <glossary:flow> names assigned to the device.- Array items (object):
name· string · Required · pattern: ^a-z0-9?$ — The name of a <glossary:flow> assigned to the device.
- Array items (object):
beamHA· object · Optional — Information about the beamHA the device is connected to.activeControllerDeviceName· string · Optional · 1-64 characters — The name of the active controller device in the beamHA.roles· list of strings · Required · 0-3 items — The roles of the device in the beamHA (high availability) group.- Array items (string):
status· string · Optional — The status of the beamHA group. Only returned for the active controller device.unregisteredDevices· list of strings · Optional — List of location IDs of devices that are part of the beamHA but not registered. Only returned for the active controller device.- Array items (string):
capabilities· object · Optional — Device capabilities based on software version and hardware.configurationBackup· boolean · Optional — Whether the device supports configuration backup. Returns false for devices with beam software version older than 1.6.
currentSoftwareVersion· string or null · Optional · <=255 characters — The current software version running on the device, as reported by the device.geolocation· object · Optional — Optional geolocation data for the device.coordinates· list of doubles · Required · 0-2 items — Co-ordinates that describe the geolocation (ISO 6709), an array of two floating point numbers [latitude(North - South), longitude(East - West)]. Set an empty array to clear the geolocation.- Array items (double):
interfaces· list of objects · Optional — A list of the physical and virtual interfaces reported by the device. If an interface is referenced directly by a source or a destination, it may be continue to be present in the list even if the device no longer reports it. Thestatefield indicates if the interface is currently present on the device.- Array items (object):
ipAddresses· list of strings · Optional — The IP address associated with this interface, if applicable.- Array items (string):
name· string · Required · pattern: ^([^"]{1,16}|[a-zA-Z][a-zA-Z0-9]{1,255})$_ — The name of the interface on the device.state· enum · Required — Whether the interface is currently present on the device. If an interface is referenced directly by a source or a destination, it may be continue to be present in the list even if the device no longer reports it.- Allowed values:
NotPresent,Present
- Allowed values:
type· enum · Required — The type of the physical or virtual interface on the device (IP, SDI/ASI or RF).- Allowed values:
IP,SDIASI,RF
- Allowed values:
- Array items (object):
lastContact· string or null · Optional — The last time the device contacted the system.locationId· string or null · Optional · pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ — The location id is the identity of the actual device that will be associated with this record. This can be used instead of theshortCodefield when registering an on-prem device. The location id does not change so this can be a simpler approach for large scale system administration.preloadedSoftware· list of objects or null · Optional — The preloaded software present on the device.- Array items (object):
downgradeCompatible· boolean · Optional — Whether switching to this release is safe from an underlying component perspective. False if this release has a lower minimum version requirement than the currently installed release. True when no suitable reference release can be found (fail open).name· string · Required · 1-255 characters — The name of the preloaded software present on the device.precentProgress· integer · Optional · 0 to 100 — Indication of coarse progress for states with a significant duration.progressDetails· string · Optional · <=255 characters · _Defaults to _ — Additional information about states with a significant duration.state· enum · Required — The current state of the preloaded software.- Allowed values:
Requested,Downloading,Downloaded,Importing,PreloadFailed,PreloadCancelled,Removing,Removed
- Allowed values:
upgradeCompatible· boolean · Optional — Whether the device's current software version meets the minimum version requirement for upgrading to this release. Mirrors the field on the device software list endpoint.version· string · Required · <=255 characters — The version of the preloaded software.
- Array items (object):
rollbackSoftwareVersion· string or null · Optional · <=255 characters — The rollback software version, as reported by the device.secondsSinceLastContact· integer or null · Optional — The number of seconds since the last time the device contacted the system.serialNumber· string or null · Optional · 1-255 characters — The serial number of the device, as reported by the device.softwareName· string or null · Optional · 0-255 characters — The name of the software installed on the device.softwareUpgradeState· enum · Optional — Indicates if a software upgrade is in progress or has failed.- Allowed values:
Idle,Switching,SwitchFailed
- Allowed values:
url· string · Optional · 1-2048 characters — The URL to access the device's web interface remotely.
- Array items (object):
Example
{
"@odata.nextLink": "string",
"supplemental": {
"count": 0,
"kind": "string",
"operation": "string",
"pagination": {
"end": 0,
"records": 0,
"start": 0,
"total": 0
},
"subscription": {
"id": "string",
"name": "string"
}
},
"value": [
{
"kind": "string",
"metadata": {
"created": "2024-01-01T00:00:00Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"createdByEmail": "string",
"displayName": "string",
"id": "00000000-0000-0000-0000-000000000000",
"labels": {
"label1": "value1",
"label2": "value2"
},
"name": "string",
"updated": "2024-01-01T00:00:00Z",
"updatedBy": "00000000-0000-0000-0000-000000000000",
"updatedByEmail": "string"
},
"spec": {
"autoPreloadLatestSoftware": true,
"availableNetworks": [
{
"interfaceName": "eth0",
"networkName": "internet"
}
],
"desiredSoftwareVersion": "1.0.0.0",
"geolocation": {
"coordinates": [
0
]
},
"locationId": "e188ca13-604f-4940-9afb-c3cb952baf01",
"preloadSoftwareVersion": "1.0.0.1",
"shortCode": "XU7U23WD",
"siteName": "world"
},
"status": {
"alarmSeverity": 0,
"assignedFlows": [
{
"name": "channel-1"
}
],
"beamHA": {
"activeControllerDeviceName": "controller-01",
"roles": [
"Controller",
"Worker",
"Arbiter"
],
"status": "OK",
"unregisteredDevices": [
"e188ca13-604f-4940-9afb-c3cb952baf01"
]
},
"capabilities": {
"configurationBackup": true
},
"currentSoftwareVersion": "1.0.0.2",
"geolocation": {
"coordinates": [
0
]
},
"interfaces": [
{
"ipAddresses": [
"10.10.10.1"
],
"name": "eth0",
"state": "Present",
"type": "IP"
}
],
"lastContact": "string",
"locationId": "e188ca13-604f-4940-9afb-c3cb952baf01",
"preloadedSoftware": [
{
"downgradeCompatible": true,
"name": "beam",
"precentProgress": 25,
"progressDetails": "1.2GiB of 4.9GiB",
"state": "Downloading",
"upgradeCompatible": true,
"version": "1.0.0.0"
}
],
"rollbackSoftwareVersion": "1.0.0.1",
"secondsSinceLastContact": 0,
"serialNumber": "string",
"softwareName": "beam",
"softwareUpgradeState": "Idle",
"url": "string"
}
}
]
}
400 — Bad Request
error· object · Required — Pertinent information about the errorcode· string · Required — The error code.detail· string · Required — The error message.extraDetail· map from strings to any · Optional — Extra information regarding this error.[any key]· any — map of additional properties
ref· string · Required — A reference to the request that caused the error.status· integer · Required — The HTTP status code
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
401 — Unauthorized
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
403 — Forbidden
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
404 — Not Found
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
429 — Too Many Requests
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
500 — Internal Server Error
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
Source spec: fleets-api · operationId: [get]_/api/v1/projects/{project_name}/fleet/devices