Skip to content

Commit

Permalink
Revert "Migrate HdInsightOnAks from generation to main (Azure#25611)" (
Browse files Browse the repository at this point in the history
…Azure#25684)

This reverts commit 6981fa4.
  • Loading branch information
VeryEarly authored Jul 30, 2024
1 parent 923aab5 commit fb2fec6
Show file tree
Hide file tree
Showing 458 changed files with 11,278 additions and 54,605 deletions.
1,506 changes: 42 additions & 1,464 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-AzHdInsightOnAksClusterLibrary', 'Get-AzHdInsightOnAksClusterPool', 'Get-AzHdInsightOnAksClusterPoolAvailableUpgrade', 'Get-AzHdInsightOnAksClusterPoolUpgradeHistory', 'Get-AzHdInsightOnAksClusterServiceConfig', 'Get-AzHdInsightOnAksClusterUpgradeHistory', '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', 'Upgrade-AzHdInsightOnAksCluster', 'Upgrade-AzHdInsightOnAksClusterManualRollback', 'Upgrade-AzHdInsightOnAksClusterPool'
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'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'HdInsightOnAks'
Expand Down
41 changes: 3 additions & 38 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-2024-05
commit: c766bb559e93067acf5a852e63f7edcee75a2f5b
tag: package-preview-2023-11
commit: 754d31188c080f20b8155acdf8b8fbd77dace467
require:
- $(this-folder)/../../readme.azure.noprofile.md
- $(repo)/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md
Expand All @@ -71,25 +71,6 @@ default-exclude-tableview-properties: true
``` yaml
identity-correction-for-post: true
directive:
- model-cmdlet:
- model-name: ManagedIdentitySpec
cmdlet-name: New-AzHdInsightOnAksManagedIdentityObject
- model-name: ClusterHotfixUpgradeProperties
cmdlet-name: New-AzHdInsightOnAksClusterHotfixUpgradeObject
- 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 @@ -141,17 +122,7 @@ directive:
model-name: ClusterVersion
property-name: PropertiesClusterVersion
set:
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
property-name: ClusterVersionValue
# the below is cmdlet part
- where:
verb: New|Set
Expand Down Expand Up @@ -338,11 +309,5 @@ directive:
set:
parameter-name: FlinkHiveCatalogDbUserName
# The below customize the output model
- where:
verb: Update
subject: [Cluster|ClusterPool]
variant: [Upgrade|UpgradeExpanded|UpgradeViaIdentity|UpgradeViaIdentityExpanded|UpgradeViaJsonFilePath|UpgradeViaJsonString]
set:
verb: Upgrade

```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusterpools/clusters",
"apiVersion": "2024-05-01-preview",
"apiVersion": "2023-11-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": "2024-05-01-preview",
"apiVersion": "2023-11-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.hdinsightonaks"
},
Expand Down
14 changes: 2 additions & 12 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, [Switch]$DisableAfterBuildTasks)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
$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 = @(@{modelName="ManagedIdentitySpec"; cmdletName="New-AzHdInsightOnAksManagedIdentityObject"}, @{modelName="ClusterHotfixUpgradeProperties"; cmdletName="New-AzHdInsightOnAksClusterHotfixUpgradeObject"}, @{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"})
$modelCmdlets = @()
$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,14 +177,4 @@ 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-------------'
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create cluster config file.
.Description
Create cluster config file.
.Example
$coreSiteConfigFile=New-AzHDInsightAksClusterConfigFile -FileName "core-site.xml" -Value @{"fs.defaultFS"="abfs://testcontainer@$teststorage.dfs.core.windows.net"}
.Inputs
System.Collections.HashTable
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.IClusterConfigFile
.Notes
.Link
https://learn.microsoft.com/powershell/module/az.hdinsightonaks/New-AzHdInsightOnAksClusterConfigFileObject
#>
function New-AzHdInsightOnAksClusterConfigFileObject {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.IClusterConfigFile])]
[CmdletBinding(DefaultParameterSetName = 'Create', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'Create', Mandatory)]
[Alias('Name')]
[System.String]
# The name of the config file.
${FileName},

[Parameter(ParameterSetName = 'Create', Mandatory)]
[System.Collections.HashTable]
# List of key value pairs where key represents a valid service configuration name and value represents the value of the config.
${Value}
)

process {
try {
$configFileValue = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterConfigFileValues

foreach ($item in $Value.GetEnumerator()) {
$configFileValue.Add($item.Name, $item.Value)
}

$configFile = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterConfigFile -Property @{FileName = $FileName; Value = $configFileValue }
return $configFile
}
catch {

throw
}

finally {

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create an object to hold the cluster upgrade parameters.
.Description
Create an object to hold the cluster upgrade parameters.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterUpgrade
.Link
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},

[Parameter(ParameterSetName = 'Create')]
[System.String]
# Target OSS version of component to be upgraded.
${TargetOssVersion}
)
process {
try {
$hotfixProperty = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterHotfixUpgradeProperties -Property `
@{ComponentName = $ComponentName;
TargetBuildNumber = $TargetBuildNumber;
TargetClusterVersion = $TargetClusterVersion;
TargetOssVersion = $TargetOssVersion;
}

$hotfixObject = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterUpgrade -Property `
@{Property = $hotfixProperty }

return $hotfixObject
}
catch {
throw
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create an object to hold the cluster pool upgrade parameters.
.Description
Create an object to hold the cluster pool upgrade parameters.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterPoolUpgrade
.Link
https://learn.microsoft.com/powershell/module/az.hdinsightonaks/New-AzHdInsightOnAksClusterPoolAKSUpgradeObject
#>
function New-AzHdInsightOnAksClusterPoolAKSUpgradeObject {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.IClusterPoolUpgrade])]
[CmdletBinding(DefaultParameterSetName = 'Create', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'Create')]
[System.String]
# Target AKS version. When it's not set, latest version will be used. When upgradeClusterPool is true and upgradeAllClusterNodes is false, target version should be greater or equal to current version. When upgradeClusterPool is false and upgradeAllClusterNodes is true, target version should be equal to AKS version of cluster pool.
${TargetAksVersion},

[Parameter(ParameterSetName = 'Create')]
[System.String]
# whether upgrade all clusters' nodes. If it's true, upgradeClusterPool should be false.
${UpgradeAllClusterNode},

[Parameter(ParameterSetName = 'Create')]
[System.String]
# whether upgrade cluster pool or not. If it's true, upgradeAllClusterNodes should be false.
${UpgradeClusterPool}
)
process {
try {
$aksPatchProperty = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterPoolAksPatchVersionUpgradeProperties -Property `
@{TargetAksVersion = $TargetAksVersion;
UpgradeAllClusterNode = $UpgradeAllClusterNode;
UpgradeClusterPool = $UpgradeClusterPool;
}

$AKSPatchatchObject = New-Object Microsoft.Azure.PowerShell.Cmdlets.HdInsightOnAks.Models.ClusterPoolUpgrade -Property `
@{Property = $aksPatchProperty }

return $AKSPatchatchObject
}
catch {
throw
}
}
}
Loading

0 comments on commit fb2fec6

Please sign in to comment.