Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b9d0d59
Initial - adding new 2025-06-01 stable version to Diagnostic RP. Only…
Elina-L Apr 29, 2025
bdc8cbe
Run npx prettier on on GetSpotPlacementScores
Elina-L Apr 29, 2025
d9cac72
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 29, 2025
9b2d327
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 29, 2025
2c676de
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 30, 2025
3b3bb32
Changing subscription id to all zeros and changing request ids to sam…
Elina-L Apr 30, 2025
a6e4e86
Adding suppression to DiagnosticRP/preview/2025-06-01/**/*.json
Elina-L Apr 30, 2025
4a0d313
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 30, 2025
f12f7c0
Change suppressions path to stable instead of preview
Elina-L Apr 30, 2025
3cfc4e5
Merge branch 'wenxliu/CDRPNewAPIVersion20250601' of https://github.co…
Elina-L Apr 30, 2025
ff7a733
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 30, 2025
ed0b31e
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 30, 2025
9c4450b
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L Apr 30, 2025
6faaf09
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 1, 2025
942d47d
Remove redundant property definitions and updating the description co…
Elina-L May 1, 2025
3b2225a
Merge branch 'wenxliu/CDRPNewAPIVersion20250601' of https://github.co…
Elina-L May 1, 2025
36389f5
Update description for availabilityZone
Elina-L May 1, 2025
df2f624
Remove H/M/L from placement score description comment
Elina-L May 1, 2025
ebdc439
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 1, 2025
4da3160
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 2, 2025
22458de
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 7, 2025
fcc43c0
Remove ProxyResource from ComputeRP/stable/2024-11-01/computeRPCommon…
Elina-L May 9, 2025
14055af
Merge branch 'wenxliu/CDRPNewAPIVersion20250601' of https://github.co…
Elina-L May 9, 2025
7528892
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 9, 2025
c0fc5ab
Merge branch 'wenxliu/CDRPNewAPIVersion20250601' of https://github.co…
Elina-L May 9, 2025
7e7909d
Reference local ProxyResource in diagnostic.json
Elina-L May 12, 2025
df4848b
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 12, 2025
1e421b0
Fix allref reference path to ProxyResource
Elina-L May 12, 2025
ac2b55c
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 12, 2025
6de83c3
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 12, 2025
0fee86d
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 12, 2025
6eb2d4f
Adding type: object to fix lint error
Elina-L May 12, 2025
c004693
Run prettier on diagnostic.json file
Elina-L May 12, 2025
3456eb9
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 13, 2025
bbb4bb0
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 13, 2025
9b19c5b
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 14, 2025
d8c2f92
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
mikeharder May 16, 2025
4c258de
Update version number from 2025-06-01 to 2025-06-05 to comply with CP…
Elina-L May 29, 2025
f493f33
Change suppressions yaml version number
Elina-L May 29, 2025
c49524f
Merge branch 'main' into wenxliu/CDRPNewAPIVersion20250601
Elina-L May 29, 2025
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,307 @@
{
"swagger": "2.0",
"info": {
"title": "ComputeDiagnosticResourceProviderClient",
"description": "The Compute Diagnostic Resource Provider Client",
"version": "2025-06-01"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot

This is a singleton instance of resourceType locations/placementScores. Was that intentional? If so, it's normally suggested to use the name "default" instead of "spot". You will also need to add a collection GET path for the locations/placementScores type (will just return a list with one item in it).

If something else is intended, this API may need to be changed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above - adding new API version to an already existing API that has been rolled out in private versions

There is an internal placementScores/general API which will also be exposed via ARM in future versions

"get": {
"tags": [
"placementScores_spot"
],
"operationId": "SpotPlacementScores_Get",
"description": "Gets Spot Placement Scores metadata.",
"parameters": [
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/LocationParameter"
},
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ComputeDiagnosticBase"
}
},
"default": {
"description": "Error response describing why the get call failed.",
"schema": {
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Gets the metadata of Spot Placement Scores.": {
"$ref": "./examples/GetSpotPlacementScores.json"
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate": {
"post": {
"tags": [
"spotPlacementScores"
],
"operationId": "SpotPlacementScores_Post",
"description": "Generates placement scores for Spot VM skus.",
"parameters": [
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/LocationParameter"
},
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
},
{
"name": "spotPlacementScoresInput",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/SpotPlacementScoresInput"
},
"description": "SpotPlacementScores object supplied in the body of the Post spot placement scores operation."
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/SpotPlacementScoresResponse"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Returns spot VM placement scores for given configurations.": {
"$ref": "./examples/GenerateSpotPlacementScores.json"
}
}
}
}
},
"definitions": {
"ComputeDiagnosticBase": {
"description": "Contains metadata of a diagnostic type",
"type": "object",
"properties": {
"properties": {
"$ref": "#/definitions/DiagnosticProperties"
}
},
"allOf": [
{
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
}
]
},
"DiagnosticProperties": {
"description": "Contains additional properties of a diagnostic",
"type": "object",
"properties": {
"supportedResourceTypes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Describes what are the supported resource types for a diagnostic."
}
}
},
"ErrorResponse": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ErrorResponse

This definition is unused and should be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed

"type": "object",
"properties": {
"error": {
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorDetail"
}
},
"description": "An error response from the Compute Diagnostic Resource Provider service."
},
"ErrorDetail": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ErrorDetail

Also unused.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed

"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The error code."
},
"target": {
"type": "string",
"description": "The target of the particular error."
},
"message": {
"type": "string",
"description": "User friendly error message."
},
"details": {
"type": "array",
"items": {
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorDetail"
},
"description": "The Api error details"
},
"innerError": {
"$ref": "#/definitions/InnerError",
"description": "The Api inner error"
}
},
"description": "Error Detail message."
},
"InnerError": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

InnerError

Unused.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed

"type": "object",
"properties": {
"exceptiontype": {
"type": "string",
"description": "The exception type."
},
"errordetail": {
"type": "string",
"description": "The internal error message or exception dump."
}
},
"description": "Inner error details."
},
"SpotPlacementScoresInput": {
"type": "object",
"properties": {
"desiredLocations": {
"type": "array",
"items": {
"type": "string"
},
"description": "The desired regions"
},
"desiredSizes": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

desiredSizes

Looks like these are actually SKUs. Should this be named desiredSkus?

@Elina-L Elina-L May 1, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This API has already been rolled out to Prod as part of several preview versions and is being called by several external customers. This PR is just adding a new stable API version to the existing API without any changes to the API request or response entity models

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Elina-L - In future, when adding a new API version please follow this process to make your PR:

  1. Copy latest published API specs unchanged to new API version folder.
  2. Make a base commit.
  3. In subsequent commits, apply the changes you are implementing in your new API version.

Note, the above was implied by the item you checked:
[X] New API version for an existing resource provider. (If API spec is not defined in TypeSpec, the PR should have been created in adherence to OpenAPI specs PR creation guidance).

Also, if your APIs are unchanged new the new API version from an API version that was previously signed off by ARM, you should indicate that in a comment with a pointer to the PR that was signed off.

These steps will save a lot of your and the reviewer's time.

"type": "array",
"items": {
"$ref": "#/definitions/ResourceSize"
},
"description": "The desired resource SKUs."

@mentat9 mentat9 May 1, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"The desired resource SKUs."

Reconcile property name and description. Also, could you use a more specific term than "resource" (e.g. virtual machine...?). #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated description

},
"desiredCount": {
"type": "integer",
"format": "int32",
"description": "Desired instance count per region/zone based on the scope."
},
"availabilityZones": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

availabilityZones

ARM recommends enum over boolean. You could use something like availabilityType: { Regional, Zonal } or similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This API has already been rolled out to Prod as part of several preview versions and is being called by several external customers. This PR is just adding a new stable API version to the existing API without any changes to the API request or response entity models

"type": "boolean",
"description": "Defines if the scope is zonal or regional."
}
},
"description": "SpotPlacementScores API Input."
},
"SpotPlacementScoresResponse": {
"type": "object",
"properties": {
"desiredLocations": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

desiredLocations

Do these four properties (desired*, availabilityZones) just reflect the same values that were passed in the request, or are they set by the API?

If they are set by the API, how do they differ from the input values?

If they are just reflecting the input values, I'm not sure it makes sense to have them here in the response.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This API has already been rolled out to Prod as part of several preview versions and is being called by several external customers. This PR is just adding a new stable API version to the existing API without any changes to the API request or response entity models

"type": "array",
"items": {
"type": "string"
},
"description": "The desired regions"
},
"desiredSizes": {
"type": "array",
"items": {
"$ref": "#/definitions/ResourceSize"
},
"description": "The desired resource SKUs."
},
"desiredCount": {
"type": "integer",
"format": "int32",
"description": "Desired instance count per region/zone based on the scope."
},
"availabilityZones": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

availabilityZones

Recommend enum

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above

"type": "boolean",
"description": "Defines if the scope is zonal or regional."
},
"placementScores": {
"type": "array",
"items": {
"$ref": "#/definitions/PlacementScore"
},
"description": "The spot placement scores."
}
},
"description": "SpotPlacementScores API response."
},
"ResourceSize": {
"type": "object",
"properties": {
"sku": {
"type": "string",
"description": "The resource's CRP virtual machine SKU size."
}
},
"description": "SpotPlacementRecommender API response."
},
"PlacementScore": {
"type": "object",
"properties": {
"sku": {
"type": "string",
"description": "The resource's CRP virtual machine SKU size."
},
"region": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

region

Is this region or location? Is there a difference?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no difference between region and location

"type": "string",
"description": "The region."
},
"availabilityZone": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

availabilityZone

What is this set to in a query for regional availability?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If it's set to regional availability, the availabilityZone property is not displayed.

Example:
"availabilityZones": false,
"placementScores": [
{
"sku": "Standard_D32ads_v6",
"region": "westcentralus",
"score": "Low",
"isQuotaAvailable": false
},
...
]

"type": "string",
"description": "The availability region."

@mentat9 mentat9 May 1, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The availability region

Reconcile property name and description. #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated

},
"score": {
"type": "string",
"description": "The placement score."

@mentat9 mentat9 May 1, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"The placement score."

More information about the meaning of this property would be very helpful for clients. #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated

},
"isQuotaAvailable": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isQuotaAvailable

Consider using enum, maybe something like placementAvailability: { InsufficientQuota, Available }, or something better you come up with.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above - adding new API version to an already existing API that has been rolled out in private versions

"type": "boolean",
"description": "Whether the desired quota is available."
}
},
"description": "The spot placement score for sku/region/zone combination."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"api-version": "2025-06-01",
"spotPlacementScoresInput": {
"desiredLocations": [
"eastus",
"eastus2"
],
"desiredSizes": [
{
"sku": "Standard_D2_v2"
}
],
"desiredCount": 1,
"availabilityZones": true
}
},
"responses": {
"200": {
"body": {
"desiredLocations": [
"eastus",
"eastus2"
],
"desiredSizes": [
{
"sku": "Standard_D2_v2"
}
],
"desiredCount": 1,
"availabilityZones": true,
"placementScores": [
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "1",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "2",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "3",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "1",
"score": "DataNotFoundOrStale",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "2",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "3",
"score": "High",
"isQuotaAvailable": true
}
]
},
"headers": {
"x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f",
"location": "https://management.azure.com/subscriptions/be23ca13-8eb4-4d0e-be10-b00451817956/providers/Microsoft.Compute/locations/eastus/placementScores/spot/generate?api-version=2025-06-01"
Comment thread
Elina-L marked this conversation as resolved.
Outdated
}
}
}
}
Loading