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

az cosmosdb gremlin role assignment

Note

This reference is part of the cosmosdb-preview extension for the Azure CLI (version 2.17.1 or higher). 该扩展将在首次运行 az cosmosdb gremlin 角色分配 命令时自动安装。 Learn more about extensions.

管理 Azure Cosmos DB Gremlin 角色分配。

命令

名称 说明 类型 Status
az cosmosdb gremlin role assignment create

在 Azure Cosmos DB 帐户下创建 Gremlin 角色分配。

Extension GA
az cosmosdb gremlin role assignment delete

删除 Azure Cosmos DB 帐户下的 Gremlin 角色分配。

Extension GA
az cosmosdb gremlin role assignment exists

检查 Azure Cosmos DB 角色分配是否存在。

Extension GA
az cosmosdb gremlin role assignment list

列出 Azure Cosmos DB 帐户下的所有 Gremlin 角色分配。

Extension GA
az cosmosdb gremlin role assignment show

显示 Azure Cosmos DB 帐户下 Gremlin 角色分配的属性。

Extension GA
az cosmosdb gremlin role assignment update

在 Azure Cosmos DB 帐户下更新 Gremlin 角色分配。

Extension GA

az cosmosdb gremlin role assignment create

在 Azure Cosmos DB 帐户下创建 Gremlin 角色分配。

az cosmosdb gremlin role assignment create --account-name
                                           --principal-id
                                           --resource-group
                                           --scope
                                           [--role-assignment-id]
                                           [--role-definition-id]
                                           [--role-definition-name]

示例

使用角色定义名称在 Azure Cosmos DB 帐户下创建 Gremlin 角色分配。

az cosmosdb gremlin role assignment create --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-name "My Read Only Role" \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

使用角色定义 ID 在 Azure Cosmos DB 帐户下创建 Gremlin 角色分配。

az cosmosdb gremlin role assignment create --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-id be79875a-2cc4-40d5-8958-566017875b39 \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

必需参数

--account-name -a

Cosmosdb 帐户名称。

--principal-id -p

要向其授予此角色分配的主体的 AAD 对象 ID。

--resource-group -g

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

--scope -s

要向其授予此角色分配的数据平面资源路径。

可选参数

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

--role-assignment-id -i

“创建”可选。 角色分配的唯一 ID。 如果未提供,将使用新的 GUID。

--role-definition-id -d

此角色分配引用的角色定义的唯一 ID。

--role-definition-name -n

此角色分配引用的角色定义的唯一名称。 Eg. “Contoso 读者角色”。

全局参数
--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

az cosmosdb gremlin role assignment delete

删除 Azure Cosmos DB 帐户下的 Gremlin 角色分配。

az cosmosdb gremlin role assignment delete --account-name
                                           --resource-group
                                           --role-assignment-id
                                           [--yes]

示例

删除 Azure Cosmos DB 帐户下的 Gremlin 角色分配。

az cosmosdb gremlin role assignment delete --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

必需参数

--account-name -a

Cosmosdb 帐户名称。

--resource-group -g

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

--role-assignment-id -i

“创建”可选。 角色分配的唯一 ID。 如果未提供,将使用新的 GUID。

可选参数

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

--yes -y

不要提示确认。

属性
默认值: False
全局参数
--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

az cosmosdb gremlin role assignment exists

检查 Azure Cosmos DB 角色分配是否存在。

az cosmosdb gremlin role assignment exists --account-name
                                           --resource-group
                                           --role-assignment-id

示例

检查 Azure Cosmos DB 角色分配是否存在。

az cosmosdb gremlin role assignment exists --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

必需参数

--account-name -a

Cosmosdb 帐户名称。

--resource-group -g

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

--role-assignment-id -i

“创建”可选。 角色分配的唯一 ID。 如果未提供,将使用新的 GUID。

全局参数
--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

az cosmosdb gremlin role assignment list

列出 Azure Cosmos DB 帐户下的所有 Gremlin 角色分配。

az cosmosdb gremlin role assignment list --account-name
                                         --resource-group

示例

列出 Azure Cosmos DB 帐户下的所有 Gremlin 角色分配。

az cosmosdb gremlin role assignment list --account-name MyAccount --resource-group MyResourceGroup

必需参数

--account-name -a

Cosmosdb 帐户名称。

--resource-group -g

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

全局参数
--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

az cosmosdb gremlin role assignment show

显示 Azure Cosmos DB 帐户下 Gremlin 角色分配的属性。

az cosmosdb gremlin role assignment show --account-name
                                         --resource-group
                                         --role-assignment-id

示例

显示 Azure Cosmos DB 帐户下 Gremlin 角色分配的属性。

az cosmosdb gremlin role assignment show --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8

必需参数

--account-name -a

Cosmosdb 帐户名称。

--resource-group -g

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

--role-assignment-id -i

“创建”可选。 角色分配的唯一 ID。 如果未提供,将使用新的 GUID。

全局参数
--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

az cosmosdb gremlin role assignment update

在 Azure Cosmos DB 帐户下更新 Gremlin 角色分配。

az cosmosdb gremlin role assignment update --account-name
                                           --principal-id
                                           --resource-group
                                           --scope
                                           [--role-assignment-id]
                                           [--role-definition-id]
                                           [--role-definition-name]

示例

使用角色定义名称在 Azure Cosmos DB 帐户下更新 Gremlin 角色分配。

az cosmosdb gremlin role assignment update --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-name "My Read Only Role" \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

使用角色定义 ID 更新 Azure Cosmos DB 帐户下的 Gremlin 角色分配。

az cosmosdb gremlin role assignment update --account-name MyAccount --resource-group MyResourceGroup \
  --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8 \
  --role-definition-id be79875a-2cc4-40d5-8958-566017875b39 \
  --scope "/dbs/mydb/colls/mycontainer" \
  --principal-id 6328f5f7-dbf7-4244-bba8-fbb9d8066506

必需参数

--account-name -a

Cosmosdb 帐户名称。

--principal-id -p

要向其授予此角色分配的主体的 AAD 对象 ID。

--resource-group -g

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

--scope -s

要向其授予此角色分配的数据平面资源路径。

可选参数

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

--role-assignment-id -i

“创建”可选。 角色分配的唯一 ID。 如果未提供,将使用新的 GUID。

--role-definition-id -d

此角色分配引用的角色定义的唯一 ID。

--role-definition-name -n

此角色分配引用的角色定义的唯一名称。 Eg. “Contoso 读者角色”。

全局参数
--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