SpotPlacementRecommender resource split
…b4e701938dd79df2b and new swagger file specification/compute/resource-manager/Microsoft.Compute/DiagnosticRP/preview/2024-06-01-preview/diagnostic.json
Description
Update the spot placement recommender API URI to the new API: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{region}/placementScores/spot/generate
The new API URI is defined in Swagger: https://github.com/Azure/azure-rest-api-specs/blob/259fe9abaed3b55b600dc82d79323f046501e87f/specification/compute/resource-manager/Microsoft.Compute/DiagnosticRP/preview/2024-06-01-preview/diagnostic.json#L405
The old API "Invoke-AzSpotPlacementRecommender" will be deprecated and replaced with "Invoke-AzSpotPlacementScore" instead. The behavior of the cmdlet will be the same, the only difference will be the cmdlet name and parameter names (all instances of 'Recommender' is replaced with 'Score').
Note: after running autorest and build-module, there are many changes in other files that are not related to my PR (Invoke-AzSpotPlacementRecommender -> Invoke-AzSpotPlacementScore). Those are not intentional but I am adding them to the PR to retain auto-generated changes. If these changes should not be included, please let me know and I will remove them, thanks in advance.
Mandatory Checklist
-
Please choose the target release of Azure PowerShell. (⚠️Target release is a different concept from API readiness. Please click below links for details.)
- [X] General release
- [ ] Public preview
- [ ] Private preview
- [ ] Engineering build
- [ ] No need for a release
-
[X] Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:
- SHOULD update
ChangeLog.mdfile(s) appropriately- For SDK-based development mode, update
src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.- A snippet outlining the change(s) made in the PR should be written under the
## Upcoming Releaseheader in the past tense.
- A snippet outlining the change(s) made in the PR should be written under the
- For autorest-based development mode, include the changelog in the PR description.
- Should not change
ChangeLog.mdif no new release is required, such as fixing test case only.
- For SDK-based development mode, update
- SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
- SHOULD have proper test coverage for changes in pull request.
- SHOULD NOT adjust version of module manually in pull request
️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
⚠️Az.Compute
️✔️Build
️✔️PowerShell Core - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Help Example Check
️✔️PowerShell Core - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
⚠️File Change Check
⚠️PowerShell Core - Windows
Type Cmdlet Description Remediation ⚠️ It is required to update ChangeLog.md if you want to release a new version for Az.Compute. Add a changelog record under Upcoming Release section with past tense. ️✔️UX Metadata Check
️✔️PowerShell Core - Windows
⚠️Test
⚠️ - Linux
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.40 % Test coverage for the module cannot be lower than 50%. ⚠️ - MacOS
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.40% Test coverage for the module cannot be lower than 50%. ⚠️PowerShell Core - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 0.40% Test coverage for the module cannot be lower than 50%.
️✔️Az.KeyVault
️✔️Build
️✔️PowerShell Core - Windows
To the author of the pull request, This PR was labeled "Breaking Change Release" because it contains breaking changes.
Validated that all permutations of the cmdlet is working successfully:
- Invoke-AzSpotPlacementScore -SpotPlacementScoresInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response = Invoke-AzSpotPlacementScore -Location eastus -SpotPlacementScoresInput $spotPlacementScoresInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
True japaneast RestrictedSkuNotAvailable Standard_D2_v3
True japaneast RestrictedSkuNotAvailable Standard_D2_v2
True japaneast RestrictedSkuNotAvailable Standard_D4_v3
True southcentralus Medium Standard_D2_v3
True southcentralus Medium Standard_D2_v2
True southcentralus Medium Standard_D4_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v2
True centralus RestrictedSkuNotAvailable Standard_D4_v3
- Invoke-AzSpotPlacementRecommender -SpotPlacementScoresInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response = Invoke-AzSpotPlacementRecommender -Location eastus -SpotPlacementScoresInput $spotPlacementScoresInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
True japaneast RestrictedSkuNotAvailable Standard_D2_v3
True japaneast RestrictedSkuNotAvailable Standard_D2_v2
True japaneast RestrictedSkuNotAvailable Standard_D4_v3
True southcentralus Medium Standard_D2_v3
True southcentralus Medium Standard_D2_v2
True southcentralus Medium Standard_D4_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v2
True centralus RestrictedSkuNotAvailable Standard_D4_v3
- Invoke-AzSpotPlacementRecommender -SpotPlacementRecommenderInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response = Invoke-AzSpotPlacementRecommender -Location eastus -SpotPlacementRecommenderInput $spotPlacementScoresInput
PS C:\One\azure-powershell-codegen-directory\azure-powershell\src\Compute\Compute.Autorest [Az.Compute]> $response.PlacementScore
AvailabilityZone IsQuotaAvailable Region Score Sku
---------------- ---------------- ------ ----- ---
True japaneast RestrictedSkuNotAvailable Standard_D2_v3
True japaneast RestrictedSkuNotAvailable Standard_D2_v2
True japaneast RestrictedSkuNotAvailable Standard_D4_v3
True southcentralus Medium Standard_D2_v3
True southcentralus Medium Standard_D2_v2
True southcentralus Medium Standard_D4_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v3
True centralus RestrictedSkuNotAvailable Standard_D2_v2
True centralus RestrictedSkuNotAvailable Standard_D4_v3
@Elina-L , needs the changelog update.
ChangeLog:
Adding "Invoke-AzSpotPlacementScore" cmdlet. This cmdlet calls the latest Spot Placement Score API https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{region}/placementScores/spot/generate Remove the "Invoke-AzSpotPlacementRecommender" cmdlet. This cmdlet calls the soon to be deprecated Spot Placement Recommender API: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{region}/diagnostics/spotPlacementRecommender/generate