Share via


az iot ops ns asset rest

Note

This reference is part of the azure-iot-ops extension for the Azure CLI (version 2.67.0 or higher). The extension will automatically install the first time you run an az iot ops ns asset rest command. Learn more about extensions.

Command group 'iot ops ns' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage namespaced assets that point to REST device endpoints.

Commands

Name Description Type Status
az iot ops ns asset rest create

Create a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset

Manage datasets for REST namespaced assets in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset add

Add a dataset to a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset list

List datasets for a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset remove

Remove a dataset from a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset show

Show details of a dataset for a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest dataset update

Update a dataset for a REST namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset rest update

Update a REST namespaced asset in an IoT Operations instance.

Extension Preview

az iot ops ns asset rest create

Preview

Command group 'iot ops ns' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a REST namespaced asset in an IoT Operations instance.

The device endpoint must be of type Microsoft.Http.

az iot ops ns asset rest create --device
                                --endpoint --ep
                                --instance
                                --name
                                --resource-group
                                [--asset-type-ref --type-ref]
                                [--attr --attribute]
                                [--dataset-dest --dsd]
                                [--description]
                                [--disable {false, true}]
                                [--display-name --dn]
                                [--doc-uri --documentation-uri]
                                [--eid --external-asset-id]
                                [--hardware-revision --hw-rev]
                                [--manufacturer]
                                [--manufacturer-uri --mfr-uri]
                                [--model]
                                [--pc --product-code]
                                [--sampling-int --si]
                                [--serial-number --sn]
                                [--software-revision --sw-rev]
                                [--tags]

Examples

Create a basic REST asset

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint

Create a REST asset with dataset configuration

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --sampling-int 5000

Create a REST asset with dataset destination

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --dataset-dest topic="factory/rest/data" retain=Never qos=Qos1 ttl=3600

Create a REST asset with custom configuration and BrokerStateStore destination

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --sampling-int 2000 --dataset-dest key="rest-data-cache"

Create a REST asset with additional metadata

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --description "Temperature sensor API" --display-name "Facility Temperature Monitor" --model "TempSensor-3000" --manufacturer "SensorCorp" --serial-number "TS-12345" --documentation-uri "https://example.com/docs/api"

Create a REST asset with custom attributes

az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --attribute location=warehouse --attribute sensor-type=temperature --attribute units=celsius

Required Parameters

--device -d

Device name.

--endpoint --ep

Device endpoint name.

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Name of the asset.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--asset-type-ref --type-ref

Space-separated list of asset type references.

Property Value
Parameter group: Additional Info Arguments
--attr --attribute

Space-separated key=value pairs for custom asset attributes.

Property Value
Parameter group: Additional Info Arguments
--dataset-dest --dsd

Key=value pairs representing the destination for datasets. Allowed arguments include: key for BrokerStateStore or topic, retain, qos, and ttl for MQTT. Allowed values for retain are Never and Keep and allowed values for qos are Qos0 and Qos1.

--description

Description of the asset.

Property Value
Parameter group: Additional Info Arguments
--disable

Disable the asset.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--display-name --dn

Display name for the asset.

Property Value
Parameter group: Additional Info Arguments
--doc-uri --documentation-uri

Documentation URI for the asset.

Property Value
Parameter group: Additional Info Arguments
--eid --external-asset-id

External asset ID.

Property Value
Parameter group: Additional Info Arguments
--hardware-revision --hw-rev

Hardware revision information.

Property Value
Parameter group: Additional Info Arguments
--manufacturer

Manufacturer name.

Property Value
Parameter group: Additional Info Arguments
--manufacturer-uri --mfr-uri

Manufacturer URI.

Property Value
Parameter group: Additional Info Arguments
--model

Model name or number.

Property Value
Parameter group: Additional Info Arguments
--pc --product-code

Product code.

Property Value
Parameter group: Additional Info Arguments
--sampling-int --si

Sampling interval for datasets in milliseconds. Minimum: -1.

--serial-number --sn

Serial number.

Property Value
Parameter group: Additional Info Arguments
--software-revision --sw-rev

Software revision information.

Property Value
Parameter group: Additional Info Arguments
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset rest update

Preview

Command group 'iot ops ns' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a REST namespaced asset in an IoT Operations instance.

The device endpoint must be of type Microsoft.Http.

az iot ops ns asset rest update --instance
                                --name
                                --resource-group
                                [--asset-type-ref --type-ref]
                                [--attr --attribute]
                                [--dataset-dest --dsd]
                                [--description]
                                [--disable {false, true}]
                                [--display-name --dn]
                                [--doc-uri --documentation-uri]
                                [--eid --external-asset-id]
                                [--hardware-revision --hw-rev]
                                [--manufacturer]
                                [--manufacturer-uri --mfr-uri]
                                [--model]
                                [--pc --product-code]
                                [--sampling-int --si]
                                [--serial-number --sn]
                                [--software-revision --sw-rev]
                                [--tags]

Examples

Update a REST asset's basic properties

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --description "Updated temperature sensor API" --display-name "Main Warehouse Temperature"

Update a REST asset's dataset destination to MQTT

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --dataset-dest topic="factory/rest/updated/data" retain=Keep qos=Qos1 ttl=7200

Update a REST asset's dataset destination to BrokerStateStore

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --dataset-dest key="updated-rest-cache"

Update a REST asset's metadata

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --model "TempSensor-4000" --manufacturer "SensorCorp" --serial-number "TS-67890" --documentation-uri "https://example.com/docs/api/v2"

Update a REST asset's custom attributes

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --attribute location=main-warehouse sensor-type=temperature units=fahrenheit accuracy=high

Disable a REST asset and update its reference information

az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --disable --external-asset-id "TEMP-MAIN-01" --hardware-revision "v2.1"

Required Parameters

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Name of the asset.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--asset-type-ref --type-ref

Space-separated list of asset type references.

Property Value
Parameter group: Additional Info Arguments
--attr --attribute

Space-separated key=value pairs for custom asset attributes.

Property Value
Parameter group: Additional Info Arguments
--dataset-dest --dsd

Key=value pairs representing the destination for datasets. Allowed arguments include: key for BrokerStateStore or topic, retain, qos, and ttl for MQTT. Allowed values for retain are Never and Keep and allowed values for qos are Qos0 and Qos1.

--description

Description of the asset.

Property Value
Parameter group: Additional Info Arguments
--disable

Disable the asset.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--display-name --dn

Display name for the asset.

Property Value
Parameter group: Additional Info Arguments
--doc-uri --documentation-uri

Documentation URI for the asset.

Property Value
Parameter group: Additional Info Arguments
--eid --external-asset-id

External asset ID.

Property Value
Parameter group: Additional Info Arguments
--hardware-revision --hw-rev

Hardware revision information.

Property Value
Parameter group: Additional Info Arguments
--manufacturer

Manufacturer name.

Property Value
Parameter group: Additional Info Arguments
--manufacturer-uri --mfr-uri

Manufacturer URI.

Property Value
Parameter group: Additional Info Arguments
--model

Model name or number.

Property Value
Parameter group: Additional Info Arguments
--pc --product-code

Product code.

Property Value
Parameter group: Additional Info Arguments
--sampling-int --si

Sampling interval for datasets in milliseconds. Minimum: -1.

--serial-number --sn

Serial number.

Property Value
Parameter group: Additional Info Arguments
--software-revision --sw-rev

Software revision information.

Property Value
Parameter group: Additional Info Arguments
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False