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

az iot hub route

此命令组已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

管理 IoT 中心的路由。

命令

名称 说明 类型 状态
az iot hub route create

在 IoT 中心 中创建路由。

核心 已放弃
az iot hub route delete

删除IoT 中心的所有或提及路由。

核心 已放弃
az iot hub route list

获取IoT 中心中的所有路由。

核心 已放弃
az iot hub route show

获取有关IoT 中心中的路由的信息。

核心 已放弃
az iot hub route test

在IoT 中心中测试所有路由或提及路由。

核心 已放弃
az iot hub route update

更新IoT 中心中的路由。

核心 已放弃

az iot hub route create

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

在 IoT 中心 中创建路由。

创建路由以将特定数据源和条件发送到所需的终结点。

az iot hub route create --en
                        --hub-name
                        --name
                        --source {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}
                        [--condition]
                        [--enabled {false, true}]
                        [--resource-group]

示例

创建新的路由“R1”。

az iot hub route create -g MyResourceGroup --hub-name MyIotHub --endpoint-name E2 --source DeviceMessages --route-name R1

使用所有参数创建新的路由“R1”。

az iot hub route create -g MyResourceGroup --hub-name MyIotHub --endpoint-name E2 --source DeviceMessages --route-name R1 --condition true --enabled true

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name

IoT 中心名称。

--name --route-name -n

路由的名称。

--source --source-type --type -s

路由的源。

接受的值: deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents

可选参数

--condition -c

评估为应用路由规则的条件。

--enabled -e

一个布尔值,指示是否启用到 Iot 中心的路由。

接受的值: false, true
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az iot hub route delete

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

删除IoT 中心的所有或提及路由。

删除IoT 中心的路由或所有路由。

az iot hub route delete [--hub-name]
                        [--ids]
                        [--name]
                        [--resource-group]
                        [--source {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
                        [--subscription]

示例

从“MyIotHub”中删除路由“R1”IoT 中心。

az iot hub route delete -g MyResourceGroup --hub-name MyIotHub --route-name R1

从“MyIotHub”中删除源类型“DeviceMessages”的所有路由IoT 中心。

az iot hub route delete -g MyResourceGroup --hub-name MyIotHub --source DeviceMessages

从“MyIotHub”中删除所有路由IoT 中心。

az iot hub route delete -g MyResourceGroup --hub-name MyIotHub

可选参数

--hub-name

IoT 中心名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name --route-name -n

路由的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--source --source-type --type -s

路由的源。

接受的值: deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents
--subscription

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az iot hub route list

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

获取IoT 中心中的所有路由。

从IoT 中心获取有关所有路由的信息。

az iot hub route list [--hub-name]
                      [--ids]
                      [--resource-group]
                      [--source {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
                      [--subscription]

示例

从“MyIotHub”IoT 中心获取所有路由。

az iot hub route list -g MyResourceGroup --hub-name MyIotHub

从“MyIotHub”获取源类型“DeviceMessages”的所有路由IoT 中心。

az iot hub route list -g MyResourceGroup --hub-name MyIotHub --source DeviceMessages

可选参数

--hub-name

IoT 中心名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--source --source-type --type -s

路由的源。

接受的值: deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents
--subscription

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az iot hub route show

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

获取有关IoT 中心中的路由的信息。

获取有关IoT 中心中特定路由的信息。

az iot hub route show --name
                      [--hub-name]
                      [--ids]
                      [--resource-group]
                      [--subscription]

示例

从“MyIotHub”IoT 中心获取路由信息。

az iot hub route show -g MyResourceGroup --hub-name MyIotHub --route-name {routeName}

必需参数

--name --route-name -n

路由的名称。

可选参数

--hub-name

IoT 中心名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az iot hub route test

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

在IoT 中心中测试所有路由或提及路由。

测试IoT 中心中的所有现有路由或提及路由。 可以提供用于测试路由的示例消息。

az iot hub route test [--ap]
                      [--body]
                      [--hub-name]
                      [--ids]
                      [--name]
                      [--resource-group]
                      [--source {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
                      [--sp]
                      [--subscription]

示例

从“MyIotHub”IoT 中心测试路由“R1”。

az iot hub route test -g MyResourceGroup --hub-name MyIotHub --route-name R1

从“MyIotHub”IoT 中心测试源类型“DeviceMessages”的所有路由。

az iot hub route test -g MyResourceGroup --hub-name MyIotHub --source DeviceMessages

可选参数

--ap --app-properties

路由消息的应用属性。

--body -b

路由消息的正文。

--hub-name

IoT 中心名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name --route-name -n

路由的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--source --source-type --type -s

路由的源。

接受的值: deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents
--sp --system-properties

路由消息的系统属性。

--subscription

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az iot hub route update

已放弃

此命令已隐式弃用,因为命令组“iot 中心路由”已弃用,将在将来的版本中删除。 请改用“IoT 扩展(azure-iot)message-route 命令组(az iot hub message-route)。

更新IoT 中心中的路由。

在 IoT 中心 中汇报路由。 可以在路由上更改源、终结点或查询。

az iot hub route update --name
                        [--condition]
                        [--en]
                        [--enabled {false, true}]
                        [--hub-name]
                        [--ids]
                        [--resource-group]
                        [--source {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
                        [--subscription]

示例

从“MyIotHub”IoT 中心更新路由“R1”的源类型。

az iot hub route update -g MyResourceGroup --hub-name MyIotHub --source DeviceMessages --route-name R1

必需参数

--name --route-name -n

路由的名称。

可选参数

--condition -c

评估为应用路由规则的条件。

--en --endpoint --endpoint-name

路由终结点的名称。

--enabled -e

一个布尔值,指示是否启用到 Iot 中心的路由。

接受的值: false, true
--hub-name

IoT 中心名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--source --source-type --type -s

路由的源。

接受的值: deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents
--subscription

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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