Skip to content

Commit e40a6de

Browse files
gatneilsergey-shandar
authored andcommitted
Examples for Disks/Images (#2303)
* added disk/image examples for 2017-03-30 * added disk/image examples to 2016-04-30-preview * added example refs to compute.json * added image examples to 2017-12-01
1 parent 679502c commit e40a6de

File tree

65 files changed

+3221
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3221
-3
lines changed

specification/compute/resource-manager/Microsoft.Compute/preview/2016-04-30-preview/compute.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,29 @@
947947
}
948948
}
949949
},
950+
"x-ms-examples": {
951+
"Create a virtual machine image from a blob.": {
952+
"$ref": "./examples/CreateAnImageFromABlob.json"
953+
},
954+
"Create a virtual machine image from a snapshot.": {
955+
"$ref": "./examples/CreateAnImageFromASnapshot.json"
956+
},
957+
"Create a virtual machine image from a managed disk.": {
958+
"$ref": "./examples/CreateAnImageFromAManagedDisk.json"
959+
},
960+
"Create a virtual machine image from an existing virtual machine.": {
961+
"$ref": "./examples/CreateAnImageFromAVM.json"
962+
},
963+
"Create a virtual machine image that includes a data disk from a blob.": {
964+
"$ref": "./examples/CreateAnImageThatIncludesADataDiskFromABlob.json"
965+
},
966+
"Create a virtual machine image that includes a data disk from a snapshot.": {
967+
"$ref": "./examples/CreateAnImageThatIncludesADataDiskFromASnapshot.json"
968+
},
969+
"Create a virtual machine image that includes a data disk from a managed disk.": {
970+
"$ref": "./examples/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json"
971+
}
972+
},
950973
"x-ms-long-running-operation": true
951974
},
952975
"delete": {
@@ -1035,6 +1058,11 @@
10351058
"$ref": "#/definitions/Image"
10361059
}
10371060
}
1061+
},
1062+
"x-ms-examples": {
1063+
"Get information about a virtual machine image.": {
1064+
"$ref": "./examples/GetInformationAboutAnImage.json"
1065+
}
10381066
}
10391067
}
10401068
},
@@ -1068,6 +1096,11 @@
10681096
}
10691097
}
10701098
},
1099+
"x-ms-examples": {
1100+
"List all virtual machine images in a resource group.": {
1101+
"$ref": "./examples/ListImagesInAResourceGroup.json"
1102+
}
1103+
},
10711104
"x-ms-pageable": {
10721105
"nextLinkName": "nextLink"
10731106
}
@@ -1096,6 +1129,11 @@
10961129
}
10971130
}
10981131
},
1132+
"x-ms-examples": {
1133+
"List all virtual machine images in a subscription.": {
1134+
"$ref": "./examples/ListImagesInASubscription.json"
1135+
}
1136+
},
10991137
"x-ms-pageable": {
11001138
"nextLinkName": "nextLink"
11011139
}

specification/compute/resource-manager/Microsoft.Compute/preview/2016-04-30-preview/disk.json

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@
6060
}
6161
}
6262
},
63+
"x-ms-examples": {
64+
"Create an empty managed disk.": {
65+
"$ref": "./examples/CreateAnEmptyManagedDisk.json"
66+
},
67+
"Create a managed disk from a platform image.": {
68+
"$ref": "./examples/CreateAManagedDiskFromAPlatformImage.json"
69+
},
70+
"Create a managed disk from an existing managed disk in the same or different subscription.": {
71+
"$ref": "./examples/CreateAManagedDiskFromAnExistingManagedDisk.json"
72+
},
73+
"Create a managed disk by importing an unmanaged blob from the same subscription.": {
74+
"$ref": "./examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json"
75+
},
76+
"Create a managed disk by importing an unmanaged blob from a different subscription.": {
77+
"$ref": "./examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json"
78+
},
79+
"Create a managed disk by copying a snapshot.": {
80+
"$ref": "./examples/CreateAManagedDiskByCopyingASnapshot.json"
81+
}
82+
},
6383
"x-ms-long-running-operation": true
6484
},
6585
"patch": {
@@ -134,6 +154,11 @@
134154
"$ref": "#/definitions/Disk"
135155
}
136156
}
157+
},
158+
"x-ms-examples": {
159+
"Get information about a managed disk.": {
160+
"$ref": "./examples/GetInformationAboutAManagedDisk.json"
161+
}
137162
}
138163
},
139164
"delete": {
@@ -207,6 +232,11 @@
207232
}
208233
}
209234
},
235+
"x-ms-examples": {
236+
"List all managed disks in a resource group.": {
237+
"$ref": "./examples/ListManagedDisksInAResourceGroup.json"
238+
}
239+
},
210240
"x-ms-pageable": {
211241
"nextLinkName": "nextLink"
212242
}
@@ -235,6 +265,11 @@
235265
}
236266
}
237267
},
268+
"x-ms-examples": {
269+
"List all managed disks in a subscription.": {
270+
"$ref": "./examples/ListManagedDisksInASubscription.json"
271+
}
272+
},
238273
"x-ms-pageable": {
239274
"nextLinkName": "nextLink"
240275
}
@@ -371,6 +406,17 @@
371406
}
372407
}
373408
},
409+
"x-ms-examples": {
410+
"Create a snapshot from an existing snapshot in the same or a different subscription.": {
411+
"$ref": "./examples/CreateASnapshotFromAnExistingSnapshot.json"
412+
},
413+
"Create a snapshot by importing an unmanaged blob from the same subscription.": {
414+
"$ref": "./examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json"
415+
},
416+
"Create a snapshot by importing an unmanaged blob from a different subscription.": {
417+
"$ref": "./examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json"
418+
}
419+
},
374420
"x-ms-long-running-operation": true
375421
},
376422
"patch": {
@@ -445,6 +491,11 @@
445491
"$ref": "#/definitions/Snapshot"
446492
}
447493
}
494+
},
495+
"x-ms-examples": {
496+
"Get information about a snapshot.": {
497+
"$ref": "./examples/GetInformationAboutASnapshot.json"
498+
}
448499
}
449500
},
450501
"delete": {
@@ -510,6 +561,11 @@
510561
}
511562
}
512563
},
564+
"x-ms-examples": {
565+
"List all snapshots in a resource group.": {
566+
"$ref": "./examples/ListSnapshotsInAResourceGroup.json"
567+
}
568+
},
513569
"x-ms-pageable": {
514570
"nextLinkName": "nextLink"
515571
}
@@ -538,6 +594,11 @@
538594
}
539595
}
540596
},
597+
"x-ms-examples": {
598+
"List all snapshots in a subscription.": {
599+
"$ref": "./examples/ListSnapshotsInASubscription.json"
600+
}
601+
},
541602
"x-ms-pageable": {
542603
"nextLinkName": "nextLink"
543604
}
@@ -1159,7 +1220,7 @@
11591220
"in": "path",
11601221
"required": true,
11611222
"type": "string",
1162-
"description": "The name of the disk within the given subscription and resource group.",
1223+
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.",
11631224
"x-ms-parameter-location": "method"
11641225
},
11651226
"SnapshotNameParameter": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2016-04-30-preview",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"name": "myDisk",
9+
"location": "West US",
10+
"properties": {
11+
"creationData": {
12+
"createOption": "Copy",
13+
"sourceResourceId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
14+
}
15+
}
16+
}
17+
},
18+
"responses": {
19+
"202": {
20+
"body": {
21+
"name": "myDisk",
22+
"location": "West US",
23+
"properties": {
24+
"provisioningState": "Updating",
25+
"creationData": {
26+
"createOption": "Copy",
27+
"sourceResourceId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2016-04-30-preview",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"name": "myDisk",
9+
"location": "West US",
10+
"properties": {
11+
"creationData": {
12+
"createOption": "Import",
13+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
14+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
15+
}
16+
}
17+
}
18+
},
19+
"responses": {
20+
"202": {
21+
"body": {
22+
"name": "myDisk",
23+
"location": "West US",
24+
"properties": {
25+
"provisioningState": "Updating",
26+
"creationData": {
27+
"createOption": "Import",
28+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
29+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2016-04-30-preview",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"name": "myDisk",
9+
"location": "West US",
10+
"properties": {
11+
"creationData": {
12+
"createOption": "Import",
13+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
14+
}
15+
}
16+
}
17+
},
18+
"responses": {
19+
"202": {
20+
"body": {
21+
"name": "myDisk",
22+
"location": "West US",
23+
"properties": {
24+
"provisioningState": "Updating",
25+
"creationData": {
26+
"createOption": "Import",
27+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2016-04-30-preview",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"name": "myDisk",
9+
"location": "West US",
10+
"properties": {
11+
"osType": "Windows",
12+
"creationData": {
13+
"createOption": "FromImage",
14+
"imageReference": {
15+
"id": "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"
16+
}
17+
}
18+
}
19+
}
20+
},
21+
"responses": {
22+
"202": {
23+
"body": {
24+
"name": "myDisk",
25+
"location": "West US",
26+
"properties": {
27+
"provisioningState": "Updating",
28+
"osType": "Windows",
29+
"creationData": {
30+
"createOption": "FromImage",
31+
"imageReference": {
32+
"id": "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2016-04-30-preview",
6+
"diskName": "myDisk2",
7+
"disk": {
8+
"name": "myDisk2",
9+
"location": "West US",
10+
"properties": {
11+
"creationData": {
12+
"createOption": "Copy",
13+
"sourceResourceId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"
14+
}
15+
}
16+
}
17+
},
18+
"responses": {
19+
"202": {
20+
"body": {
21+
"properties": {
22+
"creationData": {
23+
"createOption": "Copy",
24+
"sourceResourceId": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"
25+
},
26+
"provisioningState": "Updating"
27+
},
28+
"location": "West US",
29+
"name": "myDisk2"
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)