Skip to content

Commit 5657350

Browse files
jgu17James Gu
andauthored
Add stackhcivm 2026-02-01-preview api and snapshot feature (#39909)
* add stackhcivm 2026-02-01-preview api * fix snapshotstatus comments * Add examples for stackhcivm 2026-02-01-preview * address review comments regarding the header * revert package-lock.json change * revert package-lock.json change --------- Co-authored-by: James Gu <gujames@microsoft.com>
1 parent b993024 commit 5657350

222 files changed

Lines changed: 23167 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/openapi";
4+
import "@typespec/rest";
5+
import "./models.tsp";
6+
7+
using TypeSpec.Rest;
8+
using Azure.ResourceManager;
9+
using TypeSpec.Http;
10+
using TypeSpec.OpenAPI;
11+
using TypeSpec.Versioning;
12+
13+
namespace Microsoft.AzureStackHCI;
14+
15+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility"
16+
#suppress "@azure-tools/typespec-azure-core/no-openapi" "x-ms-azure-resource legacy"
17+
@added(Versions.v2026_02_01_preview)
18+
@doc("The snapshot resource definition.")
19+
@extension("x-ms-azure-resource", true)
20+
model Snapshot is TrackedResource<SnapshotProperties> {
21+
@doc("Name of the snapshot")
22+
@pattern("^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$")
23+
@path
24+
@key("snapshotName")
25+
@segment("snapshots")
26+
@visibility(Lifecycle.Read)
27+
name: string;
28+
29+
@doc("The extendedLocation of the resource.")
30+
extendedLocation?: ExtendedLocation;
31+
}
32+
33+
@added(Versions.v2026_02_01_preview)
34+
@armResourceOperations
35+
interface Snapshots {
36+
@doc("Gets a snapshot")
37+
get is ArmResourceRead<Snapshot>;
38+
39+
#suppress "@azure-tools/typespec-azure-core/invalid-final-state" "MUST CHANGE ON NEXT UPDATE"
40+
@doc("The operation to create or update a snapshot. Please note some properties can be set only during snapshot creation.")
41+
@Azure.Core.useFinalStateVia("azure-async-operation")
42+
createOrUpdate is ArmResourceCreateOrReplaceAsync<
43+
Snapshot,
44+
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
45+
>;
46+
47+
@doc("The operation to update a snapshot.")
48+
@patch(#{ implicitOptionality: false })
49+
@sharedRoute
50+
update is ArmTagsPatchAsync<Snapshot>;
51+
52+
@doc("The operation to delete a snapshot.")
53+
delete is ArmResourceDeleteWithoutOkAsync<Snapshot>;
54+
55+
@doc("Lists all of the snapshots in the specified resource group. Use the nextLink property in the response to get the next page of snapshots.")
56+
listByResourceGroup is ArmResourceListByParent<Snapshot>;
57+
58+
@doc("Lists all of the snapshots in the specified subscription. Use the nextLink property in the response to get the next page of snapshots.")
59+
listAll is ArmListBySubscription<Snapshot>;
60+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"parameters": {
3+
"api-version": "2026-02-01-preview",
4+
"resourceUri": "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"name": "default",
10+
"type": "Microsoft.AzureStackHCI/virtualMachineInstances/AttestationStatus",
11+
"id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/attestationStatus/default",
12+
"properties": {
13+
"attestSecureBootEnabled": "Disabled",
14+
"attestationCertValidated": "Invalid",
15+
"bootIntegrityValidated": "Invalid",
16+
"errorMessage": "Attestation token has invalid signature",
17+
"healthStatus": "Unhealthy",
18+
"linuxKernelVersion": "1.0.0.0",
19+
"timestamp": "2023/11/10 9:48"
20+
}
21+
}
22+
}
23+
},
24+
"operationId": "AttestationStatuses_Get",
25+
"title": "GetAttestationStatus"
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"parameters": {
3+
"api-version": "2026-02-01-preview",
4+
"galleryImageName": "test-gallery-image",
5+
"resource": {
6+
"extendedLocation": {
7+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
8+
"type": "CustomLocation"
9+
},
10+
"location": "West US2",
11+
"properties": {
12+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
13+
"imagePath": "C:\\test.vhdx",
14+
"osType": "Linux"
15+
}
16+
},
17+
"resourceGroupName": "test-rg",
18+
"subscriptionId": "fd3c3665-1729-4b7b-9a38-238e83b0f98b"
19+
},
20+
"responses": {
21+
"200": {
22+
"body": {
23+
"name": "test-gallery-image",
24+
"type": "Microsoft.AzureStackHCI/galleryImages",
25+
"extendedLocation": {
26+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
27+
"type": "CustomLocation"
28+
},
29+
"id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image",
30+
"location": "West US2",
31+
"properties": {
32+
"cloudInitDataSource": "NoCloud",
33+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
34+
"hyperVGeneration": "V2",
35+
"osType": "Linux",
36+
"provisioningState": "Accepted",
37+
"status": {
38+
"downloadStatus": {
39+
"downloadSizeInMB": 9383
40+
},
41+
"progressPercentage": 100,
42+
"provisioningStatus": {
43+
"operationId": "79cfc696-44f5-4a68-a620-21850f7e9fb0",
44+
"status": "Succeeded"
45+
}
46+
},
47+
"version": {
48+
"properties": {
49+
"storageProfile": {
50+
"osDiskImage": {
51+
"sizeInMB": 30270
52+
}
53+
}
54+
}
55+
}
56+
}
57+
}
58+
},
59+
"201": {
60+
"body": {
61+
"name": "test-gallery-image",
62+
"type": "Microsoft.AzureStackHCI/galleryImages",
63+
"extendedLocation": {
64+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
65+
"type": "CustomLocation"
66+
},
67+
"id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-galimg3325",
68+
"location": "West US2",
69+
"properties": {
70+
"cloudInitDataSource": "NoCloud",
71+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
72+
"hyperVGeneration": "V2",
73+
"osType": "Linux",
74+
"provisioningState": "Succeeded",
75+
"status": {
76+
"downloadStatus": {
77+
"downloadSizeInMB": 9383
78+
},
79+
"progressPercentage": 100,
80+
"provisioningStatus": {
81+
"operationId": "79cfc696-44f5-4a68-a620-21850f7e9fb0",
82+
"status": "Succeeded"
83+
}
84+
},
85+
"version": {
86+
"properties": {
87+
"storageProfile": {
88+
"osDiskImage": {
89+
"sizeInMB": 30270
90+
}
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
97+
},
98+
"operationId": "GalleryImages_CreateOrUpdate",
99+
"title": "PutGalleryImage"
100+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"parameters": {
3+
"api-version": "2026-02-01-preview",
4+
"galleryImageName": "test-gallery-image",
5+
"resource": {
6+
"extendedLocation": {
7+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
8+
"type": "CustomLocation"
9+
},
10+
"location": "West US2",
11+
"properties": {
12+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
13+
"sourceVirtualMachineId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualMachineInstance/test-vm",
14+
"osType": "Windows"
15+
}
16+
},
17+
"resourceGroupName": "test-rg",
18+
"subscriptionId": "fd3c3665-1729-4b7b-9a38-238e83b0f98b"
19+
},
20+
"responses": {
21+
"200": {
22+
"body": {
23+
"name": "test-gallery-image",
24+
"type": "Microsoft.AzureStackHCI/galleryImages",
25+
"extendedLocation": {
26+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
27+
"type": "CustomLocation"
28+
},
29+
"id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image",
30+
"location": "West US2",
31+
"properties": {
32+
"cloudInitDataSource": "NoCloud",
33+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
34+
"hyperVGeneration": "V2",
35+
"osType": "Linux",
36+
"provisioningState": "Accepted",
37+
"status": {
38+
"downloadStatus": {
39+
"downloadSizeInMB": 9383
40+
},
41+
"progressPercentage": 100,
42+
"provisioningStatus": {
43+
"operationId": "79cfc696-44f5-4a68-a620-21850f7e9fb0",
44+
"status": "Succeeded"
45+
}
46+
},
47+
"version": {
48+
"properties": {
49+
"storageProfile": {
50+
"osDiskImage": {
51+
"sizeInMB": 30270
52+
}
53+
}
54+
}
55+
}
56+
}
57+
}
58+
},
59+
"201": {
60+
"body": {
61+
"name": "test-gallery-image",
62+
"type": "Microsoft.AzureStackHCI/galleryImages",
63+
"extendedLocation": {
64+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
65+
"type": "CustomLocation"
66+
},
67+
"id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-galimg3325",
68+
"location": "West US2",
69+
"properties": {
70+
"cloudInitDataSource": "NoCloud",
71+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
72+
"hyperVGeneration": "V2",
73+
"osType": "Linux",
74+
"provisioningState": "Succeeded",
75+
"status": {
76+
"downloadStatus": {
77+
"downloadSizeInMB": 9383
78+
},
79+
"progressPercentage": 100,
80+
"provisioningStatus": {
81+
"operationId": "79cfc696-44f5-4a68-a620-21850f7e9fb0",
82+
"status": "Succeeded"
83+
}
84+
},
85+
"version": {
86+
"properties": {
87+
"storageProfile": {
88+
"osDiskImage": {
89+
"sizeInMB": 30270
90+
}
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
97+
},
98+
"operationId": "GalleryImages_CreateOrUpdate_FromVM",
99+
"title": "PutGalleryImage_FromVM"
100+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"api-version": "2026-02-01-preview",
4+
"galleryImageName": "test-gallery-image",
5+
"resourceGroupName": "test-rg",
6+
"subscriptionId": "fd3c3665-1729-4b7b-9a38-238e83b0f98b"
7+
},
8+
"responses": {
9+
"202": {
10+
"headers": {
11+
"azure-asyncoperation": "http://azure.async.operation/status"
12+
}
13+
},
14+
"204": {
15+
"headers": {
16+
"azure-asyncoperation": "http://azure.async.operation/status"
17+
}
18+
}
19+
},
20+
"operationId": "GalleryImages_Delete",
21+
"title": "DeleteGalleryImage"
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"parameters": {
3+
"api-version": "2026-02-01-preview",
4+
"galleryImageName": "test-gallery-image",
5+
"resourceGroupName": "test-rg",
6+
"subscriptionId": "fd3c3665-1729-4b7b-9a38-238e83b0f98b"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"name": "test-gallery-image",
12+
"type": "Microsoft.AzureStackHCI/galleryImages",
13+
"extendedLocation": {
14+
"name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
15+
"type": "CustomLocation"
16+
},
17+
"id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image",
18+
"location": "West US2",
19+
"properties": {
20+
"cloudInitDataSource": "NoCloud",
21+
"containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
22+
"hyperVGeneration": "V1",
23+
"identifier": {
24+
"offer": "myOfferName",
25+
"publisher": "myPublisherName",
26+
"sku": "mySkuName"
27+
},
28+
"osType": "Windows",
29+
"provisioningState": "Accepted",
30+
"status": {
31+
"downloadStatus": {
32+
"downloadSizeInMB": 9383
33+
},
34+
"progressPercentage": 100,
35+
"provisioningStatus": {
36+
"operationId": "79cfc696-44f5-4a68-a620-21850f7e9fb0",
37+
"status": "Succeeded"
38+
}
39+
},
40+
"version": {
41+
"name": "1.0.0",
42+
"properties": {
43+
"storageProfile": {
44+
"osDiskImage": {
45+
"sizeInMB": 30270
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}
53+
},
54+
"operationId": "GalleryImages_Get",
55+
"title": "GetGalleryImage"
56+
}

0 commit comments

Comments
 (0)