Condividi tramite


ManagedInstancesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

SqlManagementClient's

<xref:managed_instances> attribute.

Constructor

ManagedInstancesOperations(*args, **kwargs)

Methods

begin_create_or_update

Creates or updates a managed instance.

begin_delete

Deletes a managed instance.

begin_failover

Failovers a managed instance.

begin_refresh_status

Refresh external governance enablement status.

begin_start

Starts the managed instance.

begin_stop

Stops the managed instance.

begin_update

Updates a managed instance.

get

Gets a managed instance.

list

Gets a list of all managed instances in the subscription.

list_by_instance_pool

Gets a list of all managed instances in an instance pool.

list_by_managed_instance

Get top resource consuming queries of a managed instance.

list_by_resource_group

Gets a list of managed instances in a resource group.

list_outbound_network_dependencies_by_managed_instance

Gets the collection of outbound network dependencies for the given managed instance.

begin_create_or_update

Creates or updates a managed instance.

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

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

parameters
Required

The requested managed instance resource state. Is either a ManagedInstance type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_delete

Deletes a managed instance.

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

managed_instance_name
Required
str

The name of the managed instance. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_failover

Failovers a managed instance.

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

managed_instance_name
Required
str

The name of the managed instance to failover. Required.

replica_type

The type of replica to be failed over. Known values are: "Primary" and "ReadableSecondary". Default value is None.

Default value: None

Returns

Type Description

An instance of AsyncLROPoller that returns either None 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, managed_instance_name: str, **kwargs: Any) -> AsyncLROPoller[RefreshExternalGovernanceStatusOperationResultMI]

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_start

Starts the managed instance.

async begin_start(resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> AsyncLROPoller[ManagedInstance]

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_stop

Stops the managed instance.

async begin_stop(resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> AsyncLROPoller[ManagedInstance]

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_update

Updates a managed instance.

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

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

parameters
Required

The requested managed instance resource state. Is either a ManagedInstanceUpdate type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

get

Gets a managed instance.

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

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

expand
str

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

Default value: None

Returns

Type Description

ManagedInstance or the result of cls(response)

Exceptions

Type Description

list

Gets a list of all managed instances in the subscription.

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

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 ManagedInstance or the result of cls(response)

Exceptions

Type Description

list_by_instance_pool

Gets a list of all managed instances in an instance pool.

list_by_instance_pool(resource_group_name: str, instance_pool_name: str, expand: str | None = None, **kwargs: Any) -> AsyncItemPaged[ManagedInstance]

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.

instance_pool_name
Required
str

The instance pool name. 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 ManagedInstance or the result of cls(response)

Exceptions

Type Description

list_by_managed_instance

Get top resource consuming queries of a managed instance.

list_by_managed_instance(resource_group_name: str, managed_instance_name: str, number_of_queries: int | None = None, databases: str | None = None, start_time: str | None = None, end_time: str | None = None, interval: str | QueryTimeGrainType | None = None, aggregation_function: str | AggregationFunctionType | None = None, observation_metric: str | MetricType | None = None, **kwargs: Any) -> AsyncItemPaged[TopQueries]

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

number_of_queries
int

How many 'top queries' to return. Default is 5. Default value is None.

Default value: None
databases
str

Comma separated list of databases to be included into search. All DB's are included if this parameter is not specified. Default value is None.

Default value: None
start_time
str

Start time for observed period. Default value is None.

Default value: None
end_time
str

End time for observed period. Default value is None.

Default value: None
interval

The time step to be used to summarize the metric values. Default value is PT1H. Known values are: "PT1H" and "P1D". Default value is None.

Default value: None
aggregation_function

Aggregation function to be used, default value is 'sum'. Known values are: "avg", "min", "max", "stdev", and "sum". Default value is None.

Default value: None
observation_metric

Metric to be used for ranking top queries. Default is 'cpu'. Known values are: "cpu", "io", "logIo", "duration", and "dtu". Default value is None.

Default value: None

Returns

Type Description

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

Exceptions

Type Description

list_by_resource_group

Gets a list of managed instances in a resource group.

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

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 ManagedInstance or the result of cls(response)

Exceptions

Type Description

list_outbound_network_dependencies_by_managed_instance

Gets the collection of outbound network dependencies for the given managed instance.

list_outbound_network_dependencies_by_managed_instance(resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> AsyncItemPaged[OutboundEnvironmentEndpoint]

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.

managed_instance_name
Required
str

The name of the managed instance. Required.

Returns

Type Description

An iterator like instance of either OutboundEnvironmentEndpoint 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'>