Virtual Machine Images - Get
获取虚拟机映像。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}?api-version=2025-04-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
location
|
path | True |
string minLength: 1 |
Azure 区域的名称。 |
|
offer
|
path | True |
string |
有效的图像发布者产品/服务。 |
|
publisher
|
path | True |
string |
有效的图像发布者。 |
|
skus
|
path | True |
string |
有效的镜像 SKU。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
version
|
path | True |
string |
有效的映像 SKU 版本。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure作已成功完成。 |
|
| Other Status Codes |
意外错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
|
Virtual |
|
Virtual |
VirtualMachineImage_Get_MaximumSet_Gen
示例请求
GET https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/aaaaaa/publishers/aaa/artifacttypes/vmimage/offers/aaaaaaaaaaaaaaaaaaaaaaaaaaaaa/skus/aaaaaaaaaaaaaaaaaaaaaaaaaaa/versions/aaaaaaaaaaaaaaaaaaa?api-version=2025-04-01
示例响应
{
"properties": {
"plan": {
"publisher": "aaaaaaaaaaaaaaaaaaa",
"name": "aaaaaaaaa",
"product": "aaaaaaaaaaaaaa"
},
"osDiskImage": {
"operatingSystem": "Windows"
},
"dataDiskImages": [
{
"lun": 17
}
],
"automaticOSUpgradeProperties": {
"automaticOSUpgradeSupported": true
},
"hyperVGeneration": "V1",
"disallowed": {
"vmDiskType": "None"
},
"features": [
{
"name": "aaaaaaaaaaaaaaaaaaaaa",
"value": "aaaaaaaaaaaaaaaaaaaa"
}
],
"imageDeprecationStatus": {
"imageState": "ScheduledForDeprecation",
"scheduledDeprecationTime": "2023-01-13T00:00:00+00:00",
"alternativeOption": {
"type": "Offer",
"value": "aaaaaaa"
}
}
},
"name": "aaaaaaaaa",
"location": "aaaaa",
"tags": {
"key6817": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
},
"extendedLocation": {
"name": "aaaaaaaaaaaaaaaaaaaaa",
"type": "EdgeZone"
},
"id": "aaaaaaaaaaa"
}
VirtualMachineImage_Get_MinimumSet_Gen
示例请求
示例响应
{
"name": "aaaaaaaaa",
"location": "aaaaa",
"id": "aaaaaaaaaaa"
}
定义
| 名称 | 说明 |
|---|---|
|
Alternative |
描述当此映像被弃用时,发布者为此映像指定的替代选项。 |
|
Alternative |
描述备选选项的类型。 |
|
Api |
API 错误。 |
|
Api |
Api 错误库。 |
|
Architecture |
指定体系结构类型 |
|
Automatic |
描述映像上的自动作系统升级属性。 |
|
Cloud |
来自计算服务的错误响应。 |
|
Data |
包含数据磁盘映像信息。 |
|
Disallowed |
指定虚拟机映像的不允许配置。 |
|
Extended |
扩展位置的复杂类型。 |
|
Extended |
扩展位置的类型。 |
|
Hyper |
指定 HyperVGeneration 类型 |
|
Image |
描述映像上的映像弃用状态属性。 |
|
Image |
描述图像的状态。 |
|
Inner |
内部错误详细信息。 |
|
Operating |
此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。 可能的值包括:Windows、Linux。 |
|
OSDisk |
包含作系统磁盘映像信息。 |
|
Purchase |
用于通过 MarketPlace 建立任何第三方工件的购买上下文。 |
|
Virtual |
描述虚拟机映像。 |
|
Virtual |
指定映像支持的其他功能 |
|
Vm |
不允许的虚拟机磁盘类型。 |
AlternativeOption
描述当此映像被弃用时,发布者为此映像指定的替代选项。
| 名称 | 类型 | 说明 |
|---|---|---|
| type |
描述备选选项的类型。 |
|
| value |
string |
指示发布者指定的替代选项值。 当类型为“产品/服务”时,这是“产品/服务名称”,当类型为“计划”时,这是“计划名称”。 |
AlternativeType
描述备选选项的类型。
| 值 | 说明 |
|---|---|
| None | |
| Offer | |
| Plan |
ApiError
API 错误。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| details |
Api 错误详细信息 |
|
| innererror |
Api 内部错误 |
|
| message |
string |
错误消息。 |
| target |
string |
特定错误的目标。 |
ApiErrorBase
Api 错误库。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
错误消息。 |
| target |
string |
特定错误的目标。 |
ArchitectureTypes
指定体系结构类型
| 值 | 说明 |
|---|---|
| x64 | |
| Arm64 |
AutomaticOSUpgradeProperties
描述映像上的自动作系统升级属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| automaticOSUpgradeSupported |
boolean |
指定映像是否支持自动作系统升级。 |
CloudError
来自计算服务的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
API 错误。 |
DataDiskImage
包含数据磁盘映像信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| lun |
integer (int32) |
指定数据磁盘的逻辑单元号。 此值用于标识 VM 中的数据磁盘,因此对于附加到 VM 的每个数据磁盘必须是唯一的。 |
DisallowedConfiguration
指定虚拟机映像的不允许配置。
| 名称 | 类型 | 说明 |
|---|---|---|
| vmDiskType |
不允许的虚拟机磁盘类型。 |
ExtendedLocation
扩展位置的复杂类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
扩展位置的名称。 |
| type |
扩展位置的类型。 |
ExtendedLocationTypes
扩展位置的类型。
| 值 | 说明 |
|---|---|
| EdgeZone |
HyperVGenerationTypes
指定 HyperVGeneration 类型
| 值 | 说明 |
|---|---|
| V1 | |
| V2 |
ImageDeprecationStatus
描述映像上的映像弃用状态属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| alternativeOption |
描述当此映像被弃用时,发布者为此映像指定的替代选项。 |
|
| imageState |
描述图像的状态。 |
|
| scheduledDeprecationTime |
string (date-time) |
将来将此映像标记为已弃用的时间。 此计划时间由发布者选择。 |
ImageState
描述图像的状态。
| 值 | 说明 |
|---|---|
| Active | |
| ScheduledForDeprecation | |
| Deprecated |
InnerError
内部错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| errordetail |
string |
内部错误消息或异常转储。 |
| exceptiontype |
string |
异常类型。 |
OperatingSystemTypes
此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。 可能的值包括:Windows、Linux。
| 值 | 说明 |
|---|---|
| Windows | |
| Linux |
OSDiskImage
包含作系统磁盘映像信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| operatingSystem |
osDiskImage 的作系统。 |
PurchasePlan
用于通过 MarketPlace 建立任何第三方工件的购买上下文。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
计划 ID。 |
| product |
string |
指定来自市场的映像的产品。 此值与 imageReference 元素下的 Offer 相同。 |
| publisher |
string |
发布者 ID。 |
VirtualMachineImage
描述虚拟机映像。
| 名称 | 类型 | 说明 |
|---|---|---|
| extendedLocation |
虚拟机的扩展位置。 |
|
| id |
string |
资源 ID |
| location |
string |
资源支持的 Azure 位置。 |
| name |
string |
资源的名称。 |
| properties.architecture |
指定体系结构类型 |
|
| properties.automaticOSUpgradeProperties |
描述映像上的自动作系统升级属性。 |
|
| properties.dataDiskImages |
数据磁盘映像信息列表。 |
|
| properties.disallowed |
为从映像创建的虚拟机指定不允许的配置 |
|
| properties.features |
指定映像支持的其他功能 |
|
| properties.hyperVGeneration |
指定 HyperVGeneration 类型 |
|
| properties.imageDeprecationStatus |
描述映像上的映像弃用状态属性。 |
|
| properties.osDiskImage |
包含作系统磁盘映像信息。 |
|
| properties.plan |
用于通过 MarketPlace 建立任何第三方工件的购买上下文。 |
|
| tags |
object |
指定分配给虚拟机的标记。 有关使用标记的详细信息,请参阅 使用标记组织 Azure 资源。 |
VirtualMachineImageFeature
指定映像支持的其他功能
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
功能的名称。 |
| value |
string |
特征的相应值。 |
VmDiskTypes
不允许的虚拟机磁盘类型。
| 值 | 说明 |
|---|---|
| None | |
| Unmanaged |