diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp new file mode 100644 index 000000000000..303e184d0d43 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/ComputeDiagnosticBase.tsp @@ -0,0 +1,57 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Compute; +/** + * Contains metadata of a diagnostic type + */ +@singleton("spot") +@subscriptionResource +@parentResource(SubscriptionLocationResource) +model ComputeDiagnosticBase + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = ComputeDiagnosticBase, + KeyName = "placementScore", + SegmentName = "placementScores", + NamePattern = "" + >; +} + +@armResourceOperations +interface ComputeDiagnosticBases { + /** + * Gets Spot Placement Scores metadata. + */ + get is ArmResourceRead< + ComputeDiagnosticBase, + BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters + >; + + /** + * Generates placement scores for Spot VM skus. + */ + @action("generate") + post is ArmResourceActionSync< + ComputeDiagnosticBase, + SpotPlacementScoresInput, + ArmResponse, + BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters + >; +} + +@@doc(ComputeDiagnosticBase.name, ""); +@@doc(ComputeDiagnosticBase.properties, + "Contains additional properties of a diagnostic" +); +@@doc(ComputeDiagnosticBases.post::parameters.body, + "SpotPlacementScores object supplied in the body of the Post spot placement scores operation." +); diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/back-compatible.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/back-compatible.tsp new file mode 100644 index 000000000000..29ac036329d3 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/back-compatible.tsp @@ -0,0 +1,14 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.Compute; + +@@clientLocation(ComputeDiagnosticBases.get, "SpotPlacementScores"); +@@clientLocation(ComputeDiagnosticBases.post, "SpotPlacementScores"); +@@clientName(ComputeDiagnosticBases.post::parameters.body, + "spotPlacementScoresInput" +); +@@clientName(SpotPlacementScoresResponse, + "SpotPlacementScoresResult", + "csharp" +); diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GenerateSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GenerateSpotPlacementScores.json new file mode 100644 index 000000000000..2a562f0b36ef --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GenerateSpotPlacementScores.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2025-06-05", + "location": "eastus", + "spotPlacementScoresInput": { + "availabilityZones": true, + "desiredCount": 1, + "desiredLocations": [ + "eastus", + "eastus2" + ], + "desiredSizes": [ + { + "sku": "Standard_D2_v2" + } + ] + }, + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "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" + } + } + }, + "operationId": "SpotPlacementScores_Post", + "title": "Returns spot VM placement scores for given configurations." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GetSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GetSpotPlacementScores.json new file mode 100644 index 000000000000..f5c61a673441 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/GetSpotPlacementScores.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2025-06-05", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "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" + } + } + }, + "operationId": "SpotPlacementScores_Get", + "title": "Gets the metadata of Spot Placement Scores." +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MaximumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MaximumSet_Gen.json new file mode 100644 index 000000000000..51091a8209bc --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-06-05" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "origin": "aaaaa", + "name": "aaaaaaaaaaaa", + "display": { + "operation": "aaaaaaaaaaaaaaaaaaaaaa", + "resource": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "description": "aaaaaaaaaaaaaaaaaaaaaa", + "provider": "aaaaaaaaaaaaaaaaaa" + } + } + ] + } + } + }, + "operationId": "Operations_List", + "title": "Operations_List_MaximumSet_Gen" +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MinimumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MinimumSet_Gen.json new file mode 100644 index 000000000000..1d3b6ef65ed0 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/examples/2025-06-05/Operations_List_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2025-06-05" + }, + "responses": { + "200": { + "body": {} + } + }, + "operationId": "Operations_List", + "title": "Operations_List_MinimumSet_Gen" +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp new file mode 100644 index 000000000000..c9233fec6c63 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/main.tsp @@ -0,0 +1,44 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.10.14 + * Date: 2025-07-18T08:45:04.778Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "./models.tsp"; +import "./ComputeDiagnosticBase.tsp"; +import "./back-compatible.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * The Compute Recommender Resource Provider Client + */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@armProviderNamespace +@service(#{ title: "ComputeRecommenderResourceProviderClient" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v6) +namespace Microsoft.Compute; + +interface Operations extends Azure.ResourceManager.Operations {} + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-06-05 API version. + */ + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + v2025_06_05: "2025-06-05", +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp new file mode 100644 index 000000000000..f3cd277511ee --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/models.tsp @@ -0,0 +1,119 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.Compute; + +/** + * Contains additional properties of a diagnostic + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "This resource does not involve long-running operations and does not require provisioningState." +model DiagnosticProperties { + /** + * Describes what are the supported resource types for a diagnostic. + */ + supportedResourceTypes?: string[]; +} + +/** + * SpotPlacementScores API Input. + */ +model SpotPlacementScoresInput { + /** + * The desired regions + */ + desiredLocations?: string[]; + + /** + * The desired virtual machine SKU sizes. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "ResourceSize is a non-resource data structure representing SKU metadata; it is not individually addressable and does not require identifiers." + desiredSizes?: ResourceSize[]; + + /** + * Desired instance count per region/zone based on the scope. + */ + desiredCount?: int32; + + /** + * Defines if the scope is zonal or regional. + */ + availabilityZones?: boolean; +} + +/** + * SpotPlacementRecommender API response. + */ +model ResourceSize { + /** + * The resource's CRP virtual machine SKU size. + */ + sku?: string; +} + +/** + * SpotPlacementScores API response. + */ +model SpotPlacementScoresResponse { + /** + * The desired regions + */ + desiredLocations?: string[]; + + /** + * The desired virtual machine SKU sizes. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "ResourceSize is a non-resource data structure representing SKU metadata; it is not individually addressable and does not require identifiers." + desiredSizes?: ResourceSize[]; + + /** + * Desired instance count per region/zone based on the scope. + */ + desiredCount?: int32; + + /** + * Defines if the scope is zonal or regional. + */ + availabilityZones?: boolean; + + /** + * 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. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "PlacementScore is a non-resource data model used for telemetry and scoring; items are not uniquely addressable and do not require x-ms-identifiers." + placementScores?: PlacementScore[]; +} + +/** + * The spot placement score for sku/region/zone combination. + */ +model PlacementScore { + /** + * The resource's CRP virtual machine SKU size. + */ + sku?: string; + + /** + * The region. + */ + region?: string; + + /** + * The availability zone. + */ + availabilityZone?: string; + + /** + * 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. + */ + score?: string; + + /** + * Whether the desired quota is available. + */ + isQuotaAvailable?: boolean; +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md index f2a2b348d905..e5e91955f0c4 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/readme.md @@ -25,11 +25,11 @@ To see additional help and options, run: These are the global settings for the AzureComputeRecommenderClient API. ``` yaml !$(python) || !$(track2) -title: AzureComputeRecommenderManagementClient +title: ComputeRecommenderResourceProviderClient ``` ``` yaml -description: Azure Compute Recommender Client +description: The Compute Recommender Resource Provider Client openapi-type: arm tag: package-2025-06-05 diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/RecommenderRP.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/RecommenderRP.json index 648bab9cb834..21d1e2039bac 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/RecommenderRP.json +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/RecommenderRP.json @@ -1,18 +1,23 @@ { "swagger": "2.0", "info": { - "title": "AzureComputeRecommenderManagementClient", - "description": "Azure Compute Recommender Client", - "version": "2025-06-05" + "title": "ComputeRecommenderResourceProviderClient", + "version": "2025-06-05", + "description": "The Compute Recommender Resource Provider Client", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] }, - "host": "management.azure.com", "schemes": [ "https" ], - "consumes": [ + "host": "management.azure.com", + "produces": [ "application/json" ], - "produces": [ + "consumes": [ "application/json" ], "security": [ @@ -25,42 +30,89 @@ "securityDefinitions": { "azure_auth": { "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "ComputeDiagnosticBases" + } + ], "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot": { + "/providers/Microsoft.Compute/operations": { "get": { + "operationId": "Operations_List", "tags": [ - "placementScores_spot" + "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/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/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter" + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter" } ], "responses": { "200": { - "description": "Success", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ComputeDiagnosticBase" } }, "default": { - "description": "Error response describing why the get call failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } @@ -75,40 +127,40 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate": { "post": { + "operationId": "SpotPlacementScores_Post", "tags": [ - "spotPlacementScores" + "ComputeDiagnosticBases" ], - "operationId": "SpotPlacementScores_Post", "description": "Generates placement scores for Spot VM skus.", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter" + "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$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" - }, - "description": "SpotPlacementScores object supplied in the body of the Post spot placement scores operation." + } } ], "responses": { "200": { - "description": "Success", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/SpotPlacementScoresResponse" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } @@ -124,11 +176,12 @@ }, "definitions": { "ComputeDiagnosticBase": { - "description": "Contains metadata of a diagnostic type", "type": "object", + "description": "Contains metadata of a diagnostic type", "properties": { "properties": { - "$ref": "#/definitions/DiagnosticProperties" + "$ref": "#/definitions/DiagnosticProperties", + "description": "Contains additional properties of a diagnostic" } }, "allOf": [ @@ -138,34 +191,71 @@ ] }, "DiagnosticProperties": { - "description": "Contains additional properties of a diagnostic", "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" - }, - "description": "Describes what are the supported resource types for a diagnostic." + } + } + } + }, + "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." } } }, "SpotPlacementScoresInput": { "type": "object", + "description": "SpotPlacementScores API Input.", "properties": { "desiredLocations": { "type": "array", + "description": "The desired regions", "items": { "type": "string" - }, - "description": "The desired regions" + } }, "desiredSizes": { "type": "array", + "description": "The desired virtual machine SKU sizes.", "items": { "$ref": "#/definitions/ResourceSize" - }, - "description": "The desired resource SKUs." + } }, "desiredCount": { "type": "integer", @@ -176,25 +266,25 @@ "type": "boolean", "description": "Defines if the scope is zonal or regional." } - }, - "description": "SpotPlacementScores API Input." + } }, "SpotPlacementScoresResponse": { "type": "object", + "description": "SpotPlacementScores API response.", "properties": { "desiredLocations": { "type": "array", + "description": "The desired regions", "items": { "type": "string" - }, - "description": "The desired regions" + } }, "desiredSizes": { "type": "array", + "description": "The desired virtual machine SKU sizes.", "items": { "$ref": "#/definitions/ResourceSize" - }, - "description": "The desired resource SKUs." + } }, "desiredCount": { "type": "integer", @@ -207,49 +297,13 @@ }, "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" - }, - "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": { - "type": "string", - "description": "The region." - }, - "availabilityZone": { - "type": "string", - "description": "The availability region." - }, - "score": { - "type": "string", - "description": "The placement score." - }, - "isQuotaAvailable": { - "type": "boolean", - "description": "Whether the desired quota is available." + } } - }, - "description": "The spot placement score for sku/region/zone combination." + } } - } + }, + "parameters": {} } diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GenerateSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GenerateSpotPlacementScores.json index f6f4f9209f59..2a562f0b36ef 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GenerateSpotPlacementScores.json +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GenerateSpotPlacementScores.json @@ -1,9 +1,10 @@ { "parameters": { - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "location": "eastus", "api-version": "2025-06-05", + "location": "eastus", "spotPlacementScoresInput": { + "availabilityZones": true, + "desiredCount": 1, "desiredLocations": [ "eastus", "eastus2" @@ -12,14 +13,15 @@ { "sku": "Standard_D2_v2" } - ], - "desiredCount": 1, - "availabilityZones": true - } + ] + }, + "subscriptionId": "00000000-0000-0000-0000-000000000000" }, "responses": { "200": { "body": { + "availabilityZones": true, + "desiredCount": 1, "desiredLocations": [ "eastus", "eastus2" @@ -29,57 +31,57 @@ "sku": "Standard_D2_v2" } ], - "desiredCount": 1, - "availabilityZones": true, "placementScores": [ { - "sku": "Standard_D2_v2", - "region": "eastus", "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus", "score": "High", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" }, { - "sku": "Standard_D2_v2", - "region": "eastus", "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus", "score": "High", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" }, { - "sku": "Standard_D2_v2", - "region": "eastus", "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus", "score": "High", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" }, { - "sku": "Standard_D2_v2", - "region": "eastus2", "availabilityZone": "1", + "isQuotaAvailable": true, + "region": "eastus2", "score": "DataNotFoundOrStale", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" }, { - "sku": "Standard_D2_v2", - "region": "eastus2", "availabilityZone": "2", + "isQuotaAvailable": true, + "region": "eastus2", "score": "High", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" }, { - "sku": "Standard_D2_v2", - "region": "eastus2", "availabilityZone": "3", + "isQuotaAvailable": true, + "region": "eastus2", "score": "High", - "isQuotaAvailable": true + "sku": "Standard_D2_v2" } ] }, "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-05" + "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" } } - } + }, + "operationId": "SpotPlacementScores_Post", + "title": "Returns spot VM placement scores for given configurations." } diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GetSpotPlacementScores.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GetSpotPlacementScores.json index 125661ce2c8a..f5c61a673441 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GetSpotPlacementScores.json +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/GetSpotPlacementScores.json @@ -1,24 +1,26 @@ { "parameters": { - "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2025-06-05", "location": "eastus", - "api-version": "2025-06-05" + "subscriptionId": "00000000-0000-0000-0000-000000000000" }, "responses": { "200": { - "headers": { - "x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1" - }, "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/placementScores/spot?api-version=2025-06-05", "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" } } - } + }, + "operationId": "SpotPlacementScores_Get", + "title": "Gets the metadata of Spot Placement Scores." } diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MaximumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MaximumSet_Gen.json new file mode 100644 index 000000000000..51091a8209bc --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-06-05" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "origin": "aaaaa", + "name": "aaaaaaaaaaaa", + "display": { + "operation": "aaaaaaaaaaaaaaaaaaaaaa", + "resource": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "description": "aaaaaaaaaaaaaaaaaaaaaa", + "provider": "aaaaaaaaaaaaaaaaaa" + } + } + ] + } + } + }, + "operationId": "Operations_List", + "title": "Operations_List_MaximumSet_Gen" +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MinimumSet_Gen.json b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MinimumSet_Gen.json new file mode 100644 index 000000000000..1d3b6ef65ed0 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/stable/2025-06-05/examples/Operations_List_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2025-06-05" + }, + "responses": { + "200": { + "body": {} + } + }, + "operationId": "Operations_List", + "title": "Operations_List_MinimumSet_Gen" +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/tspconfig.yaml b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/tspconfig.yaml new file mode 100644 index 000000000000..5b97e4ba1071 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/RecommenderRP/tspconfig.yaml @@ -0,0 +1,50 @@ +parameters: + "service-dir": + default: "sdk/computerecommender" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + omit-unreachable-types: true + emitter-output-dir: "{project-root}" + azure-resource-provider-folder: "resource-manager" + output-file: "{version-status}/{version}/RecommenderRP.json" + examples-dir: "{project-root}/examples" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + "@azure-tools/typespec-csharp": + flavor: azure + package-dir: "Azure.ResourceManager.ComputeRecommender" + clear-output-folder: true + model-namespace: true + namespace: "{package-dir}" + "@azure-tools/typespec-python": + package-dir: "azure-mgmt-computerecommender" + namespace: "azure.mgmt.computerecommender" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + package-dir: "azure-resourcemanager-computerecommender" + namespace: "com.azure.resourcemanager.computerecommender" + service-name: "Compute Recommender" + flavor: azure + "@azure-tools/typespec-ts": + package-dir: "arm-computerecommender" + flavor: azure + experimental-extensible-enums: true + package-details: + name: "@azure/arm-computerecommender" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/computerecommender" + package-dir: "armcomputerecommender" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager"