Share via


az cosmosdb gremlin role definition

Note

This reference is part of the cosmosdb-preview extension for the Azure CLI (version 2.17.1 or higher). The extension will automatically install the first time you run an az cosmosdb gremlin role definition command. Learn more about extensions.

Manage Azure Cosmos DB Gremlin role definitions.

Commands

Name Description Type Status
az cosmosdb gremlin role definition create

Create a Gremlin role definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb gremlin role definition delete

Delete a Gremlin role definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb gremlin role definition exists

Check if an Azure Cosmos DB role definition exists.

Extension GA
az cosmosdb gremlin role definition list

List all Gremlin role definitions under an Azure Cosmos DB account.

Extension GA
az cosmosdb gremlin role definition show

Show the properties of a Gremlin role definition under an Azure Cosmos DB account.

Extension GA
az cosmosdb gremlin role definition update

Update a Gremlin role definition under an Azure Cosmos DB account.

Extension GA

az cosmosdb gremlin role definition create

Create a Gremlin role definition under an Azure Cosmos DB account.

az cosmosdb gremlin role definition create --account-name
                                           --body
                                           --resource-group

Examples

Create a Gremlin role definition under an Azure Cosmos DB account using a JSON string.

az cosmosdb gremlin role definition create --account-name MyAccount --resource-group MyResourceGroup --body '{
  "Id": "be79875a-2cc4-40d5-8958-566017875b39",
  "RoleName": "My Read Only Role",
  "Type": "CustomRole",
  "AssignableScopes": ["/dbs/mydb/colls/mycontainer"],
  "Permissions": [{
    "DataActions": [
      "Microsoft.DocumentDB/databaseAccounts/readMetadata",
      "Microsoft.DocumentDB/databaseAccounts/gremlin/containers/entities/read",
      "Microsoft.DocumentDB/databaseAccounts/gremlin/containers/executeQuery",
      "Microsoft.DocumentDB/databaseAccounts/gremlin/containers/readChangeFeed"
    ]
  }]
}'

Create a Gremlin role definition under an Azure Cosmos DB account using a JSON file.

az cosmosdb gremlin role definition create --account-name MyAccount --resource-group MyResourceGroup --body @role-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), RoleName, Description, AssignableScopes, Permissions. You can enter it as a string or as a file, e.g., --body @gremlin-role_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "RoleName": "MyTestRole", "type": "CustomRole", "description": "Custom role to read Cosmos DB metadata", "AssignableScopes":["/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/MyDBAccountName"], "Permissions": [{"dataActions": ["Microsoft.DocumentDB/databaseAccounts/readMetadata"]}] }".

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb gremlin role definition delete

Delete a Gremlin role definition under an Azure Cosmos DB account.

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

Examples

Delete a Gremlin role definition under an Azure Cosmos DB account.

az cosmosdb gremlin role definition delete --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--role-definition-id -i

Unique ID for the Gremlin Role Definition.

Optional Parameters

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb gremlin role definition exists

Check if an Azure Cosmos DB role definition exists.

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

Examples

Check if an Azure Cosmos DB role definition exists.

az cosmosdb gremlin role definition exists --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--role-definition-id -i

Unique ID for the Gremlin Role Definition.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb gremlin role definition list

List all Gremlin role definitions under an Azure Cosmos DB account.

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

Examples

List all Gremlin role definitions under an Azure Cosmos DB account.

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

Required Parameters

--account-name -a

Cosmosdb account name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb gremlin role definition show

Show the properties of a Gremlin role definition under an Azure Cosmos DB account.

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

Examples

Show the properties of a Gremlin role definition under an Azure Cosmos DB account.

az cosmosdb gremlin role definition show --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39

Required Parameters

--account-name -a

Cosmosdb account name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--role-definition-id -i

Unique ID for the Gremlin Role Definition.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb gremlin role definition update

Update a Gremlin role definition under an Azure Cosmos DB account.

az cosmosdb gremlin role definition update --account-name
                                           --body
                                           --resource-group

Examples

Update a Gremlin role definition under an Azure Cosmos DB account.

az cosmosdb gremlin role definition update --account-name MyAccount --resource-group MyResourceGroup --body @role-definition.json

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Role Definition body with Id (Optional for create), Type (Default is CustomRole), RoleName, Description, AssignableScopes, Permissions. You can enter it as a string or as a file, e.g., --body @gremlin-role_definition-body-file.json or --body "{ "Id": "be79875a-2cc4-40d5-8958-566017875b39", "RoleName": "MyTestRole", "type": "CustomRole", "description": "Custom role to read Cosmos DB metadata", "AssignableScopes":["/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/MyDBAccountName"], "Permissions": [{"dataActions": ["Microsoft.DocumentDB/databaseAccounts/readMetadata"]}] }".

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.