devices
Creates, updates, deletes, gets or lists a devices
resource.
Overview
Name | devices |
Type | Resource |
Id | azure.sphere.devices |
Fields
- vw_devices
- devices
Name | Datatype | Description |
---|---|---|
catalogName | text | field from the properties object |
chip_sku | text | field from the properties object |
deviceGroupName | text | field from the properties object |
deviceName | text | field from the properties object |
device_id | text | field from the properties object |
last_available_os_version | text | field from the properties object |
last_installed_os_version | text | field from the properties object |
last_os_update_utc | text | field from the properties object |
last_update_request_utc | text | field from the properties object |
productName | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
subscriptionId | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | The properties of device |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | catalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId | Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. |
list_by_device_group | SELECT | catalogName, deviceGroupName, productName, resourceGroupName, subscriptionId | List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. |
create_or_update | INSERT | catalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId | Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. |
delete | DELETE | catalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId | Delete a Device |
update | UPDATE | catalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId | Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. |
generate_capability_image | EXEC | catalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId, data__capabilities | Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. |
SELECT
examples
List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
- vw_devices
- devices
SELECT
catalogName,
chip_sku,
deviceGroupName,
deviceName,
device_id,
last_available_os_version,
last_installed_os_version,
last_os_update_utc,
last_update_request_utc,
productName,
provisioning_state,
resourceGroupName,
subscriptionId
FROM azure.sphere.vw_devices
WHERE catalogName = '{{ catalogName }}'
AND deviceGroupName = '{{ deviceGroupName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sphere.devices
WHERE catalogName = '{{ catalogName }}'
AND deviceGroupName = '{{ deviceGroupName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new devices
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sphere.devices (
catalogName,
deviceGroupName,
deviceName,
productName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ catalogName }}',
'{{ deviceGroupName }}',
'{{ deviceName }}',
'{{ productName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: deviceId
value: string
- name: chipSku
value: string
- name: lastAvailableOsVersion
value: string
- name: lastInstalledOsVersion
value: string
- name: lastOsUpdateUtc
value: string
- name: lastUpdateRequestUtc
value: string
- name: provisioningState
value: []
UPDATE
example
Updates a devices
resource.
/*+ update */
UPDATE azure.sphere.devices
SET
properties = '{{ properties }}'
WHERE
catalogName = '{{ catalogName }}'
AND deviceGroupName = '{{ deviceGroupName }}'
AND deviceName = '{{ deviceName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified devices
resource.
/*+ delete */
DELETE FROM azure.sphere.devices
WHERE catalogName = '{{ catalogName }}'
AND deviceGroupName = '{{ deviceGroupName }}'
AND deviceName = '{{ deviceName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';