Skip to content

Migrate Fleet from generation to main #24430

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

Merged
merged 3 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 14 additions & 10 deletions src/Fleet/Fleet.Autorest/Az.Fleet.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,41 @@

# Ask for the shared functionality table
$VTable = Register-AzModule

# Tweaks the pipeline on module load
$instance.OnModuleLoad = $VTable.OnModuleLoad

# Following two delegates are added for telemetry
$instance.GetTelemetryId = $VTable.GetTelemetryId
$instance.Telemetry = $VTable.Telemetry


# Delegate to sanitize the output object
$instance.SanitizeOutput = $VTable.SanitizerHandler

# Delegate to get the telemetry info
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo

# Tweaks the pipeline per call
$instance.OnNewRequest = $VTable.OnNewRequest

# Gets shared parameter values
$instance.GetParameterValue = $VTable.GetParameterValue

# Allows shared module to listen to events from this module
$instance.EventListener = $VTable.EventListener

# Gets shared argument completers
$instance.ArgumentCompleter = $VTable.ArgumentCompleter

# The name of the currently selected Azure profile
$instance.ProfileName = $VTable.ProfileName


# Load the custom module
$customModulePath = Join-Path $PSScriptRoot './custom/Az.Fleet.custom.psm1'
if(Test-Path $customModulePath) {
$null = Import-Module -Name $customModulePath
}

# Export nothing to clear implicit exports
Export-ModuleMember

Expand All @@ -97,12 +101,12 @@
# Load the last folder if no profile is selected
$profileDirectory = $directories | Select-Object -Last 1
}

if($profileDirectory) {
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
$exportsPath = $profileDirectory.FullName
}

if($exportsPath) {
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
Expand Down
20 changes: 19 additions & 1 deletion src/Fleet/Fleet.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the Fleet service.

---

## Info
- Modifiable: yes
- Generated: all
Expand Down Expand Up @@ -38,6 +37,8 @@ require:
title: Fleet
module-version: 0.1.0
subject-prefix: $(service-name)
disable-transform-identity-type: true
flatten-userassignedidentity: false

directive:
# # # Following is two common directive which are normally required in all the RPs
Expand All @@ -56,6 +57,23 @@ directive:
- from: swagger-document
where: $.definitions.UpdateRun
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.FleetUpdateStrategy.properties.properties.x-ms-mutability
transform: >-
return [
"read",
"update",
"create"
]
- from: swagger-document
where: $.definitions.UpdateRun.properties.properties
transform: $['x-ms-mutability'] = ["read", "update", "create"]
- from: swagger-document
where: $.definitions.ManagedClusterUpdate.properties.nodeImageSelection
transform: $['x-ms-mutability'] = ["read", "update", "create"]
- from: swagger-document
where: $.definitions.NodeImageSelection.properties.type
transform: $['x-ms-mutability'] = ["read", "update", "create"]
# Hide set cmdlet
- where:
verb: Set
Expand Down
1 change: 0 additions & 1 deletion src/Fleet/Fleet.Autorest/exports/Get-AzFleet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter()]
Expand Down
2 changes: 0 additions & 2 deletions src/Fleet/Fleet.Autorest/exports/Get-AzFleetMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityFleet', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand Down
2 changes: 0 additions & 2 deletions src/Fleet/Fleet.Autorest/exports/Get-AzFleetUpdateRun.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityFleet', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityFleet', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand Down
1 change: 0 additions & 1 deletion src/Fleet/Fleet.Autorest/exports/New-AzFleet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter()]
Expand Down
2 changes: 0 additions & 2 deletions src/Fleet/Fleet.Autorest/exports/New-AzFleetMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='CreateViaIdentityFleetExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand Down
3 changes: 0 additions & 3 deletions src/Fleet/Fleet.Autorest/exports/New-AzFleetUpdateRun.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='CreateViaIdentityFleetExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand Down Expand Up @@ -149,7 +147,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IUpdateStage[]]
# The list of stages that compose this update run.
# Min size: 1.
# To construct, see NOTES section for STRATEGYSTAGE properties and create a hash table.
${StrategyStage},

[Parameter(ParameterSetName='CreateExpanded')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ param(
# Defines the groups to be executed in parallel in this stage.
# Duplicate groups are not allowed.
# Min size: 1.
# To construct, see NOTES section for GROUP properties and create a hash table.
${Group}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='CreateViaIdentityFleetExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IFleetIdentity]
# Identity Parameter
# To construct, see NOTES section for FLEETINPUTOBJECT properties and create a hash table.
${FleetInputObject},

[Parameter()]
Expand All @@ -135,7 +133,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Fleet.Models.IUpdateStage[]]
# The list of stages that compose this update run.
# Min size: 1.
# To construct, see NOTES section for STRATEGYSTAGE properties and create a hash table.
${StrategyStage},

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
Expand Down
Loading