swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Shared Image Gallery Service Client.
  title: SharedImageGalleryServiceClient
  version: 2018-06-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/compute/resource-manager/Microsoft.Compute/stable/2018-06-01/gallery.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: compute-gallery
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  ResourceGroupNameParameter:
    description: The name of the resource group.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries":
    get:
      description: List galleries under a subscription.
      operationId: Galleries_List
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryList"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - Galleries
      x-ms-examples:
        List galleries in a subscription.:
          parameters:
            api-version: 2018-06-01
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                nextLink: http://svchost:99/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries?$skiptoken={token}/Subscriptions/{subscriptionId}/ResourceGroups/myResourceGroup/galleries/myGalleryName
                value:
                  - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName
                    location: West US
                    name: myGalleryName
                    properties:
                      description: This is the gallery description.
                      identifier:
                        uniqueName: "{subscription-id}-MYGALLERYNAME"
                      provisioningState: Succeeded
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries":
    get:
      description: List galleries under a resource group.
      operationId: Galleries_ListByResourceGroup
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryList"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - Galleries
      x-ms-examples:
        List galleries in a resource group.:
          parameters:
            api-version: 2018-06-01
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                nextLink: http://svchost:99/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries?$skiptoken={token}/Subscriptions/{subscriptionId}/ResourceGroups/myResourceGroup/galleries/myGalleryName
                value:
                  - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName
                    location: West US
                    name: myGalleryName
                    properties:
                      description: This is the gallery description.
                      identifier:
                        uniqueName: "{subscription-id}-MYGALLERYNAME"
                      provisioningState: Succeeded
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}":
    delete:
      description: Delete a Shared Image Gallery.
      operationId: Galleries_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery to be deleted.
          in: path
          name: galleryName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
        "202":
          description: Accepted
        "204":
          description: No Content
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - Galleries
      x-ms-examples:
        Delete a gallery.:
          parameters:
            api-version: 2018-06-01
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Retrieves information about a Shared Image Gallery.
      operationId: Galleries_Get
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery.
          in: path
          name: galleryName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Gallery"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - Galleries
      x-ms-examples:
        Get a gallery.:
          parameters:
            api-version: 2018-06-01
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: myGalleryName
                properties:
                  description: This is the gallery description.
                  identifier:
                    uniqueName: "{subscription-id}-MYGALLERYNAME"
                  provisioningState: Succeeded
    put:
      description: Create or update a Shared Image Gallery.
      operationId: Galleries_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods allowed in the middle. The maximum length is 80 characters.
          in: path
          name: galleryName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - description: Parameters supplied to the create or update Shared Image Gallery operation.
          in: body
          name: gallery
          required: true
          schema:
            $ref: "#/definitions/Gallery"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Gallery"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/Gallery"
        "202":
          description: Accepted
          schema:
            $ref: "#/definitions/Gallery"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - Galleries
      x-ms-examples:
        Create or update a simple gallery.:
          parameters:
            api-version: 2018-06-01
            gallery:
              location: West US
              properties:
                description: This is the gallery description.
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: myGalleryName
                properties:
                  description: This is the gallery description.
                  identifier:
                    uniqueName: "{subscription-id}-MYGALLERYNAME"
                  provisioningState: Updating
            "201":
              body:
                location: West US
                name: myGalleryName
                properties:
                  description: This is the gallery description.
                  identifier:
                    uniqueName: "{subscription-id}-MYGALLERYNAME"
                  provisioningState: Creating
            "202":
              body:
                location: West US
                name: myGalleryName
                properties:
                  description: This is the gallery description.
                  identifier:
                    uniqueName: "{subscription-id}-MYGALLERYNAME"
                  provisioningState: Updating
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images":
    get:
      description: List gallery Image Definitions in a gallery.
      operationId: GalleryImages_ListByGallery
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery from which Image Definitions are to be listed.
          in: path
          name: galleryName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImageList"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImages
      x-ms-examples:
        List gallery images in a gallery.:
          parameters:
            api-version: 2018-06-01
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                nextLink: http://svchost:99/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images?$skiptoken={token}/Subscriptions/{subscriptionId}/ResourceGroups/myResourceGroup/galleries/myGalleryName/images/myGalleryImageName
                value:
                  - location: West US
                    name: myGalleryImageName
                    properties:
                      identifier:
                        offer: myOfferName
                        publisher: myPublisherName
                        sku: mySkuName
                      osState: Generalized
                      osType: Windows
                      provisioningState: Succeeded
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}":
    delete:
      description: Delete a gallery image.
      operationId: GalleryImages_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition is to be deleted.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition to be deleted.
          in: path
          name: galleryImageName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
        "202":
          description: Accepted
        "204":
          description: No Content
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImages
      x-ms-examples:
        Delete a gallery image.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Retrieves information about a gallery Image Definition.
      operationId: GalleryImages_Get
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery from which the Image Definitions are to be retrieved.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition to be retrieved.
          in: path
          name: galleryImageName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImage"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImages
      x-ms-examples:
        Get a gallery image.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: myGalleryImageName
                properties:
                  identifier:
                    offer: myOfferName
                    publisher: myPublisherName
                    sku: mySkuName
                  osState: Generalized
                  osType: Windows
                  provisioningState: Succeeded
    put:
      description: Create or update a gallery Image Definition.
      operationId: GalleryImages_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition is to be created.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
          in: path
          name: galleryImageName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - description: Parameters supplied to the create or update gallery image operation.
          in: body
          name: galleryImage
          required: true
          schema:
            $ref: "#/definitions/GalleryImage"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImage"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/GalleryImage"
        "202":
          description: Accepted
          schema:
            $ref: "#/definitions/GalleryImage"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImages
      x-ms-examples:
        Create or update a simple gallery image.:
          parameters:
            api-version: 2018-06-01
            galleryImage:
              location: West US
              properties:
                identifier:
                  offer: myOfferName
                  publisher: myPublisherName
                  sku: mySkuName
                osState: Generalized
                osType: Windows
            galleryImageName: myGalleryImageName
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: myGalleryImageName
                properties:
                  identifier:
                    offer: myOfferName
                    publisher: myPublisherName
                    sku: mySkuName
                  osState: Generalized
                  osType: Windows
                  provisioningState: Updating
            "201":
              body:
                location: West US
                name: myGalleryImageName
                properties:
                  identifier:
                    offer: myOfferName
                    publisher: myPublisherName
                    sku: mySkuName
                  osState: Generalized
                  osType: Windows
                  provisioningState: Creating
            "202":
              body:
                location: West US
                name: myGalleryImageName
                properties:
                  identifier:
                    offer: myOfferName
                    publisher: myPublisherName
                    sku: mySkuName
                  osState: Generalized
                  osType: Windows
                  provisioningState: Updating
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions":
    get:
      description: List gallery Image Versions in a gallery Image Definition.
      operationId: GalleryImageVersions_ListByGalleryImage
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition resides.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed.
          in: path
          name: galleryImageName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImageVersionList"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImageVersions
      x-ms-examples:
        List gallery Image Versions in a gallery Image Definition.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                nextLink: http://svchost:99/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName/versions?$skiptoken={token}/Subscriptions/{subscriptionId}/ResourceGroups/myResourceGroup/galleries/myGalleryName/images/myGalleryImageName/versions/myGalleryImageVersionName
                value:
                  - location: West US
                    name: 1.0.0
                    properties:
                      provisioningState: Succeeded
                      publishingProfile:
                        publishedDate: 2018-01-01T00:00:00Z
                        replicaCount: 1
                        source:
                          managedImage:
                            id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                        targetRegions:
                          - name: West US
                            regionalReplicaCount: 1
                          - name: East US
                            regionalReplicaCount: 2
                      storageProfile:
                        dataDiskImages:
                          - hostCaching: None
                            lun: 1
                            sizeInGB: 10
                        osDiskImage:
                          hostCaching: ReadOnly
                          sizeInGB: 10
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}":
    delete:
      description: Delete a gallery Image Version.
      operationId: GalleryImageVersions_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition resides.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition in which the Image Version resides.
          in: path
          name: galleryImageName
          required: true
          type: string
        - description: The name of the gallery Image Version to be deleted.
          in: path
          name: galleryImageVersionName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
        "202":
          description: Accepted
        "204":
          description: No Content
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImageVersions
      x-ms-examples:
        Delete a gallery Image Version.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryImageVersionName: 1.0.0
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Retrieves information about a gallery Image Version.
      operationId: GalleryImageVersions_Get
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition resides.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition in which the Image Version resides.
          in: path
          name: galleryImageName
          required: true
          type: string
        - description: The name of the gallery Image Version to be retrieved.
          in: path
          name: galleryImageVersionName
          required: true
          type: string
        - description: The expand expression to apply on the operation.
          enum:
            - ReplicationStatus
          in: query
          name: $expand
          required: false
          type: string
          x-ms-enum:
            modelAsString: true
            name: ReplicationStatusTypes
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImageVersion"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImageVersions
      x-ms-examples:
        Get a gallery Image Version with replication status.:
          parameters:
            $expand: ReplicationStatus
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryImageVersion:
              location: West US
              properties:
                publishingProfile:
                  source:
                    managedImage:
                      id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                  targetRegions:
                    - name: West US
                      regionalReplicaCount: 1
                    - name: East US
                      regionalReplicaCount: 2
            galleryImageVersionName: 1.0.0
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: 1.0.0
                properties:
                  provisioningState: Succeeded
                  publishingProfile:
                    publishedDate: 2018-01-01T00:00:00Z
                    replicaCount: 1
                    source:
                      managedImage:
                        id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                    targetRegions:
                      - name: West US
                        regionalReplicaCount: 1
                      - name: East US
                        regionalReplicaCount: 2
                  replicationStatus:
                    aggregatedState: Completed
                    summary:
                      - details: ""
                        progress: 100
                        region: West US
                        state: Completed
                      - details: ""
                        progress: 100
                        region: East US
                        state: Completed
                  storageProfile:
                    dataDiskImages:
                      - hostCaching: None
                        lun: 1
                        sizeInGB: 10
                    osDiskImage:
                      hostCaching: ReadOnly
                      sizeInGB: 10
        Get a gallery Image Version.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryImageVersion:
              location: West US
              properties:
                publishingProfile:
                  source:
                    managedImage:
                      id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                  targetRegions:
                    - name: West US
                      regionalReplicaCount: 1
                    - name: East US
                      regionalReplicaCount: 2
            galleryImageVersionName: 1.0.0
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: 1.0.0
                properties:
                  provisioningState: Succeeded
                  publishingProfile:
                    publishedDate: 2018-01-01T00:00:00Z
                    replicaCount: 1
                    source:
                      managedImage:
                        id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                    targetRegions:
                      - name: West US
                        regionalReplicaCount: 1
                      - name: East US
                        regionalReplicaCount: 2
                  storageProfile:
                    dataDiskImages:
                      - hostCaching: None
                        lun: 1
                        sizeInGB: 10
                    osDiskImage:
                      hostCaching: ReadOnly
                      sizeInGB: 10
    put:
      description: Create or update a gallery Image Version.
      operationId: GalleryImageVersions_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - description: The name of the Shared Image Gallery in which the Image Definition resides.
          in: path
          name: galleryName
          required: true
          type: string
        - description: The name of the gallery Image Definition in which the Image Version is to be created.
          in: path
          name: galleryImageName
          required: true
          type: string
        - description: "The name of the gallery Image Version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>"
          in: path
          name: galleryImageVersionName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - description: Parameters supplied to the create or update gallery Image Version operation.
          in: body
          name: galleryImageVersion
          required: true
          schema:
            $ref: "#/definitions/GalleryImageVersion"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GalleryImageVersion"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/GalleryImageVersion"
        "202":
          description: Accepted
          schema:
            $ref: "#/definitions/GalleryImageVersion"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - GalleryImageVersions
      x-ms-examples:
        Create or update a simple gallery Image Version.:
          parameters:
            api-version: 2018-06-01
            galleryImageName: myGalleryImageName
            galleryImageVersion:
              location: West US
              properties:
                publishingProfile:
                  source:
                    managedImage:
                      id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                  targetRegions:
                    - name: West US
                      regionalReplicaCount: 1
                    - name: East US
                      regionalReplicaCount: 2
            galleryImageVersionName: 1.0.0
            galleryName: myGalleryName
            resourceGroupName: myResourceGroup
            subscriptionId: "{subscription-id}"
          responses:
            "200":
              body:
                location: West US
                name: 1.0.0
                properties:
                  provisioningState: Updating
                  publishingProfile:
                    publishedDate: 2018-01-01T00:00:00Z
                    replicaCount: 1
                    source:
                      managedImage:
                        id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                    targetRegions:
                      - name: West US
                        regionalReplicaCount: 1
                      - name: East US
                        regionalReplicaCount: 2
            "201":
              body:
                location: West US
                name: 1.0.0
                properties:
                  provisioningState: Creating
                  publishingProfile:
                    publishedDate: 2018-01-01T00:00:00Z
                    replicaCount: 1
                    source:
                      managedImage:
                        id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                    targetRegions:
                      - name: West US
                        regionalReplicaCount: 1
                      - name: East US
                        regionalReplicaCount: 2
            "202":
              body:
                location: West US
                name: 1.0.0
                properties:
                  provisioningState: Updating
                  publishingProfile:
                    publishedDate: 2018-01-01T00:00:00Z
                    replicaCount: 1
                    source:
                      managedImage:
                        id: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
                    targetRegions:
                      - name: West US
                        regionalReplicaCount: 1
                      - name: East US
                        regionalReplicaCount: 2
      x-ms-long-running-operation: true
definitions:
  ApiError:
    description: Api error.
    properties:
      code:
        description: The error code.
        type: string
      details:
        description: The Api error details
        items:
          $ref: "#/definitions/ApiErrorBase"
        type: array
      innererror:
        $ref: "#/definitions/InnerError"
        description: The Api inner error
      message:
        description: The error message.
        type: string
      target:
        description: The target of the particular error.
        type: string
  ApiErrorBase:
    description: Api error base.
    properties:
      code:
        description: The error code.
        type: string
      message:
        description: The error message.
        type: string
      target:
        description: The target of the particular error.
        type: string
  CloudError:
    description: An error response from the Gallery service.
    properties:
      error:
        $ref: "#/definitions/ApiError"
    x-ms-external: true
  Disallowed:
    description: Describes the disallowed disk types.
    properties:
      diskTypes:
        description: A list of disk types.
        items:
          type: string
        type: array
  Gallery:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Specifies information about the Shared Image Gallery that you want to create or update.
    properties:
      properties:
        $ref: "#/definitions/GalleryProperties"
        x-ms-client-flatten: true
  GalleryArtifactPublishingProfileBase:
    description: Describes the basic gallery artifact publishing profile.
    properties:
      source:
        $ref: "#/definitions/GalleryArtifactSource"
      targetRegions:
        description: The target regions where the Image Version is going to be replicated to. This property is updatable.
        items:
          $ref: "#/definitions/TargetRegion"
        type: array
    required:
      - source
  GalleryArtifactSource:
    description: The source image from which the Image Version is going to be created.
    properties:
      managedImage:
        $ref: "#/definitions/ManagedArtifact"
    required:
      - managedImage
  GalleryDataDiskImage:
    allOf:
      - $ref: "#/definitions/GalleryDiskImage"
    description: This is the data disk image.
    properties:
      lun:
        description: This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.
        format: int32
        readOnly: true
        type: integer
  GalleryDiskImage:
    description: This is the disk image base class.
    properties:
      hostCaching:
        description: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
        enum:
          - None
          - ReadOnly
          - ReadWrite
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: false
          name: HostCaching
      sizeInGB:
        description: This property indicates the size of the VHD to be created.
        format: int32
        readOnly: true
        type: integer
  GalleryIdentifier:
    description: Describes the gallery unique name.
    properties:
      uniqueName:
        description: The unique name of the Shared Image Gallery. This name is generated automatically by Azure.
        readOnly: true
        type: string
  GalleryImage:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Specifies information about the gallery Image Definition that you want to create or update.
    properties:
      properties:
        $ref: "#/definitions/GalleryImageProperties"
        x-ms-client-flatten: true
  GalleryImageIdentifier:
    description: This is the gallery Image Definition identifier.
    properties:
      offer:
        description: The name of the gallery Image Definition offer.
        type: string
      publisher:
        description: The name of the gallery Image Definition publisher.
        type: string
      sku:
        description: The name of the gallery Image Definition SKU.
        type: string
    required:
      - publisher
      - offer
      - sku
  GalleryImageList:
    description: The List Gallery Images operation response.
    properties:
      nextLink:
        description: The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery Image Definitions.
        type: string
      value:
        description: A list of Shared Image Gallery images.
        items:
          $ref: "#/definitions/GalleryImage"
        type: array
    required:
      - value
  GalleryImageProperties:
    description: Describes the properties of a gallery Image Definition.
    properties:
      description:
        description: The description of this gallery Image Definition resource. This property is updatable.
        type: string
      disallowed:
        $ref: "#/definitions/Disallowed"
      endOfLifeDate:
        description: The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable.
        format: date-time
        type: string
      eula:
        description: The Eula agreement for the gallery Image Definition.
        type: string
      identifier:
        $ref: "#/definitions/GalleryImageIdentifier"
      osState:
        description: The allowed values for OS State are 'Generalized'.
        enum:
          - Generalized
          - Specialized
        type: string
        x-ms-enum:
          modelAsString: false
          name: OperatingSystemStateTypes
      osType:
        description: "This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**"
        enum:
          - Windows
          - Linux
        type: string
        x-ms-enum:
          modelAsString: false
          name: OperatingSystemTypes
      privacyStatementUri:
        description: The privacy statement uri.
        type: string
      provisioningState:
        description: The provisioning state, which only appears in the response.
        enum:
          - Creating
          - Updating
          - Failed
          - Succeeded
          - Deleting
          - Migrating
        readOnly: true
        title: The current state of the gallery Image Definition.
        type: string
      purchasePlan:
        $ref: "#/definitions/ImagePurchasePlan"
      recommended:
        $ref: "#/definitions/RecommendedMachineConfiguration"
      releaseNoteUri:
        description: The release note uri.
        type: string
    required:
      - osType
      - osState
      - identifier
  GalleryImageVersion:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Specifies information about the gallery Image Version that you want to create or update.
    properties:
      properties:
        $ref: "#/definitions/GalleryImageVersionProperties"
        x-ms-client-flatten: true
  GalleryImageVersionList:
    description: The List Gallery Image version operation response.
    properties:
      nextLink:
        description: The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to fetch the next page of gallery Image Versions.
        type: string
      value:
        description: A list of gallery Image Versions.
        items:
          $ref: "#/definitions/GalleryImageVersion"
        type: array
    required:
      - value
  GalleryImageVersionProperties:
    description: Describes the properties of a gallery Image Version.
    properties:
      provisioningState:
        description: The provisioning state, which only appears in the response.
        enum:
          - Creating
          - Updating
          - Failed
          - Succeeded
          - Deleting
          - Migrating
        readOnly: true
        title: The current state of the gallery Image Version.
        type: string
      publishingProfile:
        $ref: "#/definitions/GalleryImageVersionPublishingProfile"
      replicationStatus:
        $ref: "#/definitions/ReplicationStatus"
        readOnly: true
      storageProfile:
        $ref: "#/definitions/GalleryImageVersionStorageProfile"
        readOnly: true
    required:
      - publishingProfile
  GalleryImageVersionPublishingProfile:
    allOf:
      - $ref: "#/definitions/GalleryArtifactPublishingProfileBase"
    description: The publishing profile of a gallery Image Version.
    properties:
      endOfLifeDate:
        description: The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable.
        format: date-time
        type: string
      excludeFromLatest:
        description: If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
        type: boolean
      publishedDate:
        description: The timestamp for when the gallery Image Version is published.
        format: date-time
        readOnly: true
        type: string
      replicaCount:
        description: The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable.
        format: int32
        type: integer
  GalleryImageVersionStorageProfile:
    description: This is the storage profile of a gallery Image Version.
    properties:
      dataDiskImages:
        description: A list of data disk images.
        items:
          $ref: "#/definitions/GalleryDataDiskImage"
        readOnly: true
        type: array
      osDiskImage:
        $ref: "#/definitions/GalleryOSDiskImage"
        readOnly: true
  GalleryList:
    description: The List Galleries operation response.
    properties:
      nextLink:
        description: The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries.
        type: string
      value:
        description: A list of galleries.
        items:
          $ref: "#/definitions/Gallery"
        type: array
    required:
      - value
  GalleryOSDiskImage:
    allOf:
      - $ref: "#/definitions/GalleryDiskImage"
    description: This is the OS disk image.
  GalleryProperties:
    description: Describes the properties of a Shared Image Gallery.
    properties:
      description:
        description: The description of this Shared Image Gallery resource. This property is updatable.
        type: string
      identifier:
        $ref: "#/definitions/GalleryIdentifier"
      provisioningState:
        description: The provisioning state, which only appears in the response.
        enum:
          - Creating
          - Updating
          - Failed
          - Succeeded
          - Deleting
          - Migrating
        readOnly: true
        title: The current state of the gallery.
        type: string
  ImagePurchasePlan:
    description: Describes the gallery Image Definition purchase plan. This is used by marketplace images.
    properties:
      name:
        description: The plan ID.
        type: string
      product:
        description: The product ID.
        type: string
      publisher:
        description: The publisher ID.
        type: string
  InnerError:
    description: Inner error details.
    properties:
      errordetail:
        description: The internal error message or exception dump.
        type: string
      exceptiontype:
        description: The exception type.
        type: string
  ManagedArtifact:
    description: The managed artifact.
    properties:
      id:
        description: The managed artifact id.
        type: string
    required:
      - id
  RecommendedMachineConfiguration:
    description: The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.
    properties:
      memory:
        $ref: "#/definitions/ResourceRange"
      vCPUs:
        $ref: "#/definitions/ResourceRange"
  RegionalReplicationStatus:
    description: This is the regional replication status.
    properties:
      details:
        description: The details of the replication status.
        readOnly: true
        type: string
      progress:
        description: It indicates progress of the replication job.
        format: int32
        readOnly: true
        type: integer
      region:
        description: The region to which the gallery Image Version is being replicated to.
        readOnly: true
        type: string
      state:
        description: This is the regional replication state.
        enum:
          - Unknown
          - Replicating
          - Completed
          - Failed
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: ReplicationState
  ReplicationStatus:
    description: This is the replication status of the gallery Image Version.
    properties:
      aggregatedState:
        description: This is the aggregated replication status based on all the regional replication status flags.
        enum:
          - Unknown
          - InProgress
          - Completed
          - Failed
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: AggregatedReplicationState
      summary:
        description: This is a summary of replication status for each region.
        items:
          $ref: "#/definitions/RegionalReplicationStatus"
        readOnly: true
        type: array
  Resource:
    description: The Resource model definition.
    properties:
      id:
        description: Resource Id
        readOnly: true
        type: string
      location:
        description: Resource location
        type: string
      name:
        description: Resource name
        readOnly: true
        type: string
      tags:
        additionalProperties:
          type: string
        description: Resource tags
        type: object
      type:
        description: Resource type
        readOnly: true
        type: string
    required:
      - location
    x-ms-azure-resource: true
  ResourceRange:
    description: Describes the resource range.
    properties:
      max:
        description: The maximum number of the resource.
        format: int32
        type: integer
      min:
        description: The minimum number of the resource.
        format: int32
        type: integer
  TargetRegion:
    description: Describes the target region information.
    properties:
      name:
        description: The name of the region.
        type: string
      regionalReplicaCount:
        description: The number of replicas of the Image Version to be created per region. This property is updatable.
        format: int32
        type: integer
    required:
      - name
