Skip to content

Commit 59930ee

Browse files
ookokaTheodore Changmikeharderaudreyttt
authored
Merge GalleryRP 2025-03-03 Features into Main (#38715)
* add new version to main.tsp * add examples * swagger generated * update readme file * add import versioining * Gallery Image version StorageAccountStrategy (#35769) * tsp update * swagger added * fix typespec CI validation --------- Co-authored-by: Ojo Okoka <[email protected]> * New resource type - Gallery Scripts (#35887) * added models and main.tsp reference * update * add added decorators * fix unintentional change * add examples * update galleryScript name pattern * fix parameter name with back-compatibles * fix CI failures * update responses codes * fix enum descriptions * add validationStatus * update * set readOnly properties as readOnly * remove schema from 202 returns * fix typo * tsp compiler updated * Included Azure-AsyncOperation headers to address ARM Comments * Added ArmAsyncOperationHeader for ARM Comments and fixed Tsp compile issues * Attempt to fix CI TypeSpec Validation * Attempt to fix CI TypeSpec Validation through npx commands * Attempted fix * Cleanup GalleryScriptVersion.tsp file * Attempted to use Azure decorators --------- Co-authored-by: Mike Harder <[email protected]> Co-authored-by: Ojo Okoka <[email protected]> * Compilation Errors for TS Validation Fix * Adding updated Gallery swagger to updated Readme input-file * Rollback name pattern req + updates to Typespec Validation * Adding delete read only directives to change 2024-03-03 json from update * Reversing changes and Getting Breaking Change Approval * Revert name pattern changes to see CI checks * Fix Readme and add Swagger Lint Suppression * Corrected name for min and maxValue * Rollback on parameter name changes * Added existing name pattern for GalleryApplications * Removed suppression for NamePattern --------- Co-authored-by: Theodore Chang <[email protected]> Co-authored-by: Mike Harder <[email protected]> Co-authored-by: audreyttt <[email protected]>
1 parent aed3f19 commit 59930ee

File tree

188 files changed

+25408
-52
lines changed

Some content is hidden

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

188 files changed

+25408
-52
lines changed

specification/compute/Gallery.Management/Gallery.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ model Gallery is Azure.ResourceManager.TrackedResource<GalleryProperties> {
1818
Resource = Gallery,
1919
KeyName = "galleryName",
2020
SegmentName = "galleries",
21-
NamePattern = ""
21+
NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2222
>;
2323

2424
/**
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 "@typespec/versioning";
6+
import "./models.tsp";
7+
import "./Gallery.tsp";
8+
import "../Common.Management/operations.tsp";
9+
10+
using TypeSpec.Rest;
11+
using Versioning;
12+
using Azure.ResourceManager;
13+
using TypeSpec.Http;
14+
15+
namespace Microsoft.Compute;
16+
17+
/**
18+
* Gallery script name with pattern validation
19+
*/
20+
@pattern("^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")
21+
@doc("The name of the gallery Script Definition in which the Script Version is to be created.")
22+
scalar GalleryScriptName extends string;
23+
24+
/**
25+
* Specifies information about the gallery Script Definition that you want to create or update.
26+
*/
27+
@added(Versions.v2025_03_03)
28+
@parentResource(Gallery)
29+
model GalleryScript
30+
is Azure.ResourceManager.TrackedResource<GalleryScriptProperties> {
31+
@key("galleryScriptName")
32+
@segment("scripts")
33+
@path
34+
name: GalleryScriptName;
35+
}
36+
37+
@armResourceOperations
38+
interface GalleryScripts {
39+
/**
40+
* Retrieves information about a gallery script definition.
41+
*/
42+
@added(Versions.v2025_03_03)
43+
get is ComputeResourceRead<GalleryScript>;
44+
45+
/**
46+
* Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts
47+
*/
48+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility"
49+
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
50+
@added(Versions.v2025_03_03)
51+
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
52+
GalleryScript,
53+
Response = ArmResourceUpdatedResponse<GalleryScript> | ArmResourceCreatedResponse<
54+
GalleryScript,
55+
ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
56+
>
57+
>;
58+
59+
/**
60+
* Update a gallery Script Definition.
61+
*/
62+
@patch(#{ implicitOptionality: false })
63+
@added(Versions.v2025_03_03)
64+
update is ComputeCustomPatchAsync<
65+
GalleryScript,
66+
PatchModel = GalleryScriptUpdate,
67+
Response = ArmResponse<GalleryScript> | ArmAcceptedLroResponse
68+
>;
69+
70+
/**
71+
* Delete a gallery Script Definition.
72+
*/
73+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
74+
@added(Versions.v2025_03_03)
75+
delete is ComputeResourceDeleteAsync<
76+
GalleryScript,
77+
Response = ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
78+
>;
79+
80+
/**
81+
* List gallery Script Definitions in a gallery.
82+
*/
83+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "For backward compatibility"
84+
@added(Versions.v2025_03_03)
85+
listByGallery is ComputeResourceListByParent<
86+
GalleryScript,
87+
Response = ArmResponse<GalleryScriptList>
88+
>;
89+
}
90+
91+
@@doc(GalleryScript.name,
92+
"The name of the gallery Script Definition to be retrieved."
93+
);
94+
@@doc(GalleryScript.properties,
95+
"Describes the properties of a gallery Script Definition."
96+
);
97+
@@doc(GalleryScripts.createOrUpdate::parameters.resource,
98+
"Parameters supplied to the create or update gallery Script operation."
99+
);
100+
@@doc(GalleryScripts.update::parameters.properties,
101+
"Parameters supplied to the update gallery Script operation."
102+
);
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/rest";
4+
import "@typespec/versioning";
5+
import "./models.tsp";
6+
import "./GalleryScript.tsp";
7+
import "../Common.Management/operations.tsp";
8+
9+
using TypeSpec.Rest;
10+
using Versioning;
11+
using Azure.ResourceManager;
12+
using TypeSpec.Http;
13+
using Azure.Core; // Needed for @useFinalStateVia decorator
14+
15+
namespace Microsoft.Compute {
16+
@pattern("^[0-9]+\\.[0-9]+\\.[0-9]+$")
17+
@doc("The name of the gallery Script Version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>")
18+
scalar GalleryScriptVersionName extends string;
19+
20+
@added(Versions.v2025_03_03)
21+
model GalleryScriptVersionList is Azure.Core.Page<GalleryScriptVersion>;
22+
23+
@added(Versions.v2025_03_03)
24+
@parentResource(GalleryScript)
25+
model GalleryScriptVersion
26+
is Azure.ResourceManager.TrackedResource<GalleryScriptVersionProperties> {
27+
@key("galleryScriptVersionName")
28+
@segment("versions")
29+
@path
30+
name: GalleryScriptVersionName;
31+
}
32+
33+
/**
34+
* Common LRO headers (Azure-AsyncOperation required Jan 2025). Keep Location + Retry-After for backward compatibility.
35+
*/
36+
alias GalleryScriptVersionLroHeaders = ArmAsyncOperationHeader<FinalResult = GalleryScriptVersion> &
37+
ArmLroLocationHeader &
38+
Azure.Core.Foundations.RetryAfterHeader;
39+
40+
@armResourceOperations
41+
interface GalleryScriptVersions {
42+
@added(Versions.v2025_03_03)
43+
get is ComputeResourceRead<GalleryScriptVersion>;
44+
45+
/**
46+
* Create or update a gallery Script Version.
47+
*/
48+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility"
49+
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
50+
@useFinalStateVia("azure-async-operation")
51+
@added(Versions.v2025_03_03)
52+
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
53+
GalleryScriptVersion,
54+
Azure.ResourceManager.Foundations.DefaultBaseParameters<GalleryScriptVersion>,
55+
GalleryScriptVersionLroHeaders,
56+
{},
57+
ArmResourceUpdatedResponse<GalleryScriptVersion> | ArmResourceCreatedResponse<
58+
GalleryScriptVersion,
59+
GalleryScriptVersionLroHeaders
60+
>
61+
>;
62+
63+
/**
64+
* Update a gallery Script Version.
65+
*/
66+
@useFinalStateVia("azure-async-operation")
67+
@added(Versions.v2025_03_03)
68+
@patch(#{ implicitOptionality: false })
69+
update is ComputeCustomPatchAsync<
70+
GalleryScriptVersion,
71+
GalleryScriptVersionUpdate,
72+
Azure.ResourceManager.Foundations.DefaultBaseParameters<GalleryScriptVersion>,
73+
GalleryScriptVersionLroHeaders,
74+
{},
75+
ArmResponse<GalleryScriptVersion> | ArmAcceptedLroResponse<
76+
"Resource update request accepted.",
77+
GalleryScriptVersionLroHeaders
78+
>
79+
>;
80+
81+
/**
82+
* Delete a gallery Script Version.
83+
*/
84+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
85+
@useFinalStateVia("azure-async-operation")
86+
@added(Versions.v2025_03_03)
87+
delete is ComputeResourceDeleteAsync<
88+
GalleryScriptVersion,
89+
Azure.ResourceManager.Foundations.DefaultBaseParameters<GalleryScriptVersion>,
90+
GalleryScriptVersionLroHeaders,
91+
{},
92+
ArmDeleteAcceptedLroResponse<GalleryScriptVersionLroHeaders> | ArmDeletedNoContentResponse
93+
>;
94+
95+
/**
96+
* List gallery Script Versions in a gallery Script Definition.
97+
*/
98+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "For backward compatibility"
99+
@added(Versions.v2025_03_03)
100+
listByGalleryScript is ComputeResourceListByParent<
101+
GalleryScriptVersion,
102+
Response = ArmResponse<GalleryScriptVersionList>
103+
>;
104+
}
105+
106+
@@doc(GalleryScriptVersion.name,
107+
"The name of the gallery Script Version to be retrieved."
108+
);
109+
@@doc(GalleryScriptVersion.properties,
110+
"Describes the properties of a gallery Script Version."
111+
);
112+
@@doc(GalleryScriptVersions.createOrUpdate::parameters.resource,
113+
"Parameters supplied to the create or update gallery Script Version operation."
114+
);
115+
@@doc(GalleryScriptVersions.update::parameters.properties,
116+
"Parameters supplied to the update gallery Script Version operation."
117+
);
118+
}

specification/compute/Gallery.Management/back-compatible.tsp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,20 @@ using Microsoft.Compute;
8080
@@clientName(GalleryApplications.update::parameters.properties,
8181
"galleryApplication"
8282
);
83-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "@flattenProperty decorator is not recommended to use."
84-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility"
83+
84+
@@clientName(GalleryScripts.createOrUpdate::parameters.resource,
85+
"galleryScript"
86+
);
87+
@@clientName(GalleryScripts.update::parameters.properties, "galleryScript");
88+
89+
@@clientName(GalleryScriptVersions.createOrUpdate::parameters.resource,
90+
"galleryScriptVersion"
91+
);
92+
@@clientName(GalleryScriptVersions.update::parameters.properties,
93+
"galleryScriptVersion"
94+
);
95+
96+
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten retained for backward compatibility."
8597
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(GalleryApplication.properties
8698
);
8799

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"location": "myLocation",
5+
"api-version": "2025-03-03",
6+
"publicGalleryName": "publicGalleryName",
7+
"galleryImageName": "myGalleryImageName",
8+
"galleryImageVersionName": "myGalleryImageVersionName"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"properties": {
14+
"publishedDate": "2018-03-20T09:12:28Z",
15+
"endOfLifeDate": "2022-03-20T09:12:28Z",
16+
"excludeFromLatest": false,
17+
"storageProfile": {
18+
"osDiskImage": {
19+
"diskSizeGB": 29,
20+
"hostCaching": "None"
21+
}
22+
},
23+
"artifactTags": {
24+
"ShareTag-CommunityGallery": "CommunityGallery"
25+
},
26+
"disclaimer": "https://test-uri.com"
27+
},
28+
"location": "myLocation",
29+
"name": "myGalleryImageVersionName",
30+
"type": "Microsoft.Compute/locations/communityGalleryImageVersion",
31+
"identifier": {
32+
"uniqueId": "/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"
33+
}
34+
}
35+
}
36+
},
37+
"operationId": "CommunityGalleryImageVersions_Get",
38+
"title": "Get a community gallery image version."
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"location": "myLocation",
5+
"api-version": "2025-03-03",
6+
"publicGalleryName": "publicGalleryName",
7+
"galleryImageName": "myGalleryImageName"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"properties": {
15+
"publishedDate": "2018-03-20T09:12:28Z",
16+
"endOfLifeDate": "2022-03-20T09:12:28Z",
17+
"excludeFromLatest": false,
18+
"storageProfile": {
19+
"osDiskImage": {
20+
"diskSizeGB": 29,
21+
"hostCaching": "None"
22+
}
23+
},
24+
"artifactTags": {
25+
"ShareTag-CommunityGallery": "CommunityGallery"
26+
},
27+
"disclaimer": "https://test-uri.com"
28+
},
29+
"location": "myLocation",
30+
"name": "myGalleryImageVersionName",
31+
"identifier": {
32+
"uniqueId": "/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"
33+
}
34+
}
35+
],
36+
"nextLink": "http://svchost:99/subscriptions/subscriptionId/providers/Microsoft.Compute/communityGalleries/publicGalleryName/images/myGalleryImageName/versions?$skiptoken=token/communityGalleries/publicGalleryName/images/myGalleryImageName/versions/myGalleryImageVersionName"
37+
}
38+
}
39+
},
40+
"operationId": "CommunityGalleryImageVersions_List",
41+
"title": "List community gallery image versions."
42+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"location": "myLocation",
5+
"api-version": "2025-03-03",
6+
"publicGalleryName": "publicGalleryName",
7+
"galleryImageName": "myGalleryImageName"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"properties": {
13+
"osType": "Windows",
14+
"osState": "Generalized",
15+
"hyperVGeneration": "V1",
16+
"identifier": {
17+
"publisher": "myPublisherName",
18+
"offer": "myOfferName",
19+
"sku": "mySkuName"
20+
},
21+
"privacyStatementUri": "https://test-uri.com",
22+
"eula": "https://test-uri.com",
23+
"artifactTags": {
24+
"ShareTag-CommunityGallery": "CommunityGallery"
25+
},
26+
"disclaimer": "https://test-uri.com"
27+
},
28+
"location": "myLocation",
29+
"name": "myGalleryImageName",
30+
"type": "Microsoft.Compute/locations/communityGalleryImage",
31+
"identifier": {
32+
"uniqueId": "/CommunityGalleries/publicGalleryName/Images/myGalleryImageName"
33+
}
34+
}
35+
}
36+
},
37+
"operationId": "CommunityGalleryImages_Get",
38+
"title": "Get a community gallery image."
39+
}

0 commit comments

Comments
 (0)