DatabaseAccountsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

CosmosDBManagementClient's

<xref:database_accounts> attribute.

Inheritance
builtins.object
DatabaseAccountsOperations

Constructor

DatabaseAccountsOperations(*args, **kwargs)

Methods

begin_create_or_update

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

begin_delete

Deletes an existing Azure Cosmos DB database account.

begin_failover_priority_change

Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.

begin_offline_region

Offline the specified region for the specified Azure Cosmos DB database account.

begin_online_region

Online the specified region for the specified Azure Cosmos DB database account.

begin_regenerate_key

Regenerates an access key for the specified Azure Cosmos DB database account.

begin_update

Updates the properties of an existing Azure Cosmos DB database account.

check_name_exists

Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.

get

Retrieves the properties of an existing Azure Cosmos DB database account.

get_read_only_keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

list

Lists all the Azure Cosmos DB database accounts available under the subscription.

list_by_resource_group

Lists all the Azure Cosmos DB database accounts available under the given resource group.

list_connection_strings

Lists the connection strings for the specified Azure Cosmos DB database account.

list_keys

Lists the access keys for the specified Azure Cosmos DB database account.

list_metric_definitions

Retrieves metric definitions for the given database account.

list_metrics

Retrieves the metrics determined by the given filter for the given database account.

list_read_only_keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

list_usages

Retrieves the usages (most recent data) for the given database account.

begin_create_or_update

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

begin_create_or_update(resource_group_name: str, account_name: str, create_update_parameters: azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountCreateUpdateParameters, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountGetResults]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

create_update_parameters
DatabaseAccountCreateUpdateParameters
Required

The parameters to provide for the current database account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either DatabaseAccountGetResults or the result of cls(response)

Return type

Exceptions

begin_delete

Deletes an existing Azure Cosmos DB database account.

begin_delete(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_failover_priority_change

Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.

begin_failover_priority_change(resource_group_name: str, account_name: str, failover_parameters: azure.mgmt.cosmosdb.models._models_py3.FailoverPolicies, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

failover_parameters
FailoverPolicies
Required

The new failover policies for the database account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_offline_region

Offline the specified region for the specified Azure Cosmos DB database account.

begin_offline_region(resource_group_name: str, account_name: str, region_parameter_for_offline: azure.mgmt.cosmosdb.models._models_py3.RegionForOnlineOffline, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

region_parameter_for_offline
RegionForOnlineOffline
Required

Cosmos DB region to offline for the database account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_online_region

Online the specified region for the specified Azure Cosmos DB database account.

begin_online_region(resource_group_name: str, account_name: str, region_parameter_for_online: azure.mgmt.cosmosdb.models._models_py3.RegionForOnlineOffline, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

region_parameter_for_online
RegionForOnlineOffline
Required

Cosmos DB region to online for the database account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_regenerate_key

Regenerates an access key for the specified Azure Cosmos DB database account.

begin_regenerate_key(resource_group_name: str, account_name: str, key_to_regenerate: azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountRegenerateKeyParameters, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

key_to_regenerate
DatabaseAccountRegenerateKeyParameters
Required

The name of the key to regenerate.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_update

Updates the properties of an existing Azure Cosmos DB database account.

begin_update(resource_group_name: str, account_name: str, update_parameters: azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountUpdateParameters, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountGetResults]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

update_parameters
DatabaseAccountUpdateParameters
Required

The parameters to provide for the current database account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either DatabaseAccountGetResults or the result of cls(response)

Return type

Exceptions

check_name_exists

Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.

check_name_exists(account_name: str, **kwargs: Any) -> bool

Parameters

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

bool, or the result of cls(response)

Return type

Exceptions

get

Retrieves the properties of an existing Azure Cosmos DB database account.

get(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountGetResults

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

DatabaseAccountGetResults, or the result of cls(response)

Return type

Exceptions

get_read_only_keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

get_read_only_keys(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountListReadOnlyKeysResult

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

DatabaseAccountListReadOnlyKeysResult, or the result of cls(response)

Return type

Exceptions

list

Lists all the Azure Cosmos DB database accounts available under the subscription.

list(**kwargs: Any) -> Iterable[azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountsListResult]

Parameters

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list_by_resource_group

Lists all the Azure Cosmos DB database accounts available under the given resource group.

list_by_resource_group(resource_group_name: str, **kwargs: Any) -> Iterable[azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountsListResult]

Parameters

resource_group_name
str
Required

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

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list_connection_strings

Lists the connection strings for the specified Azure Cosmos DB database account.

list_connection_strings(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountListConnectionStringsResult

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

DatabaseAccountListConnectionStringsResult, or the result of cls(response)

Return type

Exceptions

list_keys

Lists the access keys for the specified Azure Cosmos DB database account.

list_keys(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountListKeysResult

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

DatabaseAccountListKeysResult, or the result of cls(response)

Return type

Exceptions

list_metric_definitions

Retrieves metric definitions for the given database account.

list_metric_definitions(resource_group_name: str, account_name: str, **kwargs: Any) -> Iterable[azure.mgmt.cosmosdb.models._models_py3.MetricDefinitionsListResult]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list_metrics

Retrieves the metrics determined by the given filter for the given database account.

list_metrics(resource_group_name: str, account_name: str, filter: str, **kwargs: Any) -> Iterable[azure.mgmt.cosmosdb.models._models_py3.MetricListResult]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

filter
str
Required

An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list_read_only_keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

list_read_only_keys(resource_group_name: str, account_name: str, **kwargs: Any) -> azure.mgmt.cosmosdb.models._models_py3.DatabaseAccountListReadOnlyKeysResult

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

cls
callable

A custom type or function that will be passed the direct response

Returns

DatabaseAccountListReadOnlyKeysResult, or the result of cls(response)

Return type

Exceptions

list_usages

Retrieves the usages (most recent data) for the given database account.

list_usages(resource_group_name: str, account_name: str, filter: Optional[str] = None, **kwargs: Any) -> Iterable[azure.mgmt.cosmosdb.models._models_py3.UsagesResult]

Parameters

resource_group_name
str
Required

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

account_name
str
Required

Cosmos DB database account name.

filter
str
Required

An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). Default value is None.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

Attributes

models

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