products
Creates, updates, deletes, gets or lists a products
resource.
Overview
Name | products |
Type | Resource |
Id | azure.sphere.products |
Fields
- vw_products
- products
Name | Datatype | Description |
---|---|---|
description | text | field from the properties object |
catalogName | 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 product |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | catalogName, productName, resourceGroupName, subscriptionId | Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. |
list_by_catalog | SELECT | catalogName, resourceGroupName, subscriptionId | List Product resources by Catalog |
create_or_update | INSERT | catalogName, productName, resourceGroupName, subscriptionId | Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. |
delete | DELETE | catalogName, productName, resourceGroupName, subscriptionId | Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' |
update | UPDATE | catalogName, productName, resourceGroupName, subscriptionId | Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. |
count_devices | EXEC | catalogName, productName, resourceGroupName, subscriptionId | Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. |
generate_default_device_groups | EXEC | catalogName, productName, resourceGroupName, subscriptionId | Generates 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
- vw_products
- products
SELECT
description,
catalogName,
productName,
provisioning_state,
resourceGroupName,
subscriptionId
FROM azure.sphere.vw_products
WHERE catalogName = '{{ catalogName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sphere.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sphere.products (
catalogName,
productName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ catalogName }}',
'{{ productName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: description
value: string
- name: provisioningState
value: []
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 }}';