DatabaseOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

CosmosDBManagementClient's

<xref:database> attribute.

Inheritance
builtins.object
DatabaseOperations

Constructor

DatabaseOperations(*args, **kwargs)

Methods

list_metric_definitions

Retrieves metric definitions for the given database.

list_metrics

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

list_usages

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

list_metric_definitions

Retrieves metric definitions for the given database.

list_metric_definitions(resource_group_name: str, account_name: str, database_rid: 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.

database_rid
str
Required

Cosmos DB database rid.

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 and database.

list_metrics(resource_group_name: str, account_name: str, database_rid: 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.

database_rid
str
Required

Cosmos DB database rid.

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_usages

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

list_usages(resource_group_name: str, account_name: str, database_rid: 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.

database_rid
str
Required

Cosmos DB database rid.

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'>