Skip to content

Commit

Permalink
Adding SpotPlacementRecommender API cmdlets - version 2024-03-01-prev…
Browse files Browse the repository at this point in the history
…iew (Azure#24352)

* Initial commit

* Update files after setting directives to add remove cmdlets

* Add initial tests for Invoke-SpotPlacementRecommender cmdlet and some examples in the doc

* Add examples to Invoke-Spot examples md file

* Remove unnecessary test.ps1 files

* Readding some removed files that should not be deleted (1)

* Readding some removed files that should not be deleted (2)

* Readding some removed files that should not be deleted (3)

* Adding older deleted cmds to FunctionsToExport

* Removing Get SpotPlacementRecommender files

* Remove Get-AzSpotPlacementRecommender.Tests.ps1, update failing test and doc

* Rever changes to docs/Az.Compute.md

* Only remove new functions from diagnostic.json

* Reverting changes to docs of other cmdlets

* Update README.md to point to remote swagger

* Readd removed Get-AzGalleryApplication Get-AzGalleryApplicationVersion descriptions from Az.Compute.md

* Update README.md commit to the commit version that includes Spot Placement Recommender merge

* Update Az.Compute.psd1 to remove Get-AzSpotPlacementRecommender function to export, add additional examples for SpotPlacementRecommenderInput parameter, update test to include SpotPlacementRecommenderInput example

* Update test cases, response should not be null or empty, update env.json, localEnv.json values

* Add recording file and fix invalid input desired size
  • Loading branch information
Elina-L authored and qinzhouxu committed Jun 5, 2024
1 parent 7937b38 commit 5325002
Show file tree
Hide file tree
Showing 10 changed files with 819 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Compute/Compute.Autorest/Az.Compute.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Compute.private.dll'
FormatsToProcess = './Az.Compute.format.ps1xml'
FunctionsToExport = 'Get-AzGalleryApplication', 'Get-AzGalleryApplicationVersion', 'New-AzGalleryApplication', 'New-AzGalleryApplicationVersion', 'Remove-AzGalleryApplication', 'Remove-AzGalleryApplicationVersion', 'Remove-AzVMRunCommand', 'Remove-AzVmssVMRunCommand', 'Set-AzVMRunCommand', 'Set-AzVmssVMRunCommand', 'Update-AzGalleryApplication', 'Update-AzGalleryApplicationVersion', '*'
FunctionsToExport = 'Get-AzGalleryApplication', 'Get-AzGalleryApplicationVersion', 'Invoke-AzSpotPlacementRecommender', 'New-AzGalleryApplication', 'New-AzGalleryApplicationVersion', 'Remove-AzGalleryApplication', 'Remove-AzGalleryApplicationVersion', 'Remove-AzVMRunCommand', 'Remove-AzVmssVMRunCommand', 'Set-AzVMRunCommand', 'Set-AzVmssVMRunCommand', 'Update-AzGalleryApplication', 'Update-AzGalleryApplicationVersion', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Expand Down
35 changes: 31 additions & 4 deletions src/Compute/Compute.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
This directory contains the PowerShell module for the Compute service.

---
## Status
[![Az.Compute](https://img.shields.io/powershellgallery/v/Az.Compute.svg?style=flat-square&label=Az.Compute "Az.Compute")](https://www.powershellgallery.com/packages/Az.Compute/)

## Info
- Modifiable: yes
- Generated: all
Expand All @@ -29,7 +26,7 @@ For information on how to develop for `Az.Compute`, see [how-to.md](how-to.md).
### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
commit: 1a925d1afe288a5f20d078bbc89214a36a0e4287
commit: 77c47a7fba8d8b900595966b81d6bb92a0308370
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
Expand All @@ -38,6 +35,7 @@ input-file:
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-01-03/gallery.json
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-07-01/runCommand.json
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/common-types/v1/common.json
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
module-version: 0.3.0
# Normally, title is the service name
Expand Down Expand Up @@ -235,4 +233,33 @@ directive:
subject: VMRunCommand|VmssVMRunCommand
verb: Get
remove: true
### Remove All Diagnostic cmdlets aside from Invoke Spot Placement Recommender - generate ONLY SpotPlacementRecommender cmdlets
- where:
verb: Get
subject: Diagnostic
remove: true
- where:
verb: Get
subject: DiskInspection
remove: true
- where:
verb: New
subject: DiskInspection
remove: true
- where:
verb: Read
subject: DiagnosticOperation
remove: true
- where:
verb: Register
subject: DiskInspectionStorageConfiguration
remove: true
- where:
verb: Test
subject: DiskInspectionStorageConfiguration
remove: true
- where:
verb: Get
subject: SpotPlacementRecommender
remove: true
```
42 changes: 42 additions & 0 deletions src/Compute/Compute.Autorest/UX/Microsoft.Compute/locations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"resourceType": "locations",
"apiVersion": "2021-06-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.compute"
},
"commands": [
{
"name": "Invoke-AzSpotPlacementRecommender",
"description": "Generates placement scores for Spot VM skus.",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/diagnostics/spotPlacementRecommender/generate",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.compute/invoke-azspotplacementrecommender"
},
"parameterSets": [
{
"parameters": [
"-Location <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Generates placement scores for Spot VM skus.",
"parameters": [
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
3 changes: 3 additions & 0 deletions src/Compute/Compute.Autorest/docs/Az.Compute.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Locale: en-US
Microsoft Azure PowerShell: Compute cmdlets

## Az.Compute Cmdlets
### [Invoke-AzSpotPlacementRecommender](Invoke-AzSpotPlacementRecommender.md)
Generates placement scores for Spot VM skus.

### [Get-AzGalleryApplication](Get-AzGalleryApplication.md)
Retrieves information about a gallery Application Definition.

Expand Down
Loading

0 comments on commit 5325002

Please sign in to comment.