From ac3d58b9b861bf20b0c2a90a2c013fba9f1610f5 Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Fri, 29 Mar 2019 15:25:24 -0700 Subject: [PATCH 1/5] Adds base for updating Microsoft.VirtualMachineImages from version preview/2019-02-01-preview to version 2019-05-01-preview --- .../examples/CreateImageTemplate.json | 73 ++ .../examples/DeleteImageTemplate.json | 15 + .../examples/GetImageTemplate.json | 43 + .../examples/GetRunOutput.json | 22 + .../examples/ListImageTemplates.json | 79 ++ .../examples/ListImageTemplatesByRg.json | 84 ++ .../examples/ListRunOutputs.json | 35 + .../examples/RunImageTemplate.json | 15 + .../examples/UpdateImageTemplateTags.json | 51 + .../2019-05-01-preview/imagebuilder.json | 1148 +++++++++++++++++ 10 files changed, 1565 insertions(+) create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json new file mode 100644 index 000000000000..372bd37ece53 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json @@ -0,0 +1,73 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "api-version": "2019-02-01-preview", + "imageTemplateName": "myImageTemplate", + "parameters": { + "location": "westus", + "tags": { + "imagetemplate_tag1": "IT_T1", + "imagetemplate_tag2": "IT_T2" + }, + "properties": { + "source": { + "type": "ManagedImage", + "imageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell Customizer Example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "ManagedImage", + "imageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell Customizer Example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json new file mode 100644 index 000000000000..737024b70b17 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "api-version": "2019-02-01-preview" + }, + "responses":{ + "202": { + "headers": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.VirtualMachineImages/locations/westus/operations/85506efc-36f7-11e9-a0c2-000d3afd16e3?api-version=2018-02-01-preview" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json new file mode 100644 index 000000000000..c3ce564e99f9 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "api-version": "2019-02-01-preview", + "imageTemplateName": "myImageTemplate" + }, + "responses": { + "202": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "ISO", + "sourceURI": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell Customizer Example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json new file mode 100644 index 000000000000..1e16b8ea9f2f --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "runOutputName": "myManagedImageOutput", + "api-version": "2019-02-01-preview" + }, + "responses":{ + "200": { + "body":{ + "id": "/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/myManagedImageOutput", + "name": "myManagedImageOutput", + "properties": { + "artifactId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/output_managed_image", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.VirtualMachineImages/imageTemplates/runOutputs" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json new file mode 100644 index 000000000000..93bd73ddd64c --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "api-version": "2019-02-01-preview" + }, + "responses": { + "202": { + "body": { + "value": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "ISO", + "sourceURI": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + }, + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myOtherResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/mySecondImageTemplate", + "name": "mySecondImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "PlatformImage", + "publisher": "Canonical", + "offer": "UbuntuServer", + "sku": "18.04-LTS", + "version": "18.04.201902121" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "eastus", + "runOutputName": "eus", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/mySecondImage-eus", + "tags": { + "stage": "development" + } + } + ] + } + } + ], + "nextLink": "/subscriptions/{subscription-id}/providers/Microsoft.VirtualMachineImages/imageTemplates?api-version=2018-02-01-preview&skip-token=2" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json new file mode 100644 index 000000000000..b90ebc7ca10b --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json @@ -0,0 +1,84 @@ +{ + "parameters": { + "subscritionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "api-version": "2019-02-01-preview" + }, + "responses": { + "202": { + "body": { + "value": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "ISO", + "sourceURI": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + }, + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myOtherImageTemplate", + "name": "myOtherImageTemplate", + "location": "eastus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "properties": { + "source": { + "type": "PlatformImage", + "publisher": "Canonical", + "offer": "UbuntuServer", + "sku": "18.04-LTS", + "version": "18.04.201902121" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "centralus", + "runOutputName": "singleImage", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/baseimage-cus" + }, + { + "type": "SharedImage", + "galleryImageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/gallery/baseimages/images/baseimage", + "replicationRegions":[ "eastus", "westus"], + "runOutputName": "gallery", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/baseimage-eus" + } + ] + } + } + ], + "nextLink": "/subscriptions/{subscription-id}/resourceGroup/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates?api-version=2018-02-01-preview&skip-token=2" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json new file mode 100644 index 000000000000..aeaad646ca66 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "api-version": "2019-02-01-preview" + }, + "responses":{ + "200": { + "body":{ + "value": [ + { + "id": "/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/myManagedImageOutput", + "name": "myManagedImageOutput", + "properties": { + "artifactId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/output_managed_image", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.VirtualMachineImages/imageTemplates/runOutputs" + }, + { + "id": "/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/mySharedImageOutput", + "name": "mySharedImageOutput", + "properties": { + "artifactId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/galleries/Gallery1/images/SharedImageOutput/imageversions/1.2.3", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.VirtualMachineImages/imageTemplates/runOutputs" + } + ], + "nextLink": "/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs?api-version=2018-02-01-preview&$skipToken=3" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json new file mode 100644 index 000000000000..a00363b0d347 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "api-version": "2019-02-01-preview" + }, + "responses":{ + "202":{ + "headers": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.VirtualMachineImages/locations/westus/operations/777b2050-36f8-11e9-b8fa-000d3afd16e3?api-version=2018-02-01-preview" + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json new file mode 100644 index 000000000000..de7627d76fef --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "api-version": "2019-02-01-preview", + "parameters":{ + "tags": { + "new-tag": "new-value" + } + } + }, + "responses":{ + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "tags": { + "new-tag": "new-value" + }, + "properties": { + "source": { + "type": "ISO", + "sourceURI": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "script": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json new file mode 100644 index 000000000000..79fab2ca9990 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json @@ -0,0 +1,1148 @@ +{ + "swagger": "2.0", + "info": { + "title": "VirtualMachineImageTemplate", + "description": "Virtual Machine Image Template", + "version": "2019-02-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.VirtualMachineImages/imageTemplates": { + "get": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_List", + "description": "Gets information about the VM image templates associated with the subscription.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ImageTemplateListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List images by subscription.": { + "$ref": "./examples/ListImageTemplates.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates": { + "get": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_ListByResourceGroup", + "description": "Gets information about the VM image templates associated with the specified resource group.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ImageTemplateListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List images by resource group": { + "$ref": "./examples/ListImageTemplatesByRg.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}": { + "put": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_CreateOrUpdate", + "description": "Create or update a virtual machine image template", + "parameters": [ + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImageTemplate" + }, + "description": "Parameters supplied to the CreateImageTemplate operation" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ImageTemplate" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/ImageTemplate" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-examples": { + "Create an Image Template.": { + "$ref": "./examples/CreateImageTemplate.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via":"azure-async-operation" + } + }, + "patch": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_Update", + "description": "Update the tags for this Virtual Machine Image Template", + "parameters": [ + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImageTemplateUpdateParameters" + }, + "description": "Additional parameters for Image Template update." + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ImageTemplate" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-examples": { + "Update the tags for an Image Template.": { + "$ref": "./examples/UpdateImageTemplateTags.json" + } + } + }, + "get": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_Get", + "description": "Get information about a virtual machine image template", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ImageTemplate" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-examples": { + "Retrieve an Image Template.": { + "$ref": "./examples/GetImageTemplate.json" + } + } + }, + "delete": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_Delete", + "description": "Delete a virtual machine image template", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + } + ], + "responses": { + "200": { + "description": "The operation was successful." + }, + "202": { + "description": "The operation will be completed asynchronously." + }, + "204": { + "description": "NoContent -- VM image template does not exist in the subscription." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via":"azure-async-operation" + }, + "x-ms-examples": { + "Delete an Image Template.": { + "$ref": "./examples/DeleteImageTemplate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/run": { + "post": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_Run", + "description": "Create artifacts from a existing image template", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + } + ], + "responses": { + "204": { + "description": "The operation was successful." + }, + "202": { + "description": "The operation will be completed asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via":"azure-async-operation" + }, + "x-ms-examples": { + "Create image(s) from existing imageTemplate.": { + "$ref": "./examples/RunImageTemplate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs": { + "get": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_ListRunOutputs", + "description": "List all run outputs for the specified Image Template resource", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/RunOutputCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Retrieve a list of all outputs created by the last run of an Image Template": { + "$ref": "./examples/ListRunOutputs.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs/{runOutputName}": { + "get": { + "tags": [ + "VirtualMachineImageTemplate" + ], + "operationId": "VirtualMachineImageTemplates_GetRunOutput", + "description": "Get the specified run output for the specified image template resource", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ImageTemplateNameParameter" + }, + { + "$ref": "#/parameters/RunOutputNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/RunOutput" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-examples": { + "Retrieve single runOutput": { + "$ref": "./examples/GetRunOutput.json" + } + } + } + }, + "/providers/Microsoft.VirtualMachineImages/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "Lists available operations for the Microsoft.VirtualMachineImages provider", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The operation was successful. The response contains the list of available operations.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ApiError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "ImageTemplateListResult" : { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageTemplate" + } + }, + "nextLink": { + "type": "string", + "description": "The continuation token." + } + } + }, + "ImageTemplateSource": { + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "description": "Specifies the type of source image you want to start with." + } + }, + "required": [ + "type" + ] + }, + "ImageTemplateIsoSource": { + "description": "Describes an image source that is an installation ISO. Currently only supports Red Hat Enterprise Linux 7.2-7.5 ISO's.", + "x-ms-discriminator-value": "ISO", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateSource" + } + ], + "properties": { + "sourceURI": { + "type": "string", + "description": "URI to get the ISO image. This URI has to be accessible to the resource provider at the time of the image template creation." + }, + "sha256Checksum": { + "type": "string", + "description": "SHA256 Checksum of the ISO image." + } + }, + "required": [ + "sourceURI", + "sha256Checksum" + ] + }, + "ImageTemplatePlatformImageSource": { + "description": "Describes an image source from [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages).", + "x-ms-discriminator-value": "PlatformImage", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateSource" + } + ], + "properties": { + "publisher": { + "type": "string", + "description": "Image Publisher in [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + }, + "offer": { + "type": "string", + "description": "Image offer from the [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + }, + "sku": { + "type": "string", + "description": "Image sku from the [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + }, + "version": { + "type": "string", + "description": "Image version from the [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + } + } + }, + "ImageTemplateManagedImageSource": { + "description": "Describes an image source that is a managed image in customer subscription.", + "x-ms-discriminator-value": "ManagedImage", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateSource" + } + ], + "properties": { + "imageId": { + "type": "string", + "description": "ARM resource id of the managed image in customer subscription" + } + }, + "required": [ + "imageId" + ] + }, + "ImageTemplateCustomizer": { + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "description": "The type of customization tool you want to use on the Image. For example, \"Shell\" can be shell customizer" + }, + "name": { + "type": "string", + "description": "Friendly Name to provide context on what this customization step does" + } + }, + "required": [ + "type" + ] + }, + "ImageTemplateShellCustomizer": { + "description": "Runs a shell script during the customization phase (Linux)", + "x-ms-discriminator-value": "Shell", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateCustomizer" + } + ], + "properties": { + "script": { + "type": "string", + "description": "The shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + } + } + }, + "ImageTemplateRestartCustomizer": { + "description": "Reboots a VM and waits for it to come back online (Windows). Corresponds to Packer windows-restart provisioner", + "x-ms-discriminator-value": "WindowsRestart", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateCustomizer" + } + ], + "properties": { + "restartCommand": { + "type": "string", + "description": "Command to execute the restart [Default: 'shutdown /r /f /t 0 /c \"packer restart\"']" + }, + "restartCheckCommand": { + "type": "string", + "description": "Command to check if restart succeeded [Default: '']" + }, + "restartTimeout": { + "type": "string", + "description": "Restart timeout specified as a string of magnitude and unit, e.g. '5m' (5 minutes) or '2h' (2 hours) [Default: '5m']" + } + } + }, + "ImageTemplatePowerShellCustomizer": { + "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner", + "x-ms-discriminator-value": "PowerShell", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateCustomizer" + } + ], + "properties": { + "script": { + "type": "string", + "description": "The PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + }, + "validExitCodes" : { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "ImageTemplateDistributor": { + "type": "object", + "description": "Generic distribution object", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "description": "Type of distribution." + }, + "runOutputName": { + "type": "string", + "description": "The name to be used for the associated RunOutput.", + "pattern": "^[A-Za-z0-9-_]{1,64}$" + }, + "artifactTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Tags that will be applied to the artifact once it has been created/updated by the distributor." + } + }, + "required": [ + "type", + "runOutputName" + ] + }, + "ImageTemplateManagedImageDistributor": { + "x-ms-discriminator-value": "ManagedImage", + "description": "Distribute as a Managed Disk Image.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateDistributor" + } + ], + "properties": { + "imageId": { + "type": "string", + "description": "Resource Id of the Managed Disk Image" + }, + "location": { + "type": "string", + "description": "Azure location for the image, should match if image already exists" + } + }, + "required": [ + "imageId", + "location" + ] + }, + "ImageTemplateSharedImageDistributor": { + "x-ms-discriminator-value": "SharedImage", + "description": "Distribute via Shared Image Gallery.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateDistributor" + } + ], + "properties": { + "galleryImageId": { + "type": "string", + "description": "Resource Id of the Shared Image Gallery image" + }, + "replicationRegions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "galleryImageId", + "replicationRegions" + ] + }, + "ImageTemplateVhdDistributor": { + "x-ms-discriminator-value": "VHD", + "description": "Distribute via VHD in a storage account.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateDistributor" + } + ] + }, + "ProvisioningState": { + "type": "string", + "enum": [ + "Creating", + "Succeeded", + "Failed", + "Deleting" + ], + "description": "Provisioning state of the resource" + }, + "ProvisioningError": { + "properties": { + "provisioningErrorCode": { + "type": "string", + "enum": [ + "BadSourceType", + "BadPIRSource", + "BadISOSource", + "BadManagedImageSource", + "BadCustomizerType", + "UnsupportedCustomizerType", + "NoCustomizerScript", + "BadDistributeType", + "BadSharedImageDistribute", + "ServerError", + "Other" + ], + "description": "Error code of the provisioning failure" + }, + "message": { + "type":"string", + "description": "Verbose error message about the provisioning failure" + } + } + }, + "ImageTemplateLastRunStatus": { + "properties": { + "startTime": { + "type": "string", + "format": "date-time", + "description": "Start time of the last run (UTC)" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "End time of the last run (UTC)" + }, + "runState": { + "type": "string", + "enum": [ + "Running", + "Succeeded", + "PartiallySucceeded", + "Failed" + ], + "description": "State of the last run" + }, + "runSubState": { + "type": "string", + "enum": [ + "Queued", + "Building", + "Customizing", + "Distributing" + ], + "description": "Sub-state of the last run" + }, + "message": { + "type": "string", + "description": "Verbose information about the last run state" + } + } + }, + "ImageTemplateProperties": { + "properties": { + "source": { + "$ref": "#/definitions/ImageTemplateSource", + "description": "Specifies the properties used to describe the source image." + }, + "customize": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageTemplateCustomizer" + }, + "description": "Specifies the properties used to describe the customization steps of the image, like Image source etc" + }, + "distribute": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageTemplateDistributor" + }, + "description": "The distribution targets where the image output needs to go to." + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "Provisioning state of the resource", + "readOnly": true + }, + "provisioningError": { + "$ref": "#/definitions/ProvisioningError", + "description": "Provisioning error, if any", + "readOnly": true + }, + "lastRunStatus": { + "$ref": "#/definitions/ImageTemplateLastRunStatus", + "description": "State of 'run' that is currently executing or was last executed.", + "readOnly": true + } + }, + "required": [ + "source", + "distribute" + ] + }, + "RunOutputProperties": { + "properties": { + "artifactId": { + "type": "string", + "description": "The resource id of the artifact." + }, + "artifactLocation": { + "type": "string", + "description": "The URL location of the artifact." + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "Provisioning state of the resource", + "readOnly": true + } + } + }, + "ImageTemplate": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ImageTemplateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "ImageTemplateUpdateParameters": { + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The user-specified tags associated with the image template." + } + }, + "description": "Parameters for updating an image template." + }, + "RunOutput": { + "description": "Represents an output that was created by running an image template.", + "allOf": [ + { + "$ref": "#/definitions/SubResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/RunOutputProperties", + "x-ms-client-flatten": true + } + } + }, + "RunOutputCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/RunOutput" + } + }, + "nextLink": { + "type": "string", + "description": "The continuation token." + } + } + }, + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ "create", "read" ] + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true + }, + "SubResource": { + "description": "The Sub Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id" + }, + "name": { + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + } + }, + "required": [ + "name" + ] + }, + "Operation": { + "title": "A REST API operation", + "type": "object", + "properties": { + "name": { + "title": "The operation name.", + "description": "This is of the format {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "title": "The object that describes the operation.", + "properties": { + "provider": { + "title": "Friendly name of the resource provider.", + "type": "string" + }, + "operation": { + "title": "The operation type.", + "description": "For example: read, write, delete, or listKeys/action", + "type": "string" + }, + "resource": { + "title": "The resource type on which the operation is performed.", + "type": "string" + }, + "description": { + "title": "The friendly name of the operation", + "type": "string" + } + } + }, + "origin": { + "title": "The intended executor of the operation.", + "type": "string" + }, + "properties": { + "title": "Properties of the operation.", + "type": "object" + } + } + }, + "OperationListResult": { + "title": "Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "title": "The list of operations supported by the resource provider." + }, + "nextLink": { + "type": "string", + "title": "The URL to get the next set of operation list results if there are any." + } + } + }, + "ApiErrorBase": { + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "target": { + "type": "string", + "description": "The target of the particular error." + }, + "message": { + "type": "string", + "description": "The error message." + } + }, + "description": "Api error base." + }, + "InnerError": { + "properties": { + "exceptionType": { + "type": "string", + "description": "The exception type." + }, + "errorDetail": { + "type": "string", + "description": "The internal error message or exception dump." + } + }, + "description": "Inner error details." + }, + "ApiError": { + "properties": { + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/ApiErrorBase" + }, + "description": "The Api error details" + }, + "innerError": { + "$ref": "#/definitions/InnerError", + "description": "The Api inner error" + }, + "code": { + "type": "string", + "description": "The error code." + }, + "target": { + "type": "string", + "description": "The target of the particular error." + }, + "message": { + "type": "string", + "description": "The error message." + } + }, + "description": "Api error." + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of the URI for every service call." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "ImageTemplateNameParameter": { + "name": "imageTemplateName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the image Template", + "pattern": "^[A-Za-z0-9-_]{1,64}$", + "x-ms-parameter-location": "method" + }, + "RunOutputNameParameter": { + "name": "runOutputName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the run output", + "pattern": "^[A-Za-z0-9-_]{1,64}$", + "x-ms-parameter-location": "method" + }, + "LocationParameter": { + "name": "location", + "in": "path", + "required": true, + "type": "string", + "description": "Location of the service.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} From 252663411f54a4b37edbca7866d3b37639fcf9e3 Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Fri, 29 Mar 2019 15:25:25 -0700 Subject: [PATCH 2/5] Updates readme --- .../imagebuilder/resource-manager/readme.md | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/specification/imagebuilder/resource-manager/readme.md b/specification/imagebuilder/resource-manager/readme.md index f96597553255..e17cd87a2f8d 100644 --- a/specification/imagebuilder/resource-manager/readme.md +++ b/specification/imagebuilder/resource-manager/readme.md @@ -4,10 +4,10 @@ This is the AutoRest configuration file for Virtual Machine Image Builder. - - --- + ## Getting Started + To build the SDK for Virtual Machine Image Builder, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: > `autorest` @@ -15,24 +15,32 @@ To build the SDK for Virtual Machine Image Builder, simply [Install AutoRest](ht To see additional help and options, run: > `autorest --help` + --- ## Configuration - - ### Basic Information + These are the global settings for the Virtual Machine Image Builder API. ``` yaml title: ImageBuilderClient description: Azure Virtual Machine Image Builder Client openapi-type: arm -tag: package-2019-02 +tag: package-preview-2019-05 azure-arm: true ``` +### Tag: package-preview-2019-05 + +These settings apply only when `--tag=package-preview-2019-05` is specified on the command line. + +```yaml $(tag) == 'package-preview-2019-05' +input-file: + - Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json +``` ### Tag: package-2018-02 These settings apply only when `--tag=package-2018-02` is specified on the command line. @@ -53,7 +61,6 @@ input-file: # Code Generation - ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -85,11 +92,13 @@ python: clear-output-folder: true package-version: 0.1.0 ``` + ``` yaml $(python) && $(python-mode) == 'update' python: no-namespace-folders: true output-folder: $(python-sdks-folder)/azure-mgmt-imagebuilder/azure/mgmt/imagebuilder ``` + ``` yaml $(python) && $(python-mode) == 'create' python: basic-setup-py: true @@ -146,4 +155,3 @@ java: regenerate-manager: true generate-interface: true ``` - From 933f703300c1b74726605ef5722f974de97e2bad Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Fri, 29 Mar 2019 15:25:26 -0700 Subject: [PATCH 3/5] Updates API version in new specs and examples --- .../examples/CreateImageTemplate.json | 2 +- .../examples/DeleteImageTemplate.json | 2 +- .../examples/GetImageTemplate.json | 2 +- .../examples/GetRunOutput.json | 2 +- .../examples/ListImageTemplates.json | 2 +- .../examples/ListImageTemplatesByRg.json | 2 +- .../examples/ListRunOutputs.json | 2 +- .../examples/RunImageTemplate.json | 2 +- .../examples/UpdateImageTemplateTags.json | 2 +- .../2019-05-01-preview/imagebuilder.json | 23 +++++++++++++++---- 10 files changed, 28 insertions(+), 13 deletions(-) diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json index 372bd37ece53..03e42527ef55 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", - "api-version": "2019-02-01-preview", + "api-version": "2019-05-01-preview", "imageTemplateName": "myImageTemplate", "parameters": { "location": "westus", diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json index 737024b70b17..4fb1d3f5c1f1 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/DeleteImageTemplate.json @@ -3,7 +3,7 @@ "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", "imageTemplateName":"myImageTemplate", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses":{ "202": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json index c3ce564e99f9..40b9112dc604 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", - "api-version": "2019-02-01-preview", + "api-version": "2019-05-01-preview", "imageTemplateName": "myImageTemplate" }, "responses": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json index 1e16b8ea9f2f..83ae58d56c63 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetRunOutput.json @@ -4,7 +4,7 @@ "resourceGroupName": "myResourceGroup", "imageTemplateName":"myImageTemplate", "runOutputName": "myManagedImageOutput", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses":{ "200": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json index 93bd73ddd64c..e9671f8a94cf 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "{subscription-id}", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses": { "202": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json index b90ebc7ca10b..ddd7b7b5fc71 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json @@ -2,7 +2,7 @@ "parameters": { "subscritionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses": { "202": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json index aeaad646ca66..898b0b682282 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListRunOutputs.json @@ -3,7 +3,7 @@ "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", "imageTemplateName":"myImageTemplate", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses":{ "200": { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json index a00363b0d347..28b38949d895 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RunImageTemplate.json @@ -3,7 +3,7 @@ "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", "imageTemplateName":"myImageTemplate", - "api-version": "2019-02-01-preview" + "api-version": "2019-05-01-preview" }, "responses":{ "202":{ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json index de7627d76fef..7986dd5dd39b 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json @@ -3,7 +3,7 @@ "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", "imageTemplateName":"myImageTemplate", - "api-version": "2019-02-01-preview", + "api-version": "2019-05-01-preview", "parameters":{ "tags": { "new-tag": "new-value" diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json index 79fab2ca9990..c0cc8c4fc6e2 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json @@ -592,7 +592,7 @@ ] }, "ImageTemplateShellCustomizer": { - "description": "Runs a shell script during the customization phase (Linux)", + "description": "Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'script' or 'inline' can be specified.", "x-ms-discriminator-value": "Shell", "allOf": [ { @@ -603,6 +603,13 @@ "script": { "type": "string", "description": "The shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + }, + "inline": { + "type": "array", + "description": "Array of shell commands to execute", + "items": { + "type": "string" + } } } }, @@ -630,7 +637,7 @@ } }, "ImageTemplatePowerShellCustomizer": { - "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner", + "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'script' or 'inline' can be specified.", "x-ms-discriminator-value": "PowerShell", "allOf": [ { @@ -642,8 +649,16 @@ "type": "string", "description": "The PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" }, + "inline": { + "type": "array", + "description": "Array of PowerShell commands to execute", + "items": { + "type": "string" + } + }, "validExitCodes" : { "type": "array", + "description": "Valid exit codes for the PowerShell script. [Default: 0]", "items": { "type": "integer" } @@ -857,9 +872,9 @@ "type": "string", "description": "The resource id of the artifact." }, - "artifactLocation": { + "artifactUri": { "type": "string", - "description": "The URL location of the artifact." + "description": "The location URI of the artifact." }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", From b64f11d3a7f11012ebf758fce0c65b08c411e0ff Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Fri, 29 Mar 2019 22:27:08 +0000 Subject: [PATCH 4/5] Add ManagedIdentity, File customizer, fix bugs --- .../examples/CreateImageTemplate.json | 4 +- ...ImageTemplateWithUserAssignedIdentity.json | 88 +++++++++++ .../examples/GetImageTemplate.json | 4 +- .../examples/ListImageTemplates.json | 6 +- .../examples/ListImageTemplatesByRg.json | 6 +- .../examples/RemoveImageTemplateIdentity.json | 49 ++++++ .../examples/UpdateImageTemplateTags.json | 4 +- ...UpdateImageTemplateToRemoveIdentities.json | 51 ++++++ .../2019-05-01-preview/imagebuilder.json | 145 +++++++++++++++--- 9 files changed, 324 insertions(+), 33 deletions(-) create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplateWithUserAssignedIdentity.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RemoveImageTemplateIdentity.json create mode 100644 specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateToRemoveIdentities.json diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json index 03e42527ef55..2414c0bb8873 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplate.json @@ -19,7 +19,7 @@ { "type": "Shell", "name": "Shell Customizer Example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ @@ -52,7 +52,7 @@ { "type": "Shell", "name": "Shell Customizer Example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplateWithUserAssignedIdentity.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplateWithUserAssignedIdentity.json new file mode 100644 index 000000000000..308e614cb01d --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/CreateImageTemplateWithUserAssignedIdentity.json @@ -0,0 +1,88 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "api-version": "2019-05-01-preview", + "imageTemplateName": "myImageTemplate", + "parameters": { + "location": "westus", + "tags": { + "imagetemplate_tag1": "IT_T1", + "imagetemplate_tag2": "IT_T2" + }, + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": {} + } + }, + "properties": { + "source": { + "type": "ManagedImage", + "imageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell Customizer Example", + "scriptUri": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": { + "clientId": "00000000-0000-0000-0000-000000000000", + "principalId": "00000000-0000-0000-0000-000000000000" + } + } + }, + "properties": { + "source": { + "type": "ManagedImage", + "imageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell Customizer Example", + "scriptUri": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json index 40b9112dc604..d67dd339d93d 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json @@ -15,14 +15,14 @@ "properties": { "source": { "type": "ISO", - "sourceURI": "http://redhat.com/path/to/installation.iso", + "sourceUri": "http://redhat.com/path/to/installation.iso", "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" }, "customize": [ { "type": "Shell", "name": "Shell Customizer Example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json index e9671f8a94cf..b6981e3f852b 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json @@ -15,14 +15,14 @@ "properties": { "source": { "type": "ISO", - "sourceURI": "http://redhat.com/path/to/installation.iso", + "sourceUri": "http://redhat.com/path/to/installation.iso", "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" }, "customize": [ { "type": "Shell", "name": "Shell customization example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ @@ -55,7 +55,7 @@ { "type": "Shell", "name": "Shell customization example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json index ddd7b7b5fc71..15975293401e 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json @@ -16,14 +16,14 @@ "properties": { "source": { "type": "ISO", - "sourceURI": "http://redhat.com/path/to/installation.iso", + "sourceUri": "http://redhat.com/path/to/installation.iso", "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" }, "customize": [ { "type": "Shell", "name": "Shell customization example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ @@ -56,7 +56,7 @@ { "type": "Shell", "name": "Shell customization example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RemoveImageTemplateIdentity.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RemoveImageTemplateIdentity.json new file mode 100644 index 000000000000..a3e39064a6fe --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/RemoveImageTemplateIdentity.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName":"myImageTemplate", + "api-version": "2019-05-01-preview", + "parameters":{ + "identity": { + "type": "None" + } + } + }, + "responses":{ + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "identity": null, + "properties": { + "source": { + "type": "ISO", + "sourceUri": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "scriptUri": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json index 7986dd5dd39b..622362aec679 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateTags.json @@ -23,14 +23,14 @@ "properties": { "source": { "type": "ISO", - "sourceURI": "http://redhat.com/path/to/installation.iso", + "sourceUri": "http://redhat.com/path/to/installation.iso", "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" }, "customize": [ { "type": "Shell", "name": "Shell customization example", - "script": "https://example.com/path/to/script.sh" + "scriptUri": "https://example.com/path/to/script.sh" } ], "distribute": [ diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateToRemoveIdentities.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateToRemoveIdentities.json new file mode 100644 index 000000000000..668c8f78f517 --- /dev/null +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/UpdateImageTemplateToRemoveIdentities.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "imageTemplateName": "myImageTemplate", + "api-version": "2019-05-01-preview", + "parameters": { + "identity": { + "type": "None" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", + "name": "myImageTemplate", + "location": "westus", + "type": "Microsoft.VirtualMachineImages/imageTemplate", + "tags": { + "new-tag": "new-value" + }, + "properties": { + "source": { + "type": "ISO", + "sourceUri": "http://redhat.com/path/to/installation.iso", + "sha256Checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f" + }, + "customize": [ + { + "type": "Shell", + "name": "Shell customization example", + "scriptUri": "https://example.com/path/to/script.sh" + } + ], + "distribute": [ + { + "type": "ManagedImage", + "location": "1_location", + "runOutputName": "image_it_pir_1", + "imageId": "/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1", + "tags": { + "tagName": "value" + } + } + ] + } + } + } + } +} diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json index c0cc8c4fc6e2..6c381ba54295 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/imagebuilder.json @@ -3,7 +3,7 @@ "info": { "title": "VirtualMachineImageTemplate", "description": "Virtual Machine Image Template", - "version": "2019-02-01-preview" + "version": "2019-05-01-preview" }, "host": "management.azure.com", "schemes": [ @@ -165,14 +165,17 @@ } } }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, "x-ms-examples": { "Create an Image Template.": { "$ref": "./examples/CreateImageTemplate.json" + }, + "Create an Image Template with a user assigned identity configured": { + "$ref": "./examples/CreateImageTemplateWithUserAssignedIdentity.json" } - }, - "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options": { - "final-state-via":"azure-async-operation" } }, "patch": { @@ -211,6 +214,9 @@ "$ref": "#/definitions/ImageTemplate" } }, + "202": { + "description": "The operation will be completed asynchronously." + }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -218,9 +224,16 @@ } } }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, "x-ms-examples": { "Update the tags for an Image Template.": { "$ref": "./examples/UpdateImageTemplateTags.json" + }, + "Remove identities for an Image Template.": { + "$ref": "./examples/UpdateImageTemplateToRemoveIdentities.json" } } }, @@ -303,7 +316,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via":"azure-async-operation" + "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Delete an Image Template.": { @@ -349,7 +362,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via":"azure-async-operation" + "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create image(s) from existing imageTemplate.": { @@ -481,7 +494,7 @@ } }, "definitions": { - "ImageTemplateListResult" : { + "ImageTemplateListResult": { "properties": { "value": { "type": "array", @@ -516,7 +529,7 @@ } ], "properties": { - "sourceURI": { + "sourceUri": { "type": "string", "description": "URI to get the ISO image. This URI has to be accessible to the resource provider at the time of the image template creation." }, @@ -526,7 +539,7 @@ } }, "required": [ - "sourceURI", + "sourceUri", "sha256Checksum" ] }, @@ -563,18 +576,36 @@ "allOf": [ { "$ref": "#/definitions/ImageTemplateSource" - } + } ], "properties": { "imageId": { "type": "string", "description": "ARM resource id of the managed image in customer subscription" - } + } }, "required": [ "imageId" ] }, + "ImageTemplateSharedImageVersionSource": { + "description": "Describes an image source that is an image version in a shared image gallery.", + "x-ms-discriminator-value": "SharedImageVersion", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateSource" + } + ], + "properties": { + "imageVersionId": { + "type": "string", + "description": "ARM resource id of the image version in the shared image gallery" + } + }, + "required": [ + "imageVersionId" + ] + }, "ImageTemplateCustomizer": { "discriminator": "type", "properties": { @@ -592,7 +623,7 @@ ] }, "ImageTemplateShellCustomizer": { - "description": "Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'script' or 'inline' can be specified.", + "description": "Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.", "x-ms-discriminator-value": "Shell", "allOf": [ { @@ -600,9 +631,9 @@ } ], "properties": { - "script": { + "scriptUri": { "type": "string", - "description": "The shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + "description": "URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" }, "inline": { "type": "array", @@ -637,7 +668,7 @@ } }, "ImageTemplatePowerShellCustomizer": { - "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'script' or 'inline' can be specified.", + "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.", "x-ms-discriminator-value": "PowerShell", "allOf": [ { @@ -645,9 +676,9 @@ } ], "properties": { - "script": { + "scriptUri": { "type": "string", - "description": "The PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + "description": "URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" }, "inline": { "type": "array", @@ -656,7 +687,7 @@ "type": "string" } }, - "validExitCodes" : { + "validExitCodes": { "type": "array", "description": "Valid exit codes for the PowerShell script. [Default: 0]", "items": { @@ -665,6 +696,25 @@ } } }, + "ImageTemplateFileCustomizer": { + "description": "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner", + "x-ms-discriminator-value": "File", + "allOf": [ + { + "$ref": "#/definitions/ImageTemplateCustomizer" + } + ], + "properties": { + "sourceUri": { + "type": "string", + "description": "The URI of the file to be uploaded for customizing the VM. It can be a github link, SAS URI for Azure Storage, etc" + }, + "destination": { + "type": "string", + "description": "The absolute path (with existing directory structure) where the file will be uploaded to in the VM" + } + } + }, "ImageTemplateDistributor": { "type": "object", "description": "Generic distribution object", @@ -756,6 +806,7 @@ "type": "string", "enum": [ "Creating", + "Updating", "Succeeded", "Failed", "Deleting" @@ -771,6 +822,7 @@ "BadPIRSource", "BadISOSource", "BadManagedImageSource", + "BadSharedImageVersionSource", "BadCustomizerType", "UnsupportedCustomizerType", "NoCustomizerScript", @@ -782,7 +834,7 @@ "description": "Error code of the provisioning failure" }, "message": { - "type":"string", + "type": "string", "description": "Verbose error message about the provisioning failure" } } @@ -859,6 +911,10 @@ "$ref": "#/definitions/ImageTemplateLastRunStatus", "description": "State of 'run' that is currently executing or was last executed.", "readOnly": true + }, + "buildTimeoutInMinutes": { + "type": "integer", + "description": "Maximum duration to wait while building the image template. Default is 60 minutes." } }, "required": [ @@ -866,6 +922,42 @@ "distribute" ] }, + "ImageTemplateIdentity": { + "properties": { + "type": { + "type": "string", + "description": "The type of identity used for the image template. The type 'None' will remove any identities from the image template.", + "enum": [ + "UserAssigned", + "None" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + }, + "userAssignedIdentities": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal id of user assigned identity." + }, + "clientId": { + "readOnly": true, + "type": "string", + "description": "The client id of user assigned identity." + } + } + }, + "description": "The list of user identities associated with the image template. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'." + } + }, + "description": "Identity for the image template." + }, "RunOutputProperties": { "properties": { "artifactId": { @@ -888,6 +980,10 @@ "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ImageTemplateProperties" + }, + "identity": { + "$ref": "#/definitions/ImageTemplateIdentity", + "description": "The identity of the image template, if configured." } }, "allOf": [ @@ -898,6 +994,10 @@ }, "ImageTemplateUpdateParameters": { "properties": { + "identity": { + "$ref": "#/definitions/ImageTemplateIdentity", + "description": "The identity of the image template, if configured." + }, "tags": { "type": "object", "additionalProperties": { @@ -957,7 +1057,10 @@ "location": { "type": "string", "description": "Resource location", - "x-ms-mutability": [ "create", "read" ] + "x-ms-mutability": [ + "create", + "read" + ] }, "tags": { "type": "object", From 37db3f8500b9ee3ee2da941b35e57ed202ddf183 Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Fri, 29 Mar 2019 22:41:04 +0000 Subject: [PATCH 5/5] Fix examples --- .../preview/2019-05-01-preview/examples/GetImageTemplate.json | 2 +- .../2019-05-01-preview/examples/ListImageTemplates.json | 2 +- .../2019-05-01-preview/examples/ListImageTemplatesByRg.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json index d67dd339d93d..435231254d75 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/GetImageTemplate.json @@ -6,7 +6,7 @@ "imageTemplateName": "myImageTemplate" }, "responses": { - "202": { + "200": { "body": { "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate", "name": "myImageTemplate", diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json index b6981e3f852b..966e76c3c470 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplates.json @@ -4,7 +4,7 @@ "api-version": "2019-05-01-preview" }, "responses": { - "202": { + "200": { "body": { "value": [ { diff --git a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json index 15975293401e..aa072cb92783 100644 --- a/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json +++ b/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/preview/2019-05-01-preview/examples/ListImageTemplatesByRg.json @@ -1,11 +1,11 @@ { "parameters": { - "subscritionId": "{subscription-id}", + "subscriptionId": "{subscription-id}", "resourceGroupName": "myResourceGroup", "api-version": "2019-05-01-preview" }, "responses": { - "202": { + "200": { "body": { "value": [ {