devices
Creates, updates, deletes, gets or lists a devices resource.
Overview​
| Name | devices |
| Type | Resource |
| Id | ovh.over_the_box.devices |
Fields​
The following fields are returned by SELECT queries:
- get
successful operation
| Name | Datatype | Description |
|---|---|---|
device_id | string | The id of the device (wire: deviceId) |
activated | boolean | Whether or not this device is associated to a service |
available_update | boolean | Whether or not an upate is available for this device (wire: availableUpdate) |
last_seen | string (date-time) | Last time the device has been seen on the provisionning servers (wire: lastSeen) |
network_interfaces | array | Network interfaces of the device (wire: networkInterfaces) |
public_ip | string (ipv4) | The public IP of the device (example: 192.0.2.0) (wire: publicIp) |
system | object | Device system information |
system_version | string | System version of the device (wire: systemVersion) |
version | string | Version of the device |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | Get the device of an OverTheBox service. Returns the device ID, version, system information, public IP, network interfaces, last seen date and whether an update is available. | |
delete | delete | service_name | Unlink the device of an OverTheBox service. Removes the association between the device and the service. Link another device with linkDevice. | |
backup | exec | serviceName | Back up an OverTheBox device. Creates the device action that generates a configuration backup of the device, and returns that action. | |
logs | exec | serviceName | Generate a temporary URL for the device logs. Returns a temporary URL to download the logs of the OverTheBox device, with its expiration date. | |
restore_backup | exec | serviceName, backupId | Restore a backup on an OverTheBox device. Creates the group of device actions that restore the given backup on the device, and returns them. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
serviceName | string | The internal name of your overTheBox offer |
service_name | string | The internal name of your overTheBox offer (wire: serviceName) |
SELECT examples​
- get
Get the device of an OverTheBox service. Returns the device ID, version, system information, public IP, network interfaces, last seen date and whether an update is available.
SELECT
device_id,
activated,
available_update,
last_seen,
network_interfaces,
public_ip,
system,
system_version,
version
FROM ovh.over_the_box.devices
WHERE service_name = '{{ service_name }}' -- required
;
DELETE examples​
- delete
Unlink the device of an OverTheBox service. Removes the association between the device and the service. Link another device with linkDevice.
DELETE FROM ovh.over_the_box.devices
WHERE service_name = '{{ service_name }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- backup
- logs
- restore_backup
Back up an OverTheBox device. Creates the device action that generates a configuration backup of the device, and returns that action.
EXEC ovh.over_the_box.devices.backup
@serviceName='{{ serviceName }}' --required
;
Generate a temporary URL for the device logs. Returns a temporary URL to download the logs of the OverTheBox device, with its expiration date.
EXEC ovh.over_the_box.devices.logs
@serviceName='{{ serviceName }}' --required
;
Restore a backup on an OverTheBox device. Creates the group of device actions that restore the given backup on the device, and returns them.
EXEC ovh.over_the_box.devices.restore_backup
@serviceName='{{ serviceName }}' --required
@@json=
'{
"backupId": "{{ backupId }}"
}'
;