共用方式為


Galleries - Create Or Update

建立或更新 共用映像庫。

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

URI 參數

名稱 位於 必要 類型 Description
galleryName
path True

string

共用映像庫 的名稱。 允許的字元是字母和數位,具有中間允許的點和句點。 最大長度為80個字元。

resourceGroupName
path True

string

資源群組的名稱。

subscriptionId
path True

string

可唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

api-version
query True

string

用戶端 API 版本。

要求本文

名稱 必要 類型 Description
location True

string

資源位置

properties.description

string

此 共用映像庫 資源的描述。 這個屬性是可更新的。

properties.identifier

GalleryIdentifier

描述資源庫唯一名稱。

properties.sharingProfile

SharingProfile

資源庫共用至訂用帳戶或租使用者的配置檔

properties.softDeletePolicy

SoftDeletePolicy

包含資源庫虛刪除原則的相關信息。

tags

object

資源標籤

回應

名稱 類型 Description
200 OK

Gallery

確定

201 Created

Gallery

建立時間

202 Accepted

Gallery

已接受

Other Status Codes

CloudError

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
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"
}

定義

名稱 Description
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 錯誤。

名稱 類型 Description
code

string

錯誤碼。

details

ApiErrorBase[]

API 錯誤詳細數據

innererror

InnerError

Api 內部錯誤

message

string

錯誤訊息。

target

string

特定錯誤的目標。

ApiErrorBase

API 錯誤基底。

名稱 類型 Description
code

string

錯誤碼。

message

string

錯誤訊息。

target

string

特定錯誤的目標。

CloudError

來自計算服務的錯誤回應。

名稱 類型 Description
error

ApiError

API 錯誤。

CommunityGalleryInfo

如果目前資源庫共用給社群,則社群資源庫的資訊

名稱 類型 Description
communityGalleryEnabled

boolean

包含是否啟用社群資源庫共用的相關信息。

eula

string

社群資源庫映像的使用者許可協定。

publicNamePrefix

string

將公開顯示之資源庫名稱的前置詞。 所有使用者都可以看到。

publicNames

string[]

社群資源庫公用名稱清單。

publisherContact

string

社群資源庫發行者支持電子郵件。 發行者的電子郵件位址。 所有使用者都可以看到。

publisherUri

string

發行者網站的連結。 所有使用者都可以看到。

指定您要建立或更新之 共用映像庫 的相關信息。

名稱 類型 Description
id

string

資源標識碼

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

描述資源庫唯一名稱。

名稱 類型 Description
uniqueName

string

共用映像庫 的唯一名稱。 Azure 會自動產生此名稱。

GalleryProvisioningState

資源庫或資源庫成品的目前狀態。

名稱 類型 Description
Creating

string

Deleting

string

Failed

string

Migrating

string

Succeeded

string

Updating

string

GallerySharingPermissionTypes

此屬性可讓您指定共用資源庫的許可權。 可能的值為: Private、Groups、Community。

名稱 類型 Description
Community

string

Groups

string

Private

string

InnerError

內部錯誤詳細數據。

名稱 類型 Description
errordetail

string

內部錯誤訊息或例外狀況傾印。

exceptiontype

string

例外狀況型別。

RegionalSharingStatus

資源庫區域共享狀態

名稱 類型 Description
details

string

資源庫區域共用失敗的詳細數據。

region

string

區域名稱

state

SharingState

資源庫的共享狀態。
目前區域中的資源庫共享狀態

SharingProfile

資源庫共用至訂用帳戶或租使用者的配置檔

名稱 類型 Description
communityGalleryInfo

CommunityGalleryInfo

如果目前資源庫共用給社群,則社群資源庫的資訊。

groups

SharingProfileGroup[]

共用配置檔群組的清單。

permissions

GallerySharingPermissionTypes

此屬性可讓您指定共用資源庫的許可權。 可能的值為: Private、Groups、Community。

SharingProfileGroup

資源庫共用配置檔的群組

名稱 類型 Description
ids

string[]

資源庫的目標訂用帳戶/租使用者標識符清單。

type

SharingProfileGroupTypes

此屬性可讓您指定共用群組的類型。 可能的值為: Subscriptions、AADTenants。

SharingProfileGroupTypes

此屬性可讓您指定共用群組的類型。 可能的值為: Subscriptions、AADTenants。

名稱 類型 Description
AADTenants

string

Subscriptions

string

SharingState

資源庫的共享狀態。

名稱 類型 Description
Failed

string

InProgress

string

Succeeded

string

Unknown

string

SharingStatus

目前資源庫的共享狀態。

名稱 類型 Description
aggregatedState

SharingState

資源庫的共享狀態。
目前資源庫的匯總共享狀態。

summary

RegionalSharingStatus[]

所有區域共享狀態的摘要。

SoftDeletePolicy

包含資源庫虛刪除原則的相關信息。

名稱 類型 Description
isSoftDeleteEnabled

boolean

啟用此資源庫中資源的虛刪除,使其可在保留時間內復原。