Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2fecf94
Splitting RecommenderRP to individual package, initial commit
Elina-L Jul 17, 2025
816611c
Tsp Migration
melina5656 Jul 18, 2025
42308ee
Removing -only tag and unneeded suppression
Elina-L Jul 18, 2025
78aed1a
Update types.json path
Elina-L Jul 18, 2025
c933176
Run prettier on example files
Elina-L Jul 18, 2025
61b6c9f
Run prettier
Elina-L Jul 18, 2025
c0c4b1a
Revery noop change to Microsoft.Compute/suppressions.yaml
Elina-L Jul 18, 2025
055981d
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Jul 18, 2025
ed41c7b
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Jul 19, 2025
c66da6f
Modify tspconfig and title
melina5656 Jul 21, 2025
e6806ad
Remove Code generation section
Elina-L Jul 21, 2025
eedbd18
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Jul 21, 2025
5172023
Merge branch 'wenxliu/SplitDiagnosticRPToIndividualPackageNew' of htt…
Elina-L Jul 21, 2025
1a16c11
Update tspconfig.yaml
weidongxu-microsoft Jul 21, 2025
a08e32b
Remove unused models
melina5656 Jul 21, 2025
6c589eb
Update tspconfig.yaml naming to computerecommender
Elina-L Jul 21, 2025
5819dd8
Merge branch 'wenxliu/SplitDiagnosticRPToIndividualPackageNew' of htt…
Elina-L Jul 21, 2025
7b7d922
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Jul 21, 2025
cfc05d2
Update tspconfig.yaml
weidongxu-microsoft Jul 21, 2025
478fdee
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Jul 23, 2025
d6fc738
Revert change to readme.md
Elina-L Jul 23, 2025
72310cb
Increment main.tsp common types version to v6, change RecommenderRP.j…
Elina-L Jul 23, 2025
aa54174
Run tsv on files
Elina-L Jul 23, 2025
3624032
add clientName
melina5656 Jul 23, 2025
65e7ae7
Merge branch 'wenxliu/SplitDiagnosticRPToIndividualPackageNew' of htt…
melina5656 Jul 23, 2025
de73fb0
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
mikeharder Jul 24, 2025
bf28f18
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
qiaozha Jul 25, 2025
eb0e718
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
qiaozha Aug 1, 2025
7734bd3
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
qiaozha Aug 4, 2025
5d32435
Update specification/compute/resource-manager/Microsoft.Compute/Recom…
Elina-L Aug 4, 2025
0f3ca9c
Remove some suppressions, remove some redundant imports
Elina-L Aug 4, 2025
08bd8f5
Adding Operations_List to RecommenderRP.json and also adding Operatio…
Elina-L Aug 5, 2025
425dac5
Remove examples from operations_list and also update references to ty…
Elina-L Aug 5, 2025
5d4c177
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 5, 2025
dc63870
Adding computeRPCommonExamples/Operations_List_MaximumSet_Gen compute…
Elina-L Aug 5, 2025
dd10a77
Update API version to 2025-06-05
Elina-L Aug 5, 2025
fe2b398
Readd missing parenthesis
Elina-L Aug 5, 2025
6d02962
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 5, 2025
29d016e
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 6, 2025
deaad00
Readding no-openapi suppression back to ComputeDiagnosticBase.tsp
Elina-L Aug 6, 2025
3a3e716
Merge branch 'wenxliu/SplitDiagnosticRPToIndividualPackageNew' of htt…
Elina-L Aug 6, 2025
7781955
Readd provisioning state suppression in models.tsp
Elina-L Aug 6, 2025
b261898
Remove the operationId decorator and run the TSP compile command
melina5656 Aug 6, 2025
a8ec7f5
Update arm-resource-provisioning-state Fix me justification
Elina-L Aug 6, 2025
83dd219
Adding FIXME justifications for missing-x-ms-identifiers suppressions…
Elina-L Aug 6, 2025
6f05e4e
Readd examples for operations_list
Elina-L Aug 6, 2025
a3dc356
Run npm and npx on RecommenderRP.json
Elina-L Aug 6, 2025
11f0535
Revert "Run npm and npx on RecommenderRP.json"
Elina-L Aug 6, 2025
c1d27d7
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 6, 2025
be9a4b4
Modify the example file to the correct folder
melina5656 Aug 7, 2025
332ee4b
Move Operations_List_MaximumSet_Gen.json and Operations_List_MinimumS…
Elina-L Aug 7, 2025
ad5aeee
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 7, 2025
6054f4e
Move Operations_List_MaximumSet_Gen.json and Operations_List_MinimumS…
Elina-L Aug 7, 2025
2022712
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 7, 2025
99d7620
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 8, 2025
f3359a9
Merge branch 'main' into wenxliu/SplitDiagnosticRPToIndividualPackageNew
Elina-L Aug 8, 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
Copy link
Member

Choose a reason for hiding this comment

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

Nit: could we rename this file to routes.tsp? The casing doesnt match the other files

Copy link
Member

Choose a reason for hiding this comment

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

We can't. This file contains resource operations.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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<DiagnosticProperties> {
...ResourceNameParameter<
Resource = ComputeDiagnosticBase,
KeyName = "placementScore",
SegmentName = "placementScores",
NamePattern = ""
>;
}

@armResourceOperations
interface ComputeDiagnosticBases {
/**
* Gets Spot Placement Scores metadata.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("SpotPlacementScores_Get")
get is ArmResourceRead<
ComputeDiagnosticBase,
BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters
>;

/**
* Generates placement scores for Spot VM skus.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("generate")
@operationId("SpotPlacementScores_Post")
post is ArmResourceActionSync<
ComputeDiagnosticBase,
SpotPlacementScoresInput,
ArmResponse<SpotPlacementScoresResponse>,
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."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using Microsoft.Compute;

@@clientName(ComputeDiagnosticBases.post::parameters.body,
"spotPlacementScoresInput"
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the same example file under two different directories.

Copy link
Member

Choose a reason for hiding this comment

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

@gary-x-li the examples under RecommenderRP folder are for TypeSpec, but the examples within each RecommenderRP/{version-status} folder is for swagger, the original intention is that we will have some canonical expression of the example in TypeSpec, but the design has not yet been finalized yet.
There's an issue in TypeSpec side that are discussing this Azure/typespec-azure#2824

"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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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 "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
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;
/**
* Azure Compute Recommender 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: "AzureComputeRecommenderManagementClient" })
@versioned(Versions)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
namespace Microsoft.Compute;

/**
* 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_1)
v2025_06_05: "2025-06-05",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
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" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
model DiagnosticProperties {
/**
* Describes what are the supported resource types for a diagnostic.
*/
supportedResourceTypes?: string[];
}

/**
* Common fields that are returned in the response for all Azure Resource Manager resources
*/
model Resource {
/**
* Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
*/
@visibility(Lifecycle.Read)
id?: Azure.Core.armResourceIdentifier;

/**
* The name of the resource
*/
@visibility(Lifecycle.Read)
name?: string;

/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*/
@visibility(Lifecycle.Read)
type?: string;

/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
@visibility(Lifecycle.Read)
systemData?: SystemData;
}

/**
* 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" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
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" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
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" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
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;
}
Loading
Loading