Skip to content

Commit a71c1b2

Browse files
authored
Adding SpotPlacementRecommender API cmdlets - version 2024-03-01-preview (#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
1 parent 613a09e commit a71c1b2

File tree

10 files changed

+819
-13
lines changed

10 files changed

+819
-13
lines changed

src/Compute/Compute.Autorest/Az.Compute.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.Compute.private.dll'
1313
FormatsToProcess = './Az.Compute.format.ps1xml'
14-
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', '*'
14+
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', '*'
1515
AliasesToExport = '*'
1616
PrivateData = @{
1717
PSData = @{

src/Compute/Compute.Autorest/README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
This directory contains the PowerShell module for the Compute service.
44

55
---
6-
## Status
7-
[![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/)
8-
96
## Info
107
- Modifiable: yes
118
- Generated: all
@@ -29,7 +26,7 @@ For information on how to develop for `Az.Compute`, see [how-to.md](how-to.md).
2926
### AutoRest Configuration
3027
> see https://aka.ms/autorest
3128
``` yaml
32-
commit: 1a925d1afe288a5f20d078bbc89214a36a0e4287
29+
commit: 77c47a7fba8d8b900595966b81d6bb92a0308370
3330
require:
3431
# readme.azure.noprofile.md is the common configuration file
3532
- $(this-folder)/../../readme.azure.noprofile.md
@@ -38,6 +35,7 @@ input-file:
3835
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-01-03/gallery.json
3936
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-07-01/runCommand.json
4037
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/common-types/v1/common.json
38+
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/DiagnosticRP/preview/2024-03-01-preview/diagnostic.json
4139
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
4240
module-version: 0.3.0
4341
# Normally, title is the service name
@@ -235,4 +233,33 @@ directive:
235233
subject: VMRunCommand|VmssVMRunCommand
236234
verb: Get
237235
remove: true
236+
### Remove All Diagnostic cmdlets aside from Invoke Spot Placement Recommender - generate ONLY SpotPlacementRecommender cmdlets
237+
- where:
238+
verb: Get
239+
subject: Diagnostic
240+
remove: true
241+
- where:
242+
verb: Get
243+
subject: DiskInspection
244+
remove: true
245+
- where:
246+
verb: New
247+
subject: DiskInspection
248+
remove: true
249+
- where:
250+
verb: Read
251+
subject: DiagnosticOperation
252+
remove: true
253+
- where:
254+
verb: Register
255+
subject: DiskInspectionStorageConfiguration
256+
remove: true
257+
- where:
258+
verb: Test
259+
subject: DiskInspectionStorageConfiguration
260+
remove: true
261+
- where:
262+
verb: Get
263+
subject: SpotPlacementRecommender
264+
remove: true
238265
```
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"resourceType": "locations",
3+
"apiVersion": "2021-06-01-preview",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.compute"
6+
},
7+
"commands": [
8+
{
9+
"name": "Invoke-AzSpotPlacementRecommender",
10+
"description": "Generates placement scores for Spot VM skus.",
11+
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/diagnostics/spotPlacementRecommender/generate",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.compute/invoke-azspotplacementrecommender"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-Location <String>",
20+
"[-SubscriptionId <String>]"
21+
]
22+
}
23+
]
24+
},
25+
"examples": [
26+
{
27+
"description": "Generates placement scores for Spot VM skus.",
28+
"parameters": [
29+
{
30+
"name": "-Location",
31+
"value": "[Path.location]"
32+
},
33+
{
34+
"name": "-SubscriptionId",
35+
"value": "[Path.subscriptionId]"
36+
}
37+
]
38+
}
39+
]
40+
}
41+
]
42+
}

src/Compute/Compute.Autorest/docs/Az.Compute.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Locale: en-US
1111
Microsoft Azure PowerShell: Compute cmdlets
1212

1313
## Az.Compute Cmdlets
14+
### [Invoke-AzSpotPlacementRecommender](Invoke-AzSpotPlacementRecommender.md)
15+
Generates placement scores for Spot VM skus.
16+
1417
### [Get-AzGalleryApplication](Get-AzGalleryApplication.md)
1518
Retrieves information about a gallery Application Definition.
1619

0 commit comments

Comments
 (0)