Skip to content

Commit

Permalink
Add private preview API for Azure Image Builder (#5055)
Browse files Browse the repository at this point in the history
* Add private preview API for Azure Image Builder

* Review comments

 - Added list-by-resource-group and list-by-subscription
 - Added default error response
 - Removed explicit operation url (implied by async contract)
 - Adjusted 'delete' response codes to match expectations
 - Allow patch for tags
 - Added provider operations API

* Review comment: use "nextLink" for paging

* Adding readme files for SDK generation

* PR: rename 'tags' -> 'artifactTags' for distributor

* Add examples, fix minor issues in swagger
  • Loading branch information
paulmey authored and anuchandy committed Feb 27, 2019
1 parent 101f6c7 commit f8dd2a9
Show file tree
Hide file tree
Showing 14 changed files with 1,667 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2018-02-01-preview",
"imageTemplateName": "myImageTemplate",
"parameters": {
"location": "westus",
"tags": {
"imagetemplate_tag1": "IT_T1",
"imagetemplate_tag2": "IT_T2"
},
"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"
}
}
]
}
}
},
"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": "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"
}
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"imageTemplateName":"myImageTemplate",
"api-version": "2018-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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2018-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"
}
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"imageTemplateName":"myImageTemplate",
"runOutputName": "myManagedImageOutput",
"api-version": "2018-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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"api-version": "2018-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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"parameters": {
"subscritionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2018-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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"imageTemplateName":"myImageTemplate",
"api-version": "2018-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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"imageTemplateName":"myImageTemplate",
"api-version": "2018-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"
}
}
}
}
Loading

0 comments on commit f8dd2a9

Please sign in to comment.