Перезапустите выделенный узел. Операция завершится успешно после перезапуска выделенного узла и ее выполнения. Чтобы определить работоспособность виртуальных машин, развернутых на выделенном узле после перезапуска, проверьте центр Работоспособность ресурсов на портале Azure. Дополнительные сведения см. в https://docs.microsoft.com/azure/service-health/resource-health-overview этой статье.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart?api-version=2022-03-01
Параметры URI
Name
In
Required
Type
Description
hostGroupName
path
True
string
Имя выделенной группы узлов.
hostName
path
True
string
Имя выделенного узла.
resourceGroupName
path
True
string
Имя группы ресурсов.
subscriptionId
path
True
string
Учетные данные подписки, которые однозначно идентифицируют подписку Microsoft Azure. Идентификатор подписки формирует часть URI для каждого вызова службы.
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myDedicatedHostGroup/hosts/myHost/restart?api-version=2022-03-01
import com.azure.core.util.Context;
/** Samples for DedicatedHosts Restart. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_Restart.json
*/
/**
* Sample code: Restart Dedicated Host.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void restartDedicatedHost(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getDedicatedHosts()
.restart("myResourceGroup", "myDedicatedHostGroup", "myHost", Context.NONE);
}
}
Read this SDK documentation on how to add the SDK to your project and authenticate.
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_Restart.json
func ExampleDedicatedHostsClient_BeginRestart() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginRestart(ctx,
"myResourceGroup",
"myDedicatedHostGroup",
"myHost",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
Read this SDK documentation on how to add the SDK to your project and authenticate.
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details.
*
* @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_Restart.json
*/
async function restartDedicatedHost() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const hostGroupName = "myDedicatedHostGroup";
const hostName = "myHost";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.dedicatedHosts.beginRestartAndWait(
resourceGroupName,
hostGroupName,
hostName
);
console.log(result);
}
restartDedicatedHost().catch(console.error);
Read this SDK documentation on how to add the SDK to your project and authenticate.