Skip to content
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

Migrate Aks from generation to main #21509

Merged
merged 2 commits into from
Apr 12, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,472 changes: 2,630 additions & 842 deletions src/Aks/Aks.Autorest/Az.Aks.format.ps1xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Aks/Aks.Autorest/Az.Aks.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Aks.private.dll'
FormatsToProcess = './Az.Aks.format.ps1xml'
FunctionsToExport = 'Get-AzAksNodePoolUpgradeProfile', 'Get-AzAksUpgradeProfile', 'Get-AzAksVersion', 'Start-AzAksCluster', 'Stop-AzAksCluster', '*'
FunctionsToExport = 'Get-AzAksMaintenanceConfiguration', 'Get-AzAksManagedClusterCommandResult', 'Get-AzAksManagedClusterOSOption', 'Get-AzAksManagedClusterOutboundNetworkDependencyEndpoint', 'Get-AzAksNodePoolUpgradeProfile', 'Get-AzAksSnapshot', 'Get-AzAksUpgradeProfile', 'Get-AzAksVersion', 'Install-AzAksCliTool', 'Invoke-AzAksAbortAgentPoolLatestOperation', 'Invoke-AzAksAbortManagedClusterLatestOperation', 'Invoke-AzAksRotateManagedClusterServiceAccountSigningKey', 'New-AzAksMaintenanceConfiguration', 'New-AzAksSnapshot', 'New-AzAksTimeInWeekObject', 'New-AzAksTimeSpanObject', 'Remove-AzAksMaintenanceConfiguration', 'Remove-AzAksSnapshot', 'Start-AzAksCluster', 'Start-AzAksManagedClusterCommand', 'Stop-AzAksCluster', '*'
AliasesToExport = 'Get-AzAksClusterUpgradeProfile', '*'
PrivateData = @{
PSData = @{
Expand Down
22 changes: 19 additions & 3 deletions src/Aks/Aks.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ For information on how to develop for `Az.Aks`, see [how-to.md](how-to.md).
> see https://aka.ms/autorest

``` yaml
branch: e320555a456cbc894c5a89466defdfca45ca18a8
branch: 6031674c73a95ffd60f58b5cdd633c94b3360467
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2020-09-01/managedClusters.json
- $(repo)/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-08-01/location.json
- $(repo)/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-02-01/managedClusters.json
- $(repo)/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2019-08-01/location.json

title: Aks
module-version: 0.1.0
Expand All @@ -50,6 +50,22 @@ directive:
subject: ^ManagedCluster$
verb: Get|New|Set|Remove
remove: true
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^Run$|^RunViaIdentity$
subject: ^MaintenanceConfiguration$|^Snapshot$|^ManagedClusterCommand$|^SnapshotTag$
remove: true
- where:
subject: ^MaintenanceConfiguration$|^Snapshot$
verb: Set
remove: true
# this API (Update SnapshotTag) is defined in swagger but not supported by RP
- where:
subject: ^SnapshotTag$
verb: Update
remove: true
- model-cmdlet:
- TimeSpan
- TimeInWeek
- where:
subject: ^ManagedCluster$
parameter-name: ResourceName
Expand Down
6 changes: 5 additions & 1 deletion src/Aks/Aks.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ $examplesFolder = Join-Path $PSScriptRoot 'examples'
$null = New-Item -ItemType Directory -Force -Path $examplesFolder

Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
$modelCmdlets = @()
$modelCmdlets = @('TimeSpan', 'TimeInWeek')
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
if (Test-Path $modelCmdletFolder) {
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
}
if ($modelCmdlets.Count -gt 0) {
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
CreateModelCmdlet($modelCmdlets)
Expand Down
12 changes: 8 additions & 4 deletions src/Aks/Aks.Autorest/create-model-cmdlets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ function CreateModelCmdlet {
}

$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
$ModuleName = 'Aks'
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
$null = New-Item -ItemType Directory -Force -Path $OutputDir
if (''.length -gt 0) {
$ModuleName = ''
} else {
$ModuleName = 'Az.Aks'
}

$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
$Content = ''
Expand Down Expand Up @@ -64,10 +68,10 @@ function CreateModelCmdlet {
$ObjectType = $Model
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
# remove duplicated module name
if ($ObjectType.StartsWith($ModuleName)) {
if ($ObjectType.StartsWith('Aks')) {
$ModulePrefix = ''
} else {
$ModulePrefix = $ModuleName
$ModulePrefix = 'Aks'
}
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir

Expand Down Expand Up @@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
.Outputs
${ObjectTypeWithNamespace}
.Link
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
#>
function New-Az${ModulePrefix}${ObjectType}Object {
[OutputType('${ObjectTypeWithNamespace}')]
Expand Down
2 changes: 1 addition & 1 deletion src/Aks/Aks.Autorest/custom/Install-AzAksCliTool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,4 @@ Function Install-Kubelogin
}
#endregion
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create an in-memory object for TimeInWeek.
.Description
Create an in-memory object for TimeInWeek.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeInWeek
.Link
https://learn.microsoft.com/powershell/module/Az.Aks/new-AzAksTimeInWeekObject
#>
function New-AzAksTimeInWeekObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeInWeek')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The day of the week.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Aks.Support.WeekDay])]
[Microsoft.Azure.PowerShell.Cmdlets.Aks.Support.WeekDay]
$Day,
[Parameter(HelpMessage="Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range.")]
[int[]]
$HourSlot
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeInWeek]::New()

if ($PSBoundParameters.ContainsKey('Day')) {
$Object.Day = $Day
}
if ($PSBoundParameters.ContainsKey('HourSlot')) {
$Object.HourSlot = $HourSlot
}
return $Object
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create an in-memory object for TimeSpan.
.Description
Create an in-memory object for TimeSpan.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeSpan
.Link
https://learn.microsoft.com/powershell/module/Az.Aks/new-AzAksTimeSpanObject
#>
function New-AzAksTimeSpanObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeSpan')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The end of a time span.")]
[System.DateTime]
$End,
[Parameter(HelpMessage="The start of a time span.")]
[System.DateTime]
$Start
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Aks.Models.Api20230201.TimeSpan]::New()

if ($PSBoundParameters.ContainsKey('End')) {
$Object.End = $End
}
if ($PSBoundParameters.ContainsKey('Start')) {
$Object.Start = $Start
}
return $Object
}
}

63 changes: 59 additions & 4 deletions src/Aks/Aks.Autorest/docs/Az.Aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@ Locale: en-US
Microsoft Azure PowerShell: Aks cmdlets

## Az.Aks Cmdlets
### [Get-AzAksMaintenanceConfiguration](Get-AzAksMaintenanceConfiguration.md)
Gets the specified maintenance configuration of a managed cluster.

### [Get-AzAksManagedClusterCommandResult](Get-AzAksManagedClusterCommandResult.md)
Gets the results of a command which has been run on the Managed Cluster.

### [Get-AzAksManagedClusterOSOption](Get-AzAksManagedClusterOSOption.md)
Gets supported OS options in the specified subscription.

### [Get-AzAksManagedClusterOutboundNetworkDependencyEndpoint](Get-AzAksManagedClusterOutboundNetworkDependencyEndpoint.md)
Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster.
The operation returns properties of each egress endpoint.

### [Get-AzAksNodePoolUpgradeProfile](Get-AzAksNodePoolUpgradeProfile.md)
Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster name.
Gets the upgrade profile for an agent pool.

### [Get-AzAksSnapshot](Get-AzAksSnapshot.md)
Gets a snapshot.

### [Get-AzAksUpgradeProfile](Get-AzAksUpgradeProfile.md)
Gets the details of the upgrade profile for a managed cluster with a specified resource group and name.
Gets the upgrade profile of a managed cluster.

### [Get-AzAksVersion](Get-AzAksVersion.md)
List available version for creating managed Kubernetes cluster.
Expand All @@ -24,9 +40,48 @@ The operation returns properties of each orchestrator including version, availab
### [Install-AzAksCliTool](Install-AzAksCliTool.md)
Download and install kubectl and kubelogin.

### [Invoke-AzAksAbortAgentPoolLatestOperation](Invoke-AzAksAbortAgentPoolLatestOperation.md)
Aborts the currently running operation on the agent pool.
The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes.
If the operation completes before cancellation can take place, a 409 error code is returned.

### [Invoke-AzAksAbortManagedClusterLatestOperation](Invoke-AzAksAbortManagedClusterLatestOperation.md)
Aborts the currently running operation on the managed cluster.
The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes.
If the operation completes before cancellation can take place, a 409 error code is returned.

### [Invoke-AzAksRotateManagedClusterServiceAccountSigningKey](Invoke-AzAksRotateManagedClusterServiceAccountSigningKey.md)
Rotates the service account signing keys of a managed cluster.

### [New-AzAksMaintenanceConfiguration](New-AzAksMaintenanceConfiguration.md)
Creates or updates a maintenance configuration in the specified managed cluster.

### [New-AzAksSnapshot](New-AzAksSnapshot.md)
Creates or updates a snapshot.

### [New-AzAksTimeInWeekObject](New-AzAksTimeInWeekObject.md)
Create an in-memory object for TimeInWeek.

### [New-AzAksTimeSpanObject](New-AzAksTimeSpanObject.md)
Create an in-memory object for TimeSpan.

### [Remove-AzAksMaintenanceConfiguration](Remove-AzAksMaintenanceConfiguration.md)
Deletes a maintenance configuration.

### [Remove-AzAksSnapshot](Remove-AzAksSnapshot.md)
Deletes a snapshot.

### [Start-AzAksCluster](Start-AzAksCluster.md)
Starts a Stopped Managed Cluster
See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster.

### [Start-AzAksManagedClusterCommand](Start-AzAksManagedClusterCommand.md)
AKS will create a pod to run the command.
This is primarily useful for private clusters.
For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview).

### [Stop-AzAksCluster](Stop-AzAksCluster.md)
Stops a Running Managed Cluster
This can only be performed on Azure Virtual Machine Scale set backed clusters.
Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state.
A cluster does not accrue charges while it is stopped.
See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster.

Loading