Skip to content

Commit d4449a5

Browse files
Migrate Nginx from generation to main (#23875)
* Move Nginx to main * Update ChangeLog.md --------- Co-authored-by: Yunchi Wang <[email protected]>
1 parent 5c68c91 commit d4449a5

File tree

243 files changed

+6914
-3147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+6914
-3147
lines changed

src/Nginx/Nginx.Autorest/Az.Nginx.format.ps1xml

Lines changed: 100 additions & 94 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,24 @@
1-
#
2-
# Module manifest for module 'Az.Nginx'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 9/22/2022
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.Nginx.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'a6006217-b983-465f-9b21-5017989fa14f'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft Corporation. All rights reserved.'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell: Nginx cmdlets'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
DotNetFrameworkVersion = '4.7.2'
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.1'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.Nginx.private.dll'
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.Nginx.format.ps1xml'
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Get-AzNginxCertificate', 'Get-AzNginxConfiguration',
73-
'Get-AzNginxDeployment', 'New-AzNginxCertificate',
74-
'New-AzNginxConfiguration', 'New-AzNginxConfigurationFileObject',
75-
'New-AzNginxDeployment', 'New-AzNginxNetworkProfileObject',
76-
'New-AzNginxPrivateIPAddressObject',
77-
'New-AzNginxPublicIPAddressObject', 'Remove-AzNginxCertificate',
78-
'Remove-AzNginxConfiguration', 'Remove-AzNginxDeployment',
79-
'Update-AzNginxDeployment'
80-
81-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
82-
CmdletsToExport = @()
83-
84-
# Variables to export from this module
85-
# VariablesToExport = @()
86-
87-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
88-
AliasesToExport = '*'
89-
90-
# DSC resources to export from this module
91-
# DscResourcesToExport = @()
92-
93-
# List of all modules packaged with this module
94-
# ModuleList = @()
95-
96-
# List of all files packaged with this module
97-
# FileList = @()
98-
99-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
100-
PrivateData = @{
101-
2+
GUID = 'a6006217-b983-465f-9b21-5017989fa14f'
3+
RootModule = './Az.Nginx.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Nginx cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Nginx.private.dll'
13+
FormatsToProcess = './Az.Nginx.format.ps1xml'
14+
FunctionsToExport = 'Get-AzNginxCertificate', 'Get-AzNginxConfiguration', 'Get-AzNginxDeployment', 'New-AzNginxCertificate', 'New-AzNginxConfiguration', 'New-AzNginxConfigurationFileObject', 'New-AzNginxDeployment', 'New-AzNginxNetworkProfileObject', 'New-AzNginxPrivateIPAddressObject', 'New-AzNginxPublicIPAddressObject', 'Remove-AzNginxCertificate', 'Remove-AzNginxConfiguration', 'Remove-AzNginxDeployment', 'Update-AzNginxDeployment', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
10217
PSData = @{
103-
104-
# Tags applied to this module. These help with module discovery in online galleries.
105-
Tags = 'Azure','ResourceManager','ARM','PSModule','Nginx'
106-
107-
# A URL to the license for this module.
108-
LicenseUri = 'https://aka.ms/azps-license'
109-
110-
# A URL to the main website for this project.
111-
ProjectUri = 'https://github.com/Azure/azure-powershell'
112-
113-
# A URL to an icon representing this module.
114-
# IconUri = ''
115-
116-
# ReleaseNotes of this module
117-
# ReleaseNotes = ''
118-
119-
# Prerelease string of this module
120-
# Prerelease = ''
121-
122-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
123-
# RequireLicenseAcceptance = $false
124-
125-
# External dependent modules of this module
126-
# ExternalModuleDependencies = @()
127-
128-
} # End of PSData hashtable
129-
130-
} # End of PrivateData hashtable
131-
132-
# HelpInfo URI of this module
133-
# HelpInfoURI = ''
134-
135-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
136-
# DefaultCommandPrefix = ''
137-
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Nginx'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
13824
}
139-

src/Nginx/Nginx.Autorest/README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ For information on how to develop for `Az.Nginx`, see [how-to.md](how-to.md).
2929
### AutoRest Configuration
3030
> see https://aka.ms/autorest
3131
``` yaml
32+
commit: e38e7dd462571865266d320bd7cec9804c67f70b
33+
tag: package-2023-04-01
3234
require:
3335
# readme.azure.noprofile.md is the common configuration file
34-
- $(this-folder)/../readme.azure.noprofile.md
36+
- $(this-folder)/../../readme.azure.noprofile.md
3537
input-file:
3638
# You need to specify your swagger files here.
37-
- https://github.com/Azure/azure-rest-api-specs/blob/5dd50f3a923888cae5b77a4d4a48cb57430ba9de/specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/swagger.json
39+
- $(repo)/specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2023-04-01/swagger.json
3840

3941
root-module-name: $(prefix).Nginx
4042
title: Nginx
@@ -46,6 +48,10 @@ nested-object-to-string: true
4648
# uncomment following line to support viaIdentity for these post APIs
4749
# identity-correction-for-post: true
4850

51+
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
52+
use-extension:
53+
"@autorest/powershell": "3.x"
54+
4955
directive:
5056
# Following is two common directive which are normally required in all the RPs
5157
# 1. Remove the unexpanded parameter set
@@ -54,7 +60,7 @@ directive:
5460
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
5561
remove: true
5662
- where:
57-
subject: Configuration
63+
subject: Configuration|Certificate|Deployment
5864
verb: Set
5965
remove: true
6066
# ProvisioningState readonly
@@ -111,6 +117,12 @@ directive:
111117
},
112118
"logging": {
113119
"$ref": "#/definitions/NginxLogging"
120+
},
121+
"scalingProperties": {
122+
"$ref": "#/definitions/NginxDeploymentScalingProperties"
123+
},
124+
"userProfile": {
125+
"$ref": "#/definitions/NginxDeploymentUserProfile"
114126
}
115127
},
116128
"required": [
@@ -188,12 +200,6 @@ directive:
188200
"properties": {
189201
"$ref": "#/definitions/NginxCertificateProperties"
190202
},
191-
"tags": {
192-
"type": "object",
193-
"additionalProperties": {
194-
"type": "string"
195-
}
196-
},
197203
"location": {
198204
"type": "string"
199205
},

src/Nginx/Nginx.Autorest/build-module.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125125
$modelCmdlets = @('NginxConfigurationFile', 'NginxPrivateIPAddress', 'NginxPublicIPAddress', 'NginxNetworkProfile')
126+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
127+
if (Test-Path $modelCmdletFolder) {
128+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
129+
}
126130
if ($modelCmdlets.Count -gt 0) {
127131
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128132
CreateModelCmdlet($modelCmdlets)
@@ -139,7 +143,8 @@ if($NoDocs) {
139143
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
140144
}
141145
$null = New-Item -ItemType Directory -Force -Path $docsFolder
142-
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
146+
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
147+
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
143148
}
144149

145150
Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
@@ -158,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
158163
Write-Host -ForegroundColor Green 'Creating example stubs...'
159164
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
160165

166+
if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
167+
{
168+
Write-Host -ForegroundColor Green 'Creating ux metadata...'
169+
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170+
}
171+
161172
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Nginx/Nginx.Autorest/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'Nginx'
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if ('Az.Nginx'.length -gt 0) {
29+
$ModuleName = 'Az.Nginx'
30+
} else {
31+
$ModuleName = 'Az.Nginx'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('Nginx')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'Nginx'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]

src/Nginx/Nginx.Autorest/custom/autogen-model-cmdlets/New-AzNginxConfigurationFileObject.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Create an in-memory object for NginxConfigurationFile.
2121
Create an in-memory object for NginxConfigurationFile.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxConfigurationFile
24+
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxConfigurationFile
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Nginx/new-AzNginxConfigurationFileObject
26+
https://learn.microsoft.com/powershell/module/Az.Nginx/new-AzNginxConfigurationFileObject
2727
#>
2828
function New-AzNginxConfigurationFileObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxConfigurationFile')]
29+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxConfigurationFile')]
3030
[CmdletBinding(PositionalBinding=$false)]
3131
Param(
3232

@@ -39,7 +39,7 @@ function New-AzNginxConfigurationFileObject {
3939
)
4040

4141
process {
42-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxConfigurationFile]::New()
42+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxConfigurationFile]::New()
4343

4444
if ($PSBoundParameters.ContainsKey('Content')) {
4545
$Object.Content = $Content

src/Nginx/Nginx.Autorest/custom/autogen-model-cmdlets/New-AzNginxNetworkProfileObject.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ Create an in-memory object for NginxNetworkProfile.
2121
Create an in-memory object for NginxNetworkProfile.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxNetworkProfile
24+
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxNetworkProfile
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Nginx/new-AzNginxNetworkProfileObject
26+
https://learn.microsoft.com/powershell/module/Az.Nginx/new-AzNginxNetworkProfileObject
2727
#>
2828
function New-AzNginxNetworkProfileObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxNetworkProfile')]
29+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxNetworkProfile')]
3030
[CmdletBinding(PositionalBinding=$false)]
3131
Param(
3232

3333
[Parameter()]
34-
[Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.INginxFrontendIPConfiguration]
34+
[Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.INginxFrontendIPConfiguration]
3535
$FrontEndIPConfiguration,
3636
[Parameter()]
37-
[Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.INginxNetworkInterfaceConfiguration]
37+
[Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.INginxNetworkInterfaceConfiguration]
3838
$NetworkInterfaceConfiguration
3939
)
4040

4141
process {
42-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxNetworkProfile]::New()
42+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxNetworkProfile]::New()
4343

4444
if ($PSBoundParameters.ContainsKey('FrontEndIPConfiguration')) {
4545
$Object.FrontEndIPConfiguration = $FrontEndIPConfiguration

src/Nginx/Nginx.Autorest/custom/autogen-model-cmdlets/New-AzNginxPrivateIPAddressObject.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Create an in-memory object for NginxPrivateIPAddress.
2121
Create an in-memory object for NginxPrivateIPAddress.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPrivateIPAddress
24+
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPrivateIPAddress
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Nginx/new-AzNginxPrivateIPAddressObject
26+
https://learn.microsoft.com/powershell/module/Az.Nginx/new-AzNginxPrivateIPAddressObject
2727
#>
2828
function New-AzNginxPrivateIPAddressObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPrivateIPAddress')]
29+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPrivateIPAddress')]
3030
[CmdletBinding(PositionalBinding=$false)]
3131
Param(
3232

@@ -43,7 +43,7 @@ function New-AzNginxPrivateIPAddressObject {
4343
)
4444

4545
process {
46-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPrivateIPAddress]::New()
46+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPrivateIPAddress]::New()
4747

4848
if ($PSBoundParameters.ContainsKey('PrivateIPAddress')) {
4949
$Object.PrivateIPAddress = $PrivateIPAddress

src/Nginx/Nginx.Autorest/custom/autogen-model-cmdlets/New-AzNginxPublicIPAddressObject.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Create an in-memory object for NginxPublicIPAddress.
2121
Create an in-memory object for NginxPublicIPAddress.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPublicIPAddress
24+
Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPublicIPAddress
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Nginx/new-AzNginxPublicIPAddressObject
26+
https://learn.microsoft.com/powershell/module/Az.Nginx/new-AzNginxPublicIPAddressObject
2727
#>
2828
function New-AzNginxPublicIPAddressObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPublicIPAddress')]
29+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPublicIPAddress')]
3030
[CmdletBinding(PositionalBinding=$false)]
3131
Param(
3232

@@ -36,7 +36,7 @@ function New-AzNginxPublicIPAddressObject {
3636
)
3737

3838
process {
39-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20220801.NginxPublicIPAddress]::New()
39+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Nginx.Models.Api20230401.NginxPublicIPAddress]::New()
4040

4141
if ($PSBoundParameters.ContainsKey('Id')) {
4242
$Object.Id = $Id

0 commit comments

Comments
 (0)