你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az iot central device telemetry

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.59.0 or higher). 该扩展会在首次运行 az iot central device telemetry 命令时自动安装。 Learn more about extensions.

查询 IoT Central 设备上次遥测值。

命令

名称 说明 类型 Status
az iot central device telemetry show

从设备获取最后一个遥测值。

Extension GA

az iot central device telemetry show

从设备获取最后一个遥测值。

az iot central device telemetry show --app-id
                                     --device-id
                                     --telemetry-name--tn
                                     [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                     [--central-api-uri --central-dns-suffix]
                                     [--co --component-name]
                                     [--mn --module-name]
                                     [--token]

示例

获取设备遥测值。

az iot central device telemetry show --app-id {appid} --device-id {deviceid} --telemetry-name {telemetryname}

获取设备组件遥测值。

az iot central device telemetry show --app-id {appid} --device-id {deviceid} --component-name {componentname} --telemetry-name {telemetryname}

获取设备模块组件遥测值。

az iot central device telemetry show --app-id {appid} --device-id {deviceid} --module-name {modulename} --component-name {componentname} --telemetry-name {telemetryname}

必需参数

--app-id -n

要管理的 IoT Central 应用的应用 ID。 可以在应用程序“关于”页面的帮助菜单下找到应用 ID。

--device-id -d

目标设备的设备 ID。可以通过单击“设备详细信息”页上的“连接”按钮找到设备 ID。

--telemetry-name--tn

设备遥测的名称。

可选参数

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

--api-version --av
已放弃

参数“api_version”已弃用,将在将来的版本中删除。

此命令参数已弃用,将被忽略。在未来版本中,我们仅支持最新版本的 IoT Central API。如果任何 API 尚未正式发布,我们将调用最新的预览版。

属性
默认值: 2022-07-31
接受的值: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

与应用程序关联的 IoT Central DNS 后缀。

属性
默认值: azureiotcentral.com
--co --component-name

设备组件的名称。

--mn --module-name

设备模块的名称。

--token

如果想要在不对 Azure CLI 进行身份验证的情况下提交请求,可以指定有效的用户令牌对请求进行身份验证。 必须将密钥类型指定为请求的一部分。 在 https://aka.ms/iotcentraldocsapi了解详细信息。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False