Condividi tramite


ServersOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

SqlManagementClient's

<xref:servers> attribute.

Constructor

ServersOperations(*args, **kwargs)

Methods

begin_create_or_update

Creates or updates a server.

begin_delete

Deletes a server.

begin_import_database

Imports a bacpac into a new database.

begin_refresh_status

Refresh external governance enablement status.

begin_update

Updates a server.

check_name_availability

Determines whether a resource can be created with the specified name.

get

Gets a server.

list

Gets a list of all servers in the subscription.

list_by_resource_group

Gets a list of servers in a resource groups.

begin_create_or_update

Creates or updates a server.

async begin_create_or_update(resource_group_name: str, server_name: str, parameters: _models.Server, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.Server]

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

server_name
Required
str

The name of the server. Required.

parameters
Required

The requested server resource state. Is either a Server type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_delete

Deletes a server.

async begin_delete(resource_group_name: str, server_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. Required.

server_name
Required
str

The name of the server. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_import_database

Imports a bacpac into a new database.

async begin_import_database(resource_group_name: str, server_name: str, parameters: _models.ImportNewDatabaseDefinition, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_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. Required.

server_name
Required
str

The name of the server. Required.

parameters
Required

The database import request parameters. Is either a ImportNewDatabaseDefinition type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_refresh_status

Refresh external governance enablement status.

async begin_refresh_status(resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncLROPoller[RefreshExternalGovernanceStatusOperationResult]

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

server_name
Required
str

The name of the server. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_update

Updates a server.

async begin_update(resource_group_name: str, server_name: str, parameters: _models.ServerUpdate, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.Server]

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

server_name
Required
str

The name of the server. Required.

parameters
Required

The requested server resource state. Is either a ServerUpdate type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

check_name_availability

Determines whether a resource can be created with the specified name.

async check_name_availability(parameters: _models.CheckNameAvailabilityRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.CheckNameAvailabilityResponse

Parameters

Name Description
parameters
Required

The name availability request parameters. Is either a CheckNameAvailabilityRequest type or a IO[bytes] type. Required.

Returns

Type Description

CheckNameAvailabilityResponse or the result of cls(response)

Exceptions

Type Description

get

Gets a server.

async get(resource_group_name: str, server_name: str, expand: str | None = None, **kwargs: Any) -> Server

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

server_name
Required
str

The name of the server. Required.

expand
str

The child resources to include in the response. Default value is None.

Default value: None

Returns

Type Description

Server or the result of cls(response)

Exceptions

Type Description

list

Gets a list of all servers in the subscription.

list(expand: str | None = None, **kwargs: Any) -> AsyncItemPaged[Server]

Parameters

Name Description
expand
str

The child resources to include in the response. Default value is None.

Default value: None

Returns

Type Description

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

Exceptions

Type Description

list_by_resource_group

Gets a list of servers in a resource groups.

list_by_resource_group(resource_group_name: str, expand: str | None = None, **kwargs: Any) -> AsyncItemPaged[Server]

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

expand
str

The child resources to include in the response. Default value is None.

Default value: None

Returns

Type Description

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

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.sql.models' from 'C:\\ToolCache\\Python\\3.12.10\\x64\\Lib\\site-packages\\py2docfx\\venv\\venv268\\Lib\\site-packages\\azure\\mgmt\\sql\\models\\__init__.py'>