DatabasesOperations Class

DatabasesOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
DatabasesOperations

Constructor

DatabasesOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

Name Description
models

Alias to model classes used in this operation group.

Methods

begin_create_or_update

Creates a new database or updates an existing database.

begin_delete

Deletes the database.

begin_export

Exports a database.

begin_failover

Failovers a database.

begin_import_method

Imports a bacpac into a new database.

begin_pause

Pauses a database.

begin_resume

Resumes a database.

begin_update

Updates an existing database.

begin_upgrade_data_warehouse

Upgrades a data warehouse.

get

Gets a database.

list_by_elastic_pool

Gets a list of databases in an elastic pool.

list_by_server

Gets a list of databases.

list_inaccessible_by_server

Gets a list of inaccessible databases in a logical server.

list_metric_definitions

Returns database metric definitions.

list_metrics

Returns database metrics.

rename

Renames a database.

begin_create_or_update

Creates a new database or updates an existing database.

async begin_create_or_update(resource_group_name: str, server_name: str, database_name: str, parameters: Database, **kwargs: Any) -> AsyncLROPoller[Database]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

parameters
Required

The requested database resource state.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_delete

Deletes the database.

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

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_export

Exports a database.

async begin_export(resource_group_name: str, server_name: str, database_name: str, parameters: ExportDatabaseDefinition, **kwargs: Any) -> AsyncLROPoller[ImportExportOperationResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

parameters
Required

The database export request parameters.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_failover

Failovers a database.

async begin_failover(resource_group_name: str, server_name: str, database_name: str, replica_type: str | ReplicaType | None = None, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database to failover.

replica_type

The type of replica to be failed over.

Default value: None

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_import_method

Imports a bacpac into a new database.

async begin_import_method(resource_group_name: str, server_name: str, database_name: str, parameters: ImportExistingDatabaseDefinition, **kwargs: Any) -> AsyncLROPoller[ImportExportOperationResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

parameters
Required

The database import request parameters.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_pause

Pauses a database.

async begin_pause(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> AsyncLROPoller[Database]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database to be paused.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_resume

Resumes a database.

async begin_resume(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> AsyncLROPoller[Database]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database to be resumed.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_update

Updates an existing database.

async begin_update(resource_group_name: str, server_name: str, database_name: str, parameters: DatabaseUpdate, **kwargs: Any) -> AsyncLROPoller[Database]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

parameters
Required

The requested database resource state.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

begin_upgrade_data_warehouse

Upgrades a data warehouse.

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

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database to be upgraded.

Keyword-Only Parameters

Name Description
cls

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

By default, your polling method will be AsyncARMPolling. 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

Type Description

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

Exceptions

Type Description

get

Gets a database.

async get(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> Database

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

Database, or the result of cls(response)

Exceptions

Type Description

list_by_elastic_pool

Gets a list of databases in an elastic pool.

list_by_elastic_pool(resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any) -> AsyncIterable[DatabaseListResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

elastic_pool_name
Required
str

The name of the elastic pool.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

list_by_server

Gets a list of databases.

list_by_server(resource_group_name: str, server_name: str, skip_token: str | None = None, **kwargs: Any) -> AsyncIterable[DatabaseListResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

skip_token
str
Default value: None

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

list_inaccessible_by_server

Gets a list of inaccessible databases in a logical server.

list_inaccessible_by_server(resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncIterable[DatabaseListResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

list_metric_definitions

Returns database metric definitions.

list_metric_definitions(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> AsyncIterable[MetricDefinitionListResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

list_metrics

Returns database metrics.

list_metrics(resource_group_name: str, server_name: str, database_name: str, filter: str, **kwargs: Any) -> AsyncIterable[MetricListResult]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database.

filter
Required
str

An OData filter expression that describes a subset of metrics to return.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

rename

Renames a database.

async rename(resource_group_name: str, server_name: str, database_name: str, parameters: ResourceMoveDefinition, **kwargs: Any) -> None

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

server_name
Required
str

The name of the server.

database_name
Required
str

The name of the database to rename.

parameters
Required

The resource move definition for renaming this database.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

None, or the result of cls(response)

Exceptions

Type Description

Attributes

models

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