Skip to content

Add swagger for CapacityBlocks API #34478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
215d673
Add find capacity block api
jefpa-microsoft May 5, 2025
6671100
add example
jefpa-microsoft May 6, 2025
073aaee
Merge branch 'main' into crsapi
jefpa-microsoft Jun 11, 2025
05473b3
Merge branch 'main' into crsapi
jefpa-microsoft Jun 24, 2025
a54e3ae
create new version
jefpa-microsoft Jun 26, 2025
4f568cb
remove change in old version
jefpa-microsoft Jun 26, 2025
ae31ba6
update capacity block model
jefpa-microsoft Jun 26, 2025
79f59be
update api version
jefpa-microsoft Jun 26, 2025
fdeb27f
update example
jefpa-microsoft Jun 26, 2025
3b86675
keep capacity block api only in the new version
jefpa-microsoft Jun 26, 2025
2b829ef
Merge branch 'main' into crsapi
jefpa-microsoft Jun 26, 2025
34c158f
update example
jefpa-microsoft Jun 26, 2025
d83b24f
Merge branch 'crsapi' of https://github.com/jefpa-microsoft/azure-res…
jefpa-microsoft Jun 26, 2025
8c14b91
Merge branch 'main' into crsapi
jefpa-microsoft Jun 27, 2025
22a3d83
update readme
jefpa-microsoft Jun 27, 2025
8880cd6
Merge branch 'crsapi' of https://github.com/jefpa-microsoft/azure-res…
jefpa-microsoft Jun 27, 2025
af6dcf0
fix
jefpa-microsoft Jun 27, 2025
0fda696
minor fix
jefpa-microsoft Jun 27, 2025
460873e
address validation errors
jefpa-microsoft Jun 27, 2025
633109e
Merge branch 'main' into crsapi
jefpa-microsoft Jun 27, 2025
2a7eb3e
Merge branch 'main' into crsapi
jefpa-microsoft Jun 27, 2025
50eeafa
update example
jefpa-microsoft Jun 27, 2025
c5154e4
Merge branch 'crsapi' of https://github.com/jefpa-microsoft/azure-res…
jefpa-microsoft Jun 27, 2025
d349386
fix
jefpa-microsoft Jun 27, 2025
5d7caf2
fix
jefpa-microsoft Jun 27, 2025
1b1bd86
Merge branch 'main' into crsapi
jefpa-microsoft Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"swagger": "2.0",
"info": {
"title": "ComputeDiagnosticResourceProviderClient",
"description": "The Compute Diagnostic Resource Provider Client",
"version": "2025-06-05-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityblocks": {
"get": {
"tags": [
"capacityBlocks"
],
"operationId": "CapacityBlocks_Get",
"description": "Get available capacity blocks.",
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "value"
},
"parameters": [
{
"$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter"
},
{
"name": "$filter",
"in": "query",
"required": true,
"type": "string",
"description": "An OData filter expression that describes a subset of capacity blocks to return. The parameters that can be filtered are sku, capacity, durationhours, start-date-range, end-date-range, zone and location. The supported operator is eq."
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/CapacityBlocks"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Returns list of capacity block objects.": {
"$ref": "./examples/GetCapacityBlocks.json"
}
}
}
}
},
"definitions": {
"CapacityBlocks": {
"description": "Lists available Capacity Blocks for a subscription.",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/CapacityBlock"
},
"description": "The collection of available Capacity Blocks."
},
"nextLink": {
"type": "string",
"description": "The continuation token."
}
}
},
"CapacityBlock": {
"type": "object",
"description": "Capacity block.",
"x-ms-azure-resource": true,
"properties": {
"id": {
"description": "The id of the capacity block.",
"type": "string",
"readOnly": true
},
"name": {
"description": "The name of the capacity block.",
"type": "string",
"readOnly": true
},
"type": {
"description": "The type.",
"type": "string",
"readOnly": true
},
"zone": {
"description": "Logical Zone in which the block needs to be made available",
"type": "integer",
"format": "int32",
"readOnly": true
},
"location": {
"description": "The location.",
"type": "string",
"x-ms-mutability": [
"create",
"read"
],
"readOnly": true
},
"sku": {
"description": "SKU for Capacity Block.",
"$ref": "#/definitions/Sku"
},
"schedule": {
"description": "Schedule of Capacity Block Reservation.",
"$ref": "#/definitions/Schedule"
}
}
},
"Sku": {
"type": "object",
"description": "SKU for Capacity Block.",
"properties": {
"name": {
"description": "Sku name.",
"type": "string",
"readOnly": true
},
"capacity": {
"description": "Requested Instance count.",
"type": "integer",
"format": "int32",
"readOnly": true
}
}
},
"Schedule": {
"type": "object",
"description": "Schedule of Capacity Block Reservation.",
"properties": {
"startTime": {
"description": "Start DateTime of Capacity Block reservation.",
"type": "string",
"format": "date-time",
"readOnly": true
},
"endTime": {
"description": "End DateTime of Capacity Block Reservation.",
"type": "string",
"format": "date-time",
"readOnly": true
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"$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)",
"api-version": "2025-06-05-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/37522560-0aee-4258-8146-de5db0ab97bc",
"name": "37522560-0aee-4258-8146-de5db0ab97bc",
"type": "capacityBlocks",
"location": "eastus",
"zone": 1,
"sku": {
"name": "Standard_ND_A100_v4",
"capacity": 4
},
"schedule": {
"startTime": "2025-07-16T12:00:00+00:00",
"endTime": "2025-07-17T12:00:00+00:00"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/capacityBlocks/2f8f8aea-1122-4a3b-bbdc-6535daf15dd9",
"name": "2f8f8aea-1122-4a3b-bbdc-6535daf15dd9",
"type": "capacityBlocks",
"location": "eastus",
"zone": 1,
"sku": {
"name": "Standard_ND_A100_v4",
"capacity": 4
},
"schedule": {
"startTime": "2025-07-19T12:00:00+00:00",
"endTime": "2025-07-20T12:00:00+00:00"
}
}
]
}
}
}
}
9 changes: 9 additions & 0 deletions specification/compute/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ suppressions:
reason: Existing issue from last version.
```

### Tag: package-2025-06-05-preview

These settings apply only when `--tag=package-2025-06-05-preview` is specified on the command line.

```yaml $(tag) == 'package-2025-06-05-preview'
input-file:
- Microsoft.Compute/DiagnosticRP/preview/2025-06-05-preview/diagnostic.json
```

### Tag: package-2025-03-01

These settings apply only when `--tag=package-2025-03-01` is specified on the command line.
Expand Down
Loading