From b8edbb515c23026d1ce2ecb21c73646f53d0e5a1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 30 Nov 2021 18:24:29 +0000 Subject: [PATCH] CodeGen from PR 16669 in Azure/azure-rest-api-specs Merge d80c7d0de0013354b9ca614978a64a288456798b into 635059f740b46b7e4ca87c7a4a47945e468af98b --- .../Microsoft.VirtualMachineImages.json | 847 ++++++++++++++++++ schemas/common/autogeneratedResources.json | 3 + 2 files changed, 850 insertions(+) create mode 100644 schemas/2021-10-01/Microsoft.VirtualMachineImages.json diff --git a/schemas/2021-10-01/Microsoft.VirtualMachineImages.json b/schemas/2021-10-01/Microsoft.VirtualMachineImages.json new file mode 100644 index 0000000000..de8e4588e2 --- /dev/null +++ b/schemas/2021-10-01/Microsoft.VirtualMachineImages.json @@ -0,0 +1,847 @@ +{ + "id": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.VirtualMachineImages.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.VirtualMachineImages", + "description": "Microsoft VirtualMachineImages Resource Types", + "resourceDefinitions": { + "imageTemplates": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-10-01" + ] + }, + "identity": { + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateIdentity" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Identity for the image template." + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9-_.]{1,64}$" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The name of the image Template" + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Describes the properties of an image template" + }, + "systemData": { + "oneOf": [ + { + "$ref": "#/definitions/SystemData" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Metadata pertaining to creation and last modification of the resource." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.VirtualMachineImages/imageTemplates" + ] + } + }, + "required": [ + "apiVersion", + "identity", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.VirtualMachineImages/imageTemplates" + } + }, + "definitions": { + "Componentsvrq145schemasimagetemplateidentitypropertiesuserassignedidentitiesadditionalproperties": { + "type": "object", + "properties": {} + }, + "ImageTemplateCustomizer": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateShellCustomizer" + }, + { + "$ref": "#/definitions/ImageTemplateRestartCustomizer" + }, + { + "$ref": "#/definitions/ImageTemplateWindowsUpdateCustomizer" + }, + { + "$ref": "#/definitions/ImageTemplatePowerShellCustomizer" + }, + { + "$ref": "#/definitions/ImageTemplateFileCustomizer" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Friendly Name to provide context on what this customization step does" + } + }, + "description": "Describes a unit of image customization" + }, + "ImageTemplateDistributor": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateManagedImageDistributor" + }, + { + "$ref": "#/definitions/ImageTemplateSharedImageDistributor" + }, + { + "$ref": "#/definitions/ImageTemplateVhdDistributor" + } + ], + "properties": { + "artifactTags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Tags that will be applied to the artifact once it has been created/updated by the distributor." + }, + "runOutputName": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9-_.]{1,64}$" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The name to be used for the associated RunOutput." + } + }, + "required": [ + "runOutputName" + ], + "description": "Generic distribution object" + }, + "ImageTemplateFileCustomizer": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "The absolute path to a file (with nested directory structures already created) where the file (from sourceUri) will be uploaded to in the VM" + }, + "sha256Checksum": { + "type": "string", + "default": "", + "description": "SHA256 checksum of the file provided in the sourceUri field above" + }, + "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" + }, + "type": { + "type": "string", + "enum": [ + "File" + ] + } + }, + "required": [ + "type" + ], + "description": "Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner" + }, + "ImageTemplateIdentity": { + "type": "object", + "properties": { + "type": { + "oneOf": [ + { + "type": "string", + "enum": [ + "UserAssigned", + "None" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of identity used for the image template. The type 'None' will remove any identities from the image template." + }, + "userAssignedIdentities": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Componentsvrq145schemasimagetemplateidentitypropertiesuserassignedidentitiesadditionalproperties" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "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." + }, + "ImageTemplateManagedImageDistributor": { + "type": "object", + "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" + }, + "type": { + "type": "string", + "enum": [ + "ManagedImage" + ] + } + }, + "required": [ + "imageId", + "location", + "type" + ], + "description": "Distribute as a Managed Disk Image." + }, + "ImageTemplateManagedImageSource": { + "type": "object", + "properties": { + "imageId": { + "type": "string", + "description": "ARM resource id of the managed image in customer subscription" + }, + "type": { + "type": "string", + "enum": [ + "ManagedImage" + ] + } + }, + "required": [ + "imageId", + "type" + ], + "description": "Describes an image source that is a managed image in customer subscription." + }, + "ImageTemplatePlatformImageSource": { + "type": "object", + "properties": { + "offer": { + "type": "string", + "description": "Image offer from the [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + }, + "planInfo": { + "oneOf": [ + { + "$ref": "#/definitions/PlatformImagePurchasePlan" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Purchase plan configuration for platform image." + }, + "publisher": { + "type": "string", + "description": "Image Publisher in [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)." + }, + "type": { + "type": "string", + "enum": [ + "PlatformImage" + ] + }, + "version": { + "type": "string", + "description": "Image version from the [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages). If 'latest' is specified here, the version is evaluated when the image build takes place, not when the template is submitted." + } + }, + "required": [ + "type" + ], + "description": "Describes an image source from [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages)." + }, + "ImageTemplatePowerShellCustomizer": { + "type": "object", + "properties": { + "inline": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Array of PowerShell commands to execute" + }, + "runAsSystem": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true." + }, + "runElevated": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "If specified, the PowerShell script will be run with elevated privileges" + }, + "scriptUri": { + "type": "string", + "description": "URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + }, + "sha256Checksum": { + "type": "string", + "default": "", + "description": "SHA256 checksum of the power shell script provided in the scriptUri field above" + }, + "type": { + "type": "string", + "enum": [ + "PowerShell" + ] + }, + "validExitCodes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Valid exit codes for the PowerShell script. [Default: 0]" + } + }, + "required": [ + "type" + ], + "description": "Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified." + }, + "ImageTemplateProperties": { + "type": "object", + "properties": { + "buildTimeoutInMinutes": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 960, + "default": "0" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Maximum duration to wait while building the image template. Omit or specify 0 to use the default (4 hours)." + }, + "customize": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ImageTemplateCustomizer" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies the properties used to describe the customization steps of the image, like Image source etc" + }, + "distribute": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ImageTemplateDistributor" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The distribution targets where the image output needs to go to." + }, + "source": { + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateSource" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Describes a virtual machine image source for building, customizing and distributing" + }, + "vmProfile": { + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplateVmProfile" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Describes the virtual machine used to build, customize and capture images" + } + }, + "required": [ + "distribute", + "source" + ], + "description": "Describes the properties of an image template" + }, + "ImageTemplateRestartCustomizer": { + "type": "object", + "properties": { + "restartCheckCommand": { + "type": "string", + "description": "Command to check if restart succeeded [Default: '']" + }, + "restartCommand": { + "type": "string", + "description": "Command to execute the restart [Default: 'shutdown /r /f /t 0 /c \"packer restart\"']" + }, + "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']" + }, + "type": { + "type": "string", + "enum": [ + "WindowsRestart" + ] + } + }, + "required": [ + "type" + ], + "description": "Reboots a VM and waits for it to come back online (Windows). Corresponds to Packer windows-restart provisioner" + }, + "ImageTemplateSharedImageDistributor": { + "type": "object", + "properties": { + "excludeFromLatest": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Flag that indicates whether created image version should be excluded from latest. Omit to use the default (false)." + }, + "galleryImageId": { + "type": "string", + "description": "Resource Id of the Shared Image Gallery image" + }, + "replicationRegions": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "A list of regions that the image will be replicated to" + }, + "storageAccountType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_ZRS" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS)." + }, + "type": { + "type": "string", + "enum": [ + "SharedImage" + ] + } + }, + "required": [ + "galleryImageId", + "replicationRegions", + "type" + ], + "description": "Distribute via Shared Image Gallery." + }, + "ImageTemplateSharedImageVersionSource": { + "type": "object", + "properties": { + "imageVersionId": { + "type": "string", + "description": "ARM resource id of the image version in the shared image gallery" + }, + "type": { + "type": "string", + "enum": [ + "SharedImageVersion" + ] + } + }, + "required": [ + "imageVersionId", + "type" + ], + "description": "Describes an image source that is an image version in a shared image gallery." + }, + "ImageTemplateShellCustomizer": { + "type": "object", + "properties": { + "inline": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Array of shell commands to execute" + }, + "scriptUri": { + "type": "string", + "description": "URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc" + }, + "sha256Checksum": { + "type": "string", + "default": "", + "description": "SHA256 checksum of the shell script provided in the scriptUri field" + }, + "type": { + "type": "string", + "enum": [ + "Shell" + ] + } + }, + "required": [ + "type" + ], + "description": "Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified." + }, + "ImageTemplateSource": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/ImageTemplatePlatformImageSource" + }, + { + "$ref": "#/definitions/ImageTemplateManagedImageSource" + }, + { + "$ref": "#/definitions/ImageTemplateSharedImageVersionSource" + } + ], + "properties": {}, + "description": "Describes a virtual machine image source for building, customizing and distributing" + }, + "ImageTemplateVhdDistributor": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "VHD" + ] + } + }, + "required": [ + "type" + ], + "description": "Distribute via VHD in a storage account." + }, + "ImageTemplateVmProfile": { + "type": "object", + "properties": { + "osDiskSizeGB": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "default": "0" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Size of the OS disk in GB. Omit or specify 0 to use Azure's default OS disk size." + }, + "userAssignedIdentities": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Optional array of resource IDs of user assigned managed identities to be configured on the build VM. This may include the identity of the image template." + }, + "vmSize": { + "type": "string", + "default": "", + "description": "Size of the virtual machine used to build, customize and capture images. Omit or specify empty string to use the default (Standard_D2ds_v4)." + }, + "vnetConfig": { + "oneOf": [ + { + "$ref": "#/definitions/VirtualNetworkConfig" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Virtual Network configuration." + } + }, + "description": "Describes the virtual machine used to build, customize and capture images" + }, + "ImageTemplateWindowsUpdateCustomizer": { + "type": "object", + "properties": { + "filters": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Array of filters to select updates to apply. Omit or specify empty array to use the default (no filter). Refer to above link for examples and detailed description of this field." + }, + "searchCriteria": { + "type": "string", + "description": "Criteria to search updates. Omit or specify empty string to use the default (search all). Refer to above link for examples and detailed description of this field." + }, + "type": { + "type": "string", + "enum": [ + "WindowsUpdate" + ] + }, + "updateLimit": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000)" + } + }, + "required": [ + "type" + ], + "description": "Installs Windows Updates. Corresponds to Packer Windows Update Provisioner (https://github.com/rgl/packer-provisioner-windows-update)" + }, + "PlatformImagePurchasePlan": { + "type": "object", + "properties": { + "planName": { + "type": "string", + "description": "Name of the purchase plan." + }, + "planProduct": { + "type": "string", + "description": "Product of the purchase plan." + }, + "planPublisher": { + "type": "string", + "description": "Publisher of the purchase plan." + } + }, + "required": [ + "planName", + "planProduct", + "planPublisher" + ], + "description": "Purchase plan configuration for platform image." + }, + "SystemData": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of identity that created the resource." + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)" + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of identity that last modified the resource." + } + }, + "description": "Metadata pertaining to creation and last modification of the resource." + }, + "VirtualNetworkConfig": { + "type": "object", + "properties": { + "proxyVmSize": { + "type": "string", + "default": "", + "description": "Size of the virtual machine used to build, customize and capture images. Omit or specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images)." + }, + "subnetId": { + "type": "string", + "description": "Resource id of a pre-existing subnet." + } + }, + "description": "Virtual Network configuration." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index aeeae2e947..f4144d06c8 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -14239,6 +14239,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2020-02-14/Microsoft.VirtualMachineImages.json#/resourceDefinitions/imageTemplates" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.VirtualMachineImages.json#/resourceDefinitions/imageTemplates" + }, { "$ref": "https://schema.management.azure.com/schemas/2014-04-01-preview/Microsoft.VisualStudio.json#/resourceDefinitions/account" },