你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Gallery Images - Create Or Update

创建或更新库映像定义。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}?api-version=2023-07-03

URI 参数

名称 必需 类型 说明
galleryImageName
path True

string

要创建或更新的库映像定义的名称。 允许的字符是字母和数字,中间允许有点、短划线和句点。 最大长度为 80 个字符。

galleryName
path True

string

要在其中创建映像定义的共享映像库的名称。

resourceGroupName
path True

string

资源组的名称。

subscriptionId
path True

string

唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。

api-version
query True

string

客户端 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源位置

properties.identifier True

GalleryImageIdentifier

这是库映像定义标识符。

properties.osState True

OperatingSystemStateTypes

此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。

properties.osType True

OperatingSystemTypes

此属性允许指定从托管映像创建 VM 时磁盘中包含的 OS 类型。 可能的值为: Windows、Linux。

properties.architecture

Architecture

映像的体系结构。 仅适用于 OS 磁盘。

properties.description

string

此库映像定义资源的说明。 此属性可更新。

properties.disallowed

Disallowed

介绍不允许的磁盘类型。

properties.endOfLifeDate

string

库映像定义的生命周期结束日期。 此属性可用于解除授权。 此属性可更新。

properties.eula

string

库映像定义的 Eula 协议。

properties.features

GalleryImageFeature[]

库映像功能的列表。

properties.hyperVGeneration

HyperVGeneration

虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。

properties.privacyStatementUri

string

隐私声明 URI。

properties.purchasePlan

ImagePurchasePlan

介绍库映像定义购买计划。 这由市场映像使用。

properties.recommended

RecommendedMachineConfiguration

这些属性描述了此映像定义的建议计算机配置。 这些属性可更新。

properties.releaseNoteUri

string

发行说明 URI。

tags

object

资源标记

响应

名称 类型 说明
200 OK

GalleryImage

确定

201 Created

GalleryImage

创建

202 Accepted

GalleryImage

已接受

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 模拟用户帐户

示例

Sample Request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName?api-version=2023-07-03

{
  "location": "West US",
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    }
  }
}

Sample Response

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Creating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}

定义

名称 说明
ApiError

Api 错误。

ApiErrorBase

Api 错误基。

Architecture

映像的体系结构。 仅适用于 OS 磁盘。

CloudError

来自计算服务的错误响应。

Disallowed

介绍不允许的磁盘类型。

GalleryImage

指定要创建或更新的库映像定义的相关信息。

GalleryImageFeature

库映像的一项功能。

GalleryImageIdentifier

这是库映像定义标识符。

GalleryProvisioningState

库或库项目的当前状态。

HyperVGeneration

虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。

ImagePurchasePlan

介绍库映像定义购买计划。 这由市场映像使用。

InnerError

内部错误详细信息。

OperatingSystemStateTypes

此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。

OperatingSystemTypes

此属性允许指定应用程序的受支持操作系统类型。 可能的值为: Windows、Linux。

RecommendedMachineConfiguration

这些属性描述了此映像定义的建议计算机配置。 这些属性可更新。

ResourceRange

描述资源范围。

ApiError

Api 错误。

名称 类型 说明
code

string

错误代码。

details

ApiErrorBase[]

Api 错误详细信息

innererror

InnerError

Api 内部错误

message

string

错误消息。

target

string

特定错误的目标。

ApiErrorBase

Api 错误基。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

target

string

特定错误的目标。

Architecture

映像的体系结构。 仅适用于 OS 磁盘。

名称 类型 说明
Arm64

string

x64

string

CloudError

来自计算服务的错误响应。

名称 类型 说明
error

ApiError

Api 错误。

Disallowed

介绍不允许的磁盘类型。

名称 类型 说明
diskTypes

string[]

磁盘类型的列表。

GalleryImage

指定要创建或更新的库映像定义的相关信息。

名称 类型 说明
id

string

资源 ID

location

string

资源位置

name

string

资源名称

properties.architecture

Architecture

映像的体系结构。 仅适用于 OS 磁盘。

properties.description

string

此库映像定义资源的说明。 此属性可更新。

properties.disallowed

Disallowed

介绍不允许的磁盘类型。

properties.endOfLifeDate

string

库映像定义的生命周期结束日期。 此属性可用于解除授权。 此属性可更新。

properties.eula

string

库映像定义的 Eula 协议。

properties.features

GalleryImageFeature[]

库映像功能的列表。

properties.hyperVGeneration

HyperVGeneration

虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。

properties.identifier

GalleryImageIdentifier

这是库映像定义标识符。

properties.osState

OperatingSystemStateTypes

此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。

properties.osType

OperatingSystemTypes

此属性允许指定从托管映像创建 VM 时磁盘中包含的 OS 类型。 可能的值为: Windows、Linux。

properties.privacyStatementUri

string

隐私声明 URI。

properties.provisioningState

GalleryProvisioningState

库或库项目的当前状态。
预配状态,仅显示在响应中。

properties.purchasePlan

ImagePurchasePlan

介绍库映像定义购买计划。 这由市场映像使用。

properties.recommended

RecommendedMachineConfiguration

这些属性描述了此映像定义的建议计算机配置。 这些属性可更新。

properties.releaseNoteUri

string

发行说明 URI。

tags

object

资源标记

type

string

资源类型

GalleryImageFeature

库映像的一项功能。

名称 类型 说明
name

string

库映像功能的名称。

value

string

库映像功能的值。

GalleryImageIdentifier

这是库映像定义标识符。

名称 类型 说明
offer

string

库映像定义产品/服务的名称。

publisher

string

库映像定义发布者的名称。

sku

string

库映像定义 SKU 的名称。

GalleryProvisioningState

库或库项目的当前状态。

名称 类型 说明
Creating

string

Deleting

string

Failed

string

Migrating

string

Succeeded

string

Updating

string

HyperVGeneration

虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。

名称 类型 说明
V1

string

V2

string

ImagePurchasePlan

介绍库映像定义购买计划。 这由市场映像使用。

名称 类型 说明
name

string

计划 ID。

product

string

产品 ID。

publisher

string

发布者 ID。

InnerError

内部错误详细信息。

名称 类型 说明
errordetail

string

内部错误消息或异常转储。

exceptiontype

string

异常类型。

OperatingSystemStateTypes

此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。

名称 类型 说明
Generalized

string

Specialized

string

OperatingSystemTypes

此属性允许指定应用程序的受支持操作系统类型。 可能的值为: Windows、Linux。

名称 类型 说明
Linux

string

Windows

string

RecommendedMachineConfiguration

这些属性描述了此映像定义的建议计算机配置。 这些属性可更新。

名称 类型 说明
memory

ResourceRange

描述资源范围。

vCPUs

ResourceRange

描述资源范围。

ResourceRange

描述资源范围。

名称 类型 说明
max

integer

资源的最大数目。

min

integer

资源的最小数目。