az dt twin component
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.59.0 or higher). 该扩展将在首次运行 az dt twin component 命令时自动安装。 Learn more about extensions.
显示和更新数字孪生实例的数字孪生组件。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az dt twin component show |
显示数字孪生组件的详细信息。 |
Extension | GA |
az dt twin component update |
通过 JSON 修补规范更新数字孪生组件。 |
Extension | GA |
az dt twin component show
显示数字孪生组件的详细信息。
az dt twin component show --component
--dt-name --dtn
--twin-id
[--resource-group]
示例
显示数字孪生组件的详细信息
az dt twin component show -n {instance_or_hostname} --twin-id {twin_id} --component Thermostat
必需参数
DTDL 组件的路径。
数字孪生实例名称或主机名。 如果提供了实例名称,则首先查询目标实例的用户订阅以检索主机名。 如果提供了主机名,则会跳过订阅查询,并提供的值用于后续交互。
数字孪生 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
数字孪生实例资源组。 可以使用 az configure --defaults group={name}
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az dt twin component update
通过 JSON 修补规范更新数字孪生组件。
对属性值和$model元素的更新可能在同一请求中发生。 作仅限于添加、替换和删除。
az dt twin component update --component
--dt-name --dtn
--json-patch --patch
--twin-id
[--etag]
[--resource-group]
示例
通过 JSON 修补规范更新数字孪生组件。
az dt twin component update -n {instance_or_hostname} --twin-id {twin_id} --component {component_path} --json-patch '{"op":"replace", "path":"/Temperature", "value": 20.5}'
通过 JSON 修补规范更新数字孪生组件。
az dt twin component update -n {instance_or_hostname} --twin-id {twin_id} --component {component_path} --json-patch '[
{"op":"replace", "path":"/Temperature", "value": 20.5},
{"op":"add", "path":"/Areas", "value": ["ControlSystem"]}
]'
通过文件中定义的 JSON 修补程序规范更新数字孪生组件。
az dt twin component update -n {instance_or_hostname} --twin-id {twin_id} --component {component_path} --json-patch ./my/patch/document.json
必需参数
DTDL 组件的路径。
数字孪生实例名称或主机名。 如果提供了实例名称,则首先查询目标实例的用户订阅以检索主机名。 如果提供了主机名,则会跳过订阅查询,并提供的值用于后续交互。
JSON 修补程序描述的更新规范。 对属性值和$model元素的更新可能在同一请求中发生。 作仅限于添加、替换和删除。 提供文件路径或内联 JSON。
数字孪生 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
实体标记值。 如果 etag 与资源的当前 etag 匹配,该命令将成功。
数字孪生实例资源组。 可以使用 az configure --defaults group={name}
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |