From cc7ce727542520b02c2b62682f48e1fad2a21cfb Mon Sep 17 00:00:00 2001 From: jerryc3 <48365571+jerryc3@users.noreply.github.com> Date: Tue, 3 May 2022 07:21:22 -0700 Subject: [PATCH] Add new Azure Compute Gallery image ids to ImageDiskReference for PutDisk Support in 2022-03-02 Api Version (#18868) * new sig ids for put disk 2022-03-02 * fix errors and add example path * extra space * remove required id * prettify common Co-authored-by: Jerry Chan --- .../stable/2022-03-02/DiskRP/disk.json | 9 +++ .../2022-03-02/DiskRP/diskRPCommon.json | 17 +++-- ...omAnAzureComputeGalleryCommunityImage.json | 62 +++++++++++++++++++ ...nAzureComputeGalleryDirectSharedImage.json | 62 +++++++++++++++++++ ...Create_FromAnAzureComputeGalleryImage.json | 62 +++++++++++++++++++ 5 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/disk.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/disk.json index 440fe1b879c7..9e46f5d80d07 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/disk.json +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/disk.json @@ -132,6 +132,15 @@ }, "Create a confidential VM supported disk encrypted with customer managed key": { "$ref": "./examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json" + }, + "Create a managed disk from an Azure Compute Gallery image.": { + "$ref": "./examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json" + }, + "Create a managed disk from an Azure Compute Gallery direct shared image.": { + "$ref": "./examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json" + }, + "Create a managed disk from an Azure Compute Gallery community image.": { + "$ref": "./examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json" } }, "x-ms-long-running-operation": true diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/diskRPCommon.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/diskRPCommon.json index 52d31fcdfd24..bd84ca1adb13 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/diskRPCommon.json +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/diskRPCommon.json @@ -332,7 +332,7 @@ }, "galleryImageReference": { "$ref": "#/definitions/ImageDiskReference", - "description": "Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk." + "description": "Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk." }, "sourceUri": { "type": "string", @@ -371,7 +371,15 @@ "properties": { "id": { "type": "string", - "description": "A relative uri containing either a Platform Image Repository or user image reference." + "description": "A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference." + }, + "sharedGalleryImageId": { + "type": "string", + "description": "A relative uri containing a direct shared Azure Compute Gallery image reference." + }, + "communityGalleryImageId": { + "type": "string", + "description": "A relative uri containing a community Azure Compute Gallery image reference." }, "lun": { "type": "integer", @@ -379,9 +387,6 @@ "description": "If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null." } }, - "required": [ - "id" - ], "description": "The source image used for creating the disk." }, "PurchasePlan": { @@ -458,7 +463,7 @@ "x-ms-enum": { "name": "Architecture", "modelAsString": true - } + } } }, "description": "List of supported capabilities persisted on the disk resource for VM use." diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json new file mode 100644 index 000000000000..653e7928851b --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "subscriptionId": "{subscriptionId}", + "resourceGroupName": "myResourceGroup", + "api-version": "2022-03-02", + "diskName": "myDisk", + "disk": { + "location": "West US", + "properties": { + "osType": "Windows", + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "communityGalleryImageId": "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + }, + "responses": { + "202": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "communityGalleryImageId": "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0" + } + }, + "provisioningState": "Updating" + } + } + }, + "200": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "communityGalleryImageId": "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json new file mode 100644 index 000000000000..86b42c2293f4 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "subscriptionId": "{subscriptionId}", + "resourceGroupName": "myResourceGroup", + "api-version": "2022-03-02", + "diskName": "myDisk", + "disk": { + "location": "West US", + "properties": { + "osType": "Windows", + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "sharedGalleryImageId": "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + }, + "responses": { + "202": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "sharedGalleryImageId": "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0" + } + }, + "provisioningState": "Updating" + } + } + }, + "200": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "sharedGalleryImageId": "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json new file mode 100644 index 000000000000..3fa048836521 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-02/DiskRP/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "subscriptionId": "{subscriptionId}", + "resourceGroupName": "myResourceGroup", + "api-version": "2022-03-02", + "diskName": "myDisk", + "disk": { + "location": "West US", + "properties": { + "osType": "Windows", + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "id": "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + }, + "responses": { + "202": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "id": "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0" + } + }, + "provisioningState": "Updating" + } + } + }, + "200": { + "body": { + "name": "myDisk", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "osType": "Windows", + "hyperVGeneration": "V1", + "supportedCapabilities": { + "acceleratedNetwork": true + }, + "creationData": { + "createOption": "FromImage", + "galleryImageReference": { + "id": "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0" + } + } + } + } + } + } +}