mongo_db_resources
Creates, updates, deletes, gets or lists a mongo_db_resources resource.
Overview
| Name | mongo_db_resources |
| Type | Resource |
| Id | azure.cosmosdb.mongo_db_resources |
Fields
The following fields are returned by SELECT queries:
- get_mongo_db_collection_throughput
- list_mongo_db_collections
- get_mongo_role_definition
- get_mongo_user_definition
- list_mongo_db_databases
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
identity | object | Identity for the resource. |
location | string | The location of the resource group to which the resource belongs. |
resource | object | :vartype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
identity | object | Identity for the resource. |
location | string | The location of the resource group to which the resource belongs. |
options | object | :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions |
resource | object | :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
databaseName | string | The database name for which access is being granted for this Role Definition. |
privileges | array | A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege. |
roleName | string | A user-friendly name for the Role Definition. Must be unique for the database account. |
roles | array | The set of roles inherited by this Role Definition. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
customData | string | A custom definition for the USer Definition. |
databaseName | string | The database name for which access is being granted for this User Definition. |
mechanisms | string | The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256. |
password | string | The password for User Definition. Response does not contain user password. |
roles | array | The set of roles inherited by the User Definition. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userName | string | The user name for User Definition. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
identity | object | Identity for the resource. |
location | string | The location of the resource group to which the resource belongs. |
options | object | :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions |
resource | object | :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_name | string | Cosmos DB database account name. Required. |
collection_name | string | Cosmos DB collection name. Required. |
database_name | string | Cosmos DB database name. Required. |
mongo_role_definition_id | string | The ID for the Role Definition {dbName.roleName}. Required. |
mongo_user_definition_id | string | The ID for the User Definition {dbName.userName}. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get_mongo_db_collection_throughput
- list_mongo_db_collections
- get_mongo_role_definition
- get_mongo_user_definition
- list_mongo_db_databases
Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
SELECT
id,
name,
identity,
location,
resource,
systemData,
tags,
type
FROM azure.cosmosdb.mongo_db_resources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND collection_name = '{{ collection_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists the MongoDB collection under an existing Azure Cosmos DB database account.
SELECT
id,
name,
identity,
location,
options,
resource,
systemData,
tags,
type
FROM azure.cosmosdb.mongo_db_resources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id.
SELECT
id,
name,
databaseName,
privileges,
roleName,
roles,
systemData,
type
FROM azure.cosmosdb.mongo_db_resources
WHERE mongo_role_definition_id = '{{ mongo_role_definition_id }}' -- required
AND resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id.
SELECT
id,
name,
customData,
databaseName,
mechanisms,
password,
roles,
systemData,
type,
userName
FROM azure.cosmosdb.mongo_db_resources
WHERE mongo_user_definition_id = '{{ mongo_user_definition_id }}' -- required
AND resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists the MongoDB databases under an existing Azure Cosmos DB database account.
SELECT
id,
name,
identity,
location,
options,
resource,
systemData,
tags,
type
FROM azure.cosmosdb.mongo_db_resources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lifecycle Methods
- list_mongo_role_definitions
- list_mongo_user_definitions
- get_mongo_db_database_throughput
- update_mongo_db_database_throughput
- update_mongo_db_collection_throughput
- get_mongo_db_database
- create_update_mongo_db_database
- delete_mongo_db_database
- get_mongo_db_collection
- create_update_mongo_db_collection
- delete_mongo_db_collection
- create_update_mongo_role_definition
- delete_mongo_role_definition
- create_update_mongo_user_definition
- delete_mongo_user_definition
- migrate_mongo_db_database_to_autoscale
- migrate_mongo_db_database_to_manual_throughput
- migrate_mongo_db_collection_to_autoscale
- migrate_mongo_db_collection_to_manual_throughput
- retrieve_continuous_backup_information
Retrieves the list of all Azure Cosmos DB Mongo Role Definitions.
EXEC azure.cosmosdb.mongo_db_resources.list_mongo_role_definitions
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Retrieves the list of all Azure Cosmos DB Mongo User Definition.
EXEC azure.cosmosdb.mongo_db_resources.list_mongo_user_definitions
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
EXEC azure.cosmosdb.mongo_db_resources.get_mongo_db_database_throughput
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Update RUs per second of the an Azure Cosmos DB MongoDB database.
EXEC azure.cosmosdb.mongo_db_resources.update_mongo_db_database_throughput
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"location": "{{ location }}",
"tags": "{{ tags }}",
"identity": "{{ identity }}",
"properties": "{{ properties }}"
}'
;
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
EXEC azure.cosmosdb.mongo_db_resources.update_mongo_db_collection_throughput
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"location": "{{ location }}",
"tags": "{{ tags }}",
"identity": "{{ identity }}",
"properties": "{{ properties }}"
}'
;
Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
EXEC azure.cosmosdb.mongo_db_resources.get_mongo_db_database
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Create or updates Azure Cosmos DB MongoDB database.
EXEC azure.cosmosdb.mongo_db_resources.create_update_mongo_db_database
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"location": "{{ location }}",
"tags": "{{ tags }}",
"identity": "{{ identity }}",
"properties": "{{ properties }}"
}'
;
Deletes an existing Azure Cosmos DB MongoDB database.
EXEC azure.cosmosdb.mongo_db_resources.delete_mongo_db_database
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Gets the MongoDB collection under an existing Azure Cosmos DB database account.
EXEC azure.cosmosdb.mongo_db_resources.get_mongo_db_collection
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Create or update an Azure Cosmos DB MongoDB Collection.
EXEC azure.cosmosdb.mongo_db_resources.create_update_mongo_db_collection
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"location": "{{ location }}",
"tags": "{{ tags }}",
"identity": "{{ identity }}",
"properties": "{{ properties }}"
}'
;
Deletes an existing Azure Cosmos DB MongoDB Collection.
EXEC azure.cosmosdb.mongo_db_resources.delete_mongo_db_collection
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Creates or updates an Azure Cosmos DB Mongo Role Definition.
EXEC azure.cosmosdb.mongo_db_resources.create_update_mongo_role_definition
@mongo_role_definition_id='{{ mongo_role_definition_id }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Deletes an existing Azure Cosmos DB Mongo Role Definition.
EXEC azure.cosmosdb.mongo_db_resources.delete_mongo_role_definition
@mongo_role_definition_id='{{ mongo_role_definition_id }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Creates or updates an Azure Cosmos DB Mongo User Definition.
EXEC azure.cosmosdb.mongo_db_resources.create_update_mongo_user_definition
@mongo_user_definition_id='{{ mongo_user_definition_id }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Deletes an existing Azure Cosmos DB Mongo User Definition.
EXEC azure.cosmosdb.mongo_db_resources.delete_mongo_user_definition
@mongo_user_definition_id='{{ mongo_user_definition_id }}' --required,
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale.
EXEC azure.cosmosdb.mongo_db_resources.migrate_mongo_db_database_to_autoscale
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput.
EXEC azure.cosmosdb.mongo_db_resources.migrate_mongo_db_database_to_manual_throughput
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale.
EXEC azure.cosmosdb.mongo_db_resources.migrate_mongo_db_collection_to_autoscale
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput.
EXEC azure.cosmosdb.mongo_db_resources.migrate_mongo_db_collection_to_manual_throughput
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Retrieves continuous backup information for a Mongodb collection.
EXEC azure.cosmosdb.mongo_db_resources.retrieve_continuous_backup_information
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@database_name='{{ database_name }}' --required,
@collection_name='{{ collection_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"location": "{{ location }}"
}'
;