你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Managed Instances - Failover
参考
服务:
SQL Database
API 版本:
2021-11-01
故障转移托管实例。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover?api-version=2021-11-01
具有可选参数:
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover?replicaType={replicaType}&api-version=2021-11-01
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/instanceName/failover?replicaType=Primary&api-version=2021-11-01
import com.azure.resourcemanager.sql.models.ReplicaType;
/**
* Samples for ManagedInstances Failover.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/FailoverManagedInstance.json
*/
/**
* Sample code: Failover a managed instance.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void failoverAManagedInstance(com.azure.resourcemanager.AzureResourceManager azure) {
azure.sqlServers().manager().serviceClient().getManagedInstances().failover("group1", "instanceName",
ReplicaType.PRIMARY, com.azure.core.util.Context.NONE);
}
}