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);
}
}