Skip to main content

products

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

Overview

Nameproducts
TypeResource
Idazure.sphere.products

Fields

NameDatatypeDescription
descriptiontextfield from the properties object
catalogNametextfield 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, productName, resourceGroupName, subscriptionIdGet a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
list_by_catalogSELECTcatalogName, resourceGroupName, subscriptionIdList Product resources by Catalog
create_or_updateINSERTcatalogName, productName, resourceGroupName, subscriptionIdCreate a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
deleteDELETEcatalogName, productName, resourceGroupName, subscriptionIdDelete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'
updateUPDATEcatalogName, productName, resourceGroupName, subscriptionIdUpdate a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
count_devicesEXECcatalogName, productName, resourceGroupName, subscriptionIdCounts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
generate_default_device_groupsEXECcatalogName, productName, resourceGroupName, subscriptionIdGenerates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name.

SELECT examples

List Product resources by Catalog

SELECT
description,
catalogName,
productName,
provisioning_state,
resourceGroupName,
subscriptionId
FROM azure.sphere.vw_products
WHERE catalogName = '{{ catalogName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

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

UPDATE example

Updates a products resource.

/*+ update */
UPDATE azure.sphere.products
SET
properties = '{{ properties }}'
WHERE
catalogName = '{{ catalogName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified products resource.

/*+ delete */
DELETE FROM azure.sphere.products
WHERE catalogName = '{{ catalogName }}'
AND productName = '{{ productName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';