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

Galleries - Create Or Update

创建或更新共享映像库。

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

URI 参数

名称 必需 类型 说明
galleryName
path True

string

共享映像库的名称。 允许的字符是字母和数字,中间允许有点和句点。 最大长度为 80 个字符。

resourceGroupName
path True

string

资源组的名称。

subscriptionId
path True

string

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

api-version
query True

string

客户端 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源位置

properties.description

string

此共享映像库资源的说明。 此属性可更新。

properties.identifier

GalleryIdentifier

描述库唯一名称。

properties.sharingProfile

SharingProfile

用于将库共享到订阅或租户的配置文件

properties.softDeletePolicy

SoftDeletePolicy

包含有关库的软删除策略的信息。

tags

object

资源标记

响应

名称 类型 说明
200 OK

Gallery

确定

201 Created

Gallery

创建

202 Accepted

Gallery

已接受

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

示例

Create a community gallery.
Create or update a simple gallery with sharing profile.
Create or update a simple gallery with soft deletion enabled.
Create or update a simple gallery.

Create a community gallery.

Sample Request

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

{
  "location": "West US",
  "properties": {
    "description": "This is the gallery description.",
    "sharingProfile": {
      "permissions": "Community",
      "communityGalleryInfo": {
        "publisherUri": "uri",
        "publisherContact": "pir@microsoft.com",
        "eula": "eula",
        "publicNamePrefix": "PirPublic"
      }
    }
  }
}

Sample Response

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "sharingProfile": {
      "permissions": "Community",
      "communityGalleryInfo": {
        "publisherUri": "uri",
        "publisherContact": "pir@microsoft.com",
        "eula": "eula",
        "publicNamePrefix": "PirPublic"
      }
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Creating",
    "sharingProfile": {
      "permissions": "Community",
      "communityGalleryInfo": {
        "publisherUri": "uri",
        "publisherContact": "pir@microsoft.com",
        "eula": "eula",
        "publicNamePrefix": "PirPublic"
      }
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "sharingProfile": {
      "permissions": "Community",
      "communityGalleryInfo": {
        "publisherUri": "uri",
        "publisherContact": "pir@microsoft.com",
        "eula": "eula",
        "publicNamePrefix": "PirPublic"
      }
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}

Sample Request

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

{
  "location": "West US",
  "properties": {
    "description": "This is the gallery description.",
    "sharingProfile": {
      "permissions": "Groups"
    }
  }
}

Sample Response

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "sharingProfile": {
      "permissions": "Groups"
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Creating",
    "sharingProfile": {
      "permissions": "Groups"
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "sharingProfile": {
      "permissions": "Groups"
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}

Sample Request

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

{
  "location": "West US",
  "properties": {
    "description": "This is the gallery description.",
    "softDeletePolicy": {
      "isSoftDeleteEnabled": true
    }
  }
}

Sample Response

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "softDeletePolicy": {
      "isSoftDeleteEnabled": true
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Creating",
    "softDeletePolicy": {
      "isSoftDeleteEnabled": true
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating",
    "softDeletePolicy": {
      "isSoftDeleteEnabled": true
    }
  },
  "location": "West US",
  "name": "myGalleryName"
}

Create or update a simple gallery.

Sample Request

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

{
  "location": "West US",
  "properties": {
    "description": "This is the gallery description."
  }
}

Sample Response

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Creating"
  },
  "location": "West US",
  "name": "myGalleryName"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
  "properties": {
    "description": "This is the gallery description.",
    "identifier": {
      "uniqueName": "{subscription-id}-MYGALLERYNAME"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryName"
}

定义

名称 说明
ApiError

Api 错误。

ApiErrorBase

Api 错误基。

CloudError

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

CommunityGalleryInfo

如果当前库共享到社区,则社区库的信息

Gallery

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

GalleryIdentifier

描述库唯一名称。

GalleryProvisioningState

库或库项目的当前状态。

GallerySharingPermissionTypes

此属性允许指定共享库的权限。 可能的值为: Private、Groups、Community。

InnerError

内部错误详细信息。

RegionalSharingStatus

库区域共享状态

SharingProfile

用于将库共享到订阅或租户的配置文件

SharingProfileGroup

库共享配置文件的组

SharingProfileGroupTypes

此属性允许指定共享组的类型。 可能的值为: Subscriptions、AADTenants。

SharingState

库的共享状态。

SharingStatus

当前库的共享状态。

SoftDeletePolicy

包含有关库的软删除策略的信息。

ApiError

Api 错误。

名称 类型 说明
code

string

错误代码。

details

ApiErrorBase[]

Api 错误详细信息

innererror

InnerError

Api 内部错误

message

string

错误消息。

target

string

特定错误的目标。

ApiErrorBase

Api 错误基。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

target

string

特定错误的目标。

CloudError

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

名称 类型 说明
error

ApiError

Api 错误。

CommunityGalleryInfo

如果当前库共享到社区,则社区库的信息

名称 类型 说明
communityGalleryEnabled

boolean

包含有关是否启用社区库共享的信息。

eula

string

社区库映像的最终用户许可协议。

publicNamePrefix

string

将公开显示的库名称的前缀。 对所有用户可见。

publicNames

string[]

社区库公共名称列表。

publisherContact

string

社区库发布者支持电子邮件。 发布者的电子邮件地址。 对所有用户可见。

publisherUri

string

指向发布者网站的链接。 对所有用户可见。

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

名称 类型 说明
id

string

资源 ID

location

string

资源位置

name

string

资源名称

properties.description

string

此共享映像库资源的说明。 此属性可更新。

properties.identifier

GalleryIdentifier

描述库唯一名称。

properties.provisioningState

GalleryProvisioningState

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

properties.sharingProfile

SharingProfile

用于将库共享到订阅或租户的配置文件

properties.sharingStatus

SharingStatus

当前库的共享状态。

properties.softDeletePolicy

SoftDeletePolicy

包含有关库的软删除策略的信息。

tags

object

资源标记

type

string

资源类型

GalleryIdentifier

描述库唯一名称。

名称 类型 说明
uniqueName

string

共享映像库的唯一名称。 此名称由 Azure 自动生成。

GalleryProvisioningState

库或库项目的当前状态。

名称 类型 说明
Creating

string

Deleting

string

Failed

string

Migrating

string

Succeeded

string

Updating

string

GallerySharingPermissionTypes

此属性允许指定共享库的权限。 可能的值为: Private、Groups、Community。

名称 类型 说明
Community

string

Groups

string

Private

string

InnerError

内部错误详细信息。

名称 类型 说明
errordetail

string

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

exceptiontype

string

异常类型。

RegionalSharingStatus

库区域共享状态

名称 类型 说明
details

string

库区域共享失败的详细信息。

region

string

区域名称

state

SharingState

库的共享状态。
当前区域中的库共享状态

SharingProfile

用于将库共享到订阅或租户的配置文件

名称 类型 说明
communityGalleryInfo

CommunityGalleryInfo

如果当前库共享到社区,则社区库的信息。

groups

SharingProfileGroup[]

共享配置文件组的列表。

permissions

GallerySharingPermissionTypes

此属性允许指定共享库的权限。 可能的值为: Private、Groups、Community。

SharingProfileGroup

库共享配置文件的组

名称 类型 说明
ids

string[]

库要共享到的订阅/租户 ID 列表。

type

SharingProfileGroupTypes

此属性允许指定共享组的类型。 可能的值为: Subscriptions、AADTenants。

SharingProfileGroupTypes

此属性允许指定共享组的类型。 可能的值为: Subscriptions、AADTenants。

名称 类型 说明
AADTenants

string

Subscriptions

string

SharingState

库的共享状态。

名称 类型 说明
Failed

string

InProgress

string

Succeeded

string

Unknown

string

SharingStatus

当前库的共享状态。

名称 类型 说明
aggregatedState

SharingState

库的共享状态。
当前库的聚合共享状态。

summary

RegionalSharingStatus[]

所有区域共享状态的摘要。

SoftDeletePolicy

包含有关库的软删除策略的信息。

名称 类型 说明
isSoftDeleteEnabled

boolean

为此库中的资源启用软删除,允许在保留期内恢复资源。