获取指定位置、发布者和产品/服务的虚拟机映像 SKU 列表。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus?api-version=2024-03-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
location
|
path |
True
|
string
|
受支持的 Azure 区域的名称。
|
offer
|
path |
True
|
string
|
有效的映像发布者产品/服务。
|
publisherName
|
path |
True
|
string
|
有效的映像发布者。
|
subscriptionId
|
path |
True
|
string
|
唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。
|
api-version
|
query |
True
|
string
|
客户端 API 版本。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
VirtualMachineImage_ListSkus_MaximumSet_Gen
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/aaaa/publishers/aaaaaaaaaaaaaaaaaaaaaaaaaaaa/artifacttypes/vmimage/offers/aaaaaaa/skus?api-version=2024-03-01
/**
* Samples for VirtualMachineImages ListSkus.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json
*/
/**
* Sample code: VirtualMachineImage_ListSkus_MaximumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineImageListSkusMaximumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getVirtualMachineImages().listSkusWithResponse("aaaa",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", 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/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json
func ExampleVirtualMachineImagesClient_ListSKUs_virtualMachineImageListSkusMaximumSetGen() {
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)
}
res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{
// {
// ID: to.Ptr("aaaaaaaaaaa"),
// Name: to.Ptr("aaaaaaaa"),
// ExtendedLocation: &armcompute.ExtendedLocation{
// Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"),
// Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone),
// },
// Location: to.Ptr("aaaaaaaaaaaaaaaaaa"),
// Tags: map[string]*string{
// "key7868": to.Ptr("aaaaa"),
// },
// }}
}
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
[
{
"name": "aaaaaaaa",
"location": "aaaaaaaaaaaaaaaaaa",
"tags": {
"key7868": "aaaaa"
},
"extendedLocation": {
"name": "aaaaaaaaaaaaaaaaaaaaa",
"type": "EdgeZone"
},
"id": "aaaaaaaaaaa"
}
]
VirtualMachineImage_ListSkus_MinimumSet_Gen
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/aaaa/publishers/aaaaaaaaaaaaa/artifacttypes/vmimage/offers/aaaaaaa/skus?api-version=2024-03-01
/**
* Samples for VirtualMachineImages ListSkus.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json
*/
/**
* Sample code: VirtualMachineImage_ListSkus_MinimumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineImageListSkusMinimumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getVirtualMachineImages().listSkusWithResponse("aaaa",
"aaaaaaaaaaaaa", "aaaaaaa", 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/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json
func ExampleVirtualMachineImagesClient_ListSKUs_virtualMachineImageListSkusMinimumSetGen() {
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)
}
res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaa", "aaaaaaa", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{
// {
// ID: to.Ptr("aaaaaaaaaaa"),
// Name: to.Ptr("aaaaaaaa"),
// Location: to.Ptr("aaaaaaaaaaaaaaaaaa"),
// }}
}
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
[
{
"name": "aaaaaaaa",
"location": "aaaaaaaaaaaaaaaaaa",
"id": "aaaaaaaaaaa"
}
]
定义
ApiError
API 错误。
名称 |
类型 |
说明 |
code
|
string
|
错误代码。
|
details
|
ApiErrorBase[]
|
API 错误详细信息
|
innererror
|
InnerError
|
Api 内部错误
|
message
|
string
|
错误消息。
|
target
|
string
|
特定错误的目标。
|
ApiErrorBase
API 错误基。
名称 |
类型 |
说明 |
code
|
string
|
错误代码。
|
message
|
string
|
错误消息。
|
target
|
string
|
特定错误的目标。
|
CloudError
来自计算服务的错误响应。
ExtendedLocation
扩展位置的复杂类型。
ExtendedLocationTypes
扩展位置的类型。
InnerError
内部错误详细信息。
名称 |
类型 |
说明 |
errordetail
|
string
|
内部错误消息或异常转储。
|
exceptiontype
|
string
|
异常类型。
|
VirtualMachineImageResource
虚拟机映像资源信息。
名称 |
类型 |
说明 |
extendedLocation
|
ExtendedLocation
|
虚拟机的扩展位置。
|
id
|
string
|
资源 ID
|
location
|
string
|
支持的 Azure 资源位置。
|
name
|
string
|
资源的名称。
|
tags
|
object
|
指定分配给虚拟机的标记。 有关使用标记的详细信息,请参阅 使用标记来组织 Azure 资源。
|