DatabasesOperations Class

DatabasesOperations 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.

begin_create_or_update(resource_group_name: str, server_name: str, database_name: str, parameters: '_models.Database', **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_delete

Deletes the database.

begin_delete(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller[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 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

Type Description

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

Exceptions

Type Description

begin_export

Exports a database.

begin_export(resource_group_name: str, server_name: str, database_name: str, parameters: '_models.ExportDatabaseDefinition', **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_failover

Failovers a database.

begin_failover(resource_group_name: str, server_name: str, database_name: str, replica_type: str | '_models.ReplicaType' | None = None, **kwargs: Any) -> LROPoller[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 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

Type Description

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

Exceptions

Type Description

begin_import_method

Imports a bacpac into a new database.

begin_import_method(resource_group_name: str, server_name: str, database_name: str, parameters: '_models.ImportExistingDatabaseDefinition', **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_pause

Pauses a database.

begin_pause(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_resume

Resumes a database.

begin_resume(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_update

Updates an existing database.

begin_update(resource_group_name: str, server_name: str, database_name: str, parameters: '_models.DatabaseUpdate', **kwargs: Any) -> LROPoller['_models.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 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

Type Description

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

Exceptions

Type Description

begin_upgrade_data_warehouse

Upgrades a data warehouse.

begin_upgrade_data_warehouse(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller[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 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

Type Description

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

Exceptions

Type Description

get

Gets a database.

get(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> _models.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) -> Iterable['_models.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) -> Iterable['_models.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) -> Iterable['_models.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) -> Iterable['_models.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) -> Iterable['_models.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.

rename(resource_group_name: str, server_name: str, database_name: str, parameters: '_models.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'>