Skip to content

Commit e74515a

Browse files
author
msJinLei
committed
First version of MySql flexible server cmdlets
1 parent 6463ac0 commit e74515a

File tree

687 files changed

+97339
-5861
lines changed

Some content is hidden

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

687 files changed

+97339
-5861
lines changed

src/MySql/Az.MySql.format.ps1xml

Lines changed: 1120 additions & 64 deletions
Large diffs are not rendered by default.

src/MySql/Az.MySql.psd1

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 8/21/2020
6+
# Generated on: 12/1/2020
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = './Az.MySql.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.2.0'
15+
ModuleVersion = '0.1.0'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -63,21 +63,36 @@ RequiredAssemblies = './bin/Az.MySql.private.dll'
6363
# TypesToProcess = @()
6464

6565
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.MySql.format.ps1xml'
66+
FormatsToProcess = 'Az.MySql.format.ps1xml'
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
6969
# NestedModules = @()
7070

7171
# 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.
7272
FunctionsToExport = 'Get-AzMySqlConfiguration', 'Get-AzMySqlConnectionString',
73-
'Get-AzMySqlFirewallRule', 'Get-AzMySqlReplica', 'Get-AzMySqlServer',
74-
'Get-AzMySqlVirtualNetworkRule', 'New-AzMySqlFirewallRule',
75-
'New-AzMySqlReplica', 'New-AzMySqlServer',
76-
'New-AzMySqlVirtualNetworkRule', 'Remove-AzMySqlFirewallRule',
77-
'Remove-AzMySqlServer', 'Remove-AzMySqlVirtualNetworkRule',
78-
'Restart-AzMySqlServer', 'Restore-AzMySqlServer',
79-
'Update-AzMySqlConfiguration', 'Update-AzMySqlFirewallRule',
80-
'Update-AzMySqlServer', 'Update-AzMySqlVirtualNetworkRule'
73+
'Get-AzMySqlFirewallRule', 'Get-AzMySqlFlexibleServer',
74+
'Get-AzMySqlFlexibleServerConfiguration',
75+
'Get-AzMySqlFlexibleServerDatabase',
76+
'Get-AzMySqlFlexibleServerFirewallRule',
77+
'Get-AzMySqlFlexibleServerReplica', 'Get-AzMySqlReplica',
78+
'Get-AzMySqlServer', 'Get-AzMySqlVirtualNetworkRule',
79+
'New-AzMySqlFirewallRule', 'New-AzMySqlFlexibleServer',
80+
'New-AzMySqlFlexibleServerDatabase',
81+
'New-AzMySqlFlexibleServerFirewallRule',
82+
'New-AzMySqlFlexibleServerReplica', 'New-AzMySqlReplica',
83+
'New-AzMySqlServer', 'New-AzMySqlVirtualNetworkRule',
84+
'Remove-AzMySqlFirewallRule', 'Remove-AzMySqlFlexibleServer',
85+
'Remove-AzMySqlFlexibleServerDatabase',
86+
'Remove-AzMySqlFlexibleServerFirewallRule', 'Remove-AzMySqlServer',
87+
'Remove-AzMySqlVirtualNetworkRule', 'Restart-AzMySqlFlexibleServer',
88+
'Restart-AzMySqlServer', 'Restore-AzMySqlFlexibleServer',
89+
'Restore-AzMySqlServer', 'Start-AzMySqlFlexibleServer',
90+
'Stop-AzMySqlFlexibleServer', 'Update-AzMySqlConfiguration',
91+
'Update-AzMySqlFirewallRule', 'Update-AzMySqlFlexibleServer',
92+
'Update-AzMySqlFlexibleServerConfiguration',
93+
'Update-AzMySqlFlexibleServerDatabase',
94+
'Update-AzMySqlFlexibleServerFirewallRule', 'Update-AzMySqlServer',
95+
'Update-AzMySqlVirtualNetworkRule'
8196

8297
# 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.
8398
CmdletsToExport = @()
@@ -115,13 +130,7 @@ PrivateData = @{
115130
# IconUri = ''
116131

117132
# ReleaseNotes of this module
118-
ReleaseNotes = '* Removed legacy SkuSize from input and output (#11725)
119-
* Added AllowAll & ClientIpAddress Modes to firewall rule cmdlets (#11932)
120-
* specified a default name when created MySql firewall rule without a name (#11932)
121-
* Added validateset for parameter StorageAutogrow (#11936)
122-
* Renamed New-AzMySqlServerReplica to New-AzMySqlReplica (#11938)
123-
* Used ''master'' and ''replica'' to avoid confusion when created mysql replica server (#11939)
124-
* Provided hint in doc to use Update-AzMySqlServer & Update-AzMySqlServerConfiguration as a candidate for each other (#11954)'
133+
# ReleaseNotes = ''
125134

126135
# Prerelease string of this module
127136
# Prerelease = ''

src/MySql/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added MySql flexible server cmdlets
2122

2223
## Version 0.2.0
2324
* Removed legacy SkuSize from input and output (#11725)
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
#
4+
# Copyright Microsoft Corporation
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ----------------------------------------------------------------------------------
15+
16+
<#
17+
.Synopsis
18+
Creates a new MySQL flexible server
19+
.Description
20+
Creates a new MySQL flexible server
21+
#>
22+
function New-AzMySqlFlexibleServer {
23+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated])]
24+
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
25+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Description('Creates a new server.')]
26+
param(
27+
[Parameter(Mandatory, HelpMessage = 'The name of the server.')]
28+
[Alias('ServerName')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
30+
[System.String]
31+
${Name},
32+
33+
[Parameter(Mandatory, HelpMessage = 'The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.')]
34+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
35+
[System.String]
36+
${ResourceGroupName},
37+
38+
[Parameter(HelpMessage='The subscription ID that identifies an Azure subscription.')]
39+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
40+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
41+
[System.String]
42+
${SubscriptionId},
43+
44+
[Parameter(HelpMessage = 'The location the resource resides in.')]
45+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
46+
[System.String]
47+
${Location},
48+
49+
[Parameter(Mandatory, HelpMessage = 'Administrator username for the server. Once set, it cannot be changed.')]
50+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
51+
[System.String]
52+
${AdministratorUserName},
53+
54+
[Parameter(Mandatory, HelpMessage = 'The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.')]
55+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
56+
[System.Security.SecureString]
57+
[ValidateNotNullOrEmpty()]
58+
${AdministratorLoginPassword},
59+
60+
[Parameter(HelpMessage = 'The name of the sku, typically, tier + family + cores, e.g. Standard_B1ms, Standard_D2ds_v4.')]
61+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
62+
[System.String]
63+
${Sku},
64+
65+
[Parameter(HelpMessage = 'Compute tier of the server. Accepted values: Burstable, GeneralPurpose, Memory Optimized. Default: Burstable.')]
66+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
67+
[System.String]
68+
${SkuTier},
69+
70+
[Parameter(HelpMessage = "Backup retention days for the server. Day count is between 7 and 35.")]
71+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
72+
[System.Int32]
73+
${BackupRetentionDay},
74+
75+
[Parameter(HelpMessage = 'Max storage allowed for a server.')]
76+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
77+
[System.Int32]
78+
${StorageInMb},
79+
80+
[Parameter(HelpMessage = 'Application-specific metadata in the form of key-value pairs.')]
81+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
82+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerForCreateTags]))]
83+
[System.Collections.Hashtable]
84+
${Tag},
85+
86+
[Parameter(HelpMessage = 'Server version.')]
87+
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.ServerVersion])]
88+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
89+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.ServerVersion]
90+
${Version},
91+
92+
[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')]
93+
[Alias('AzureRMContext', 'AzureCredential')]
94+
[ValidateNotNull()]
95+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
96+
[System.Management.Automation.PSObject]
97+
${DefaultProfile},
98+
99+
[Parameter(HelpMessage = 'Run the command as a job.')]
100+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
101+
[System.Management.Automation.SwitchParameter]
102+
${AsJob},
103+
104+
[Parameter(DontShow, HelpMessage = 'Wait for .NET debugger to attach.')]
105+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
106+
[System.Management.Automation.SwitchParameter]
107+
${Break},
108+
109+
[Parameter(DontShow)]
110+
[ValidateNotNull()]
111+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
112+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
113+
# SendAsync Pipeline Steps to be appended to the front of the pipeline.
114+
${HttpPipelineAppend},
115+
116+
[Parameter(DontShow)]
117+
[ValidateNotNull()]
118+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
119+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
120+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline.
121+
${HttpPipelinePrepend},
122+
123+
[Parameter(HelpMessage = 'Run the command asynchronously.')]
124+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
125+
[System.Management.Automation.SwitchParameter]
126+
${NoWait},
127+
128+
[Parameter(DontShow)]
129+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
130+
[System.Uri]
131+
# The URI for the proxy server to use.
132+
${Proxy},
133+
134+
[Parameter(DontShow)]
135+
[ValidateNotNull()]
136+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
137+
[System.Management.Automation.PSCredential]
138+
# Credentials for a proxy server to use for the remote call.
139+
${ProxyCredential},
140+
141+
[Parameter(DontShow)]
142+
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
143+
[System.Management.Automation.SwitchParameter]
144+
# Use the default credentials for the proxy.
145+
${ProxyUseDefaultCredentials}
146+
)
147+
148+
process {
149+
try {
150+
if ($PSBoundParameters.ContainsKey('Name')) {
151+
$PSBoundParameters.ServerName = $PSBoundParameters['Name']
152+
$null = $PSBoundParameters.Remove('Name')
153+
}
154+
155+
if ($PSBoundParameters.ContainsKey('Sku')) {
156+
$PSBoundParameters.SkuName = $PSBoundParameters['Sku']
157+
$null = $PSBoundParameters.Remove('Sku')
158+
}
159+
else {
160+
$PSBoundParameters.SkuName = 'Standard_B1ms'
161+
}
162+
163+
if ($PSBoundParameters.ContainsKey('BackupRetentionDay')) {
164+
$PSBoundParameters.StorageProfileBackupRetentionDay = $PSBoundParameters['BackupRetentionDay']
165+
$null = $PSBoundParameters.Remove('BackupRetentionDay')
166+
}
167+
else {
168+
$PSBoundParameters.StorageProfileBackupRetentionDay = 7
169+
}
170+
171+
if ($PSBoundParameters.ContainsKey('StorageInMb')) {
172+
$PSBoundParameters.StorageProfileStorageMb = $PSBoundParameters['StorageInMb']
173+
$null = $PSBoundParameters.Remove('StorageInMb')
174+
}
175+
else {
176+
$PSBoundParameters.StorageProfileStorageMb = 10240
177+
}
178+
179+
if (!$PSBoundParameters.ContainsKey('Version')) {
180+
$PSBoundParameters.Version = '5.7'
181+
}
182+
183+
if (!$PSBoundParameters.ContainsKey('SkuTier')) {
184+
$PSBoundParameters.SkuTier = 'Burstable'
185+
}
186+
187+
if (!$PSBoundParameters.ContainsKey('Location')) {
188+
$PSBoundParameters.Location = 'westus2'
189+
}
190+
191+
if ($PSBoundParameters.ContainsKey('AdministratorUserName')) {
192+
$PSBoundParameters.AdministratorLogin = $PSBoundParameters['AdministratorUserName']
193+
$null = $PSBoundParameters.Remove('AdministratorUserName')
194+
}
195+
196+
$PSBoundParameters.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.CreateMode]::Default
197+
$PSBoundParameters.AdministratorLoginPassword = . "$PSScriptRoot/../utils/Unprotect-SecureString.ps1" $PSBoundParameters['AdministratorLoginPassword']
198+
199+
Az.MySql.internal\New-AzMySqlFlexibleServer @PSBoundParameters
200+
} catch {
201+
throw
202+
}
203+
}
204+
}
205+
206+

0 commit comments

Comments
 (0)