diff --git a/src/MySql/Az.MySql.format.ps1xml b/src/MySql/Az.MySql.format.ps1xml
index a4a7d3b67b25..c2a0508b996c 100644
--- a/src/MySql/Az.MySql.format.ps1xml
+++ b/src/MySql/Az.MySql.format.ps1xml
@@ -648,9 +648,6 @@
-
-
-
@@ -679,9 +676,6 @@
SkuName
-
- SkuSize
- SkuTier
diff --git a/src/MySql/Az.MySql.psd1 b/src/MySql/Az.MySql.psd1
index 467bc2d2e7ca..cc8e037baae0 100644
--- a/src/MySql/Az.MySql.psd1
+++ b/src/MySql/Az.MySql.psd1
@@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
-# Generated on: 5/9/2020
+# Generated on: 8/12/2020
#
@{
@@ -72,7 +72,7 @@ FormatsToProcess = './Az.MySql.format.ps1xml'
FunctionsToExport = 'Get-AzMySqlConfiguration', 'Get-AzMySqlConnectionString',
'Get-AzMySqlFirewallRule', 'Get-AzMySqlReplica', 'Get-AzMySqlServer',
'Get-AzMySqlVirtualNetworkRule', 'New-AzMySqlFirewallRule',
- 'New-AzMySqlServer', 'New-AzMySqlServerReplica',
+ 'New-AzMySqlReplica', 'New-AzMySqlServer',
'New-AzMySqlVirtualNetworkRule', 'Remove-AzMySqlFirewallRule',
'Remove-AzMySqlServer', 'Remove-AzMySqlVirtualNetworkRule',
'Restart-AzMySqlServer', 'Restore-AzMySqlServer',
@@ -115,7 +115,7 @@ PrivateData = @{
# IconUri = ''
# ReleaseNotes of this module
- ReleaseNotes = '* the first preview release'
+ # ReleaseNotes = ''
# Prerelease string of this module
# Prerelease = ''
diff --git a/src/MySql/Az.MySql.psm1 b/src/MySql/Az.MySql.psm1
index bc1d80fc5088..3e7a8ca88acb 100644
--- a/src/MySql/Az.MySql.psm1
+++ b/src/MySql/Az.MySql.psm1
@@ -16,7 +16,7 @@
$accountsName = 'Az.Accounts'
$accountsModule = Get-Module -Name $accountsName
if(-not $accountsModule) {
- $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules'
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
if(Test-Path -Path $localAccountsPath) {
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
if($localAccounts) {
@@ -24,17 +24,17 @@
}
}
if(-not $accountsModule) {
- $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
if($hasAdequateVersion) {
- $accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
}
}
}
if(-not $accountsModule) {
- Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
- } elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
- Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"
diff --git a/src/MySql/ChangeLog.md b/src/MySql/ChangeLog.md
index b76ecb79cf4a..02cad124d94c 100644
--- a/src/MySql/ChangeLog.md
+++ b/src/MySql/ChangeLog.md
@@ -18,6 +18,13 @@
- Additional information about change #1
-->
## Upcoming Release
+* Remove legacy SkuSize from input and output (#11725)
+* Specify a default name when create MySql firewall rule without name and add AllowAll mode (#11932)
+* Enable EndIpAddress to be absent if only one IP to be authorized in firewall rule (#11933)
+* Add validateset for parameter StorageAutogrow (#11936)
+* Rename New-AzMySqlServerReplica to New-AzMySqlReplica (#11938)
+* Use 'master' and 'replica' to avoid confusion when create mysql replica server (#11939)
+* Provide hint in doc to use Update-AzMySqlServer & Update-AzMySqlServerConfiguration as a candidate for each other (#11954)
## Version 0.1.0
* the first preview release
diff --git a/src/MySql/build-module.ps1 b/src/MySql/build-module.ps1
index 261cfa3a1801..2c5033c7ff80 100644
--- a/src/MySql/build-module.ps1
+++ b/src/MySql/build-module.ps1
@@ -88,7 +88,7 @@ if(-not $Debugger) {
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
}
-$dll = Join-Path $PSScriptRoot 'bin/Az.MySql.private.dll'
+$dll = Join-Path $PSScriptRoot 'bin\Az.MySql.private.dll'
if(-not (Test-Path $dll)) {
Write-Error "Unable to find output assembly in '$binFolder'."
}
@@ -97,7 +97,7 @@ if(-not (Test-Path $dll)) {
$null = Import-Module -Name $dll
$modulePaths = $dll
-$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.MySql.custom.psm1'
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.MySql.custom.psm1'
if(Test-Path $customPsm1) {
$modulePaths = @($dll, $customPsm1)
}
diff --git a/src/MySql/check-dependencies.ps1 b/src/MySql/check-dependencies.ps1
index 30af57603366..513c52ca2fb5 100644
--- a/src/MySql/check-dependencies.ps1
+++ b/src/MySql/check-dependencies.ps1
@@ -21,13 +21,15 @@ if(-not $Isolated) {
return
}
-function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum) {
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
if($predicate) {
$module = Get-Module -ListAvailable -Name $moduleName
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
$null = New-Item -ItemType Directory -Force -Path $path
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
- if($versionMinimum) {
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
} else {
Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
@@ -39,13 +41,13 @@ function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [
$ProgressPreference = 'SilentlyContinue'
$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
-$localModulesPath = Join-Path $PSScriptRoot 'generated/modules'
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
if(Test-Path -Path $localModulesPath) {
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
}
-DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
-DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -versionMinimum ''
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
$tools = Join-Path $PSScriptRoot 'tools'
$resourceDir = Join-Path $tools 'Resources'
diff --git a/src/MySql/custom/Az.MySql.custom.psm1 b/src/MySql/custom/Az.MySql.custom.psm1
index 30b1e8be3321..09c4eb0b3234 100644
--- a/src/MySql/custom/Az.MySql.custom.psm1
+++ b/src/MySql/custom/Az.MySql.custom.psm1
@@ -1,9 +1,9 @@
# region Generated
# Load the private module dll
- $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.MySql.private.dll')
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MySql.private.dll')
# Load the internal module
- $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.MySql.internal.psm1'
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.MySql.internal.psm1'
if(Test-Path $internalModulePath) {
$null = Import-Module -Name $internalModulePath
}
diff --git a/src/MySql/custom/New-AzMySqlFirewallRule.ps1 b/src/MySql/custom/New-AzMySqlFirewallRule.ps1
new file mode 100644
index 000000000000..c38f39cb2a4a
--- /dev/null
+++ b/src/MySql/custom/New-AzMySqlFirewallRule.ps1
@@ -0,0 +1,166 @@
+
+# ----------------------------------------------------------------------------------
+#
+# 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
+Creates a new firewall rule or updates an existing firewall rule.
+.Description
+Creates a new firewall rule or updates an existing firewall rule.
+#>
+function New-AzMySqlFirewallRule {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter()]
+ [Alias('FirewallRuleName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server firewall rule.
+ # If not specified, the default is undefined.
+ # If AllowAll is present, the default name is AllowAll_yyyy-MM-dd_HH-mm-ss.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${ServerName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CreateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The end IP address of the server firewall rule.
+ # Must be IPv4 format.
+ ${EndIPAddress},
+
+ [Parameter(ParameterSetName='CreateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The start IP address of the server firewall rule.
+ # Must be IPv4 format.
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
+
+ [Parameter(ParameterSetName='AllowAll', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.
+ ${AllowAll},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+process {
+ try {
+ if($PSBoundParameters.ContainsKey('AllowAll'))
+ {
+ if(!$PSBoundParameters.ContainsKey('Name'))
+ {
+ $PSBoundParameters['Name'] = Get-Date -Format "AllowAll_yyyy-MM-dd_HH-mm-ss"
+ }
+ $PSBoundParameters['StartIPAddress'] = "0.0.0.0"
+ $PSBoundParameters['EndIPAddress'] = "255.255.255.255"
+
+ $null = $PSBoundParameters.Remove('AllowAll')
+ }
+ else
+ {
+ if(!$PSBoundParameters.ContainsKey('Name'))
+ {
+ $PSBoundParameters['Name'] = "undefined"
+ }
+ if(!$PSBoundParameters.ContainsKey('EndIPAddress'))
+ {
+ $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['StartIPAddress']
+ }
+ }
+
+ Az.MySql.internal\New-AzMySqlFirewallRule @PSBoundParameters
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/MySql/custom/New-AzMySqlServerReplica.ps1 b/src/MySql/custom/New-AzMySqlReplica.ps1
similarity index 92%
rename from src/MySql/custom/New-AzMySqlServerReplica.ps1
rename to src/MySql/custom/New-AzMySqlReplica.ps1
index 8c263fcc3884..a6551e95d5f3 100644
--- a/src/MySql/custom/New-AzMySqlServerReplica.ps1
+++ b/src/MySql/custom/New-AzMySqlReplica.ps1
@@ -13,16 +13,16 @@
# limitations under the License.
# ----------------------------------------------------------------------------------
-function New-AzMySqlServerReplica {
+function New-AzMySqlReplica {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Description('Creates a new replica from an existing database.')]
param(
[Parameter(Mandatory, HelpMessage = 'The name of the server.')]
- [Alias('ReplicaServerName')]
+ [Alias('ReplicaServerName', 'Name')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- ${Name},
+ ${Replica},
[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.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
@@ -36,9 +36,10 @@ function New-AzMySqlServerReplica {
${SubscriptionId},
[Parameter(Mandatory, ValueFromPipeline, HelpMessage = 'The source server object to create replica from.')]
+ [Alias('InputObject')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
- ${InputObject},
+ ${Master},
[Parameter(HelpMessage = 'The location the resource resides in.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
@@ -112,10 +113,10 @@ function New-AzMySqlServerReplica {
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.ServerPropertiesForReplica]::new()
$Parameter.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.CreateMode]::Replica
- $server = $PSBoundParameters['InputObject']
+ $server = $PSBoundParameters['Master']
$Parameter.Property.SourceServerId = $server.Id
$Parameter.Location = $server.Location
- $null = $PSBoundParameters.Remove('InputObject')
+ $null = $PSBoundParameters.Remove('Master')
if ($PSBoundParameters.ContainsKey('Location')) {
$Parameter.Location = $PSBoundParameters['Location']
@@ -127,6 +128,12 @@ function New-AzMySqlServerReplica {
$null = $PSBoundParameters.Remove('Sku')
}
+ if ($PSBoundParameters.ContainsKey('Replica'))
+ {
+ $PSBoundParameters['Name'] = $PSBoundParameters['Replica']
+ $null = $PSBoundParameters.Remove('Replica')
+ }
+
$PSBoundParameters.Add('Parameter', $Parameter)
Az.MySql.internal\New-AzMySqlServer @PSBoundParameters
diff --git a/src/MySql/custom/New-AzMySqlServer.ps1 b/src/MySql/custom/New-AzMySqlServer.ps1
index f207e30ebd77..ba28f06af47b 100644
--- a/src/MySql/custom/New-AzMySqlServer.ps1
+++ b/src/MySql/custom/New-AzMySqlServer.ps1
@@ -75,6 +75,7 @@ function New-AzMySqlServer {
[Parameter(HelpMessage = 'Enable Storage Auto Grow.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.StorageAutogrow])]
+ [Validateset('Enabled', 'Disabled')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.StorageAutogrow]
${StorageAutogrow},
diff --git a/src/MySql/custom/Update-AzMySqlConfiguration.ps1 b/src/MySql/custom/Update-AzMySqlConfiguration.ps1
new file mode 100644
index 000000000000..c58706844980
--- /dev/null
+++ b/src/MySql/custom/Update-AzMySqlConfiguration.ps1
@@ -0,0 +1,135 @@
+
+# ----------------------------------------------------------------------------------
+#
+# 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
+Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
+.Description
+Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
+#>
+function Update-AzMySqlConfiguration {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('ConfigurationName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server configuration.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${ServerName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
+ # Identity Parameter.
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # Source of the configuration.
+ ${Source},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # Value of the configuration.
+ ${Value},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Uri]
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
+)
+
+process {
+ try {
+ Az.MySql.internal\Update-AzMySqlConfiguration @PSBoundParameters
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/MySql/custom/Update-AzMySqlFirewallRule.ps1 b/src/MySql/custom/Update-AzMySqlFirewallRule.ps1
new file mode 100644
index 000000000000..69faa7c9c4fb
--- /dev/null
+++ b/src/MySql/custom/Update-AzMySqlFirewallRule.ps1
@@ -0,0 +1,146 @@
+
+# ----------------------------------------------------------------------------------
+#
+# 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
+Creates a new firewall rule or updates an existing firewall rule.
+.Description
+Creates a new firewall rule or updates an existing firewall rule.
+#>
+function Update-AzMySqlFirewallRule {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('FirewallRuleName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server firewall rule.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${ServerName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The end IP address of the server firewall rule.
+ # Must be IPv4 format.
+ ${EndIPAddress},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The start IP address of the server firewall rule.
+ # Must be IPv4 format.
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+process {
+ try {
+ if(!$PSBoundParameters.ContainsKey('EndIPAddress'))
+ {
+ $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['StartIPAddress']
+ }
+ Az.MySql.internal\Update-AzMySqlFirewallRule @PSBoundParameters
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/MySql/custom/Update-AzMySqlServer.ps1 b/src/MySql/custom/Update-AzMySqlServer.ps1
index f5fb5bf18773..b7e4694aace9 100644
--- a/src/MySql/custom/Update-AzMySqlServer.ps1
+++ b/src/MySql/custom/Update-AzMySqlServer.ps1
@@ -16,7 +16,7 @@
function Update-AzMySqlServer {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Description('Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Description('Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory, HelpMessage='The name of the server.')]
[Alias('ServerName')]
@@ -65,11 +65,6 @@ function Update-AzMySqlServer {
[System.String]
${Sku},
- [Parameter(HelpMessage='The size code, to be interpreted by resource as appropriate.')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- ${SkuSize},
-
[Parameter(HelpMessage='The tier of the particular SKU, e.g. Basic.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier])]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
@@ -89,6 +84,7 @@ function Update-AzMySqlServer {
[Parameter(HelpMessage='Enable Storage Auto Grow.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.StorageAutogrow])]
+ [Validateset('Enabled', 'Disabled')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.StorageAutogrow]
${StorageAutogrow},
diff --git a/src/MySql/custom/readme.md b/src/MySql/custom/readme.md
index 0fa9af4fcbfc..f8336dda153d 100644
--- a/src/MySql/custom/readme.md
+++ b/src/MySql/custom/readme.md
@@ -1,5 +1,5 @@
# Custom
-This directory contains custom implementation for non-generated cmdlets for the `Az.MySql` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.MySql.custom.psm1`. This file should not be modified.
+This directory contains custom implementation for non-generated cmdlets for the `Az.MySql` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.MySql.custom.psm1`. This file should not be modified.
## Info
- Modifiable: yes
@@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
For script cmdlets, these are loaded via the `Az.MySql.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
## Purpose
-This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder.
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
## Usage
-The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
- Break
- DefaultProfile
- HttpPipelineAppend
@@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.DoNotExportAttribute`
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.MySql`.
- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.InternalExportAttribute`
- - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.MySql`. For more information, see [readme.md](../internal/readme.md) in the `../internal` folder.
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.MySql`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder.
- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.ProfileAttribute`
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/MySql/examples/Get-AzMySqlReplica.md b/src/MySql/examples/Get-AzMySqlReplica.md
index 690ef92fdc78..93ffa81f1bac 100644
--- a/src/MySql/examples/Get-AzMySqlReplica.md
+++ b/src/MySql/examples/Get-AzMySqlReplica.md
@@ -2,9 +2,9 @@
```powershell
PS C:\> Get-AzMySqlReplica -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
-This cmdlet gets MySql server replica by resource group and server name.
\ No newline at end of file
+This cmdlet gets MySql server replica by resource group and server name.
diff --git a/src/MySql/examples/Get-AzMySqlServer.md b/src/MySql/examples/Get-AzMySqlServer.md
index a9ea3a641b9e..e65336638472 100644
--- a/src/MySql/examples/Get-AzMySqlServer.md
+++ b/src/MySql/examples/Get-AzMySqlServer.md
@@ -2,9 +2,9 @@
```powershell
PS C:\> Get-AzMySqlServer
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet gets MySql server with default context.
@@ -13,9 +13,9 @@ This cmdlet gets MySql server with default context.
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -Name mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet gets MySql server by resource group and server name.
@@ -24,9 +24,9 @@ This cmdlet gets MySql server by resource group and server name.
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet lists all the MySql servers in specified resource group.
@@ -36,9 +36,9 @@ This cmdlet lists all the MySql servers in specified resource group.
PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test"
PS C:\> Get-AzMySqlServer -InputObject $ID
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet lists gets MySql server by identity.
diff --git a/src/MySql/examples/New-AzMySqlFirewallRule.md b/src/MySql/examples/New-AzMySqlFirewallRule.md
index 23d82111a559..d6602ff94f3b 100644
--- a/src/MySql/examples/New-AzMySqlFirewallRule.md
+++ b/src/MySql/examples/New-AzMySqlFirewallRule.md
@@ -2,9 +2,31 @@
```powershell
PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
-Name Type
----- ----
-rule Microsoft.DBforMySQL/servers/firewallRules
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.0 0.0.0.1
```
-This cmdlets create a MySql server Firewall Rule.
\ No newline at end of file
+This cmdlets create a MySql server Firewall Rule.
+
+### Example 2: Create a new MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized
+```powershell
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.1 0.0.0.1
+```
+
+This cmdlets create a MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized.
+
+### Example 3: Create a new MySql Firewall Rule to allow all IPs
+```powershell
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+AllowAll_2020-08-11_18-19-27 0.0.0.0 255.255.255.255
+```
+
+This cmdlets create a new MySql Firewall Rule to allow all IPs.
\ No newline at end of file
diff --git a/src/MySql/examples/New-AzMySqlReplica.md b/src/MySql/examples/New-AzMySqlReplica.md
new file mode 100644
index 000000000000..2d9c265cd231
--- /dev/null
+++ b/src/MySql/examples/New-AzMySqlReplica.md
@@ -0,0 +1,22 @@
+### Example 1: Create a new MySql server replica
+```powershell
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlReplica -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+```
+
+This cmdlet creates a new MySql server replica.
+
+### Example 2: Create a new MySql server replica
+```powershell
+PS C:\> $mysql = Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
+PS C:\> New-AzMySqlReplica -Master $mysql -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+```
+
+This cmdlet with parameter master(inputobject) creates a new MySql server replica.
diff --git a/src/MySql/examples/New-AzMySqlServer.md b/src/MySql/examples/New-AzMySqlServer.md
index c3b17fa6e8c3..59cab1143f80 100644
--- a/src/MySql/examples/New-AzMySqlServer.md
+++ b/src/MySql/examples/New-AzMySqlServer.md
@@ -2,9 +2,9 @@
```powershell
PS C:\> New-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -Location eastus -AdministratorUser mysql_test -AdministratorLoginPassword $password -Sku GP_Gen5_4
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
These cmdlets create a new MySql server.
diff --git a/src/MySql/examples/New-AzMySqlServerReplica.md b/src/MySql/examples/New-AzMySqlServerReplica.md
deleted file mode 100644
index 9dcfa2306046..000000000000
--- a/src/MySql/examples/New-AzMySqlServerReplica.md
+++ /dev/null
@@ -1,10 +0,0 @@
-### Example 1: Create a new MySql server replica
-```powershell
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlServerReplica -Name mysql-test-replica -ResourceGroupName PowershellMySqlTest
-
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
-```
-
-This cmdlet creates a new MySql server replica.
\ No newline at end of file
diff --git a/src/MySql/examples/Restore-AzMySqlServer.md b/src/MySql/examples/Restore-AzMySqlServer.md
index 5333356ca31c..76b32c1b542d 100644
--- a/src/MySql/examples/Restore-AzMySqlServer.md
+++ b/src/MySql/examples/Restore-AzMySqlServer.md
@@ -2,9 +2,9 @@
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test-replica | Restore-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -UseGeoRestore
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
This cmdlet restores MySql server using GeoReplica Restore.
@@ -14,9 +14,9 @@ This cmdlet restores MySql server using GeoReplica Restore.
PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -UsePointInTimeRestore
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
These cmdlets restore MySql server using PointInTime Restore.
diff --git a/src/MySql/examples/Update-AzMySqlFirewallRule.md b/src/MySql/examples/Update-AzMySqlFirewallRule.md
index d2420ab09381..e5f7a398c09b 100644
--- a/src/MySql/examples/Update-AzMySqlFirewallRule.md
+++ b/src/MySql/examples/Update-AzMySqlFirewallRule.md
@@ -19,4 +19,16 @@ Name StartIPAddress EndIPAddress
rule 0.0.0.2 0.0.0.3
```
-These cmdlets update MySql Firewall Rule by identity.
\ No newline at end of file
+These cmdlets update MySql Firewall Rule by identity.
+
+### Example 3: Update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized
+```powershell
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
+PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.2 0.0.0.3
+```
+
+These cmdlets update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized.
\ No newline at end of file
diff --git a/src/MySql/examples/Update-AzMySqlServer.md b/src/MySql/examples/Update-AzMySqlServer.md
index 864133de19df..c13bd55fa217 100644
--- a/src/MySql/examples/Update-AzMySqlServer.md
+++ b/src/MySql/examples/Update-AzMySqlServer.md
@@ -2,9 +2,9 @@
```powershell
PS C:\> Update-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -SslEnforcement Disabled
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
```
This cmdlet updates MySql server by resource group and server name.
@@ -13,9 +13,9 @@ This cmdlet updates MySql server by resource group and server name.
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Update-AzMySqlServer -BackupRetentionDay 23 -StorageMb 10240
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
This cmdlet updates MySql server by identity.
diff --git a/src/MySql/export-surface.ps1 b/src/MySql/export-surface.ps1
index 666ff4777d3f..c9fcbde013e7 100644
--- a/src/MySql/export-surface.ps1
+++ b/src/MySql/export-surface.ps1
@@ -21,7 +21,7 @@ if(-not $Isolated) {
return
}
-$dll = Join-Path $PSScriptRoot 'bin/Az.MySql.private.dll'
+$dll = Join-Path $PSScriptRoot 'bin\Az.MySql.private.dll'
if(-not (Test-Path $dll)) {
Write-Error "Unable to find output assembly in '$binFolder'."
}
diff --git a/src/MySql/exports/Get-AzMySqlConfiguration.ps1 b/src/MySql/exports/Get-AzMySqlConfiguration.ps1
index 9ac0f65fb790..863e1bb7ddf0 100644
--- a/src/MySql/exports/Get-AzMySqlConfiguration.ps1
+++ b/src/MySql/exports/Get-AzMySqlConfiguration.ps1
@@ -45,6 +45,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Get-AzMySqlConnectionString.ps1 b/src/MySql/exports/Get-AzMySqlConnectionString.ps1
index f9973cbb8e68..bc8d204ce6e3 100644
--- a/src/MySql/exports/Get-AzMySqlConnectionString.ps1
+++ b/src/MySql/exports/Get-AzMySqlConnectionString.ps1
@@ -33,6 +33,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
System.String
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The source server object to create replica from.
diff --git a/src/MySql/exports/Get-AzMySqlFirewallRule.ps1 b/src/MySql/exports/Get-AzMySqlFirewallRule.ps1
index 37e288315a6d..5edf2c7e5a75 100644
--- a/src/MySql/exports/Get-AzMySqlFirewallRule.ps1
+++ b/src/MySql/exports/Get-AzMySqlFirewallRule.ps1
@@ -44,6 +44,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Get-AzMySqlReplica.ps1 b/src/MySql/exports/Get-AzMySqlReplica.ps1
index c3c6a2c46659..bd1808902ac8 100644
--- a/src/MySql/exports/Get-AzMySqlReplica.ps1
+++ b/src/MySql/exports/Get-AzMySqlReplica.ps1
@@ -21,9 +21,9 @@ List all the replicas for a given server.
.Example
PS C:\> Get-AzMySqlReplica -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
diff --git a/src/MySql/exports/Get-AzMySqlServer.ps1 b/src/MySql/exports/Get-AzMySqlServer.ps1
index 701085de52e4..3cc285401061 100644
--- a/src/MySql/exports/Get-AzMySqlServer.ps1
+++ b/src/MySql/exports/Get-AzMySqlServer.ps1
@@ -21,28 +21,28 @@ Gets information about a server.
.Example
PS C:\> Get-AzMySqlServer
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -Name mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test"
PS C:\> Get-AzMySqlServer -InputObject $ID
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
@@ -50,6 +50,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Get-AzMySqlVirtualNetworkRule.ps1 b/src/MySql/exports/Get-AzMySqlVirtualNetworkRule.ps1
index cba99a09c1d6..258ccc9b88b7 100644
--- a/src/MySql/exports/Get-AzMySqlVirtualNetworkRule.ps1
+++ b/src/MySql/exports/Get-AzMySqlVirtualNetworkRule.ps1
@@ -44,6 +44,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/New-AzMySqlFirewallRule.ps1 b/src/MySql/exports/New-AzMySqlFirewallRule.ps1
index 84cfa2c03fee..efa3d67fa041 100644
--- a/src/MySql/exports/New-AzMySqlFirewallRule.ps1
+++ b/src/MySql/exports/New-AzMySqlFirewallRule.ps1
@@ -21,9 +21,21 @@ Creates a new firewall rule or updates an existing firewall rule.
.Example
PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
-Name Type
----- ----
-rule Microsoft.DBforMySQL/servers/firewallRules
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.0 0.0.0.1
+.Example
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.1 0.0.0.1
+.Example
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+AllowAll_2020-08-11_18-19-27 0.0.0.0 255.255.255.255
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
@@ -34,13 +46,6 @@ function New-AzMySqlFirewallRule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
- [Parameter(Mandatory)]
- [Alias('FirewallRuleName')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # The name of the server firewall rule.
- ${Name},
-
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
@@ -54,6 +59,15 @@ param(
# The name of the server.
${ServerName},
+ [Parameter()]
+ [Alias('FirewallRuleName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server firewall rule.
+ # If not specified, the default is undefined.
+ # If AllowAll is present, the default name is AllowAll_yyyy-MM-dd_HH-mm-ss.
+ ${Name},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
@@ -61,19 +75,26 @@ param(
# The ID of the target subscription.
${SubscriptionId},
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The end IP address of the server firewall rule.
+ # The start IP address of the server firewall rule.
# Must be IPv4 format.
- ${EndIPAddress},
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The start IP address of the server firewall rule.
+ # The end IP address of the server firewall rule.
# Must be IPv4 format.
- ${StartIPAddress},
+ ${EndIPAddress},
+
+ [Parameter(ParameterSetName='AllowAll', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.
+ ${AllowAll},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -143,9 +164,10 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- CreateExpanded = 'Az.MySql.private\New-AzMySqlFirewallRule_CreateExpanded';
+ CreateExpanded = 'Az.MySql.custom\New-AzMySqlFirewallRule';
+ AllowAll = 'Az.MySql.custom\New-AzMySqlFirewallRule';
}
- if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('CreateExpanded', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
diff --git a/src/MySql/exports/New-AzMySqlServerReplica.ps1 b/src/MySql/exports/New-AzMySqlReplica.ps1
similarity index 87%
rename from src/MySql/exports/New-AzMySqlServerReplica.ps1
rename to src/MySql/exports/New-AzMySqlReplica.ps1
index 3dfae3871525..0bcf936f0f91 100644
--- a/src/MySql/exports/New-AzMySqlServerReplica.ps1
+++ b/src/MySql/exports/New-AzMySqlReplica.ps1
@@ -19,11 +19,18 @@ Creates a new replica from an existing database.
.Description
Creates a new replica from an existing database.
.Example
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlServerReplica -Name mysql-test-replica -ResourceGroupName PowershellMySqlTest
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlReplica -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+.Example
+PS C:\> $mysql = Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
+PS C:\> New-AzMySqlReplica -Master $mysql -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
@@ -31,9 +38,10 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : The source server object to create replica from.
+MASTER : The source server object to create replica from.
Location : The location the resource resides in.
[Tag ]: Application-specific metadata in the form of key-value pairs.
[(Any) ]: This indicates any property can be added to this object.
@@ -60,18 +68,18 @@ INPUTOBJECT : The source server object to create replica from.
[UserVisibleState ]: A state of a server that is visible to user.
[Version ]: Server version.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlserverreplica
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlreplica
#>
-function New-AzMySqlServerReplica {
+function New-AzMySqlReplica {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
- [Alias('ReplicaServerName')]
+ [Alias('ReplicaServerName', 'Name')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
# The name of the server.
- ${Name},
+ ${Replica},
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
@@ -87,11 +95,12 @@ param(
${SubscriptionId},
[Parameter(Mandatory, ValueFromPipeline)]
+ [Alias('InputObject')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
# The source server object to create replica from.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
- ${InputObject},
+ # To construct, see NOTES section for MASTER properties and create a hash table.
+ ${Master},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
@@ -169,7 +178,7 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- CreateExpanded = 'Az.MySql.custom\New-AzMySqlServerReplica';
+ CreateExpanded = 'Az.MySql.custom\New-AzMySqlReplica';
}
if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
diff --git a/src/MySql/exports/New-AzMySqlServer.ps1 b/src/MySql/exports/New-AzMySqlServer.ps1
index e7c853f8f93e..3df081b8547f 100644
--- a/src/MySql/exports/New-AzMySqlServer.ps1
+++ b/src/MySql/exports/New-AzMySqlServer.ps1
@@ -21,9 +21,9 @@ Creates a new server.
.Example
PS C:\> New-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -Location eastus -AdministratorUser mysql_test -AdministratorLoginPassword $password -Sku GP_Gen5_4
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
diff --git a/src/MySql/exports/ProxyCmdletDefinitions.ps1 b/src/MySql/exports/ProxyCmdletDefinitions.ps1
index e3ba5afaab82..e93685f48073 100644
--- a/src/MySql/exports/ProxyCmdletDefinitions.ps1
+++ b/src/MySql/exports/ProxyCmdletDefinitions.ps1
@@ -45,6 +45,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -236,6 +237,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -404,9 +406,9 @@ List all the replicas for a given server.
.Example
PS C:\> Get-AzMySqlReplica -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
@@ -546,28 +548,28 @@ Gets information about a server.
.Example
PS C:\> Get-AzMySqlServer
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -Name mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Example
PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test"
PS C:\> Get-AzMySqlServer -InputObject $ID
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
@@ -575,6 +577,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -761,6 +764,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -927,181 +931,6 @@ end {
# limitations under the License.
# ----------------------------------------------------------------------------------
-<#
-.Synopsis
-Creates a new firewall rule or updates an existing firewall rule.
-.Description
-Creates a new firewall rule or updates an existing firewall rule.
-.Example
-PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
-
-Name Type
----- ----
-rule Microsoft.DBforMySQL/servers/firewallRules
-
-.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
-.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlfirewallrule
-#>
-function New-AzMySqlFirewallRule {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
-[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
-param(
- [Parameter(Mandatory)]
- [Alias('FirewallRuleName')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # The name of the server firewall rule.
- ${Name},
-
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # The name of the resource group.
- # The name is case insensitive.
- ${ResourceGroupName},
-
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # The name of the server.
- ${ServerName},
-
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
- [System.String]
- # The ID of the target subscription.
- ${SubscriptionId},
-
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The end IP address of the server firewall rule.
- # Must be IPv4 format.
- ${EndIPAddress},
-
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The start IP address of the server firewall rule.
- # Must be IPv4 format.
- ${StartIPAddress},
-
- [Parameter()]
- [Alias('AzureRMContext', 'AzureCredential')]
- [ValidateNotNull()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
- [System.Management.Automation.PSObject]
- # The credentials, account, tenant, and subscription used for communication with Azure.
- ${DefaultProfile},
-
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command as a job
- ${AsJob},
-
- [Parameter(DontShow)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Wait for .NET debugger to attach
- ${Break},
-
- [Parameter(DontShow)]
- [ValidateNotNull()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be appended to the front of the pipeline
- ${HttpPipelineAppend},
-
- [Parameter(DontShow)]
- [ValidateNotNull()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be prepended to the front of the pipeline
- ${HttpPipelinePrepend},
-
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command asynchronously
- ${NoWait},
-
- [Parameter(DontShow)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Uri]
- # The URI for the proxy server to use
- ${Proxy},
-
- [Parameter(DontShow)]
- [ValidateNotNull()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.PSCredential]
- # Credentials for a proxy server to use for the remote call
- ${ProxyCredential},
-
- [Parameter(DontShow)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Use the default credentials for the proxy
- ${ProxyUseDefaultCredentials}
-)
-
-begin {
- try {
- $outBuffer = $null
- if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
- $PSBoundParameters['OutBuffer'] = 1
- }
- $parameterSet = $PSCmdlet.ParameterSetName
- $mapping = @{
- CreateExpanded = 'Az.MySql.private\New-AzMySqlFirewallRule_CreateExpanded';
- }
- if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
- }
- $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
- $scriptCmd = {& $wrappedCmd @PSBoundParameters}
- $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
- $steppablePipeline.Begin($PSCmdlet)
- } catch {
- throw
- }
-}
-
-process {
- try {
- $steppablePipeline.Process($_)
- } catch {
- throw
- }
-}
-
-end {
- try {
- $steppablePipeline.End()
- } catch {
- throw
- }
-}
-}
-
-# ----------------------------------------------------------------------------------
-#
-# 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
Creates or updates an existing virtual network rule.
@@ -1301,6 +1130,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -1494,6 +1324,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -1681,6 +1512,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -1874,6 +1706,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -2044,29 +1877,32 @@ end {
<#
.Synopsis
-Updates a configuration of a server.
+Creates or updates an existing virtual network rule.
.Description
-Updates a configuration of a server.
+Creates or updates an existing virtual network rule.
.Example
-PS C:\> Update-AzMySqlConfiguration -Name net_retry_count -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -Value 15
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.Network/virtualNetworks/MySqlVNet/subnets/MysqlSubnet2"
+PS C:\> Update-AzMySqlVirtualNetworkRule -Name $env.VNetName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -SubnetId $ID
-Name Value
----- -----
-net_retry_count 15
+Name Type
+---- ----
+vnet Microsoft.DBforMySQL/servers/virtualNetworkRules
.Example
-PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/configurations/wait_timeout"
-PS C:\> Update-AzMySqlConfiguration -InputObject $ID -Value 150
+PS C:\> $SubnetID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.Network/virtualNetworks/MySqlVNet/subnets/MysqlSubnet1"
+PS C:\> $VNetID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/virtualNetworkRules/vnet"
+PS C:\> Update-AzMySqlVirtualNetworkRule -InputObject $VNetID -SubnetId $SubnetID
-Name Value
----- -----
-wait_timeout 150
+Name Type
+---- ----
+vnet Microsoft.DBforMySQL/servers/virtualNetworkRules
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -2081,17 +1917,17 @@ INPUTOBJECT : Identity Parameter
[SubscriptionId ]: The ID of the target subscription.
[VirtualNetworkRuleName ]: The name of the virtual network rule.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlconfiguration
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlvirtualnetworkrule
#>
-function Update-AzMySqlConfiguration {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration])]
+function Update-AzMySqlVirtualNetworkRule {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
- [Alias('ConfigurationName')]
+ [Alias('VirtualNetworkRuleName')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the server configuration.
+ # The name of the virtual network rule.
${Name},
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
@@ -2121,17 +1957,17 @@ param(
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
- [Parameter()]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # Source of the configuration.
- ${Source},
+ # The ARM resource id of the virtual network subnet.
+ ${SubnetId},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # Value of the configuration.
- ${Value},
+ [System.Management.Automation.SwitchParameter]
+ # Create firewall rule before the virtual network has vnet service endpoint enabled.
+ ${IgnoreMissingVnetServiceEndpoint},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -2173,6 +2009,12 @@ param(
# Run the command asynchronously
${NoWait},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
@@ -2201,8 +2043,8 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- UpdateExpanded = 'Az.MySql.private\Update-AzMySqlConfiguration_UpdateExpanded';
- UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlConfiguration_UpdateViaIdentityExpanded';
+ UpdateExpanded = 'Az.MySql.private\Update-AzMySqlVirtualNetworkRule_UpdateExpanded';
+ UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlVirtualNetworkRule_UpdateViaIdentityExpanded';
}
if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
@@ -2249,97 +2091,93 @@ end {
<#
.Synopsis
-Creates a new firewall rule or updates an existing firewall rule.
+Get the connection string according to client connection provider.
.Description
-Creates a new firewall rule or updates an existing firewall rule.
+Get the connection string according to client connection provider.
.Example
-PS C:\> Update-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.3 -StartIPAddress 0.0.0.2
+PS C:\> Get-AzMySqlConnectionString -Client ADO.NET -Name mysql-test -ResourceGroupName PowershellMySqlTest
-Name StartIPAddress EndIPAddress
----- -------------- ------------
-rule 0.0.0.2 0.0.0.3
+Server=mysql-test.mysql.database.azure.com; Port=3306; Database={your_database}; Uid=mysql_test@mysql-test; Pwd={your_password};
.Example
-PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
-PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -EndIPAddress 0.0.0.3 -StartIPAddress 0.0.0.2
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Get-AzMySqlConnectionString -Client PHP
-Name StartIPAddress EndIPAddress
----- -------------- ------------
-rule 0.0.0.2 0.0.0.3
+$con=mysqli_init(); mysqli_real_connect($con, "mysql-test.mysql.database.azure.com", "mysql_test@mysql-test", {your_password}, {your_database}, 3306);
.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
+System.String
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: The name of the server configuration.
- [DatabaseName ]: The name of the database.
- [FirewallRuleName ]: The name of the server firewall rule.
- [Id ]: Resource identity path
- [LocationName ]: The name of the location.
- [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
- [SecurityAlertPolicyName ]: The name of the security alert policy.
- [ServerName ]: The name of the server.
- [SubscriptionId ]: The ID of the target subscription.
- [VirtualNetworkRuleName ]: The name of the virtual network rule.
+INPUTOBJECT : The source server object to create replica from.
+ Location : The location the resource resides in.
+ [Tag ]: Application-specific metadata in the form of key-value pairs.
+ [(Any) ]: This indicates any property can be added to this object.
+ [AdministratorLogin ]: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
+ [EarliestRestoreDate ]: Earliest restore point creation time (ISO8601 format)
+ [FullyQualifiedDomainName ]: The fully qualified domain name of a server.
+ [IdentityType ]: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
+ [InfrastructureEncryption ]: Status showing whether the server enabled infrastructure encryption.
+ [MasterServerId ]: The master server id of a replica server.
+ [MinimalTlsVersion ]: Enforce a minimal Tls version for the server.
+ [PublicNetworkAccess ]: Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
+ [ReplicaCapacity ]: The maximum number of replicas that a master server can have.
+ [ReplicationRole ]: The replication role of the server.
+ [SkuCapacity ]: The scale up/out capacity, representing server's compute units.
+ [SkuFamily ]: The family of hardware.
+ [SkuName ]: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
+ [SkuSize ]: The size code, to be interpreted by resource as appropriate.
+ [SkuTier ]: The tier of the particular SKU, e.g. Basic.
+ [SslEnforcement ]: Enable ssl enforcement or not when connect to server.
+ [StorageProfileBackupRetentionDay ]: Backup retention days for the server.
+ [StorageProfileGeoRedundantBackup ]: Enable Geo-redundant or not for server backup.
+ [StorageProfileStorageAutogrow ]: Enable Storage Auto Grow.
+ [StorageProfileStorageMb ]: Max storage allowed for a server.
+ [UserVisibleState ]: A state of a server that is visible to user.
+ [Version ]: Server version.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlfirewallrule
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlconnectionstring
#>
-function Update-AzMySqlFirewallRule {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
-[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function Get-AzMySqlConnectionString {
+[OutputType([System.String])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
param(
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
- [Alias('FirewallRuleName')]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the server firewall rule.
- ${Name},
+ # Client connection provider.
+ ${Client},
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('ServerName')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the resource group.
- # The name is case insensitive.
- ${ResourceGroupName},
+ # The name of the server.
+ ${Name},
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Parameter(ParameterSetName='Get', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the server.
- ${ServerName},
+ # The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
+ ${ResourceGroupName},
- [Parameter(ParameterSetName='UpdateExpanded')]
+ [Parameter(ParameterSetName='Get')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
- # The ID of the target subscription.
+ # The subscription ID that identifies an Azure subscription.
${SubscriptionId},
- [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
- # Identity Parameter
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
+ # The source server object to create replica from.
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The end IP address of the server firewall rule.
- # Must be IPv4 format.
- ${EndIPAddress},
-
- [Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The start IP address of the server firewall rule.
- # Must be IPv4 format.
- ${StartIPAddress},
-
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
@@ -2348,55 +2186,38 @@ param(
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command as a job
- ${AsJob},
-
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Wait for .NET debugger to attach
+ # Wait for .NET debugger to attach.
${Break},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command asynchronously
- ${NoWait},
-
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
- # The URI for the proxy server to use
${Proxy},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.PSCredential]
- # Credentials for a proxy server to use for the remote call
${ProxyCredential},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
@@ -2408,10 +2229,10 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- UpdateExpanded = 'Az.MySql.private\Update-AzMySqlFirewallRule_UpdateExpanded';
- UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlFirewallRule_UpdateViaIdentityExpanded';
+ Get = 'Az.MySql.custom\Get-AzMySqlConnectionString';
+ GetViaIdentity = 'Az.MySql.custom\Get-AzMySqlConnectionString';
}
- if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
@@ -2456,96 +2277,86 @@ end {
<#
.Synopsis
-Creates or updates an existing virtual network rule.
+Creates a new firewall rule or updates an existing firewall rule.
.Description
-Creates or updates an existing virtual network rule.
+Creates a new firewall rule or updates an existing firewall rule.
.Example
-PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.Network/virtualNetworks/MySqlVNet/subnets/MysqlSubnet2"
-PS C:\> Update-AzMySqlVirtualNetworkRule -Name $env.VNetName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -SubnetId $ID
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
-Name Type
----- ----
-vnet Microsoft.DBforMySQL/servers/virtualNetworkRules
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.0 0.0.0.1
.Example
-PS C:\> $SubnetID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.Network/virtualNetworks/MySqlVNet/subnets/MysqlSubnet1"
-PS C:\> $VNetID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/virtualNetworkRules/vnet"
-PS C:\> Update-AzMySqlVirtualNetworkRule -InputObject $VNetID -SubnetId $SubnetID
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1
-Name Type
----- ----
-vnet Microsoft.DBforMySQL/servers/virtualNetworkRules
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.1 0.0.0.1
+.Example
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll
-.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
-.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule
-.Notes
-COMPLEX PARAMETER PROPERTIES
-To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+AllowAll_2020-08-11_18-19-27 0.0.0.0 255.255.255.255
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: The name of the server configuration.
- [DatabaseName ]: The name of the database.
- [FirewallRuleName ]: The name of the server firewall rule.
- [Id ]: Resource identity path
- [LocationName ]: The name of the location.
- [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
- [SecurityAlertPolicyName ]: The name of the security alert policy.
- [ServerName ]: The name of the server.
- [SubscriptionId ]: The ID of the target subscription.
- [VirtualNetworkRuleName ]: The name of the virtual network rule.
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlvirtualnetworkrule
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlfirewallrule
#>
-function Update-AzMySqlVirtualNetworkRule {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule])]
-[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function New-AzMySqlFirewallRule {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
- [Alias('VirtualNetworkRuleName')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # The name of the virtual network rule.
- ${Name},
-
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
# The name of the resource group.
# The name is case insensitive.
${ResourceGroupName},
- [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
# The name of the server.
${ServerName},
- [Parameter(ParameterSetName='UpdateExpanded')]
+ [Parameter()]
+ [Alias('FirewallRuleName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server firewall rule.
+ # If not specified, the default is undefined.
+ # If AllowAll is present, the default name is AllowAll_yyyy-MM-dd_HH-mm-ss.
+ ${Name},
+
+ [Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# The ID of the target subscription.
${SubscriptionId},
- [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
- # Identity Parameter
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
- ${InputObject},
+ [Parameter(ParameterSetName='CreateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The start IP address of the server firewall rule.
+ # Must be IPv4 format.
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The ARM resource id of the virtual network subnet.
- ${SubnetId},
+ # The end IP address of the server firewall rule.
+ # Must be IPv4 format.
+ ${EndIPAddress},
- [Parameter()]
+ [Parameter(ParameterSetName='AllowAll', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.Management.Automation.SwitchParameter]
- # Create firewall rule before the virtual network has vnet service endpoint enabled.
- ${IgnoreMissingVnetServiceEndpoint},
+ # Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.
+ ${AllowAll},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -2587,12 +2398,6 @@ param(
# Run the command asynchronously
${NoWait},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Returns true when the command succeeds
- ${PassThru},
-
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
@@ -2621,10 +2426,10 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- UpdateExpanded = 'Az.MySql.private\Update-AzMySqlVirtualNetworkRule_UpdateExpanded';
- UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlVirtualNetworkRule_UpdateViaIdentityExpanded';
+ CreateExpanded = 'Az.MySql.custom\New-AzMySqlFirewallRule';
+ AllowAll = 'Az.MySql.custom\New-AzMySqlFirewallRule';
}
- if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('CreateExpanded', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
@@ -2669,27 +2474,33 @@ end {
<#
.Synopsis
-Get the connection string according to client connection provider.
+Creates a new replica from an existing database.
.Description
-Get the connection string according to client connection provider.
+Creates a new replica from an existing database.
.Example
-PS C:\> Get-AzMySqlConnectionString -Client ADO.NET -Name mysql-test -ResourceGroupName PowershellMySqlTest
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlReplica -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
-Server=mysql-test.mysql.database.azure.com; Port=3306; Database={your_database}; Uid=mysql_test@mysql-test; Pwd={your_password};
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Example
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Get-AzMySqlConnectionString -Client PHP
+PS C:\> $mysql = Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
+PS C:\> New-AzMySqlReplica -Master $mysql -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
-$con=mysqli_init(); mysqli_real_connect($con, "mysql-test.mysql.database.azure.com", "mysql_test@mysql-test", {your_password}, {your_database}, 3306);
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Outputs
-System.String
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : The source server object to create replica from.
+MASTER : The source server object to create replica from.
Location : The location the resource resides in.
[Tag ]: Application-specific metadata in the form of key-value pairs.
[(Any) ]: This indicates any property can be added to this object.
@@ -2716,53 +2527,67 @@ INPUTOBJECT : The source server object to create replica from.
[UserVisibleState ]: A state of a server that is visible to user.
[Version ]: Server version.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlconnectionstring
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlreplica
#>
-function Get-AzMySqlConnectionString {
-[OutputType([System.String])]
-[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+function New-AzMySqlReplica {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
- [System.String]
- # Client connection provider.
- ${Client},
-
- [Parameter(ParameterSetName='Get', Mandatory)]
- [Alias('ServerName')]
+ [Alias('ReplicaServerName', 'Name')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
# The name of the server.
- ${Name},
+ ${Replica},
- [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
# The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
${ResourceGroupName},
- [Parameter(ParameterSetName='Get')]
+ [Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# The subscription ID that identifies an Azure subscription.
${SubscriptionId},
- [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [Alias('InputObject')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
# The source server object to create replica from.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
- ${InputObject},
+ # To construct, see NOTES section for MASTER properties and create a hash table.
+ ${Master},
[Parameter()]
- [Alias('AzureRMContext', 'AzureCredential')]
- [ValidateNotNull()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
- [System.Management.Automation.PSObject]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The location the resource resides in.
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The name of the sku, typically, tier + family + cores, e.g.
+ # B_Gen4_1, GP_Gen5_8.
+ ${Sku},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
+ [System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job.
+ ${AsJob},
+
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
@@ -2781,6 +2606,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
${HttpPipelinePrepend},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously.
+ ${NoWait},
+
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
@@ -2806,10 +2637,9 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- Get = 'Az.MySql.custom\Get-AzMySqlConnectionString';
- GetViaIdentity = 'Az.MySql.custom\Get-AzMySqlConnectionString';
+ CreateExpanded = 'Az.MySql.custom\New-AzMySqlReplica';
}
- if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
@@ -2860,9 +2690,9 @@ Creates a new server.
.Example
PS C:\> New-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -Location eastus -AdministratorUser mysql_test -AdministratorLoginPassword $password -Sku GP_Gen5_4
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
@@ -3076,96 +2906,332 @@ end {
<#
.Synopsis
-Creates a new replica from an existing database.
+Restore a server from an existing backup
.Description
-Creates a new replica from an existing database.
+Restore a server from an existing backup
+.Example
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test-replica | Restore-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -UseGeoRestore
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+.Example
+PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -UsePointInTimeRestore
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : The source server object to restore from.
+ Location : The location the resource resides in.
+ [Tag ]: Application-specific metadata in the form of key-value pairs.
+ [(Any) ]: This indicates any property can be added to this object.
+ [AdministratorLogin ]: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
+ [EarliestRestoreDate ]: Earliest restore point creation time (ISO8601 format)
+ [FullyQualifiedDomainName ]: The fully qualified domain name of a server.
+ [IdentityType ]: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
+ [InfrastructureEncryption ]: Status showing whether the server enabled infrastructure encryption.
+ [MasterServerId ]: The master server id of a replica server.
+ [MinimalTlsVersion ]: Enforce a minimal Tls version for the server.
+ [PublicNetworkAccess ]: Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
+ [ReplicaCapacity ]: The maximum number of replicas that a master server can have.
+ [ReplicationRole ]: The replication role of the server.
+ [SkuCapacity ]: The scale up/out capacity, representing server's compute units.
+ [SkuFamily ]: The family of hardware.
+ [SkuName ]: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
+ [SkuSize ]: The size code, to be interpreted by resource as appropriate.
+ [SkuTier ]: The tier of the particular SKU, e.g. Basic.
+ [SslEnforcement ]: Enable ssl enforcement or not when connect to server.
+ [StorageProfileBackupRetentionDay ]: Backup retention days for the server.
+ [StorageProfileGeoRedundantBackup ]: Enable Geo-redundant or not for server backup.
+ [StorageProfileStorageAutogrow ]: Enable Storage Auto Grow.
+ [StorageProfileStorageMb ]: Max storage allowed for a server.
+ [UserVisibleState ]: A state of a server that is visible to user.
+ [Version ]: Server version.
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/restore-azmysqlserver
+#>
+function Restore-AzMySqlServer {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
+[CmdletBinding(DefaultParameterSetName='GeoRestore', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('ServerName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription ID that identifies an Azure subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
+ # The source server object to restore from.
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='GeoRestore', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Use Geo mode to restore
+ ${UseGeoRestore},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The location the resource resides in.
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.String]
+ # The name of the sku, typically, tier + family + cores, e.g.
+ # B_Gen4_1, GP_Gen5_8.
+ ${Sku},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerForCreateTags]))]
+ [System.Collections.Hashtable]
+ # Application-specific metadata in the form of key-value pairs.
+ ${Tag},
+
+ [Parameter(ParameterSetName='PointInTimeRestore', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.DateTime]
+ # The location the resource resides in.
+ ${RestorePointInTime},
+
+ [Parameter(ParameterSetName='PointInTimeRestore', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Use PointInTime mode to restore
+ ${UsePointInTimeRestore},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job.
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach.
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously.
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Uri]
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ GeoRestore = 'Az.MySql.custom\Restore-AzMySqlServer_GeoRestore';
+ PointInTimeRestore = 'Az.MySql.custom\Restore-AzMySqlServer_PointInTimeRestore';
+ }
+ if (('GeoRestore', 'PointInTimeRestore') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# 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
+Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
+.Description
+Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
+.Example
+PS C:\> Update-AzMySqlConfiguration -Name net_retry_count -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -Value 15
+
+Name Value
+---- -----
+net_retry_count 15
.Example
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlServerReplica -Name mysql-test-replica -ResourceGroupName PowershellMySqlTest
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/configurations/wait_timeout"
+PS C:\> Update-AzMySqlConfiguration -InputObject $ID -Value 150
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Value
+---- -----
+wait_timeout 150
.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : The source server object to create replica from.
- Location : The location the resource resides in.
- [Tag ]: Application-specific metadata in the form of key-value pairs.
- [(Any) ]: This indicates any property can be added to this object.
- [AdministratorLogin ]: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
- [EarliestRestoreDate ]: Earliest restore point creation time (ISO8601 format)
- [FullyQualifiedDomainName ]: The fully qualified domain name of a server.
- [IdentityType ]: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
- [InfrastructureEncryption ]: Status showing whether the server enabled infrastructure encryption.
- [MasterServerId ]: The master server id of a replica server.
- [MinimalTlsVersion ]: Enforce a minimal Tls version for the server.
- [PublicNetworkAccess ]: Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
- [ReplicaCapacity ]: The maximum number of replicas that a master server can have.
- [ReplicationRole ]: The replication role of the server.
- [SkuCapacity ]: The scale up/out capacity, representing server's compute units.
- [SkuFamily ]: The family of hardware.
- [SkuName ]: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
- [SkuSize ]: The size code, to be interpreted by resource as appropriate.
- [SkuTier ]: The tier of the particular SKU, e.g. Basic.
- [SslEnforcement ]: Enable ssl enforcement or not when connect to server.
- [StorageProfileBackupRetentionDay ]: Backup retention days for the server.
- [StorageProfileGeoRedundantBackup ]: Enable Geo-redundant or not for server backup.
- [StorageProfileStorageAutogrow ]: Enable Storage Auto Grow.
- [StorageProfileStorageMb ]: Max storage allowed for a server.
- [UserVisibleState ]: A state of a server that is visible to user.
- [Version ]: Server version.
+INPUTOBJECT : Identity Parameter.
+ [ConfigurationName ]: The name of the server configuration.
+ [DatabaseName ]: The name of the database.
+ [FirewallRuleName ]: The name of the server firewall rule.
+ [Id ]: Resource identity path
+ [LocationName ]: The name of the location.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SecurityAlertPolicyName ]: The name of the security alert policy.
+ [ServerName ]: The name of the server.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VirtualNetworkRuleName ]: The name of the virtual network rule.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlserverreplica
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlconfiguration
#>
-function New-AzMySqlServerReplica {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
-[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function Update-AzMySqlConfiguration {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
- [Parameter(Mandatory)]
- [Alias('ReplicaServerName')]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('ConfigurationName')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the server.
+ # The name of the server configuration.
${Name},
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
+ # The name of the resource group.
+ # The name is case insensitive.
${ResourceGroupName},
- [Parameter()]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${ServerName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
- # The subscription ID that identifies an Azure subscription.
+ # The ID of the target subscription.
${SubscriptionId},
- [Parameter(Mandatory, ValueFromPipeline)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
- # The source server object to create replica from.
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
+ # Identity Parameter.
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The location the resource resides in.
- ${Location},
+ # Source of the configuration.
+ ${Source},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The name of the sku, typically, tier + family + cores, e.g.
- # B_Gen4_1, GP_Gen5_8.
- ${Sku},
+ # Value of the configuration.
+ ${Value},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -3178,13 +3244,12 @@ param(
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Run the command as a job.
+ # Run the command as a job
${AsJob},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Wait for .NET debugger to attach.
${Break},
[Parameter(DontShow)]
@@ -3202,7 +3267,7 @@ param(
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Run the command asynchronously.
+ # Run the command asynchronously
${NoWait},
[Parameter(DontShow)]
@@ -3230,9 +3295,10 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- CreateExpanded = 'Az.MySql.custom\New-AzMySqlServerReplica';
+ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlConfiguration';
+ UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlConfiguration';
}
- if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
@@ -3277,128 +3343,105 @@ end {
<#
.Synopsis
-Restore a server from an existing backup
+Creates a new firewall rule or updates an existing firewall rule.
.Description
-Restore a server from an existing backup
+Creates a new firewall rule or updates an existing firewall rule.
.Example
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test-replica | Restore-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -UseGeoRestore
+PS C:\> Update-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.3 -StartIPAddress 0.0.0.2
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.2 0.0.0.3
.Example
-PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -UsePointInTimeRestore
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
+PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -EndIPAddress 0.0.0.3 -StartIPAddress 0.0.0.2
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.2 0.0.0.3
+.Example
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
+PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.2 0.0.0.3
.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
+Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : The source server object to restore from.
- Location : The location the resource resides in.
- [Tag ]: Application-specific metadata in the form of key-value pairs.
- [(Any) ]: This indicates any property can be added to this object.
- [AdministratorLogin ]: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
- [EarliestRestoreDate ]: Earliest restore point creation time (ISO8601 format)
- [FullyQualifiedDomainName ]: The fully qualified domain name of a server.
- [IdentityType ]: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
- [InfrastructureEncryption ]: Status showing whether the server enabled infrastructure encryption.
- [MasterServerId ]: The master server id of a replica server.
- [MinimalTlsVersion ]: Enforce a minimal Tls version for the server.
- [PublicNetworkAccess ]: Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
- [ReplicaCapacity ]: The maximum number of replicas that a master server can have.
- [ReplicationRole ]: The replication role of the server.
- [SkuCapacity ]: The scale up/out capacity, representing server's compute units.
- [SkuFamily ]: The family of hardware.
- [SkuName ]: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
- [SkuSize ]: The size code, to be interpreted by resource as appropriate.
- [SkuTier ]: The tier of the particular SKU, e.g. Basic.
- [SslEnforcement ]: Enable ssl enforcement or not when connect to server.
- [StorageProfileBackupRetentionDay ]: Backup retention days for the server.
- [StorageProfileGeoRedundantBackup ]: Enable Geo-redundant or not for server backup.
- [StorageProfileStorageAutogrow ]: Enable Storage Auto Grow.
- [StorageProfileStorageMb ]: Max storage allowed for a server.
- [UserVisibleState ]: A state of a server that is visible to user.
- [Version ]: Server version.
+INPUTOBJECT : Identity Parameter
+ [ConfigurationName ]: The name of the server configuration.
+ [DatabaseName ]: The name of the database.
+ [FirewallRuleName ]: The name of the server firewall rule.
+ [Id ]: Resource identity path
+ [LocationName ]: The name of the location.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SecurityAlertPolicyName ]: The name of the security alert policy.
+ [ServerName ]: The name of the server.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VirtualNetworkRuleName ]: The name of the virtual network rule.
.Link
-https://docs.microsoft.com/en-us/powershell/module/az.mysql/restore-azmysqlserver
+https://docs.microsoft.com/en-us/powershell/module/az.mysql/update-azmysqlfirewallrule
#>
-function Restore-AzMySqlServer {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
-[CmdletBinding(DefaultParameterSetName='GeoRestore', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function Update-AzMySqlFirewallRule {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
- [Parameter(Mandatory)]
- [Alias('ServerName')]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('FirewallRuleName')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the server.
+ # The name of the server firewall rule.
${Name},
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[System.String]
- # The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
+ # The name of the resource group.
+ # The name is case insensitive.
${ResourceGroupName},
- [Parameter()]
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [System.String]
+ # The name of the server.
+ ${ServerName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
- # The subscription ID that identifies an Azure subscription.
+ # The ID of the target subscription.
${SubscriptionId},
- [Parameter(Mandatory, ValueFromPipeline)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer]
- # The source server object to restore from.
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
+ # Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
- [Parameter(ParameterSetName='GeoRestore', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.Management.Automation.SwitchParameter]
- # Use Geo mode to restore
- ${UseGeoRestore},
-
- [Parameter()]
+ [Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The location the resource resides in.
- ${Location},
+ # The start IP address of the server firewall rule.
+ # Must be IPv4 format.
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The name of the sku, typically, tier + family + cores, e.g.
- # B_Gen4_1, GP_Gen5_8.
- ${Sku},
-
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerForCreateTags]))]
- [System.Collections.Hashtable]
- # Application-specific metadata in the form of key-value pairs.
- ${Tag},
-
- [Parameter(ParameterSetName='PointInTimeRestore', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.DateTime]
- # The location the resource resides in.
- ${RestorePointInTime},
-
- [Parameter(ParameterSetName='PointInTimeRestore', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.Management.Automation.SwitchParameter]
- # Use PointInTime mode to restore
- ${UsePointInTimeRestore},
+ # The end IP address of the server firewall rule.
+ # Must be IPv4 format.
+ ${EndIPAddress},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -3411,47 +3454,52 @@ param(
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Run the command as a job.
+ # Run the command as a job
${AsJob},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Wait for .NET debugger to attach.
+ # Wait for .NET debugger to attach
${Break},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Run the command asynchronously.
+ # Run the command asynchronously
${NoWait},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
+ # The URI for the proxy server to use
${Proxy},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
${ProxyCredential},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
@@ -3463,10 +3511,10 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- GeoRestore = 'Az.MySql.custom\Restore-AzMySqlServer_GeoRestore';
- PointInTimeRestore = 'Az.MySql.custom\Restore-AzMySqlServer_PointInTimeRestore';
+ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule';
+ UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule';
}
- if (('GeoRestore', 'PointInTimeRestore') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
@@ -3513,21 +3561,23 @@ end {
.Synopsis
Updates an existing server.
The request body can contain one to many of the properties present in the normal server definition.
+Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.
.Description
Updates an existing server.
The request body can contain one to many of the properties present in the normal server definition.
+Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.
.Example
PS C:\> Update-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -SslEnforcement Disabled
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Update-AzMySqlServer -BackupRetentionDay 23 -StorageMb 10240
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
@@ -3535,6 +3585,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter.
@@ -3614,12 +3665,6 @@ param(
# B_Gen4_1, GP_Gen5_8.
${Sku},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The size code, to be interpreted by resource as appropriate.
- ${SkuSize},
-
[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier])]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
diff --git a/src/MySql/exports/Remove-AzMySqlFirewallRule.ps1 b/src/MySql/exports/Remove-AzMySqlFirewallRule.ps1
index 277479dee5cc..2d2d8ec61fad 100644
--- a/src/MySql/exports/Remove-AzMySqlFirewallRule.ps1
+++ b/src/MySql/exports/Remove-AzMySqlFirewallRule.ps1
@@ -32,6 +32,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Remove-AzMySqlServer.ps1 b/src/MySql/exports/Remove-AzMySqlServer.ps1
index 9e2c802d823f..fe112c3c0d0a 100644
--- a/src/MySql/exports/Remove-AzMySqlServer.ps1
+++ b/src/MySql/exports/Remove-AzMySqlServer.ps1
@@ -32,6 +32,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Remove-AzMySqlVirtualNetworkRule.ps1 b/src/MySql/exports/Remove-AzMySqlVirtualNetworkRule.ps1
index 337b1ede80b1..ed2472cc9836 100644
--- a/src/MySql/exports/Remove-AzMySqlVirtualNetworkRule.ps1
+++ b/src/MySql/exports/Remove-AzMySqlVirtualNetworkRule.ps1
@@ -32,6 +32,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Restart-AzMySqlServer.ps1 b/src/MySql/exports/Restart-AzMySqlServer.ps1
index 4a0126923cac..d5353ac2672e 100644
--- a/src/MySql/exports/Restart-AzMySqlServer.ps1
+++ b/src/MySql/exports/Restart-AzMySqlServer.ps1
@@ -32,6 +32,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/Restore-AzMySqlServer.ps1 b/src/MySql/exports/Restore-AzMySqlServer.ps1
index b772c788301e..52c2176ee2da 100644
--- a/src/MySql/exports/Restore-AzMySqlServer.ps1
+++ b/src/MySql/exports/Restore-AzMySqlServer.ps1
@@ -21,16 +21,16 @@ Restore a server from an existing backup
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test-replica | Restore-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -UseGeoRestore
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Example
PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -UsePointInTimeRestore
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
@@ -38,6 +38,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The source server object to restore from.
diff --git a/src/MySql/exports/Update-AzMySqlConfiguration.ps1 b/src/MySql/exports/Update-AzMySqlConfiguration.ps1
index 1d846946d4e5..1d542216b768 100644
--- a/src/MySql/exports/Update-AzMySqlConfiguration.ps1
+++ b/src/MySql/exports/Update-AzMySqlConfiguration.ps1
@@ -16,8 +16,10 @@
<#
.Synopsis
Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
.Description
Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
.Example
PS C:\> Update-AzMySqlConfiguration -Name net_retry_count -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -Value 15
@@ -38,9 +40,10 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
+INPUTOBJECT : Identity Parameter.
[ConfigurationName ]: The name of the server configuration.
[DatabaseName ]: The name of the database.
[FirewallRuleName ]: The name of the server firewall rule.
@@ -88,7 +91,7 @@ param(
[Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity]
- # Identity Parameter
+ # Identity Parameter.
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
@@ -121,21 +124,18 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Wait for .NET debugger to attach
${Break},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.SendAsyncStep[]]
- # SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
[Parameter()]
@@ -147,20 +147,17 @@ param(
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Uri]
- # The URI for the proxy server to use
${Proxy},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.PSCredential]
- # Credentials for a proxy server to use for the remote call
${ProxyCredential},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
- # Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
@@ -172,8 +169,8 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- UpdateExpanded = 'Az.MySql.private\Update-AzMySqlConfiguration_UpdateExpanded';
- UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlConfiguration_UpdateViaIdentityExpanded';
+ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlConfiguration';
+ UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlConfiguration';
}
if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
diff --git a/src/MySql/exports/Update-AzMySqlFirewallRule.ps1 b/src/MySql/exports/Update-AzMySqlFirewallRule.ps1
index 869adbff1a12..66cba41f02be 100644
--- a/src/MySql/exports/Update-AzMySqlFirewallRule.ps1
+++ b/src/MySql/exports/Update-AzMySqlFirewallRule.ps1
@@ -28,6 +28,13 @@ rule 0.0.0.2 0.0.0.3
PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -EndIPAddress 0.0.0.3 -StartIPAddress 0.0.0.2
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.2 0.0.0.3
+.Example
+PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule"
+PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2
+
Name StartIPAddress EndIPAddress
---- -------------- ------------
rule 0.0.0.2 0.0.0.3
@@ -38,6 +45,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
@@ -95,16 +103,17 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The end IP address of the server firewall rule.
+ # The start IP address of the server firewall rule.
# Must be IPv4 format.
- ${EndIPAddress},
+ # If range contains one IP, use StartIPAddress only.
+ ${StartIPAddress},
- [Parameter(Mandatory)]
+ [Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
- # The start IP address of the server firewall rule.
+ # The end IP address of the server firewall rule.
# Must be IPv4 format.
- ${StartIPAddress},
+ ${EndIPAddress},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -174,8 +183,8 @@ begin {
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
- UpdateExpanded = 'Az.MySql.private\Update-AzMySqlFirewallRule_UpdateExpanded';
- UpdateViaIdentityExpanded = 'Az.MySql.private\Update-AzMySqlFirewallRule_UpdateViaIdentityExpanded';
+ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule';
+ UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule';
}
if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
diff --git a/src/MySql/exports/Update-AzMySqlServer.ps1 b/src/MySql/exports/Update-AzMySqlServer.ps1
index 388e49844859..5d025a987f8f 100644
--- a/src/MySql/exports/Update-AzMySqlServer.ps1
+++ b/src/MySql/exports/Update-AzMySqlServer.ps1
@@ -17,21 +17,23 @@
.Synopsis
Updates an existing server.
The request body can contain one to many of the properties present in the normal server definition.
+Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.
.Description
Updates an existing server.
The request body can contain one to many of the properties present in the normal server definition.
+Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.
.Example
PS C:\> Update-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -SslEnforcement Disabled
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Disabled
.Example
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Update-AzMySqlServer -BackupRetentionDay 23 -StorageMb 10240
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
@@ -39,6 +41,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter.
@@ -118,12 +121,6 @@ param(
# B_Gen4_1, GP_Gen5_8.
${Sku},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
- [System.String]
- # The size code, to be interpreted by resource as appropriate.
- ${SkuSize},
-
[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier])]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
diff --git a/src/MySql/exports/Update-AzMySqlVirtualNetworkRule.ps1 b/src/MySql/exports/Update-AzMySqlVirtualNetworkRule.ps1
index e5aaa445f4e5..6d6042b63433 100644
--- a/src/MySql/exports/Update-AzMySqlVirtualNetworkRule.ps1
+++ b/src/MySql/exports/Update-AzMySqlVirtualNetworkRule.ps1
@@ -40,6 +40,7 @@ Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IVirtualNetworkRule
.Notes
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : Identity Parameter
diff --git a/src/MySql/exports/readme.md b/src/MySql/exports/readme.md
index 0e8e41bcb2bd..26775efe51f5 100644
--- a/src/MySql/exports/readme.md
+++ b/src/MySql/exports/readme.md
@@ -1,5 +1,5 @@
# Exports
-This directory contains the cmdlets *exported by* `Az.MySql`. No other cmdlets in this repository are directly exported. What that means is the `Az.MySql` module will run [Export-ModuleMember](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation.
+This directory contains the cmdlets *exported by* `Az.MySql`. No other cmdlets in this repository are directly exported. What that means is the `Az.MySql` module will run [Export-ModuleMember](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
## Info
- Modifiable: no
@@ -8,7 +8,7 @@ This directory contains the cmdlets *exported by* `Az.MySql`. No other cmdlets i
- Packaged: yes
## Details
-The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.MySql.private.dll`) and from the `../custom/Az.MySql.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [readme.md](../internal/readme.md) in the `../internal` folder.
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.MySql.private.dll`) and from the `..\custom\Az.MySql.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [readme.md](..\internal/readme.md) in the `..\internal` folder.
## Purpose
We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
diff --git a/src/MySql/generated/api/Models/Api20171201/Server.cs b/src/MySql/generated/api/Models/Api20171201/Server.cs
index 878803e8d2c5..48e532e9fa57 100644
--- a/src/MySql/generated/api/Models/Api20171201/Server.cs
+++ b/src/MySql/generated/api/Models/Api20171201/Server.cs
@@ -188,17 +188,17 @@ public partial class Server :
/// The size code, to be interpreted by resource as appropriate.
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Origin(Microsoft.Azure.PowerShell.Cmdlets.MySql.PropertyOrigin.Inlined)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.FormatTable(Index = 6)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.DoNotFormat]
public string SkuSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.ISkuInternal)Sku).Size; set => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.ISkuInternal)Sku).Size = value; }
/// The tier of the particular SKU, e.g. Basic.
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Origin(Microsoft.Azure.PowerShell.Cmdlets.MySql.PropertyOrigin.Inlined)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.FormatTable(Index = 7)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.FormatTable(Index = 6)]
public Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.ISkuInternal)Sku).Tier = value; }
/// Enable ssl enforcement or not when connect to server.
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Origin(Microsoft.Azure.PowerShell.Cmdlets.MySql.PropertyOrigin.Inlined)]
- [Microsoft.Azure.PowerShell.Cmdlets.MySql.FormatTable(Index = 8)]
+ [Microsoft.Azure.PowerShell.Cmdlets.MySql.FormatTable(Index = 7)]
public Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SslEnforcementEnum? SslEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerPropertiesInternal)Property).SslEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerPropertiesInternal)Property).SslEnforcement = value; }
/// Backup retention days for the server.
diff --git a/src/MySql/generated/api/Support/InfrastructureEncryption.cs b/src/MySql/generated/api/Support/InfrastructureEncryption.cs
index 2721f29e7824..c4e2d7ec09af 100644
--- a/src/MySql/generated/api/Support/InfrastructureEncryption.cs
+++ b/src/MySql/generated/api/Support/InfrastructureEncryption.cs
@@ -9,8 +9,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Support
public partial struct InfrastructureEncryption :
System.IEquatable
{
+ /// Additional (2nd) layer of encryption for data at rest
public static Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.InfrastructureEncryption Disabled = @"Disabled";
+ /// Default value for single layer of encryption for data at rest.
public static Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.InfrastructureEncryption Enabled = @"Enabled";
/// the value for an instance of the Enum.
diff --git a/src/MySql/generated/cmdlets/NewAzMySqlFirewallRule_CreateExpanded.cs b/src/MySql/generated/cmdlets/NewAzMySqlFirewallRule_CreateExpanded.cs
index b4986f583bd0..8e4bea0073d9 100644
--- a/src/MySql/generated/cmdlets/NewAzMySqlFirewallRule_CreateExpanded.cs
+++ b/src/MySql/generated/cmdlets/NewAzMySqlFirewallRule_CreateExpanded.cs
@@ -11,6 +11,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Cmdlets
///
/// [OpenAPI] FirewallRules_CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}"
///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.MySql.InternalExport]
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMySqlFirewallRule_CreateExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule))]
[global::Microsoft.Azure.PowerShell.Cmdlets.MySql.Description(@"Creates a new firewall rule or updates an existing firewall rule.")]
diff --git a/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateExpanded.cs b/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateExpanded.cs
index 8c595ea4c0d3..4346a6daabab 100644
--- a/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateExpanded.cs
+++ b/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateExpanded.cs
@@ -11,6 +11,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Cmdlets
///
/// [OpenAPI] Configurations_CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}"
///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.MySql.InternalExport]
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMySqlConfiguration_UpdateExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration))]
[global::Microsoft.Azure.PowerShell.Cmdlets.MySql.Description(@"Updates a configuration of a server.")]
diff --git a/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateViaIdentityExpanded.cs b/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateViaIdentityExpanded.cs
index 51e326e79b1c..41d919fcbca9 100644
--- a/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateViaIdentityExpanded.cs
+++ b/src/MySql/generated/cmdlets/UpdateAzMySqlConfiguration_UpdateViaIdentityExpanded.cs
@@ -11,6 +11,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Cmdlets
///
/// [OpenAPI] Configurations_CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}"
///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.MySql.InternalExport]
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMySqlConfiguration_UpdateViaIdentityExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration))]
[global::Microsoft.Azure.PowerShell.Cmdlets.MySql.Description(@"Updates a configuration of a server.")]
diff --git a/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateExpanded.cs b/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateExpanded.cs
index 3ad3bddd44d4..cad90538f7b7 100644
--- a/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateExpanded.cs
+++ b/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateExpanded.cs
@@ -11,6 +11,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Cmdlets
///
/// [OpenAPI] FirewallRules_CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}"
///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.MySql.InternalExport]
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMySqlFirewallRule_UpdateExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule))]
[global::Microsoft.Azure.PowerShell.Cmdlets.MySql.Description(@"Creates a new firewall rule or updates an existing firewall rule.")]
diff --git a/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateViaIdentityExpanded.cs b/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateViaIdentityExpanded.cs
index 7a5b3eceadee..346aeae1d524 100644
--- a/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateViaIdentityExpanded.cs
+++ b/src/MySql/generated/cmdlets/UpdateAzMySqlFirewallRule_UpdateViaIdentityExpanded.cs
@@ -11,6 +11,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MySql.Cmdlets
///
/// [OpenAPI] FirewallRules_CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}"
///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.MySql.InternalExport]
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMySqlFirewallRule_UpdateViaIdentityExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule))]
[global::Microsoft.Azure.PowerShell.Cmdlets.MySql.Description(@"Creates a new firewall rule or updates an existing firewall rule.")]
diff --git a/src/MySql/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/MySql/generated/runtime/BuildTime/Models/PsProxyOutputs.cs
index d72b85dec975..add31866c271 100644
--- a/src/MySql/generated/runtime/BuildTime/Models/PsProxyOutputs.cs
+++ b/src/MySql/generated/runtime/BuildTime/Models/PsProxyOutputs.cs
@@ -415,7 +415,7 @@ internal static class PsProxyOutputExtensions
public const string ItemSeparator = ", ";
- public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}";
+ public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}";
public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}";
diff --git a/src/MySql/generated/runtime/HttpPipeline.cs b/src/MySql/generated/runtime/HttpPipeline.cs
index 3251eaec15ad..0b373523c2c3 100644
--- a/src/MySql/generated/runtime/HttpPipeline.cs
+++ b/src/MySql/generated/runtime/HttpPipeline.cs
@@ -47,7 +47,7 @@ public partial class SendAsyncFactory
{
///
/// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern.
- /// (Provided to support out-of-module delgation for Azure Cmdlets)
+ /// (Provided to support out-of-module delegation for Azure Cmdlets)
///
/// The Pipeline Step as a delegate
public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) =>
@@ -85,4 +85,4 @@ public HttpPipeline Prepend(SendAsyncStepDelegate item)
return this;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/MySql/help/Az.MySql.md b/src/MySql/help/Az.MySql.md
index d05b93b0950f..0aaaaba80eb9 100644
--- a/src/MySql/help/Az.MySql.md
+++ b/src/MySql/help/Az.MySql.md
@@ -1,6 +1,6 @@
---
Module Name: Az.MySql
-Module Guid: 43b3698e-9955-4090-9969-7b5a71479c75
+Module Guid: 8c7c6fcd-a96f-460b-89e2-ff822a3246c8
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.mysql
Help Version: 1.0.0.0
Locale: en-US
@@ -32,12 +32,12 @@ Gets a virtual network rule.
### [New-AzMySqlFirewallRule](New-AzMySqlFirewallRule.md)
Creates a new firewall rule or updates an existing firewall rule.
+### [New-AzMySqlReplica](New-AzMySqlReplica.md)
+Creates a new replica from an existing database.
+
### [New-AzMySqlServer](New-AzMySqlServer.md)
Creates a new server.
-### [New-AzMySqlServerReplica](New-AzMySqlServerReplica.md)
-Creates a new replica from an existing database.
-
### [New-AzMySqlVirtualNetworkRule](New-AzMySqlVirtualNetworkRule.md)
Creates or updates an existing virtual network rule.
@@ -58,6 +58,7 @@ Restore a server from an existing backup
### [Update-AzMySqlConfiguration](Update-AzMySqlConfiguration.md)
Updates a configuration of a server.
+Use Update-AzMySqlServer instead if you want update AdministratorLoginPassword, sku, etc.
### [Update-AzMySqlFirewallRule](Update-AzMySqlFirewallRule.md)
Creates a new firewall rule or updates an existing firewall rule.
@@ -65,6 +66,7 @@ Creates a new firewall rule or updates an existing firewall rule.
### [Update-AzMySqlServer](Update-AzMySqlServer.md)
Updates an existing server.
The request body can contain one to many of the properties present in the normal server definition.
+Use Update-AzMySqlConfiguration instead if you want update server parameters such as wait_timeout or net_retry_count.
### [Update-AzMySqlVirtualNetworkRule](Update-AzMySqlVirtualNetworkRule.md)
Creates or updates an existing virtual network rule.
diff --git a/src/MySql/help/Get-AzMySqlConfiguration.md b/src/MySql/help/Get-AzMySqlConfiguration.md
index e0ab5414c8d4..50efb1f5315f 100644
--- a/src/MySql/help/Get-AzMySqlConfiguration.md
+++ b/src/MySql/help/Get-AzMySqlConfiguration.md
@@ -174,6 +174,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
diff --git a/src/MySql/help/Get-AzMySqlConnectionString.md b/src/MySql/help/Get-AzMySqlConnectionString.md
index 27c17b47ebcd..2a91f055d2ae 100644
--- a/src/MySql/help/Get-AzMySqlConnectionString.md
+++ b/src/MySql/help/Get-AzMySqlConnectionString.md
@@ -156,6 +156,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
diff --git a/src/MySql/help/Get-AzMySqlFirewallRule.md b/src/MySql/help/Get-AzMySqlFirewallRule.md
index 8fb4e98b7e8b..02a7cf376106 100644
--- a/src/MySql/help/Get-AzMySqlFirewallRule.md
+++ b/src/MySql/help/Get-AzMySqlFirewallRule.md
@@ -178,6 +178,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
diff --git a/src/MySql/help/Get-AzMySqlReplica.md b/src/MySql/help/Get-AzMySqlReplica.md
index 6f4aac4cc1ac..26fc74aff2c8 100644
--- a/src/MySql/help/Get-AzMySqlReplica.md
+++ b/src/MySql/help/Get-AzMySqlReplica.md
@@ -26,9 +26,9 @@ List all the replicas for a given server.
```powershell
PS C:\> Get-AzMySqlReplica -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
This cmdlet gets MySql server replica by resource group and server name.
diff --git a/src/MySql/help/Get-AzMySqlServer.md b/src/MySql/help/Get-AzMySqlServer.md
index e6591422e302..2858d27dc39f 100644
--- a/src/MySql/help/Get-AzMySqlServer.md
+++ b/src/MySql/help/Get-AzMySqlServer.md
@@ -43,9 +43,9 @@ Gets information about a server.
```powershell
PS C:\> Get-AzMySqlServer
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-11 eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet gets MySql server with default context.
@@ -54,9 +54,9 @@ This cmdlet gets MySql server with default context.
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -Name mysql-test
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet gets MySql server by resource group and server name.
@@ -65,9 +65,9 @@ This cmdlet gets MySql server by resource group and server name.
```powershell
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet lists all the MySql servers in specified resource group.
@@ -77,9 +77,9 @@ This cmdlet lists all the MySql servers in specified resource group.
PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test"
PS C:\> Get-AzMySqlServer -InputObject $ID
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- ------------
-mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- ------------
+mysql-test eastus mysql_test 5.7 5120 GP_Gen5_4 GeneralPurpose Enabled
```
This cmdlet lists gets MySql server by identity.
@@ -179,6 +179,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
diff --git a/src/MySql/help/Get-AzMySqlVirtualNetworkRule.md b/src/MySql/help/Get-AzMySqlVirtualNetworkRule.md
index 3c4b7aac3fcb..1ec1563c6c33 100644
--- a/src/MySql/help/Get-AzMySqlVirtualNetworkRule.md
+++ b/src/MySql/help/Get-AzMySqlVirtualNetworkRule.md
@@ -194,6 +194,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
diff --git a/src/MySql/help/New-AzMySqlFirewallRule.md b/src/MySql/help/New-AzMySqlFirewallRule.md
index cf8739f5f358..4c9205e54af4 100644
--- a/src/MySql/help/New-AzMySqlFirewallRule.md
+++ b/src/MySql/help/New-AzMySqlFirewallRule.md
@@ -12,10 +12,18 @@ Creates a new firewall rule or updates an existing firewall rule.
## SYNTAX
+### CreateExpanded (Default)
```
-New-AzMySqlFirewallRule -Name -ResourceGroupName -ServerName -EndIPAddress
- -StartIPAddress [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait]
- [-Confirm] [-WhatIf] []
+New-AzMySqlFirewallRule -ResourceGroupName -ServerName -StartIPAddress
+ [-Name ] [-SubscriptionId ] [-EndIPAddress ] [-DefaultProfile ] [-AsJob]
+ [-NoWait] [-Confirm] [-WhatIf] []
+```
+
+### AllowAll
+```
+New-AzMySqlFirewallRule -ResourceGroupName -ServerName -AllowAll [-Name ]
+ [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
+ []
```
## DESCRIPTION
@@ -27,15 +35,52 @@ Creates a new firewall rule or updates an existing firewall rule.
```powershell
PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
-Name Type
----- ----
-rule Microsoft.DBforMySQL/servers/firewallRules
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.0 0.0.0.1
```
This cmdlets create a MySql server Firewall Rule.
+### Example 2: Create a new MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized
+```powershell
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+rule 0.0.0.1 0.0.0.1
+```
+
+This cmdlets create a MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized.
+
+### Example 3: Create a new MySql Firewall Rule to allow all IPs
+```powershell
+PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll
+
+Name StartIPAddress EndIPAddress
+---- -------------- ------------
+AllowAll_2020-08-11_18-19-27 0.0.0.0 255.255.255.255
+```
+
+This cmdlets create a new MySql Firewall Rule to allow all IPs.
+
## PARAMETERS
+### -AllowAll
+Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: AllowAll
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
### -AsJob
Run the command as a job
@@ -72,10 +117,10 @@ Must be IPv4 format.
```yaml
Type: System.String
-Parameter Sets: (All)
+Parameter Sets: CreateExpanded
Aliases:
-Required: True
+Required: False
Position: Named
Default value: None
Accept pipeline input: False
@@ -84,13 +129,15 @@ Accept wildcard characters: False
### -Name
The name of the server firewall rule.
+If not specified, the default is undefined.
+If AllowAll is present, the default name is AllowAll_yyyy-MM-dd_HH-mm-ss.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases: FirewallRuleName
-Required: True
+Required: False
Position: Named
Default value: None
Accept pipeline input: False
@@ -146,10 +193,11 @@ Accept wildcard characters: False
### -StartIPAddress
The start IP address of the server firewall rule.
Must be IPv4 format.
+If range contains one IP, use StartIPAddress only.
```yaml
Type: System.String
-Parameter Sets: (All)
+Parameter Sets: CreateExpanded
Aliases:
Required: True
diff --git a/src/MySql/help/New-AzMySqlServerReplica.md b/src/MySql/help/New-AzMySqlReplica.md
similarity index 82%
rename from src/MySql/help/New-AzMySqlServerReplica.md
rename to src/MySql/help/New-AzMySqlReplica.md
index 7bd3a4959c69..d3c68d7b46d0 100644
--- a/src/MySql/help/New-AzMySqlServerReplica.md
+++ b/src/MySql/help/New-AzMySqlReplica.md
@@ -1,11 +1,11 @@
---
external help file:
Module Name: Az.MySql
-online version: https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlserverreplica
+online version: https://docs.microsoft.com/en-us/powershell/module/az.mysql/new-azmysqlreplica
schema: 2.0.0
---
-# New-AzMySqlServerReplica
+# New-AzMySqlReplica
## SYNOPSIS
Creates a new replica from an existing database.
@@ -13,9 +13,9 @@ Creates a new replica from an existing database.
## SYNTAX
```
-New-AzMySqlServerReplica -Name -ResourceGroupName -InputObject
- [-SubscriptionId ] [-Location ] [-Sku ] [-DefaultProfile ] [-AsJob]
- [-NoWait] [-Confirm] [-WhatIf] []
+New-AzMySqlReplica -Replica -ResourceGroupName -Master [-SubscriptionId ]
+ [-Location ] [-Sku ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
+ []
```
## DESCRIPTION
@@ -25,15 +25,27 @@ Creates a new replica from an existing database.
### Example 1: Create a new MySql server replica
```powershell
-PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlServerReplica -Name mysql-test-replica -ResourceGroupName PowershellMySqlTest
+PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | New-AzMySqlReplica -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
-Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuSize SkuTier SslEnforcement
----- -------- ------------------ ------- ----------------------- ------- ------- ------- --------------
-mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
```
This cmdlet creates a new MySql server replica.
+### Example 2: Create a new MySql server replica
+```powershell
+PS C:\> $mysql = Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test
+PS C:\> New-AzMySqlReplica -Master $mysql -Replica mysql-test-replica -ResourceGroupName PowershellMySqlTest
+
+Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
+---- -------- ------------------ ------- ----------------------- ------- ------- --------------
+mysql-test-replica eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
+```
+
+This cmdlet with parameter master(inputobject) creates a new MySql server replica.
+
## PARAMETERS
### -AsJob
@@ -66,22 +78,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```
-### -InputObject
-The source server object to create replica from.
-To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
-
-```yaml
-Type: Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
-Parameter Sets: (All)
-Aliases:
-
-Required: True
-Position: Named
-Default value: None
-Accept pipeline input: True (ByValue)
-Accept wildcard characters: False
-```
-
### -Location
The location the resource resides in.
@@ -97,18 +93,19 @@ Accept pipeline input: False
Accept wildcard characters: False
```
-### -Name
-The name of the server.
+### -Master
+The source server object to create replica from.
+To construct, see NOTES section for MASTER properties and create a hash table.
```yaml
-Type: System.String
+Type: Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
Parameter Sets: (All)
-Aliases: ReplicaServerName
+Aliases: InputObject
Required: True
Position: Named
Default value: None
-Accept pipeline input: False
+Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
@@ -127,6 +124,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
+### -Replica
+The name of the server.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases: ReplicaServerName, Name
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
### -ResourceGroupName
The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
@@ -220,10 +232,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
ALIASES
COMPLEX PARAMETER PROPERTIES
+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : The source server object to create replica from.
+MASTER : The source server object to create replica from.
- `Location