Skip to content

Commit

Permalink
Spot Placement Recommender API swagger docs (#27899)
Browse files Browse the repository at this point in the history
* Adding 2024-02-01-preview files, initial commit

* Fix response bodies for RunDiskInspection and SpotPlacementRecommender

* Removing commented summary property

* Update API version to 2024-03-01-preview

* Addressing comments from PR review

* Add new diagnostics.json file to README.md

* Adding definitions and descriptions

* Adding description

* Adding ComputeDiagnosticsOperationResult and changing references

* Change qualified name to qualified ID

* Adding description for storageaccountId

* Clean up description message

* Update references to CDRP specific definitions

* Addressing more Lint failures

* Addressing 202 location lint comment, api-version parameter comment

* Fix ResourceSize ref

* Add Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json to readme.md

* Fix readme.md remove unnecessary Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json

* Addressing LintDiff validation checks

* Fixing some example jsons

* Adding SpotPlacementRecommender Json example

* Fixing example responses

* Lint fixes

* Change {subscription-id} to 00000000-00000-0000-0000-000000000000

* Change subscription id to 00000000-0000-0000-0000-000000000000

* Address ModelValidation checks

* Change resultStatus type from string to integer

* Adding 202 schema for DiskInspection_Create

* Lower casing for RunDiskInspection 202 example response properties

* Change message type from integer to string

* Change resultStatus type from string to integer

* Set ModelAsString to false for enum and add integer format

* Remove 202 schema and body from example RunDiskInspection

* Remove x-ms-pageable property from Get DiskInspection Operation

* Change resultStatus type to string, modelAsString: false

* Change resultStatus example to Success

* Adding GetSpotPlacementRecommender operation and SpotPlacementRecommender metadata in GetDiagnostics operation example

* Prettier checks

* Change Metadata to List, change GetDiagnostics to ListDiagnostics

* Add examples for storageAccountId example, update sku description to CRP VM SKU size

* Add examples for storageAccountId example, update sku description to CRP VM SKU size

* Remove responseFields: null; nextLink: null from examples

* Reference ProxyResource using allOf property in ComputeDiagnosticBase

* Revert previous change to reference ProxyResource

* Updating example for ComputeDiagnosticBase - changing ID and Name properties to match ARM requirements

* Update ComputeDiagnosticBase to use ProxyResource

* Add package-2024-03-01-preview tag and update readme.md tag to package-2024-03-01-preview

* Revert readme.md tag to package-2023-07-03

* Adding OperationsAPIImplementation suppression to diagnostic.json

* Update Lint suppression checks for diagnostic.json

* Update Lint suppression checks for diagnostic.json change where to from

* Add suppressions to global yaml list

* Update suppression reason for OperationsAPIImplementation
  • Loading branch information
Elina-L authored and vxfield committed Mar 28, 2024
1 parent 5065b6e commit 9667711
Show file tree
Hide file tree
Showing 10 changed files with 971 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"operationId": "{operation-id}",
"api-version": "2024-03-01-preview"
},
"responses": {
"200": {
"body": {
"message": "DiskInspection for selected resource succeeded.",
"createdUTC": "2024-03-05T22:15:44.2986354Z",
"resultStatus": "Success",
"errorDetail": null
},
"headers": {
"x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f",
"location": "https://westcentralus.diagnostic.compute.azure.com/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/providers/Microsoft.Compute/locations/southcentralus/diagnosticOperations/57b891ab-1fb7-4f5a-b002-71eb6854961f"
}
},
"202": {
"headers": {
"Retry-After": "120000",
"x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f",
"location": "https://westcentralus.diagnostic.compute.azure.com/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/providers/Microsoft.Compute/locations/southcentralus/diagnosticOperations/57b891ab-1fb7-4f5a-b002-71eb6854961f"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/diagnostics/diskInspection",
"name": "diskInspection",
"type": "Microsoft.Compute/locations/diagnostics",
"properties": {
"supportedResourceTypes": [
"Microsoft.Compute/virtualMachines"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/diagnostics/spotPlacementRecommender",
"name": "spotPlacementRecommender",
"type": "Microsoft.Compute/locations/diagnostics",
"properties": {
"supportedResourceTypes": [
"Microsoft.Compute/virtualMachines"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1"
},
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/diagnostics/diskInspection",
"name": "diskInspection",
"type": "Microsoft.Compute/locations/diagnostics",
"properties": {
"supportedResourceTypes": [
"Microsoft.Compute/virtualMachines"
]
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/{location}/diagnostics/spotPlacementRecommender",
"name": "spotPlacementRecommender",
"type": "Microsoft.Compute/locations/diagnostics",
"properties": {
"supportedResourceTypes": [
"Microsoft.Compute/virtualMachines"
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"api-version": "2024-03-01-preview",
"storageConfigurationInput": {
"storageAccountId": "/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/resourceGroups/az-iid-blobtest/providers/Microsoft.Storage/storageAccounts/aziidblobtest"
}
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "fa55b700-8218-42b1-a3e3-1794cfd37629"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"api-version": "2024-03-01-preview",
"runDiskInspectionInput": {
"resourceId": "/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/resourceGroups/cladtest1/providers/Microsoft.Compute/virtualMachines/adVM",
"manifest": "diagnostic",
"uploadSasUri": "testSasUri"
}
},
"responses": {
"202": {
"headers": {
"x-ms-request-id": "57b891ab-1fb7-4f5a-b002-71eb6854961f",
"location": "https://westcentralus.diagnostic.compute.azure.com/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/providers/Microsoft.Compute/locations/southcentralus/diagnosticOperations/57b891ab-1fb7-4f5a-b002-71eb6854961f"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"api-version": "2024-03-01-preview",
"spotPlacementRecommenderInput": {
"desiredLocations": [
"eastus",
"eastus2"
],
"desiredSizes": [
{
"sku": "Standard_D2_v2"
}
],
"desiredCount": 1,
"availabilityZones": true
}
},
"responses": {
"200": {
"body": {
"desiredLocations": [
"eastus",
"eastus2"
],
"desiredSizes": [
{
"sku": "Standard_D2_v2"
}
],
"desiredCount": 1,
"availabilityZones": true,
"placementScores": [
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "1",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "2",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus",
"availabilityZone": "3",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "1",
"score": "DataNotFoundOrStale",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "2",
"score": "High",
"isQuotaAvailable": true
},
{
"sku": "Standard_D2_v2",
"region": "eastus2",
"availabilityZone": "3",
"score": "High",
"isQuotaAvailable": true
}
]
},
"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/diagnostics/spotplacementrecommender/generate?api-version=2024-02-01-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"location": "eastus",
"api-version": "2024-03-01-preview"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "27b7c568-16ec-46f3-bcf1-5bea3f2529b1"
},
"body": {
"storageAccountId": "/subscriptions/88fd8cb2-8248-499e-9a2d-4929a4b0133c/resourceGroups/az-iid-blobtest/providers/Microsoft.Storage/storageAccounts/aziidblobtest"
}
}
}
}
33 changes: 33 additions & 0 deletions specification/compute/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,41 @@ directive:
- suppress: ResourceNameRestriction
from: dedicatedHost.json
reason: there is no dedicated host naming requirement. It only follows ARM resource naming requirement.

suppressions:
- code: OperationsAPIImplementation
reason: The operations API is defined in a separate file.
from: diagnostic.json
- code: PathForResourceAction
reason: This is not a valid scenario for the diskInspection and spotPlacementRecommender API as API Path does not match ARM Lint check formatting, requesting to suppress due to approval from reviewer.
from: diagnostic.json
- code: PathForNestedResource
reason: This is not a valid scenario for the diskInspection and spotPlacementRecommender API as API Path does not match ARM Lint check formatting, requesting to suppress due to approval from reviewer.
from: diagnostic.json
- code: XmsPageableForListCalls
reason: False positive error as API Path does not match ARM Lint check formatting, requesting to suppress due to approval from reviewer.
from: diagnostic.json
```
### Tag: package-2024-03-01-preview-only
These settings apply only when `--tag=package-2024-03-01-preview-only` is specified on the command line.

```yaml $(tag) == 'package-2024-03-01-preview-only'
input-file:
- Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json
```

### Tag: package-2024-03-01-preview

These settings apply only when `--tag=package-2024-03-01-preview` is specified on the command line.

```yaml $(tag) == 'package-2024-03-01-preview'
input-file:
- Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json
```


### Tag: package-2023-07-03

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

0 comments on commit 9667711

Please sign in to comment.