MongoDBResourcesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

CosmosDBManagementClient's

<xref:mongo_db_resources> attribute.

Inheritance
builtins.object
MongoDBResourcesOperations

Constructor

MongoDBResourcesOperations(*args, **kwargs)

Methods

begin_create_update_mongo_db_collection

Create or update an Azure Cosmos DB MongoDB Collection.

begin_create_update_mongo_db_database

Create or updates Azure Cosmos DB MongoDB database.

begin_create_update_mongo_role_definition

Creates or updates an Azure Cosmos DB Mongo Role Definition.

begin_create_update_mongo_user_definition

Creates or updates an Azure Cosmos DB Mongo User Definition.

begin_delete_mongo_db_collection

Deletes an existing Azure Cosmos DB MongoDB Collection.

begin_delete_mongo_db_database

Deletes an existing Azure Cosmos DB MongoDB database.

begin_delete_mongo_role_definition

Deletes an existing Azure Cosmos DB Mongo Role Definition.

begin_delete_mongo_user_definition

Deletes an existing Azure Cosmos DB Mongo User Definition.

begin_migrate_mongo_db_collection_to_autoscale

Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale.

begin_migrate_mongo_db_collection_to_manual_throughput

Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput.

begin_migrate_mongo_db_database_to_autoscale

Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale.

begin_migrate_mongo_db_database_to_manual_throughput

Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput.

begin_retrieve_continuous_backup_information

Retrieves continuous backup information for a Mongodb collection.

begin_update_mongo_db_collection_throughput

Update the RUs per second of an Azure Cosmos DB MongoDB collection.

begin_update_mongo_db_database_throughput

Update RUs per second of the an Azure Cosmos DB MongoDB database.

get_mongo_db_collection

Gets the MongoDB collection under an existing Azure Cosmos DB database account.

get_mongo_db_collection_throughput

Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.

get_mongo_db_database

Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.

get_mongo_db_database_throughput

Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.

get_mongo_role_definition

Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id.

get_mongo_user_definition

Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id.

list_mongo_db_collections

Lists the MongoDB collection under an existing Azure Cosmos DB database account.

list_mongo_db_databases

Lists the MongoDB databases under an existing Azure Cosmos DB database account.

list_mongo_role_definitions

Retrieves the list of all Azure Cosmos DB Mongo Role Definitions.

list_mongo_user_definitions

Retrieves the list of all Azure Cosmos DB Mongo User Definition.

begin_create_update_mongo_db_collection

Create or update an Azure Cosmos DB MongoDB Collection.

async begin_create_update_mongo_db_collection(resource_group_name: str, account_name: str, database_name: str, collection_name: str, create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

create_update_mongo_db_collection_parameters
Required

The parameters to provide for the current MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the result of cls(response)

Exceptions

Type Description

begin_create_update_mongo_db_database

Create or updates Azure Cosmos DB MongoDB database.

async begin_create_update_mongo_db_database(resource_group_name: str, account_name: str, database_name: str, create_update_mongo_db_database_parameters: _models.MongoDBDatabaseCreateUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.MongoDBDatabaseGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

create_update_mongo_db_database_parameters
Required

The parameters to provide for the current MongoDB database. Is either a MongoDBDatabaseCreateUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either MongoDBDatabaseGetResults or the result of cls(response)

Exceptions

Type Description

begin_create_update_mongo_role_definition

Creates or updates an Azure Cosmos DB Mongo Role Definition.

async begin_create_update_mongo_role_definition(mongo_role_definition_id: str, resource_group_name: str, account_name: str, create_update_mongo_role_definition_parameters: _models.MongoRoleDefinitionCreateUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.MongoRoleDefinitionGetResults]

Parameters

Name Description
mongo_role_definition_id
Required
str

The ID for the Role Definition {dbName.roleName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

create_update_mongo_role_definition_parameters
Required

The properties required to create or update a Role Definition. Is either a MongoRoleDefinitionCreateUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either MongoRoleDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

begin_create_update_mongo_user_definition

Creates or updates an Azure Cosmos DB Mongo User Definition.

async begin_create_update_mongo_user_definition(mongo_user_definition_id: str, resource_group_name: str, account_name: str, create_update_mongo_user_definition_parameters: _models.MongoUserDefinitionCreateUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.MongoUserDefinitionGetResults]

Parameters

Name Description
mongo_user_definition_id
Required
str

The ID for the User Definition {dbName.userName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

create_update_mongo_user_definition_parameters
Required

The properties required to create or update a User Definition. Is either a MongoUserDefinitionCreateUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either MongoUserDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

begin_delete_mongo_db_collection

Deletes an existing Azure Cosmos DB MongoDB Collection.

async begin_delete_mongo_db_collection(resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_delete_mongo_db_database

Deletes an existing Azure Cosmos DB MongoDB database.

async begin_delete_mongo_db_database(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_delete_mongo_role_definition

Deletes an existing Azure Cosmos DB Mongo Role Definition.

async begin_delete_mongo_role_definition(mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
mongo_role_definition_id
Required
str

The ID for the Role Definition {dbName.roleName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_delete_mongo_user_definition

Deletes an existing Azure Cosmos DB Mongo User Definition.

async begin_delete_mongo_user_definition(mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
mongo_user_definition_id
Required
str

The ID for the User Definition {dbName.userName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_migrate_mongo_db_collection_to_autoscale

Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale.

async begin_migrate_mongo_db_collection_to_autoscale(resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any) -> AsyncLROPoller[ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

begin_migrate_mongo_db_collection_to_manual_throughput

Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput.

async begin_migrate_mongo_db_collection_to_manual_throughput(resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any) -> AsyncLROPoller[ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

begin_migrate_mongo_db_database_to_autoscale

Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale.

async begin_migrate_mongo_db_database_to_autoscale(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> AsyncLROPoller[ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

begin_migrate_mongo_db_database_to_manual_throughput

Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput.

async begin_migrate_mongo_db_database_to_manual_throughput(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> AsyncLROPoller[ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

begin_retrieve_continuous_backup_information

Retrieves continuous backup information for a Mongodb collection.

async begin_retrieve_continuous_backup_information(resource_group_name: str, account_name: str, database_name: str, collection_name: str, location: _models.ContinuousBackupRestoreLocation, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.BackupInformation]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

location
Required

The name of the continuous backup restore location. Is either a ContinuousBackupRestoreLocation type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either BackupInformation or the result of cls(response)

Exceptions

Type Description

begin_update_mongo_db_collection_throughput

Update the RUs per second of an Azure Cosmos DB MongoDB collection.

async begin_update_mongo_db_collection_throughput(resource_group_name: str, account_name: str, database_name: str, collection_name: str, update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

update_throughput_parameters
Required

The RUs per second of the parameters to provide for the current MongoDB collection. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

begin_update_mongo_db_database_throughput

Update RUs per second of the an Azure Cosmos DB MongoDB database.

async begin_update_mongo_db_database_throughput(resource_group_name: str, account_name: str, database_name: str, update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

update_throughput_parameters
Required

The RUs per second of the parameters to provide for the current MongoDB database. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_db_collection

Gets the MongoDB collection under an existing Azure Cosmos DB database account.

async get_mongo_db_collection(resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any) -> MongoDBCollectionGetResults

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

Returns

Type Description

MongoDBCollectionGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_db_collection_throughput

Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.

async get_mongo_db_collection_throughput(resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any) -> ThroughputSettingsGetResults

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

collection_name
Required
str

Cosmos DB collection name. Required.

Returns

Type Description

ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_db_database

Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.

async get_mongo_db_database(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> MongoDBDatabaseGetResults

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

MongoDBDatabaseGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_db_database_throughput

Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.

async get_mongo_db_database_throughput(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> ThroughputSettingsGetResults

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

ThroughputSettingsGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_role_definition

Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id.

async get_mongo_role_definition(mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any) -> MongoRoleDefinitionGetResults

Parameters

Name Description
mongo_role_definition_id
Required
str

The ID for the Role Definition {dbName.roleName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

MongoRoleDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

get_mongo_user_definition

Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id.

async get_mongo_user_definition(mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any) -> MongoUserDefinitionGetResults

Parameters

Name Description
mongo_user_definition_id
Required
str

The ID for the User Definition {dbName.userName}. Required.

resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

MongoUserDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

list_mongo_db_collections

Lists the MongoDB collection under an existing Azure Cosmos DB database account.

list_mongo_db_collections(resource_group_name: str, account_name: str, database_name: str, **kwargs: Any) -> AsyncIterable[MongoDBCollectionGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

database_name
Required
str

Cosmos DB database name. Required.

Returns

Type Description

An iterator like instance of either MongoDBCollectionGetResults or the result of cls(response)

Exceptions

Type Description

list_mongo_db_databases

Lists the MongoDB databases under an existing Azure Cosmos DB database account.

list_mongo_db_databases(resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterable[MongoDBDatabaseGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

An iterator like instance of either MongoDBDatabaseGetResults or the result of cls(response)

Exceptions

Type Description

list_mongo_role_definitions

Retrieves the list of all Azure Cosmos DB Mongo Role Definitions.

list_mongo_role_definitions(resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterable[MongoRoleDefinitionGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

An iterator like instance of either MongoRoleDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

list_mongo_user_definitions

Retrieves the list of all Azure Cosmos DB Mongo User Definition.

list_mongo_user_definitions(resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterable[MongoUserDefinitionGetResults]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

account_name
Required
str

Cosmos DB database account name. Required.

Returns

Type Description

An iterator like instance of either MongoUserDefinitionGetResults or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.cosmosdb.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\cosmosdb\\models\\__init__.py'>