diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp index 092ca2d91b46..24298a9db9ef 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp @@ -1,13 +1,11 @@ -import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-azure-resource-manager"; -import "@typespec/openapi"; -import "@typespec/rest"; import "./models.tsp"; +import "@typespec/openapi"; -using TypeSpec.Rest; using Azure.ResourceManager; using TypeSpec.Http; using TypeSpec.OpenAPI; +using TypeSpec.Rest; +using Versioning; namespace Microsoft.Compute; /** @@ -50,3 +48,57 @@ interface ComputeDiagnosticBases { @@doc(ComputeDiagnosticBases.post::parameters.body, "SpotPlacementScores object supplied in the body of the Post spot placement scores operation." ); + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +@armResourceOperations +@added(Versions.v2025_06_05_preview) +interface CapacityBlocksOperationGroup { + /** + * Get available capacity blocks. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("CapacityBlocks_Get") + @autoRoute + @get + @action("capacityBlocks") + @list + list is ArmProviderActionSync< + Response = CapacityBlocks, + Scope = SubscriptionActionScope, + Parameters = { + /** + * An OData filter expression that describes a subset of capacity blocks to return. Mandatory parameters are sku, capacity, durationhours, start-date-range and end-date-range. Optional parameters are zone and location. The supported operator is eq. Example: $filter = sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-06-25T00:00:00-07:00 and end-date-range eq 2025-06-27T00:00:00-07:00 and durationhours eq 24 and zone eq 1 and location eq westus + */ + @query("$filter") + $filter: string; + } + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +@armResourceOperations +@added(Versions.v2025_06_05_preview) +interface RegionalCapacityBlocksOperationGroup { + /** + * Get available capacity blocks by location. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("RegionalCapacityBlocks_Get") + @autoRoute + @get + @action("capacityBlocks") + @list + list is ArmProviderActionSync< + Response = CapacityBlocks, + Scope = SubscriptionActionScope, + Parameters = { + ...LocationParameter; + + /** + * An OData filter expression that describes a subset of capacity blocks to return. Mandatory parameters are sku, capacity, durationhours, start-date-range and end-date-range. Optional parameters are zone. The supported operator is eq. Example: $filter = sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-06-25T00:00:00-07:00 and end-date-range eq 2025-06-27T00:00:00-07:00 and durationhours eq 24 and zone eq 1 + */ + @query("$filter") + $filter: string; + } + >; +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GenerateSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GenerateSpotPlacementScores.json new file mode 100644 index 000000000000..64801c4d5229 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GenerateSpotPlacementScores.json @@ -0,0 +1,87 @@ +{ + "operationId": "SpotPlacementScores_Post", + "parameters": { + "api-version": "2025-06-05-preview", + "location": "eastus", + "spotPlacementScoresInput": { + "availabilityZones": true, + "desiredCount": 1, + "desiredLocations": [ + "eastus", + "eastus2" + ], + "desiredSizes": [ + { + "sku": "Standard_D2_v2" + } + ] + }, + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "title": "Returns spot VM placement scores for given configurations.", + "responses": { + "200": { + "body": { + "availabilityZones": true, + "desiredCount": 1, + "desiredLocations": [ + "eastus", + "eastus2" + ], + "desiredSizes": [ + { + "sku": "Standard_D2_v2" + } + ], + "placementScores": [ + { + "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "DataNotFoundOrStale", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "High", + "sku": "Standard_D2_v2" + } + ] + }, + "headers": { + "location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/placementScores/spot/generate?api-version=2025-06-05", + "x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f" + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocks.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocks.json new file mode 100644 index 000000000000..10934172348e --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocks.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "$filter": "sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-07-15T00:00:00-07:00 and end-date-range eq 2025-07-21T00:00:00-07:00 and durationhours eq 24 and zone eq 1 and location eq eastus", + "api-version": "2025-06-05-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "37522560-0aee-4258-8146-de5db0ab97bc", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/37522560-0aee-4258-8146-de5db0ab97bc", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-17T12:00:00+00:00", + "start": "2025-07-16T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + }, + { + "name": "2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-20T12:00:00+00:00", + "start": "2025-07-19T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + } + ] + } + } + }, + "operationId": "CapacityBlocks_Get", + "title": "Returns list of capacity block objects." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocksByLocation.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocksByLocation.json new file mode 100644 index 000000000000..8d97cfe21adf --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetCapacityBlocksByLocation.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "$filter": "sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-07-15T00:00:00-07:00 and end-date-range eq 2025-07-21T00:00:00-07:00 and durationhours eq 24 and zone eq 1", + "api-version": "2025-06-05-preview", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "37522560-0aee-4258-8146-de5db0ab97bc", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/37522560-0aee-4258-8146-de5db0ab97bc", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-17T12:00:00+00:00", + "start": "2025-07-16T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + }, + { + "name": "2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-20T12:00:00+00:00", + "start": "2025-07-19T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + } + ] + } + } + }, + "operationId": "RegionalCapacityBlocks_Get", + "title": "Returns list of capacity block objects." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetSpotPlacementScores.json new file mode 100644 index 000000000000..7ba7afc94fe7 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/GetSpotPlacementScores.json @@ -0,0 +1,26 @@ +{ + "operationId": "SpotPlacementScores_Get", + "parameters": { + "api-version": "2025-06-05-preview", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "title": "Gets the metadata of Spot Placement Scores.", + "responses": { + "200": { + "body": { + "name": "spotPlacementScores", + "type": "Microsoft.Compute/placementScores", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/placementScores/spot?api-version=2025-06-05", + "properties": { + "supportedResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ] + } + }, + "headers": { + "x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1" + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MaximumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MaximumSet_Gen.json new file mode 100644 index 000000000000..5b0489ac08b0 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "operationId": "Operations_List", + "parameters": { + "api-version": "2025-06-05-preview" + }, + "title": "Operations_List_MaximumSet_Gen", + "responses": { + "200": { + "body": { + "value": [ + { + "name": "aaaaaaaaaaaa", + "display": { + "description": "aaaaaaaaaaaaaaaaaaaaaa", + "operation": "aaaaaaaaaaaaaaaaaaaaaa", + "provider": "aaaaaaaaaaaaaaaaaa", + "resource": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "origin": "aaaaa" + } + ] + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MinimumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MinimumSet_Gen.json new file mode 100644 index 000000000000..9225be0ed968 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05-preview/Operations_List_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "operationId": "Operations_List", + "parameters": { + "api-version": "2025-06-05-preview" + }, + "title": "Operations_List_MinimumSet_Gen", + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp index 50eaea17b246..a846d44b27d0 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp @@ -39,4 +39,9 @@ enum Versions { * The 2025-06-05 API version. */ v2025_06_05: "2025-06-05", + + /** + * The 2025-06-05-preview API version. + */ + v2025_06_05_preview: "2025-06-05-preview", } diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp index f3cd277511ee..d1ca751e9a89 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp @@ -1,9 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using Versioning; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -117,3 +120,67 @@ model PlacementScore { */ isQuotaAvailable?: boolean; } + +/** + * Lists available Capacity Blocks for a subscription. + */ +@added(Versions.v2025_06_05_preview) +model CapacityBlocks is Azure.Core.Page; + +/** + * Capacity block. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" +@added(Versions.v2025_06_05_preview) +model CapacityBlock extends Azure.ResourceManager.CommonTypes.ProxyResource { + /** + * Contains additional properties of a capacity block + */ + properties?: CapacityBlockProperties; +} + +/** + * Contains additional properties of a capacity block + */ +@added(Versions.v2025_06_05_preview) +model CapacityBlockProperties { + /** + * Logical Zone of the Capacity Block + */ + @visibility(Lifecycle.Read) + zone?: int32; + + /** + * Location of the Capacity Block. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + location?: string; + + /** + * SKU of the Capacity Block. + */ + sku?: Azure.ResourceManager.CommonTypes.Sku; + + /** + * Schedule profile of the Capacity Block. + */ + scheduleProfile?: ScheduleProfile; +} + +/** + * Schedule of Capacity Block Reservation. + */ +@added(Versions.v2025_06_05_preview) +model ScheduleProfile { + /** + * Start DateTime of Capacity Block reservation. + */ + @visibility(Lifecycle.Read) + start?: utcDateTime; + + /** + * End DateTime of Capacity Block Reservation. + */ + @visibility(Lifecycle.Read) + end?: utcDateTime; +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/RecommenderRP.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/RecommenderRP.json new file mode 100644 index 000000000000..9fcafd7cfc53 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/RecommenderRP.json @@ -0,0 +1,492 @@ +{ + "swagger": "2.0", + "info": { + "title": "ComputeRecommenderResourceProviderClient", + "version": "2025-06-05-preview", + "description": "The Compute Recommender Resource Provider Client", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "ComputeDiagnosticBases" + }, + { + "name": "CapacityBlocksOperationGroup" + }, + { + "name": "RegionalCapacityBlocksOperationGroup" + } + ], + "paths": { + "/providers/Microsoft.Compute/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Operations_List_MaximumSet_Gen": { + "$ref": "./examples/Operations_List_MaximumSet_Gen.json" + }, + "Operations_List_MinimumSet_Gen": { + "$ref": "./examples/Operations_List_MinimumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityBlocks": { + "get": { + "operationId": "CapacityBlocks_Get", + "tags": [ + "CapacityBlocksOperationGroup" + ], + "description": "Get available capacity blocks.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "$filter", + "in": "query", + "description": "An OData filter expression that describes a subset of capacity blocks to return. Mandatory parameters are sku, capacity, durationhours, start-date-range and end-date-range. Optional parameters are zone and location. The supported operator is eq. Example: $filter = sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-06-25T00:00:00-07:00 and end-date-range eq 2025-06-27T00:00:00-07:00 and durationhours eq 24 and zone eq 1 and location eq westus", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/CapacityBlocks" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Returns list of capacity block objects.": { + "$ref": "./examples/GetCapacityBlocks.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/capacityBlocks": { + "get": { + "operationId": "RegionalCapacityBlocks_Get", + "tags": [ + "RegionalCapacityBlocksOperationGroup" + ], + "description": "Get available capacity blocks by location.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/LocationParameter" + }, + { + "name": "$filter", + "in": "query", + "description": "An OData filter expression that describes a subset of capacity blocks to return. Mandatory parameters are sku, capacity, durationhours, start-date-range and end-date-range. Optional parameters are zone. The supported operator is eq. Example: $filter = sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-06-25T00:00:00-07:00 and end-date-range eq 2025-06-27T00:00:00-07:00 and durationhours eq 24 and zone eq 1", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/CapacityBlocks" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Returns list of capacity block objects.": { + "$ref": "./examples/GetCapacityBlocksByLocation.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot": { + "get": { + "operationId": "SpotPlacementScores_Get", + "tags": [ + "ComputeDiagnosticBases" + ], + "description": "Gets Spot Placement Scores metadata.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/ComputeDiagnosticBase" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/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": { + "operationId": "SpotPlacementScores_Post", + "tags": [ + "ComputeDiagnosticBases" + ], + "description": "Generates placement scores for Spot VM skus.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter" + }, + { + "name": "spotPlacementScoresInput", + "in": "body", + "description": "SpotPlacementScores object supplied in the body of the Post spot placement scores operation.", + "required": true, + "schema": { + "$ref": "#/definitions/SpotPlacementScoresInput" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/SpotPlacementScoresResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Returns spot VM placement scores for given configurations.": { + "$ref": "./examples/GenerateSpotPlacementScores.json" + } + } + } + } + }, + "definitions": { + "CapacityBlock": { + "type": "object", + "description": "Capacity block.", + "properties": { + "properties": { + "$ref": "#/definitions/CapacityBlockProperties", + "description": "Contains additional properties of a capacity block" + } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + } + ] + }, + "CapacityBlockProperties": { + "type": "object", + "description": "Contains additional properties of a capacity block", + "properties": { + "zone": { + "type": "integer", + "format": "int32", + "description": "Logical Zone of the Capacity Block", + "readOnly": true + }, + "location": { + "type": "string", + "description": "Location of the Capacity Block.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "sku": { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/Sku", + "description": "SKU of the Capacity Block." + }, + "scheduleProfile": { + "$ref": "#/definitions/ScheduleProfile", + "description": "Schedule profile of the Capacity Block." + } + } + }, + "CapacityBlocks": { + "type": "object", + "description": "Lists available Capacity Blocks for a subscription.", + "properties": { + "value": { + "type": "array", + "description": "The CapacityBlock items on this page", + "items": { + "$ref": "#/definitions/CapacityBlock" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "ComputeDiagnosticBase": { + "type": "object", + "description": "Contains metadata of a diagnostic type", + "properties": { + "properties": { + "$ref": "#/definitions/DiagnosticProperties", + "description": "Contains additional properties of a diagnostic" + } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + } + ] + }, + "DiagnosticProperties": { + "type": "object", + "description": "Contains additional properties of a diagnostic", + "properties": { + "supportedResourceTypes": { + "type": "array", + "description": "Describes what are the supported resource types for a diagnostic.", + "items": { + "type": "string" + } + } + } + }, + "PlacementScore": { + "type": "object", + "description": "The spot placement score for sku/region/zone combination.", + "properties": { + "sku": { + "type": "string", + "description": "The resource's CRP virtual machine SKU size." + }, + "region": { + "type": "string", + "description": "The region." + }, + "availabilityZone": { + "type": "string", + "description": "The availability zone." + }, + "score": { + "type": "string", + "description": "A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation." + }, + "isQuotaAvailable": { + "type": "boolean", + "description": "Whether the desired quota is available." + } + } + }, + "ResourceSize": { + "type": "object", + "description": "SpotPlacementRecommender API response.", + "properties": { + "sku": { + "type": "string", + "description": "The resource's CRP virtual machine SKU size." + } + } + }, + "ScheduleProfile": { + "type": "object", + "description": "Schedule of Capacity Block Reservation.", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "Start DateTime of Capacity Block reservation.", + "readOnly": true + }, + "end": { + "type": "string", + "format": "date-time", + "description": "End DateTime of Capacity Block Reservation.", + "readOnly": true + } + } + }, + "SpotPlacementScoresInput": { + "type": "object", + "description": "SpotPlacementScores API Input.", + "properties": { + "desiredLocations": { + "type": "array", + "description": "The desired regions", + "items": { + "type": "string" + } + }, + "desiredSizes": { + "type": "array", + "description": "The desired virtual machine SKU sizes.", + "items": { + "$ref": "#/definitions/ResourceSize" + } + }, + "desiredCount": { + "type": "integer", + "format": "int32", + "description": "Desired instance count per region/zone based on the scope." + }, + "availabilityZones": { + "type": "boolean", + "description": "Defines if the scope is zonal or regional." + } + } + }, + "SpotPlacementScoresResponse": { + "type": "object", + "description": "SpotPlacementScores API response.", + "properties": { + "desiredLocations": { + "type": "array", + "description": "The desired regions", + "items": { + "type": "string" + } + }, + "desiredSizes": { + "type": "array", + "description": "The desired virtual machine SKU sizes.", + "items": { + "$ref": "#/definitions/ResourceSize" + } + }, + "desiredCount": { + "type": "integer", + "format": "int32", + "description": "Desired instance count per region/zone based on the scope." + }, + "availabilityZones": { + "type": "boolean", + "description": "Defines if the scope is zonal or regional." + }, + "placementScores": { + "type": "array", + "description": "A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation.", + "items": { + "$ref": "#/definitions/PlacementScore" + } + } + } + } + }, + "parameters": {} +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GenerateSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GenerateSpotPlacementScores.json new file mode 100644 index 000000000000..64801c4d5229 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GenerateSpotPlacementScores.json @@ -0,0 +1,87 @@ +{ + "operationId": "SpotPlacementScores_Post", + "parameters": { + "api-version": "2025-06-05-preview", + "location": "eastus", + "spotPlacementScoresInput": { + "availabilityZones": true, + "desiredCount": 1, + "desiredLocations": [ + "eastus", + "eastus2" + ], + "desiredSizes": [ + { + "sku": "Standard_D2_v2" + } + ] + }, + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "title": "Returns spot VM placement scores for given configurations.", + "responses": { + "200": { + "body": { + "availabilityZones": true, + "desiredCount": 1, + "desiredLocations": [ + "eastus", + "eastus2" + ], + "desiredSizes": [ + { + "sku": "Standard_D2_v2" + } + ], + "placementScores": [ + { + "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "DataNotFoundOrStale", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "High", + "sku": "Standard_D2_v2" + }, + { + "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus2", + "score": "High", + "sku": "Standard_D2_v2" + } + ] + }, + "headers": { + "location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/placementScores/spot/generate?api-version=2025-06-05", + "x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f" + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocks.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocks.json new file mode 100644 index 000000000000..10934172348e --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocks.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "$filter": "sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-07-15T00:00:00-07:00 and end-date-range eq 2025-07-21T00:00:00-07:00 and durationhours eq 24 and zone eq 1 and location eq eastus", + "api-version": "2025-06-05-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "37522560-0aee-4258-8146-de5db0ab97bc", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/37522560-0aee-4258-8146-de5db0ab97bc", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-17T12:00:00+00:00", + "start": "2025-07-16T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + }, + { + "name": "2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-20T12:00:00+00:00", + "start": "2025-07-19T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + } + ] + } + } + }, + "operationId": "CapacityBlocks_Get", + "title": "Returns list of capacity block objects." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocksByLocation.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocksByLocation.json new file mode 100644 index 000000000000..8d97cfe21adf --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetCapacityBlocksByLocation.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "$filter": "sku eq Standard_D16s_v4 and capacity eq 4 and start-date-range eq 2025-07-15T00:00:00-07:00 and end-date-range eq 2025-07-21T00:00:00-07:00 and durationhours eq 24 and zone eq 1", + "api-version": "2025-06-05-preview", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "37522560-0aee-4258-8146-de5db0ab97bc", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/37522560-0aee-4258-8146-de5db0ab97bc", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-17T12:00:00+00:00", + "start": "2025-07-16T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + }, + { + "name": "2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "type": "capacityBlocks", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/2f8f8aea-1122-4a3b-bbdc-6535daf15dd9", + "properties": { + "location": "eastus", + "scheduleProfile": { + "end": "2025-07-20T12:00:00+00:00", + "start": "2025-07-19T12:00:00+00:00" + }, + "sku": { + "name": "Standard_ND_A100_v4", + "capacity": 4 + }, + "zone": 1 + } + } + ] + } + } + }, + "operationId": "RegionalCapacityBlocks_Get", + "title": "Returns list of capacity block objects." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetSpotPlacementScores.json new file mode 100644 index 000000000000..7ba7afc94fe7 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/GetSpotPlacementScores.json @@ -0,0 +1,26 @@ +{ + "operationId": "SpotPlacementScores_Get", + "parameters": { + "api-version": "2025-06-05-preview", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "title": "Gets the metadata of Spot Placement Scores.", + "responses": { + "200": { + "body": { + "name": "spotPlacementScores", + "type": "Microsoft.Compute/placementScores", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/placementScores/spot?api-version=2025-06-05", + "properties": { + "supportedResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ] + } + }, + "headers": { + "x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1" + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MaximumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MaximumSet_Gen.json new file mode 100644 index 000000000000..5b0489ac08b0 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "operationId": "Operations_List", + "parameters": { + "api-version": "2025-06-05-preview" + }, + "title": "Operations_List_MaximumSet_Gen", + "responses": { + "200": { + "body": { + "value": [ + { + "name": "aaaaaaaaaaaa", + "display": { + "description": "aaaaaaaaaaaaaaaaaaaaaa", + "operation": "aaaaaaaaaaaaaaaaaaaaaa", + "provider": "aaaaaaaaaaaaaaaaaa", + "resource": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "origin": "aaaaa" + } + ] + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MinimumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MinimumSet_Gen.json new file mode 100644 index 000000000000..9225be0ed968 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/preview/2025-06-05-preview/examples/Operations_List_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "operationId": "Operations_List", + "parameters": { + "api-version": "2025-06-05-preview" + }, + "title": "Operations_List_MinimumSet_Gen", + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md index e5e91955f0c4..5573830a48dd 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md @@ -24,11 +24,11 @@ To see additional help and options, run: These are the global settings for the AzureComputeRecommenderClient API. -``` yaml !$(python) || !$(track2) +```yaml !$(python) || !$(track2) title: ComputeRecommenderResourceProviderClient ``` -``` yaml +```yaml description: The Compute Recommender Resource Provider Client openapi-type: arm tag: package-2025-06-05 @@ -51,7 +51,16 @@ suppressions: These settings apply only when `--tag=package-package-2025-06-05` is specified on the command line -``` yaml $(tag) == 'package-2025-06-05' +```yaml $(tag) == 'package-2025-06-05' input-file: -- stable/2025-06-05/RecommenderRP.json + - stable/2025-06-05/RecommenderRP.json +``` + +### Tag: package-2025-06-05-preview + +These settings apply only when `--tag=package-package-2025-06-05-preview` is specified on the command line + +```yaml $(tag) == 'package-2025-06-05-preview' +input-file: + - preview/2025-06-05-preview/RecommenderRP.json ``` diff --git a/specification/compute/resource-manager/Microsoft.Compute/suppressions.yaml b/specification/compute/resource-manager/Microsoft.Compute/suppressions.yaml index 8f00d3085a73..2b342f11ba27 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/suppressions.yaml +++ b/specification/compute/resource-manager/Microsoft.Compute/suppressions.yaml @@ -3,7 +3,4 @@ reason: CDRP service not yet ready to migrate to typespec - tool: TypeSpecRequirement path: DiagnosticRP/preview/2025-02-01-preview/**/*.json - reason: CDRP service not yet ready to migrate to typespec -- tool: TypeSpecRequirement - path: RecommenderRP/stable/2025-06-05/**/*.json - reason: CDRP service not yet ready to migrate to typespec + reason: CDRP service not yet ready to migrate to typespec \ No newline at end of file