Skip to main content

devices

Creates, updates, deletes, gets or lists a devices resource.

Overview

Namedevices
TypeResource
Idazure.sphere.devices

Fields

NameDatatypeDescription
catalogNametextfield from the properties object
chip_skutextfield from the properties object
deviceGroupNametextfield from the properties object
deviceNametextfield from the properties object
device_idtextfield from the properties object
last_available_os_versiontextfield from the properties object
last_installed_os_versiontextfield from the properties object
last_os_update_utctextfield from the properties object
last_update_request_utctextfield from the properties object
productNametextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTcatalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionIdGet 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_groupSELECTcatalogName, deviceGroupName, productName, resourceGroupName, subscriptionIdList Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
create_or_updateINSERTcatalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionIdCreate a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only.
deleteDELETEcatalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionIdDelete a Device
updateUPDATEcatalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionIdUpdate a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level.
generate_capability_imageEXECcatalogName, deviceGroupName, deviceName, productName, resourceGroupName, subscriptionId, data__capabilitiesGenerates 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.

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new devices resource.

/*+ create */
INSERT INTO azure.sphere.devices (
catalogName,
deviceGroupName,
deviceName,
productName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ catalogName }}',
'{{ deviceGroupName }}',
'{{ deviceName }}',
'{{ productName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

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 }}';