删除专用主机。
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}?api-version=2024-03-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
hostGroupName
|
path |
True
|
string
|
专用主机组的名称。
|
hostName
|
path |
True
|
string
|
专用主机的名称。
|
resourceGroupName
|
path |
True
|
string
|
资源组的名称。
|
subscriptionId
|
path |
True
|
string
|
唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。
|
api-version
|
query |
True
|
string
|
客户端 API 版本。
|
响应
名称 |
类型 |
说明 |
200 OK
|
|
确定
|
202 Accepted
|
|
已接受
|
204 No Content
|
|
无内容
|
Other Status Codes
|
CloudError
|
描述操作失败原因的错误响应。
|
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
DedicatedHost_Delete_MaximumSet_Gen
Sample Request
DELETE https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/hostGroups/aaaaaa/hosts/aaaaaaaaaaaaaaa?api-version=2024-03-01
/**
* Samples for DedicatedHosts Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: DedicatedHost_Delete_MaximumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void dedicatedHostDeleteMaximumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDedicatedHosts().delete("rgcompute", "aaaaaa",
"aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json
func ExampleDedicatedHostsClient_BeginDelete_dedicatedHostDeleteMaximumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDedicatedHostsClient().BeginDelete(ctx, "rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa", 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)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
location: https://foo.com/operationstatus
DedicatedHost_Delete_MinimumSet_Gen
Sample Request
DELETE https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/hostGroups/aaaaaaaaaaaaaaa/hosts/aaaaa?api-version=2024-03-01
/**
* Samples for DedicatedHosts Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: DedicatedHost_Delete_MinimumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void dedicatedHostDeleteMinimumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDedicatedHosts().delete("rgcompute", "aaaaaaaaaaaaaaa",
"aaaaa", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json
func ExampleDedicatedHostsClient_BeginDelete_dedicatedHostDeleteMinimumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDedicatedHostsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaa", "aaaaa", 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)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
location: https://foo.com/operationstatus
定义
ApiError
Api 错误。
名称 |
类型 |
说明 |
code
|
string
|
错误代码。
|
details
|
ApiErrorBase[]
|
Api 错误详细信息
|
innererror
|
InnerError
|
Api 内部错误
|
message
|
string
|
错误消息。
|
target
|
string
|
特定错误的目标。
|
ApiErrorBase
Api 错误基。
名称 |
类型 |
说明 |
code
|
string
|
错误代码。
|
message
|
string
|
错误消息。
|
target
|
string
|
特定错误的目标。
|
CloudError
来自计算服务的错误响应。
InnerError
内部错误详细信息。
名称 |
类型 |
说明 |
errordetail
|
string
|
内部错误消息或异常转储。
|
exceptiontype
|
string
|
异常类型。
|