Skip to content

Migrate HdInsightOnAks from generation to release-2024-08-06 #25707

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 2 commits into from
Jul 31, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,496 changes: 1,459 additions & 37 deletions src/HdInsightOnAks/HdInsightOnAks.Autorest/Az.HdInsightOnAks.format.ps1xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.HdInsightOnAks.private.dll'
FormatsToProcess = './Az.HdInsightOnAks.format.ps1xml'
FunctionsToExport = 'Get-AzHdInsightOnAksAvailableClusterPoolVersion', 'Get-AzHdInsightOnAksAvailableClusterVersion', 'Get-AzHdInsightOnAksCluster', 'Get-AzHdInsightOnAksClusterAvailableUpgrade', 'Get-AzHdInsightOnAksClusterInstanceView', 'Get-AzHdInsightOnAksClusterJob', 'Get-AzHdInsightOnAksClusterPool', 'Get-AzHdInsightOnAksClusterPoolAvailableUpgrade', 'Get-AzHdInsightOnAksClusterServiceConfig', 'New-AzHdInsightOnAksCluster', 'New-AzHdInsightOnAksClusterConfigFileObject', 'New-AzHdInsightOnAksClusterHotfixUpgradeObject', 'New-AzHdInsightOnAksClusterPool', 'New-AzHdInsightOnAksClusterPoolAKSUpgradeObject', 'New-AzHdInsightOnAksClusterServiceConfigObject', 'New-AzHdInsightOnAksClusterServiceConfigsProfileObject', 'New-AzHdInsightOnAksFlinkJobObject', 'New-AzHdInsightOnAksNodeProfileObject', 'New-AzHdInsightOnAksSecretReferenceObject', 'New-AzHdInsightOnAksTrinoHiveCatalogObject', 'Remove-AzHdInsightOnAksCluster', 'Remove-AzHdInsightOnAksClusterPool', 'Resize-AzHdInsightOnAksCluster', 'Set-AzHdInsightOnAksClusterPool', 'Start-AzHdInsightOnAksClusterJob', 'Test-AzHdInsightOnAksLocationNameAvailability', 'Update-AzHdInsightOnAksCluster', 'Update-AzHdInsightOnAksClusterPool', 'Update-AzHdInsightOnAksClusterPoolTag'
FunctionsToExport = 'Get-AzHdInsightOnAksAvailableClusterPoolVersion', 'Get-AzHdInsightOnAksAvailableClusterVersion', 'Get-AzHdInsightOnAksCluster', 'Get-AzHdInsightOnAksClusterAvailableUpgrade', 'Get-AzHdInsightOnAksClusterInstanceView', 'Get-AzHdInsightOnAksClusterJob', 'Get-AzHdInsightOnAksClusterLibrary', 'Get-AzHdInsightOnAksClusterPool', 'Get-AzHdInsightOnAksClusterPoolAvailableUpgrade', 'Get-AzHdInsightOnAksClusterPoolUpgradeHistory', 'Get-AzHdInsightOnAksClusterServiceConfig', 'Get-AzHdInsightOnAksClusterUpgradeHistory', 'Invoke-AzHdInsightOnAksClusterManualRollback', 'Invoke-AzHdInsightOnAksClusterPoolUpgrade', 'Invoke-AzHdInsightOnAksClusterUpgrade', 'Invoke-AzHdInsightOnAksManageClusterLibrary', 'New-AzHdInsightOnAksCluster', 'New-AzHdInsightOnAksClusterConfigFileObject', 'New-AzHdInsightOnAksClusterHotfixUpgradeObject', 'New-AzHdInsightOnAksClusterMavenLibraryObject', 'New-AzHdInsightOnAksClusterPool', 'New-AzHdInsightOnAksClusterPoolAksPatchVersionUpgradeObject', 'New-AzHdInsightOnAksClusterPyPiLibraryObject', 'New-AzHdInsightOnAksClusterServiceConfigObject', 'New-AzHdInsightOnAksClusterServiceConfigsProfileObject', 'New-AzHdInsightOnAksFlinkJobObject', 'New-AzHdInsightOnAksManagedIdentityObject', 'New-AzHdInsightOnAksNodeProfileObject', 'New-AzHdInsightOnAksSecretReferenceObject', 'New-AzHdInsightOnAksTrinoHiveCatalogObject', 'Remove-AzHdInsightOnAksCluster', 'Remove-AzHdInsightOnAksClusterPool', 'Resize-AzHdInsightOnAksCluster', 'Set-AzHdInsightOnAksClusterPool', 'Start-AzHdInsightOnAksClusterJob', 'Test-AzHdInsightOnAksLocationNameAvailability', 'Update-AzHdInsightOnAksCluster', 'Update-AzHdInsightOnAksClusterPoolTag'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'HdInsightOnAks'
Expand Down
54 changes: 50 additions & 4 deletions src/HdInsightOnAks/HdInsightOnAks.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ In this directory, run AutoRest:
### General settings
> Values
``` yaml
tag: package-preview-2023-11
commit: 754d31188c080f20b8155acdf8b8fbd77dace467
tag: package-preview-2024-05
commit: c766bb559e93067acf5a852e63f7edcee75a2f5b
require:
- $(this-folder)/../../readme.azure.noprofile.md
- $(repo)/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md
Expand All @@ -71,6 +71,23 @@ default-exclude-tableview-properties: true
``` yaml
identity-correction-for-post: true
directive:
- model-cmdlet:
- model-name: ManagedIdentitySpec
cmdlet-name: New-AzHdInsightOnAksManagedIdentityObject
- model-name: ClusterPoolAksPatchVersionUpgradeProperties
cmdlet-name: New-AzHdInsightOnAksClusterPoolAksPatchVersionUpgradeObject
- model-name: NodeProfile
cmdlet-name: New-AzHdInsightOnAksNodeProfileObject
- model-name: SecretReference
cmdlet-name: New-AzHdInsightOnAksSecretReferenceObject
- model-name: HiveCatalogOption
cmdlet-name: New-AzHdInsightOnAksTrinoHiveCatalogObject
- model-name: ClusterConfigFile
cmdlet-name: New-AzHdInsightOnAksClusterConfigFileObject
- model-name: ClusterServiceConfig
cmdlet-name: New-AzHdInsightOnAksClusterServiceConfigObject
- model-name: ClusterServiceConfigsProfile
cmdlet-name: New-AzHdInsightOnAksClusterServiceConfigsProfileObject
- from: swagger-document
where: $.paths..responses.202
transform: delete $.headers
Expand Down Expand Up @@ -122,7 +139,17 @@ directive:
model-name: ClusterVersion
property-name: PropertiesClusterVersion
set:
property-name: ClusterVersionValue
property-name: ClusterVersionValue
- where:
model-name: SecretReference
property-name: KeyVaultObjectName
set:
property-name: SecretName
- where:
model-name: ClusterServiceConfig
property-name: Component
set:
property-name: ComponentName
# the below is cmdlet part
- where:
verb: New|Set
Expand Down Expand Up @@ -309,5 +336,24 @@ directive:
set:
parameter-name: FlinkHiveCatalogDbUserName
# The below customize the output model

- where:
verb: Update
subject: [Cluster]
variant: [Upgrade|UpgradeExpanded|UpgradeViaIdentity|UpgradeViaIdentityExpanded|UpgradeViaJsonFilePath|UpgradeViaJsonString]
set:
verb: Invoke
subject: ClusterUpgrade
- where:
verb: Update
subject: [ClusterManualRollback]
variant: [Upgrade|UpgradeExpanded|UpgradeViaIdentity|UpgradeViaIdentityExpanded|UpgradeViaJsonFilePath|UpgradeViaJsonString]
set:
verb: Invoke
- where:
verb: Update
subject: [ClusterPool]
variant: [Upgrade|UpgradeExpanded|UpgradeViaIdentity|UpgradeViaIdentityExpanded|UpgradeViaJsonFilePath|UpgradeViaJsonString]
set:
verb: Invoke
subject: ClusterPoolUpgrade
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusterpools/clusters",
"apiVersion": "2023-11-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.hdinsightonaks"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusterpools",
"apiVersion": "2023-11-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.hdinsightonaks"
},
Expand Down
14 changes: 12 additions & 2 deletions src/HdInsightOnAks/HdInsightOnAks.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -130,7 +130,7 @@ $examplesFolder = Join-Path $PSScriptRoot 'examples'
$null = New-Item -ItemType Directory -Force -Path $examplesFolder

Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
$modelCmdlets = @()
$modelCmdlets = @(@{modelName="ManagedIdentitySpec"; cmdletName="New-AzHdInsightOnAksManagedIdentityObject"}, @{modelName="ClusterPoolAksPatchVersionUpgradeProperties"; cmdletName="New-AzHdInsightOnAksClusterPoolAksPatchVersionUpgradeObject"}, @{modelName="NodeProfile"; cmdletName="New-AzHdInsightOnAksNodeProfileObject"}, @{modelName="SecretReference"; cmdletName="New-AzHdInsightOnAksSecretReferenceObject"}, @{modelName="HiveCatalogOption"; cmdletName="New-AzHdInsightOnAksTrinoHiveCatalogObject"}, @{modelName="ClusterConfigFile"; cmdletName="New-AzHdInsightOnAksClusterConfigFileObject"}, @{modelName="ClusterServiceConfig"; cmdletName="New-AzHdInsightOnAksClusterServiceConfigObject"}, @{modelName="ClusterServiceConfigsProfile"; cmdletName="New-AzHdInsightOnAksClusterServiceConfigsProfileObject"})
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
if (Test-Path $modelCmdletFolder) {
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
Expand Down Expand Up @@ -177,4 +177,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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
Expand All @@ -10,59 +10,60 @@
# 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 object to hold the cluster upgrade parameters.
Create an in-memory object for ClusterHotfixUpgradeProperties.
.Description
Create an object to hold the cluster upgrade parameters.
Create an in-memory object for ClusterHotfixUpgradeProperties.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterUpgrade
Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterHotfixUpgradeProperties
.Link
https://learn.microsoft.com/powershell/module/az.hdinsightonaks/New-AzHdInsightOnAksClusterHotfixUpgradeObject
https://learn.microsoft.com/powershell/module/Az.HdInsightOnAks/new-azhdinsightonaksclusterhotfixupgradeobject
#>
function New-AzHdInsightOnAksClusterHotfixUpgradeObject {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.IClusterUpgrade])]
[CmdletBinding(DefaultParameterSetName = 'Create', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'Create')]
[System.String]
# Name of component to be upgraded.
${ComponentName},

[Parameter(ParameterSetName = 'Create')]
[System.String]
# Target build number of component to be upgraded.
${TargetBuildNumber},

[Parameter(ParameterSetName = 'Create')]
[System.String]
# Target cluster version of component to be upgraded.
${TargetClusterVersion},
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.IClusterUpgrade')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(ParameterSetName = 'Create')]
[System.String]
# Target OSS version of component to be upgraded.
${TargetOssVersion}
[Parameter(HelpMessage="Name of component to be upgraded.")]
[string]
$ComponentName,
[Parameter(HelpMessage="Target build number of component to be upgraded.")]
[string]
$TargetBuildNumber,
[Parameter(HelpMessage="Target cluster version of component to be upgraded.")]
[string]
$TargetClusterVersion,
[Parameter(HelpMessage="Target OSS version of component to be upgraded.")]
[string]
$TargetOssVersion
)

process {
try {
$hotfixProperty = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterHotfixUpgradeProperties -Property `
@{ComponentName = $ComponentName;
TargetBuildNumber = $TargetBuildNumber;
TargetClusterVersion = $TargetClusterVersion;
TargetOssVersion = $TargetOssVersion;
}
$Object = [Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterHotfixUpgradeProperties]::New()

$hotfixObject = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterUpgrade -Property `
@{Property = $hotfixProperty }
$RequestObject = [Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterUpgrade]::New()

return $hotfixObject
if ($PSBoundParameters.ContainsKey('ComponentName')) {
$Object.ComponentName = $ComponentName
}
if ($PSBoundParameters.ContainsKey('TargetBuildNumber')) {
$Object.TargetBuildNumber = $TargetBuildNumber
}
catch {
throw
if ($PSBoundParameters.ContainsKey('TargetClusterVersion')) {
$Object.TargetClusterVersion = $TargetClusterVersion
}
if ($PSBoundParameters.ContainsKey('TargetOssVersion')) {
$Object.TargetOssVersion = $TargetOssVersion
}

$RequestObject.Property = $Object
return $RequestObject
}
}
}

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

# ----------------------------------------------------------------------------------
# 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 MavenLibraryProperties.
.Description
Create an in-memory object for MavenLibraryProperties.

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

[Parameter(Mandatory, HelpMessage="GroupId of the Maven package.")]
[string]
$GroupId,
[Parameter(Mandatory, HelpMessage="ArtifactId of the Maven package.")]
[string]
$Name,
[Parameter(HelpMessage="Version of the Maven package.")]
[string]
$Version,
[Parameter(HelpMessage="Remark of the latest library management operation.")]
[string]
$Remark
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.MavenLibraryProperties]::New()

if ($PSBoundParameters.ContainsKey('GroupId')) {
$Object.GroupId = $GroupId
}
if ($PSBoundParameters.ContainsKey('Name')) {
$Object.Name = $Name
}
if ($PSBoundParameters.ContainsKey('Version')) {
$Object.Version = $Version
}
if ($PSBoundParameters.ContainsKey('Remark')) {
$Object.Remark = $Remark
}

$LibraryObj = [Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterLibrary]::New()

$LibraryObj.Property = $Object

return $LibraryObj
}
}

Loading