Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
83672a1
create new version folder with old version files
jefpa-microsoft Jun 27, 2025
53cdd31
Add capacity block api
jefpa-microsoft Jun 27, 2025
af74b12
update version
jefpa-microsoft Jun 27, 2025
0fb2d18
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jun 27, 2025
72393d0
fix
jefpa-microsoft Jun 27, 2025
1f98956
fix
jefpa-microsoft Jun 27, 2025
2719301
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jun 27, 2025
a710c44
fix prettier
jefpa-microsoft Jun 28, 2025
da43509
Merge branch 'capacityblocksapi' of https://github.com/jefpa-microsof…
jefpa-microsoft Jun 28, 2025
9747ba1
fix
jefpa-microsoft Jun 28, 2025
e1b2947
fix
jefpa-microsoft Jun 28, 2025
ab71274
fix
jefpa-microsoft Jun 28, 2025
84125d2
update tag
jefpa-microsoft Jun 28, 2025
dbc1672
replace v5 types with v6
jefpa-microsoft Jun 28, 2025
b1dfb8d
try fix sdk generation error
jefpa-microsoft Jun 28, 2025
9032dbd
revert changes
jefpa-microsoft Jun 28, 2025
aefa614
update odata filter example and description
jefpa-microsoft Jun 29, 2025
6919585
address Swagger Lint issue
jefpa-microsoft Jun 29, 2025
c319a00
address Swagger Lint issue
jefpa-microsoft Jun 29, 2025
069d625
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jun 30, 2025
09473a8
address comment
jefpa-microsoft Jun 30, 2025
b6e06de
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jun 30, 2025
8aa9be5
Merge branch 'capacityblocksapi' of https://github.com/jefpa-microsof…
jefpa-microsoft Jun 30, 2025
09a3698
fix
jefpa-microsoft Jun 30, 2025
d4f26b5
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jun 30, 2025
e831c4a
minor fix
jefpa-microsoft Jun 30, 2025
3a76fe0
Merge branch 'capacityblocksapi' of https://github.com/jefpa-microsof…
jefpa-microsoft Jun 30, 2025
3eaa3ff
fix
jefpa-microsoft Jun 30, 2025
94eea62
clean up
jefpa-microsoft Jun 30, 2025
cf01c8c
fix casing in api url
jefpa-microsoft Jul 2, 2025
acaa676
Merge branch 'main' into capacityblocksapi
sgovindaraju-github Jul 3, 2025
d3938b5
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jul 4, 2025
8dec899
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jul 10, 2025
6f3e342
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jul 18, 2025
0f22d7f
merge main
jefpa-microsoft Aug 5, 2025
ff04124
Move capacity block API to RecommenderRP
jefpa-microsoft Aug 5, 2025
02ea160
fix
jefpa-microsoft Aug 5, 2025
7bae327
Add location based get capacity block api
jefpa-microsoft Aug 5, 2025
c3eab85
fix version
jefpa-microsoft Aug 5, 2025
a26665c
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 5, 2025
06471f7
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 5, 2025
6334cbb
update suppression for preview version
jefpa-microsoft Aug 5, 2025
39768a9
Merge branch 'capacityblocksapi' of https://github.com/jefpa-microsof…
jefpa-microsoft Aug 5, 2025
87ab951
move capacity block properties to property bag
jefpa-microsoft Aug 6, 2025
f558dd3
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 6, 2025
837097c
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 7, 2025
8fc4223
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 11, 2025
4643973
Update PR with changes merged to master recently
jefpa-microsoft Aug 13, 2025
ddde3be
Convert swagger to typespec
jefpa-microsoft Aug 13, 2025
306d174
fix prettier
jefpa-microsoft Aug 13, 2025
89c3dbd
fix prettier
jefpa-microsoft Aug 13, 2025
6ffaca6
revert changes generated by typespec converter
jefpa-microsoft Aug 25, 2025
3a084f2
revert suppression
jefpa-microsoft Aug 25, 2025
cfd0c51
update readme.md
jefpa-microsoft Aug 25, 2025
f027876
Add Capacity Block APIs to tsp files and compile
jefpa-microsoft Aug 28, 2025
002a50c
fix route
jefpa-microsoft Aug 29, 2025
f30191a
revert change on RecommenderRP.json by typespec validation
jefpa-microsoft Aug 29, 2025
d3028ea
re-generate RecommenderRP.json by typespec
jefpa-microsoft Aug 29, 2025
a26aa37
update operation id to match with swagger and examples
jefpa-microsoft Aug 29, 2025
f9986d4
Add a few missing info to tsp file
jefpa-microsoft Aug 29, 2025
54e3756
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Aug 29, 2025
a866c38
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Sep 2, 2025
ab93e85
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Sep 25, 2025
9270636
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Oct 9, 2025
a53eba5
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Nov 9, 2025
6f3757b
Merge branch 'main' into capacityblocksapi
jefpa-microsoft Jan 28, 2026
25d8d91
Merge branch 'Azure:main' into capacityblocksapi
jefpa-microsoft Jan 28, 2026
a73efee
Remove invalid dependency in main.tsp
jefpa-microsoft Jan 28, 2026
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
@@ -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;
/**
Expand Down Expand Up @@ -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;
}
>;
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"operationId": "Operations_List",
"parameters": {
"api-version": "2025-06-05-preview"
},
"title": "Operations_List_MinimumSet_Gen",
"responses": {
"200": {
"body": {}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Loading
Loading