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.objectDatabasesOperations
Constructor
DatabasesOperations(client, config, serializer, deserializer)
Parameters
- client
Client for service requests.
- config
Configuration of service client.
- serializer
An object model serializer.
- deserializer
An object model deserializer.
Variables
- 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
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either Database or the result of cls(response)
Return type
Exceptions
begin_delete
Deletes the database.
begin_delete(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller[None]
Parameters
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either None or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either ImportExportOperationResult or the result of cls(response)
Return type
Exceptions
begin_failover
Failovers a database.
begin_failover(resource_group_name: str, server_name: str, database_name: str, replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any) -> LROPoller[None]
Parameters
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either None or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either ImportExportOperationResult or the result of cls(response)
Return type
Exceptions
begin_pause
Pauses a database.
begin_pause(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller[_models.Database]
Parameters
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either Database or the result of cls(response)
Return type
Exceptions
begin_resume
Resumes a database.
begin_resume(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> LROPoller[_models.Database]
Parameters
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either Database or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either Database or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
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
- bool or PollingMethod
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
An instance of LROPoller that returns either None or the result of cls(response)
Return type
Exceptions
get
Gets a database.
get(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> _models.Database
Parameters
- resource_group_name
- 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.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
Database, or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either DatabaseListResult or the result of cls(response)
Return type
Exceptions
list_by_server
Gets a list of databases.
list_by_server(resource_group_name: str, server_name: str, skip_token: Optional[str] = None, **kwargs: Any) -> Iterable[_models.DatabaseListResult]
Parameters
- resource_group_name
- 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.
- skip_token
- str
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either DatabaseListResult or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either DatabaseListResult or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either MetricDefinitionListResult or the result of cls(response)
Return type
Exceptions
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
- resource_group_name
- 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.
- 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
rename
Renames a database.
rename(resource_group_name: str, server_name: str, database_name: str, parameters: _models.ResourceMoveDefinition, **kwargs: Any) -> None
Parameters
- resource_group_name
- 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.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
None, or the result of cls(response)
Return type
Exceptions
Attributes
models
models = <module 'azure.mgmt.sql.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\sql\\models\\__init__.py'>
Feedback
Submit and view feedback for