Skip to content

Commit 037a946

Browse files
2025 01 02 typespec pr1 (#35215)
* update tsp * add examples to tsp folder * add "Added" * fix examples in tsp folder * updated swagger files --------- Co-authored-by: Jiao Di (MSFT) <[email protected]>
1 parent 0bae083 commit 037a946

File tree

6 files changed

+227
-4
lines changed

6 files changed

+227
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"diskName": "myDisk",
6+
"api-version": "2025-01-02",
7+
"grantAccessData": {
8+
"access": "Read",
9+
"durationInSeconds": 300,
10+
"getSecureVMGuestStateSAS": true
11+
}
12+
},
13+
"responses": {
14+
"200": {
15+
"body": {
16+
"accessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
17+
"securityDataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
18+
"securityMetadataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/ghm3kwd5jzbn/2be55b76-f471-4f6b-bff0-4dcea6cbca7f_vmmd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r"
19+
}
20+
},
21+
"202": {
22+
"headers": {
23+
"Location": "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/operations/{operationId}&monitor=true&api-version=2025-01-02"
24+
}
25+
}
26+
},
27+
"operationId": "Disks_GrantAccess",
28+
"title": "get sas on managed disk, VM guest state and VM metadata for Confidential VM."
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2025-01-02",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"location": "West US",
9+
"properties": {
10+
"osType": "Windows",
11+
"securityProfile": {
12+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
13+
},
14+
"creationData": {
15+
"createOption": "ImportSecure",
16+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
17+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
18+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
19+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
20+
}
21+
}
22+
}
23+
},
24+
"responses": {
25+
"202": {
26+
"body": {
27+
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
28+
"name": "myDisk",
29+
"location": "West US",
30+
"properties": {
31+
"provisioningState": "Updating",
32+
"osType": "Windows",
33+
"securityProfile": {
34+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
35+
},
36+
"creationData": {
37+
"createOption": "ImportSecure",
38+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
39+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
40+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
41+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
42+
}
43+
}
44+
}
45+
},
46+
"200": {
47+
"body": {
48+
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
49+
"name": "myDisk",
50+
"location": "West US",
51+
"properties": {
52+
"provisioningState": "Succeeded",
53+
"osType": "Windows",
54+
"securityProfile": {
55+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
56+
},
57+
"creationData": {
58+
"createOption": "ImportSecure",
59+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
60+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
61+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
62+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
63+
}
64+
}
65+
}
66+
}
67+
},
68+
"operationId": "Disks_CreateOrUpdate",
69+
"title": "create a managed disk from ImportSecure create option with metadata URI for Confidential VM."
70+
}

specification/compute/Disk.Management/models.tsp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ union DiskCreateOption {
123123
CopyStart: "CopyStart",
124124

125125
/**
126-
* Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId
126+
* Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM.
127127
*/
128128
ImportSecure: "ImportSecure",
129129

130130
/**
131-
* Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in both disk and VM guest state
131+
* Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM.
132132
*/
133133
UploadPreparedSecure: "UploadPreparedSecure",
134134

@@ -747,6 +747,10 @@ model CreationData {
747747
*/
748748
securityDataUri?: string;
749749

750+
/** If createOption is ImportSecure, this is the URI of a blob to be imported into VM metadata for Confidential VM.*/
751+
@added(Versions.v2025_01_02)
752+
securityMetadataUri?: string;
753+
750754
/**
751755
* Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.
752756
*/
@@ -1090,6 +1094,12 @@ model AccessUri {
10901094
#suppress "@azure-tools/typespec-azure-core/casing-style" "Respecting name of the variable"
10911095
@visibility(Lifecycle.Read)
10921096
securityDataAccessSAS?: string;
1097+
1098+
/** A SAS uri for accessing a VM metadata.*/
1099+
#suppress "@azure-tools/typespec-azure-core/casing-style" "Respecting name of the variable"
1100+
@visibility(Lifecycle.Read)
1101+
@added(Versions.v2025_01_02)
1102+
securityMetadataAccessSAS?: string;
10931103
}
10941104

10951105
/**

specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/DiskRP.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,9 @@
13491349
"create a managed disk from ImportSecure create option": {
13501350
"$ref": "./examples/diskExamples/Disk_Create_FromImportSecure.json"
13511351
},
1352+
"create a managed disk from ImportSecure create option with metadata URI for Confidential VM.": {
1353+
"$ref": "./examples/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json"
1354+
},
13521355
"create a managed disk from UploadPreparedSecure create option": {
13531356
"$ref": "./examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json"
13541357
},
@@ -1641,6 +1644,9 @@
16411644
},
16421645
"get sas on managed disk and VM guest state": {
16431646
"$ref": "./examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json"
1647+
},
1648+
"get sas on managed disk, VM guest state and VM metadata for Confidential VM.": {
1649+
"$ref": "./examples/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json"
16441650
}
16451651
},
16461652
"x-ms-long-running-operation-options": {
@@ -2486,6 +2492,11 @@
24862492
"type": "string",
24872493
"description": "A SAS uri for accessing a VM guest state.",
24882494
"readOnly": true
2495+
},
2496+
"securityMetadataAccessSAS": {
2497+
"type": "string",
2498+
"description": "A SAS uri for accessing a VM metadata.",
2499+
"readOnly": true
24892500
}
24902501
}
24912502
},
@@ -2594,6 +2605,10 @@
25942605
"type": "string",
25952606
"description": "If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state."
25962607
},
2608+
"securityMetadataUri": {
2609+
"type": "string",
2610+
"description": "If createOption is ImportSecure, this is the URI of a blob to be imported into VM metadata for Confidential VM."
2611+
},
25972612
"performancePlus": {
25982613
"type": "boolean",
25992614
"description": "Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled."
@@ -2819,12 +2834,12 @@
28192834
{
28202835
"name": "ImportSecure",
28212836
"value": "ImportSecure",
2822-
"description": "Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId"
2837+
"description": "Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM."
28232838
},
28242839
{
28252840
"name": "UploadPreparedSecure",
28262841
"value": "UploadPreparedSecure",
2827-
"description": "Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in both disk and VM guest state"
2842+
"description": "Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM."
28282843
},
28292844
{
28302845
"name": "CopyFromSanSnapshot",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"diskName": "myDisk",
6+
"api-version": "2025-01-02",
7+
"grantAccessData": {
8+
"access": "Read",
9+
"durationInSeconds": 300,
10+
"getSecureVMGuestStateSAS": true
11+
}
12+
},
13+
"responses": {
14+
"200": {
15+
"body": {
16+
"accessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
17+
"securityDataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r",
18+
"securityMetadataAccessSAS": "https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/ghm3kwd5jzbn/2be55b76-f471-4f6b-bff0-4dcea6cbca7f_vmmd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2025-05-29T18:02:34Z&se=2025-05-29T18:19:14Z&sp=r"
19+
}
20+
},
21+
"202": {
22+
"headers": {
23+
"Location": "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/operations/{operationId}&monitor=true&api-version=2025-01-02"
24+
}
25+
}
26+
},
27+
"operationId": "Disks_GrantAccess",
28+
"title": "get sas on managed disk, VM guest state and VM metadata for Confidential VM."
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2025-01-02",
6+
"diskName": "myDisk",
7+
"disk": {
8+
"location": "West US",
9+
"properties": {
10+
"osType": "Windows",
11+
"securityProfile": {
12+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
13+
},
14+
"creationData": {
15+
"createOption": "ImportSecure",
16+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
17+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
18+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
19+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
20+
}
21+
}
22+
}
23+
},
24+
"responses": {
25+
"202": {
26+
"body": {
27+
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
28+
"name": "myDisk",
29+
"location": "West US",
30+
"properties": {
31+
"provisioningState": "Updating",
32+
"osType": "Windows",
33+
"securityProfile": {
34+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
35+
},
36+
"creationData": {
37+
"createOption": "ImportSecure",
38+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
39+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
40+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
41+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
42+
}
43+
}
44+
}
45+
},
46+
"200": {
47+
"body": {
48+
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
49+
"name": "myDisk",
50+
"location": "West US",
51+
"properties": {
52+
"provisioningState": "Succeeded",
53+
"osType": "Windows",
54+
"securityProfile": {
55+
"securityType": "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
56+
},
57+
"creationData": {
58+
"createOption": "ImportSecure",
59+
"storageAccountId": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount",
60+
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
61+
"securityDataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd",
62+
"securityMetadataUri": "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd"
63+
}
64+
}
65+
}
66+
}
67+
},
68+
"operationId": "Disks_CreateOrUpdate",
69+
"title": "create a managed disk from ImportSecure create option with metadata URI for Confidential VM."
70+
}

0 commit comments

Comments
 (0)