ManagedInstancesOperations Class

ManagedInstancesOperations 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
ManagedInstancesOperations

Constructor

ManagedInstancesOperations(client, config, serializer, deserializer)

Parameters

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

models

Alias to model classes used in this operation group.

Methods

begin_create_or_update

Creates or updates a managed instance.

begin_delete

Deletes a managed instance.

begin_failover

Failovers a 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.

begin_create_or_update

Creates or updates a managed instance.

begin_create_or_update(resource_group_name: str, managed_instance_name: str, parameters: _models.ManagedInstance, **kwargs: Any) -> LROPoller[_models.ManagedInstance]

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance.

parameters
ManagedInstance
Required

The requested managed instance resource state.

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

Return type

Exceptions

begin_delete

Deletes a managed instance.

begin_delete(resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance.

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_failover

Failovers a managed instance.

begin_failover(resource_group_name: str, managed_instance_name: str, replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance to failover.

replica_type
str or ReplicaType
default value: None

The type of replica to be failed over.

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_update

Updates a managed instance.

begin_update(resource_group_name: str, managed_instance_name: str, parameters: _models.ManagedInstanceUpdate, **kwargs: Any) -> LROPoller[_models.ManagedInstance]

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance.

parameters
ManagedInstanceUpdate
Required

The requested managed instance resource state.

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

Return type

Exceptions

get

Gets a managed instance.

get(resource_group_name: str, managed_instance_name: str, expand: Optional[str] = None, **kwargs: Any) -> _models.ManagedInstance

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance.

expand
str
default value: None

The child resources to include in the response.

cls
callable

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

Returns

ManagedInstance, or the result of cls(response)

Return type

Exceptions

list

Gets a list of all managed instances in the subscription.

list(expand: Optional[str] = None, **kwargs: Any) -> Iterable[_models.ManagedInstanceListResult]

Parameters

expand
str
default value: None

The child resources to include in the response.

cls
callable

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

Returns

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

Return type

Exceptions

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: Optional[str] = None, **kwargs: Any) -> Iterable[_models.ManagedInstanceListResult]

Parameters

resource_group_name
str
Required

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

instance_pool_name
str
Required

The instance pool name.

expand
str
default value: None

The child resources to include in the response.

cls
callable

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

Returns

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

Return type

Exceptions

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: Optional[int] = None, databases: Optional[str] = None, start_time: Optional[str] = None, end_time: Optional[str] = None, interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, observation_metric: Optional[Union[str, _models.MetricType]] = None, **kwargs: Any) -> Iterable[_models.TopQueriesListResult]

Parameters

resource_group_name
str
Required

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

managed_instance_name
str
Required

The name of the managed instance.

number_of_queries
int
default value: None

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

databases
str
default value: None

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

start_time
str
default value: None

Start time for observed period.

end_time
str
default value: None

End time for observed period.

interval
str or QueryTimeGrainType
default value: None

The time step to be used to summarize the metric values. Default value is PT1H.

aggregation_function
str or AggregationFunctionType
default value: None

Aggregation function to be used, default value is 'sum'.

observation_metric
str or MetricType
default value: None

Metric to be used for ranking top queries. Default is 'cpu'.

cls
callable

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

Returns

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

Return type

Exceptions

list_by_resource_group

Gets a list of managed instances in a resource group.

list_by_resource_group(resource_group_name: str, expand: Optional[str] = None, **kwargs: Any) -> Iterable[_models.ManagedInstanceListResult]

Parameters

resource_group_name
str
Required

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

expand
str
default value: None

The child resources to include in the response.

cls
callable

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

Returns

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