azure.mgmt.cosmosdb.operations module

class azure.mgmt.cosmosdb.operations.DatabaseAccountsOperations(client, config, serializer, deserializer)[source]

Bases: object

DatabaseAccountsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

check_name_exists(account_name, custom_headers=None, raw=False, **operation_config)[source]

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.

Parameters:
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

bool or ClientRawResponse if raw=true

Return type:

bool or ClientRawResponse

Raises:

CloudError

create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config)[source]

Creates or updates an Azure Cosmos DB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • create_update_parameters (DatabaseAccountCreateUpdateParameters) – The parameters to provide for the current database account.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns DatabaseAccount or ClientRawResponse<DatabaseAccount> if raw==True

Return type:

AzureOperationPoller[DatabaseAccount] or AzureOperationPoller[ClientRawResponse[DatabaseAccount]]

Raises:

CloudError

delete(resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config)[source]

Deletes an existing Azure Cosmos DB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns None or ClientRawResponse<None> if raw==True

Return type:

AzureOperationPoller[None] or AzureOperationPoller[ClientRawResponse[None]]

Raises:

CloudError

failover_priority_change(resource_group_name, account_name, failover_policies, custom_headers=None, raw=False, polling=True, **operation_config)[source]

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.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • failover_policies (list[FailoverPolicy]) – List of failover policies.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns None or ClientRawResponse<None> if raw==True

Return type:

AzureOperationPoller[None] or AzureOperationPoller[ClientRawResponse[None]]

Raises:

CloudError

get(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

DatabaseAccount or ClientRawResponse if raw=true

Return type:

DatabaseAccount or ClientRawResponse

Raises:

CloudError

get_read_only_keys(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

DatabaseAccountListReadOnlyKeysResult or ClientRawResponse if raw=true

Return type:

DatabaseAccountListReadOnlyKeysResult or ClientRawResponse

Raises:

CloudError

list(custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DatabaseAccount

Return type:

DatabaseAccountPaged[DatabaseAccount]

Raises:

CloudError

list_by_resource_group(resource_group_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DatabaseAccount

Return type:

DatabaseAccountPaged[DatabaseAccount]

Raises:

CloudError

list_connection_strings(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

DatabaseAccountListConnectionStringsResult or ClientRawResponse if raw=true

Return type:

DatabaseAccountListConnectionStringsResult or ClientRawResponse

Raises:

CloudError

list_keys(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

DatabaseAccountListKeysResult or ClientRawResponse if raw=true

Return type:

DatabaseAccountListKeysResult or ClientRawResponse

Raises:

CloudError

list_metric_definitions(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

Retrieves metric defintions for the given database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of MetricDefinition

Return type:

MetricDefinitionPaged[MetricDefinition]

Raises:

CloudError

list_metrics(resource_group_name, account_name, filter, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Metric

Return type:

MetricPaged[Metric]

Raises:

CloudError

list_read_only_keys(resource_group_name, account_name, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

DatabaseAccountListReadOnlyKeysResult or ClientRawResponse if raw=true

Return type:

DatabaseAccountListReadOnlyKeysResult or ClientRawResponse

Raises:

CloudError

list_usages(resource_group_name, account_name, filter=None, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • filter (str) – 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).
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Usage

Return type:

UsagePaged[Usage]

Raises:

CloudError

offline_region(resource_group_name, account_name, region, custom_headers=None, raw=False, polling=True, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns None or ClientRawResponse<None> if raw==True

Return type:

AzureOperationPoller[None] or AzureOperationPoller[ClientRawResponse[None]]

Raises:

ErrorResponseException

online_region(resource_group_name, account_name, region, custom_headers=None, raw=False, polling=True, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns None or ClientRawResponse<None> if raw==True

Return type:

AzureOperationPoller[None] or AzureOperationPoller[ClientRawResponse[None]]

Raises:

ErrorResponseException

patch(resource_group_name, account_name, tags=None, capabilities=None, custom_headers=None, raw=False, polling=True, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • tags (dict[str, str]) –
  • capabilities (list[Capability]) – List of Cosmos DB capabilities for the account
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns DatabaseAccount or ClientRawResponse<DatabaseAccount> if raw==True

Return type:

AzureOperationPoller[DatabaseAccount] or AzureOperationPoller[ClientRawResponse[DatabaseAccount]]

Raises:

CloudError

regenerate_key(resource_group_name, account_name, key_kind, custom_headers=None, raw=False, polling=True, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • key_kind (str or KeyKind) – The access key to regenerate. Possible values include: ‘primary’, ‘secondary’, ‘primaryReadonly’, ‘secondaryReadonly’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response
  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy
Returns:

An instance of LROPoller that returns None or ClientRawResponse<None> if raw==True

Return type:

AzureOperationPoller[None] or AzureOperationPoller[ClientRawResponse[None]]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.Operations(client, config, serializer, deserializer)[source]

Bases: object

Operations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list(custom_headers=None, raw=False, **operation_config)[source]

Lists all of the available Cosmos DB Resource Provider operations.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Operation

Return type:

OperationPaged[Operation]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.DatabaseOperations(client, config, serializer, deserializer)[source]

Bases: object

DatabaseOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metric_definitions(resource_group_name, account_name, database_rid, custom_headers=None, raw=False, **operation_config)[source]

Retrieves metric defintions for the given database.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of MetricDefinition

Return type:

MetricDefinitionPaged[MetricDefinition]

Raises:

CloudError

list_metrics(resource_group_name, account_name, database_rid, filter, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Metric

Return type:

MetricPaged[Metric]

Raises:

CloudError

list_usages(resource_group_name, account_name, database_rid, filter=None, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • filter (str) – 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).
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Usage

Return type:

UsagePaged[Usage]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.CollectionOperations(client, config, serializer, deserializer)[source]

Bases: object

CollectionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metric_definitions(resource_group_name, account_name, database_rid, collection_rid, custom_headers=None, raw=False, **operation_config)[source]

Retrieves metric defintions for the given collection.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of MetricDefinition

Return type:

MetricDefinitionPaged[MetricDefinition]

Raises:

CloudError

list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Metric

Return type:

MetricPaged[Metric]

Raises:

CloudError

list_usages(resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the usages (most recent storage data) for the given collection.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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).
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Usage

Return type:

UsagePaged[Usage]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.CollectionRegionOperations(client, config, serializer, deserializer)[source]

Bases: object

CollectionRegionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Metric

Return type:

MetricPaged[Metric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.DatabaseAccountRegionOperations(client, config, serializer, deserializer)[source]

Bases: object

DatabaseAccountRegionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, region, filter, custom_headers=None, raw=False, **operation_config)[source]

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

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Metric

Return type:

MetricPaged[Metric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.PercentileSourceTargetOperations(client, config, serializer, deserializer)[source]

Bases: object

PercentileSourceTargetOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, source_region, target_region, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • source_region (str) – Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • target_region (str) – Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PercentileMetric

Return type:

PercentileMetricPaged[PercentileMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.PercentileTargetOperations(client, config, serializer, deserializer)[source]

Bases: object

PercentileTargetOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, target_region, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • target_region (str) – Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PercentileMetric

Return type:

PercentileMetricPaged[PercentileMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.PercentileOperations(client, config, serializer, deserializer)[source]

Bases: object

PercentileOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PercentileMetric

Return type:

PercentileMetricPaged[PercentileMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.CollectionPartitionRegionOperations(client, config, serializer, deserializer)[source]

Bases: object

CollectionPartitionRegionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given collection and region, split by partition.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PartitionMetric

Return type:

PartitionMetricPaged[PartitionMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.CollectionPartitionOperations(client, config, serializer, deserializer)[source]

Bases: object

CollectionPartitionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given collection, split by partition.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PartitionMetric

Return type:

PartitionMetricPaged[PartitionMetric]

Raises:

CloudError

list_usages(resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the usages (most recent storage data) for the given collection, split by partition.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • filter (str) – 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).
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PartitionUsage

Return type:

PartitionUsagePaged[PartitionUsage]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdOperations(client, config, serializer, deserializer)[source]

Bases: object

PartitionKeyRangeIdOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given partition key range id.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • partition_key_range_id (str) – Partition Key Range Id for which to get data.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PartitionMetric

Return type:

PartitionMetricPaged[PartitionMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>
class azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations(client, config, serializer, deserializer)[source]

Bases: object

PartitionKeyRangeIdRegionOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: “2015-04-08”.

list_metrics(resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers=None, raw=False, **operation_config)[source]

Retrieves the metrics determined by the given filter for the given partition key range id and region.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – Cosmos DB database account name.
  • region (str) – Cosmos DB region, with spaces between words and each word capitalized.
  • database_rid (str) – Cosmos DB database rid.
  • collection_rid (str) – Cosmos DB collection rid.
  • partition_key_range_id (str) – Partition Key Range Id for which to get data.
  • filter (str) – 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.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PartitionMetric

Return type:

PartitionMetricPaged[PartitionMetric]

Raises:

CloudError

models = <module 'azure.mgmt.cosmosdb.models' from '/usr/lib/python3/dist-packages/azure/mgmt/cosmosdb/models/__init__.py'>