你当前正在访问 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=2024-03-03
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
gallery
|
path | True |
string |
要创建或更新的库映像定义的名称。 允许的字符是字母和数字,中间允许点、短划线和句点。 最大长度为 80 个字符。 |
gallery
|
path | True |
string |
要在其中创建映像定义的共享映像库的名称。 |
resource
|
path | True |
string |
资源组的名称。 |
subscription
|
path | True |
string |
唯一标识 azure 订阅Microsoft的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
location | True |
string |
资源位置 |
properties.identifier | True |
这是库映像定义标识符。 |
|
properties.osState | True |
此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。 |
|
properties.osType | True |
此属性允许指定从托管映像创建 VM 时磁盘中包含的 OS 的类型。 可能的值包括:Windows、Linux。 |
|
properties.allowUpdateImage |
boolean |
自选。 如果库映像功能正在更新,则必须设置为 true。 |
|
properties.architecture |
映像的体系结构。 仅适用于 OS 磁盘。 |
||
properties.description |
string |
此库映像定义资源的说明。 此属性可更新。 |
|
properties.disallowed |
描述不允许的磁盘类型。 |
||
properties.endOfLifeDate |
string |
库映像定义的生命周期结束日期。 此属性可用于解除授权目的。 此属性可更新。 |
|
properties.eula |
string |
库映像定义的 Eula 协议。 |
|
properties.features |
库映像功能的列表。 |
||
properties.hyperVGeneration |
虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。 |
||
properties.privacyStatementUri |
string |
隐私声明 URI。 |
|
properties.purchasePlan |
描述库映像定义购买计划。 市场映像使用此映像。 |
||
properties.recommended |
这些属性描述此映像定义的推荐计算机配置。 这些属性是可更新的。 |
||
properties.releaseNoteUri |
string |
发行说明 URI。 |
|
tags |
object |
资源标记 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
还行 |
|
201 Created |
创建 |
|
202 Accepted |
接受 |
|
Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
Create or update a simple gallery image.
示例请求
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName?api-version=2024-03-03
{
"location": "West US",
"properties": {
"osType": "Windows",
"osState": "Generalized",
"hyperVGeneration": "V1",
"identifier": {
"publisher": "myPublisherName",
"offer": "myOfferName",
"sku": "mySkuName"
}
}
}
示例响应
{
"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"
}
定义
名称 | 说明 |
---|---|
Api |
Api 错误。 |
Api |
Api 错误基数。 |
Architecture |
映像的体系结构。 仅适用于 OS 磁盘。 |
Cloud |
来自计算服务的错误响应。 |
Disallowed |
描述不允许的磁盘类型。 |
Gallery |
指定要创建或更新的库映像定义的信息。 |
Gallery |
库映像的功能。 |
Gallery |
这是库映像定义标识符。 |
Gallery |
库或库项目的当前状态。 |
Hyper |
虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。 |
Image |
描述库映像定义购买计划。 市场映像使用此映像。 |
Inner |
内部错误详细信息。 |
Operating |
此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。 |
Operating |
此属性允许指定应用程序为其构建的 OS 支持的类型。 可能的值包括:Windows、Linux。 |
Recommended |
这些属性描述此映像定义的推荐计算机配置。 这些属性是可更新的。 |
Resource |
描述资源范围。 |
ApiError
Api 错误。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
details |
API 错误详细信息 |
|
innererror |
Api 内部错误 |
|
message |
string |
错误消息。 |
target |
string |
特定错误的目标。 |
ApiErrorBase
Api 错误基数。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
message |
string |
错误消息。 |
target |
string |
特定错误的目标。 |
Architecture
映像的体系结构。 仅适用于 OS 磁盘。
值 | 说明 |
---|---|
Arm64 | |
x64 |
CloudError
来自计算服务的错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
Api 错误。 |
Disallowed
描述不允许的磁盘类型。
名称 | 类型 | 说明 |
---|---|---|
diskTypes |
string[] |
磁盘类型的列表。 |
GalleryImage
指定要创建或更新的库映像定义的信息。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源 ID |
location |
string |
资源位置 |
name |
string |
资源名称 |
properties.allowUpdateImage |
boolean |
自选。 如果库映像功能正在更新,则必须设置为 true。 |
properties.architecture |
映像的体系结构。 仅适用于 OS 磁盘。 |
|
properties.description |
string |
此库映像定义资源的说明。 此属性可更新。 |
properties.disallowed |
描述不允许的磁盘类型。 |
|
properties.endOfLifeDate |
string |
库映像定义的生命周期结束日期。 此属性可用于解除授权目的。 此属性可更新。 |
properties.eula |
string |
库映像定义的 Eula 协议。 |
properties.features |
库映像功能的列表。 |
|
properties.hyperVGeneration |
虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。 |
|
properties.identifier |
这是库映像定义标识符。 |
|
properties.osState |
此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。 |
|
properties.osType |
此属性允许指定从托管映像创建 VM 时磁盘中包含的 OS 的类型。 可能的值包括:Windows、Linux。 |
|
properties.privacyStatementUri |
string |
隐私声明 URI。 |
properties.provisioningState |
库或库项目的当前状态。 |
|
properties.purchasePlan |
描述库映像定义购买计划。 市场映像使用此映像。 |
|
properties.recommended |
这些属性描述此映像定义的推荐计算机配置。 这些属性是可更新的。 |
|
properties.releaseNoteUri |
string |
发行说明 URI。 |
tags |
object |
资源标记 |
type |
string |
资源类型 |
GalleryImageFeature
库映像的功能。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
库映像功能的名称。 |
startsAtVersion |
string |
支持此功能的最低库映像版本。 |
value |
string |
库映像功能的值。 |
GalleryImageIdentifier
这是库映像定义标识符。
名称 | 类型 | 说明 |
---|---|---|
offer |
string |
库映像定义产品/服务的名称。 |
publisher |
string |
库映像定义发布者的名称。 |
sku |
string |
库映像定义 SKU 的名称。 |
GalleryProvisioningState
库或库项目的当前状态。
值 | 说明 |
---|---|
Creating | |
Deleting | |
Failed | |
Migrating | |
Succeeded | |
Updating |
HyperVGeneration
虚拟机的虚拟机监控程序生成。 仅适用于 OS 磁盘。
值 | 说明 |
---|---|
V1 | |
V2 |
ImagePurchasePlan
描述库映像定义购买计划。 市场映像使用此映像。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
计划 ID。 |
product |
string |
产品 ID。 |
publisher |
string |
发布者 ID。 |
InnerError
内部错误详细信息。
名称 | 类型 | 说明 |
---|---|---|
errordetail |
string |
内部错误消息或异常转储。 |
exceptiontype |
string |
异常类型。 |
OperatingSystemStateTypes
此属性允许用户指定在此映像下创建的虚拟机是“通用化”还是“专用”。
值 | 说明 |
---|---|
Generalized | |
Specialized |
OperatingSystemTypes
此属性允许指定应用程序为其构建的 OS 支持的类型。 可能的值包括:Windows、Linux。
值 | 说明 |
---|---|
Linux | |
Windows |
RecommendedMachineConfiguration
这些属性描述此映像定义的推荐计算机配置。 这些属性是可更新的。
名称 | 类型 | 说明 |
---|---|---|
memory |
描述资源范围。 |
|
vCPUs |
描述资源范围。 |
ResourceRange
描述资源范围。
名称 | 类型 | 说明 |
---|---|---|
max |
integer |
资源的最大数目。 |
min |
integer |
资源的最小数目。 |