Skip to content

Add GetLatestVersionName api in Gallery #23633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: feature/cplat-2022-08-03
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2022-08-03",
"galleryName": "myGalleryName",
"galleryImageName": "myGalleryImageName"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName/versionNames/latest",
"name": "latest",
"type": "Microsoft.Compute/galleries/images/versionNames",
"properties": {
"latestVersionName": "1.0.0",
"location": "West US"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,61 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versionNames/latest": {
"get": {
"tags": [
"GalleryImageVersions"
],
"operationId": "GalleryImageVersions_GetLatest",
"description": "Retrieves information about the latest version of an image.",
"parameters": [
{
"$ref": "../../../common-types/v1/common.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"name": "galleryName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^.*$",
"description": "The name of the Shared Image Gallery in which the Image Definition resides."
},
{
"name": "galleryImageName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^.*$",
"description": "The name of the gallery image definition in which the Image Version resides."
},
{
"$ref": "../../../common-types/v1/common.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/latestVersion"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../common-types/v1/common.json#/definitions/CloudError"
}
}
},
"x-ms-examples": {
"Get latest version of an image.": {
"$ref": "./examples/galleryExamples/GalleryImageVersion_Get_LatestVersionName.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}": {
"put": {
"tags": [
Expand Down Expand Up @@ -3133,7 +3188,7 @@
"LatestGalleryImageVersion": {
"type": "object",
"readOnly": true,
"description": "The gallery image version with latest version in a particular region.",
"description": "The property latestVersion. It contains two value, the latest version name and the region.",
"properties": {
"latestVersionName": {
"type": "string",
Expand All @@ -3144,6 +3199,30 @@
"description": "region of the Gallery Image Version."
}
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold your horses.
How is this new property different from the property just above it called LatestGalleryImageVersion? https://github.com/Azure/azure-rest-api-specs/pull/23633/files#diff-2d57b1e3ef500806be7f276354fc7ae66b634ce4a9ba619f0b983855859acf35R3186

The two descriptions for these 2 properties are literally identical. Why id your property being added at all? How is it different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's nested. LatestGalleryImageVersion is a property of latestVersion.

latestVersion is an ARM resource which has id, name, type. LatestGalleryImageVersion is the property of it, which contains only region and version name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should change the description of them, to make them clear

"latestVersion": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standalone definitions should start with a capital letter.

"readOnly": true,
"description": "latestVersion is an ARM resource. It follows the schema of ARM resource, which has id, name, type and properties. The name of the latest version in the region is in the properties.",
"properties": {
"id": {
"readOnly": true,
"type": "string",
"description": "Resource Id"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these descriptions more specific. ex: 'Resource Id of the latest version of a specific image.' (if that description is correct). Same for the other 2 properties here.

},
"name": {
"readOnly": true,
"type": "string",
"description": "Resource name"
},
"type": {
"readOnly": true,
"type": "string",
"description": "Resource type"
},
"properties": {
"$ref": "#/definitions/LatestGalleryImageVersion"
}
}
}
},
"parameters": {
Expand Down