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

az iot central device-group

注意

此参考是 Azure CLI(版本 2.37.0 或更高版本)的 azure-iot 扩展的一部分。 该扩展将在首次运行 az iot central device-group 命令时自动安装。 详细了解扩展。

管理和配置 IoT Central 设备组。

命令

名称 说明 类型 状态
az iot central device-group create

创建设备组。

扩展 GA
az iot central device-group delete

删除设备组。

分机 GA
az iot central device-group list

获取 IoT Central 应用程序的设备组列表。

扩展 GA
az iot central device-group show

按 ID 获取设备组。

分机 GA
az iot central device-group update

更新现有设备组。

扩展 GA

az iot central device-group create

创建设备组。

注意:目前仅支持一个组织,不久将支持多个组织。

az iot central device-group create --app-id
                                   --device-group-id
                                   --display-name
                                   --filter
                                   [--api-version {2022-06-30-preview, 2022-07-31}]
                                   [--central-api-uri]
                                   [--description]
                                   [--organizations]
                                   [--token]

示例

创建设备组。

az iot central device-group create --app-id {appid} --device-group-id {devicegroupid} --display-name "DeviceGroup1" --filter "SELECT * FROM devices WHERE $provisioned = true" --description "This is a default device group." --organizations {organization}

必需参数

--app-id -n

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

--device-group-id

设备组的唯一 ID。

--display-name

设备组的显示名称。

--filter

查询,定义应在此组中的设备。[查询筛选器示例:标准版LECT * FROM devices WHERE $template = “dtmi:modelDefinition:dtdlv2”]。

可选参数

--api-version --av
已放弃

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

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

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

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

默认值: azureiotcentral.com
--description

设备组的简短摘要。

--organizations

设备组的组织 ID 列表。

--token

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

全局参数
--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 central device-group delete

删除设备组。

az iot central device-group delete --app-id
                                   --device-group-id
                                   [--api-version {2022-06-30-preview, 2022-07-31}]
                                   [--central-api-uri]
                                   [--token]

示例

删除设备组

az iot central device-group delete --app-id {appid} --device-group-id {devicegroupid}

必需参数

--app-id -n

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

--device-group-id

设备组的唯一 ID。

可选参数

--api-version --av
已放弃

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

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

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

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

默认值: azureiotcentral.com
--token

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

全局参数
--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 central device-group list

获取 IoT Central 应用程序的设备组列表。

az iot central device-group list --app-id
                                 [--api-version {2022-06-30-preview, 2022-07-31}]
                                 [--central-api-uri]
                                 [--token]

示例

列出应用程序中的设备组

az iot central device-group list --app-id {appid}

必需参数

--app-id -n

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

可选参数

--api-version --av
已放弃

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

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

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

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

默认值: azureiotcentral.com
--token

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

全局参数
--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 central device-group show

按 ID 获取设备组。

az iot central device-group show --app-id
                                 --device-group-id
                                 [--api-version {2022-06-30-preview, 2022-07-31}]
                                 [--central-api-uri]
                                 [--token]

示例

按 ID 获取设备组。

az iot central device-group show --app-id {appid} --device-group-id {devicegroupid}

必需参数

--app-id -n

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

--device-group-id

设备组的唯一 ID。

可选参数

--api-version --av
已放弃

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

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

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

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

默认值: azureiotcentral.com
--token

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

全局参数
--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 central device-group update

更新现有设备组。

注意:目前仅支持一个组织,不久将支持多个组织。

az iot central device-group update --app-id
                                   --device-group-id
                                   [--api-version {2022-06-30-preview, 2022-07-31}]
                                   [--central-api-uri]
                                   [--description]
                                   [--display-name]
                                   [--filter]
                                   [--organizations]
                                   [--token]

示例

通过修补程序更新设备组

az iot central device-group update --app-id {appid} --device-group-id {devicegroupid} --display-name {displayname} --filter {filter} --description {description} --organizations {organization}

必需参数

--app-id -n

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

--device-group-id

设备组的唯一 ID。

可选参数

--api-version --av
已放弃

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

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

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

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

默认值: azureiotcentral.com
--description

设备组的简短摘要。

--display-name

设备组的显示名称。

--filter

查询,定义应在此组中的设备。[查询筛选器示例:标准版LECT * FROM devices WHERE $template = “dtmi:modelDefinition:dtdlv2”]。

--organizations

设备组的组织 ID 列表。

--token

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

全局参数
--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 获取完整的调试日志。