azure.mgmt.documentdb.operations module

class azure.mgmt.documentdb.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 objec 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 DocumentDB 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) – DocumentDB 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.
Return type:

bool

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Creates or updates an Azure DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns DatabaseAccount

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Deletes an existing Azure DocumentDB database account.

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

AzureOperationPoller instance that returns None

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Changes the failover priority for the Azure DocumentDB 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) – DocumentDB database account name.
  • failover_policies (list of FailoverPolicy) – List of failover policies.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns None

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Retrieves the properties of an existing Azure DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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.
Return type:

DatabaseAccount

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Lists all the Azure DocumentDB database accounts available under the subscription.

Parameters:
Return type:

DatabaseAccountPaged

Raises:

CloudError

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

Lists all the Azure DocumentDB 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.
Return type:

DatabaseAccountPaged

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 DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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.
Return type:

DatabaseAccountListConnectionStringsResult

Return type:

ClientRawResponse if raw=true

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 DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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.
Return type:

DatabaseAccountListKeysResult

Return type:

ClientRawResponse if raw=true

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 DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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.
Return type:

DatabaseAccountListReadOnlyKeysResult

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Patches the properties of an existing Azure DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB database account name.
  • tags (dict) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns DatabaseAccount

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

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

Regenerates an access key for the specified Azure DocumentDB database account.

Parameters:
  • resource_group_name (str) – Name of an Azure resource group.
  • account_name (str) – DocumentDB 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) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns None

Return type:

ClientRawResponse if raw=true

Raises:

CloudError