az iot ops ns asset rest
Note
此参考是 Azure CLI(版本 2.67.0 或更高版本)的 azure-iot-ops 扩展的一部分。 该扩展将在首次运行 az iot ops ns asset rest 命令时自动安装。 了解更多关于扩展的信息。
命令组“iot ops ns”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
管理指向 REST 设备终结点的命名空间资产。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az iot ops ns asset rest create |
在 IoT作实例中创建 REST 命名空间资产。 |
Extension | Preview |
| az iot ops ns asset rest dataset |
管理 IoT作实例中 REST 命名空间资产的数据集。 |
Extension | Preview |
| az iot ops ns asset rest dataset add |
将数据集添加到 IoT作实例中的 REST 命名空间资产。 |
Extension | Preview |
| az iot ops ns asset rest dataset list |
列出 IoT作实例中 REST 命名空间资产的数据集。 |
Extension | Preview |
| az iot ops ns asset rest dataset remove |
从 IoT作实例中的 REST 命名空间资产中删除数据集。 |
Extension | Preview |
| az iot ops ns asset rest dataset show |
显示 IoT作实例中 REST 命名空间资产数据集的详细信息。 |
Extension | Preview |
| az iot ops ns asset rest dataset update |
更新 IoT作实例中 REST 命名空间资产的数据集。 |
Extension | Preview |
| az iot ops ns asset rest update |
更新 IoT作实例中的 REST 命名空间资产。 |
Extension | Preview |
az iot ops ns asset rest create
命令组“iot ops ns”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
在 IoT作实例中创建 REST 命名空间资产。
设备终结点的类型必须为 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]
示例
创建基本 REST 资产
az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint
使用数据集配置创建 REST 资产
az iot ops ns asset rest create --name myrestasset --instance myInstance -g myInstanceResourceGroup --device myrestdevice --endpoint myRestEndpoint --sampling-int 5000
使用数据集目标创建 REST 资产
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
使用自定义配置和 BrokerStateStore 目标创建 REST 资产
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"
使用其他元数据创建 REST 资产
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"
使用自定义属性创建 REST 资产
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
必需参数
设备名称。
设备终结点名称。
Azure IoT作实例的名称。
资产的名称。
Azure IoT作实例的资源组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资产类型引用的空间分隔列表。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
自定义资产属性的空间分隔键=值对。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
表示数据集目标的键=值对。 允许的参数包括: key BrokerStateStore 或 topic,retainqos以及 ttl MQTT。 允许的 retain 值为 Never 和 Keep 允许的 qos 值为 Qos0 和 Qos1。
资产的说明。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
禁用资产。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
| 接受的值: | false, true |
资产的显示名称。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
资产的文档 URI。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
外部资产 ID。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
硬件修订信息。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
制造商名称。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
制造商 URI。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
模型名称或数字。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
产品代码。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
数据集的采样间隔(以毫秒为单位)。 最小值:-1。
序列号。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
软件修订信息。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az iot ops ns asset rest update
命令组“iot ops ns”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
更新 IoT作实例中的 REST 命名空间资产。
设备终结点的类型必须为 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]
示例
更新 REST 资产的基本属性
az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --description "Updated temperature sensor API" --display-name "Main Warehouse Temperature"
将 REST 资产的数据集目标更新为 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
将 REST 资产的数据集目标更新到 BrokerStateStore
az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --dataset-dest key="updated-rest-cache"
更新 REST 资产的元数据
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"
更新 REST 资产的自定义属性
az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --attribute location=main-warehouse sensor-type=temperature units=fahrenheit accuracy=high
禁用 REST 资产并更新其引用信息
az iot ops ns asset rest update --name myrestasset --instance myInstance -g myInstanceResourceGroup --disable --external-asset-id "TEMP-MAIN-01" --hardware-revision "v2.1"
必需参数
Azure IoT作实例的名称。
资产的名称。
Azure IoT作实例的资源组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资产类型引用的空间分隔列表。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
自定义资产属性的空间分隔键=值对。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
表示数据集目标的键=值对。 允许的参数包括: key BrokerStateStore 或 topic,retainqos以及 ttl MQTT。 允许的 retain 值为 Never 和 Keep 允许的 qos 值为 Qos0 和 Qos1。
资产的说明。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
禁用资产。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
| 接受的值: | false, true |
资产的显示名称。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
资产的文档 URI。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
外部资产 ID。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
硬件修订信息。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
制造商名称。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
制造商 URI。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
模型名称或数字。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
产品代码。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
数据集的采样间隔(以毫秒为单位)。 最小值:-1。
序列号。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
软件修订信息。
| 属性 | 值 |
|---|---|
| Parameter group: | Additional Info Arguments |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |