Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/MySql/Az.MySql.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -1071,9 +1071,6 @@
<TableColumnHeader>
<Label>AdministratorLogin</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>AdministratorLoginPassword</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
Expand Down Expand Up @@ -1111,9 +1108,6 @@
<TableColumnItem>
<PropertyName>AdministratorLogin</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>AdministratorLoginPassword</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
Expand Down Expand Up @@ -1406,9 +1400,6 @@
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>AdministratorLoginPassword</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>MinimalTlsVersion</Label>
</TableColumnHeader>
Expand All @@ -1428,9 +1419,6 @@
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>AdministratorLoginPassword</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>MinimalTlsVersion</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -2441,9 +2429,6 @@
<TableColumnHeader>
<Label>AdministratorLogin</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>AdministratorLoginPassword</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>AvailabilityZone</Label>
</TableColumnHeader>
Expand Down Expand Up @@ -2502,9 +2487,6 @@
<TableColumnItem>
<PropertyName>AdministratorLogin</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>AdministratorLoginPassword</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>AvailabilityZone</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -2568,9 +2550,6 @@
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>AdministratorLoginPassword</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>HaEnabled</Label>
</TableColumnHeader>
Expand All @@ -2584,9 +2563,6 @@
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>AdministratorLoginPassword</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>HaEnabled</PropertyName>
</TableColumnItem>
Expand Down
12 changes: 6 additions & 6 deletions src/MySql/Az.MySql.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2/5/2021
# Generated on: 2/23/2021
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = './Az.MySql.psm1'

# Version number of this module.
ModuleVersion = '0.5.0'
ModuleVersion = '0.1.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -45,7 +45,7 @@ PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
Expand All @@ -54,7 +54,7 @@ DotNetFrameworkVersion = '4.7.2'
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.5'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'bin\Az.MySql.private.dll'
RequiredAssemblies = './bin/Az.MySql.private.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
Expand All @@ -63,7 +63,7 @@ RequiredAssemblies = 'bin\Az.MySql.private.dll'
# TypesToProcess = @()

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

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
Expand Down Expand Up @@ -133,7 +133,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Added cmdlet ''Test-AzMySqlFlexibleServerConnect'''
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''
Expand Down
2 changes: 2 additions & 0 deletions src/MySql/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Added maintenance windows parameter to Update-AzMySqlFlexibleServer cmdlet
* Added zone parameter to server New-AzMySqlFlexibleServer cmdlet.

## Version 0.5.0
* Added cmdlet `Test-AzMySqlFlexibleServerConnect`
Expand Down
11 changes: 11 additions & 0 deletions src/MySql/custom/New-AzMySqlFlexibleServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ param(
[System.String]
${Location},

[Parameter(HelpMessage = 'Availability zone into which to provision the resource.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
${Zone},

[Parameter(HelpMessage = 'Administrator username for the server. Once set, it cannot be changed.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
Expand Down Expand Up @@ -187,6 +192,11 @@ process {
$PSBoundParameters.Location = 'westus2'
}

if ($PSBoundParameters.ContainsKey('Zone')) {
$PSBoundParameters.AvailabilityZone = $PSBoundParameters.Zone
$null = $PSBoundParameters.Remove('Zone')
}

if (!$PSBoundParameters.ContainsKey('AdministratorLoginPassword')) {
$Password = Get-GeneratePassword
$PSBoundParameters.AdministratorLoginPassword = $Password | ConvertTo-SecureString -AsPlainText -Force
Expand Down Expand Up @@ -515,6 +525,7 @@ function CreateFirewallRule($Parameters) {
}
elseif ($StartIP -eq $EndIP) {
$Msg = 'Configuring server firewall rule to accept connections from ' + $StartIP
$RuleName = "FirewallIPAddress_" + $Date
}
else {
$Msg = 'Configuring server firewall rule to accept connections from {0} to {1}' -f $StartIP, $EndIp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ function Restore-AzMySqlFlexibleServer_PointInTimeRestore {
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated]
${InputObject},

[Parameter(HelpMessage = 'The name of the sku, e.g., Standard_D2ds_v4, Standard_B1ms')]
[Parameter(HelpMessage = 'Availability zone into which to provision the resource.')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
${Sku},
${Zone},

[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')]
[Alias('AzureRMContext', 'AzureCredential')]
Expand Down Expand Up @@ -113,16 +113,13 @@ function Restore-AzMySqlFlexibleServer_PointInTimeRestore {
$server = $PSBoundParameters['InputObject']
$PSBoundParameters.SourceServerId = $server.Id
$PSBoundParameters.Location = $server.Location
$PSBoundParameters.SkuName = $server.SkuName
$null = $PSBoundParameters.Remove('InputObject')

if($PSBoundParameters.ContainsKey('Sku'))
{
$PSBoundParameters.SkuName = $PSBoundParameters['Sku']
$null = $PSBoundParameters.Remove('Sku')
if ($PSBoundParameters.ContainsKey('Zone')) {
$PSBoundParameters.AvailabilityZone = $PSBoundParameters.Zone
$null = $PSBoundParameters.Remove('Zone')
}


Az.MySql.internal\New-AzMySqlFlexibleServer @PSBoundParameters
} catch {
throw
Expand Down
45 changes: 43 additions & 2 deletions src/MySql/custom/Update-AzMySqlFlexibleServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,28 @@ function Update-AzMySqlFlexibleServer {
[System.String]
${ReplicationRole},

[Parameter(HelpMessage='The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.')]
[Parameter(HelpMessage='The name of the sku, typically, tier + family + cores, e.g. Burstable_B1ms, Standard_D2ds_v4')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
${Sku},

[Parameter(HelpMessage='The tier of the particular SKU, e.g. Basic.')]
[Parameter(HelpMessage='The tier of the particular SKU. Accepted values: Burstable, GeneralPurpose, Memory Optimized. Default: Burstable.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier])]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SkuTier]
${SkuTier},

[Parameter(HelpMessage='Enable or disable high availability feature.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.HaEnabledEnum])]
[Validateset('Enabled', 'Disabled')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.HaEnabledEnum]
# Enable HA or not for a server.
${HaEnabled},

[Parameter(HelpMessage='Enable ssl enforcement or not when connect to server.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SslEnforcementEnum])]
[Validateset('Enabled', 'Disabled')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.SslEnforcementEnum]
${SslEnforcement},
Expand Down Expand Up @@ -103,6 +105,11 @@ function Update-AzMySqlFlexibleServer {
[System.Collections.Hashtable]
${Tag},

[Parameter(HelpMessage='Period of time (UTC) designated for maintenance. Examples: "Sun:23:30" to schedule on Sunday, 11:30pm UTC. To set back to default pass in "Disabled"')]
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')]
[System.String]
${MaintenanceWindow},

[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -181,6 +188,40 @@ function Update-AzMySqlFlexibleServer {
$null = $PSBoundParameters.Remove('StorageAutogrow')
}

if ($PSBoundParameters.ContainsKey('MaintenanceWindow')) {

$PSBoundParameters.MaintenanceWindowDayOfWeek = $null
$PSBoundParameters.MaintenanceWindowStartHour = $null
$PSBoundParameters.MaintenanceWindowStartMinute = $null

if ($PSBoundParameters.MaintenanceWindow.ToLower() -eq "disabled"){
$PSBoundParameters.MaintenanceWindowDayOfWeek = 0
$PSBoundParameters.MaintenanceWindowStartHour = 0
$PSBoundParameters.MaintenanceWindowStartMinute = 0
$PSBoundParameters.MaintenanceWindowCustomWindow = "Disabled"
}
else {
$ParsedWindow = $PSBoundParameters.MaintenanceWindow -split ":"
$DaytoNumber = @{Mon = 1; Tue = 2; Wed = 3; Thur = 4; Fri = 5; Sat = 6; Sun = 0}

if ($ParsedWindow.Length -ge 1){
$PSBoundParameters.MaintenanceWindowDayOfWeek = $DaytoNumber[$ParsedWindow[0]]
}

if ($ParsedWindow.Length -ge 2){
$PSBoundParameters.MaintenanceWindowStartHour = $ParsedWindow[1]
}

if ($ParsedWindow.Length -ge 3){
$PSBoundParameters.MaintenanceWindowStartMinute = $ParsedWindow[2]
}

$PSBoundParameters.MaintenanceWindowCustomWindow = "Enabled"
}

$null = $PSBoundParameters.Remove('MaintenanceWindow')
}

Az.MySql.internal\Update-AzMySqlFlexibleServer @PSBoundParameters
} catch {
throw
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlconfiguration
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlconfiguration
#>
function Get-AzMySqlConfiguration {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IConfiguration])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlConnectionString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ INPUTOBJECT <IServer>: The server for the connection string.
[UserVisibleState <ServerState?>]: A state of a server that is visible to user.
[Version <ServerVersion?>]: Server version.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlconnectionstring
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlconnectionstring
#>
function Get-AzMySqlConnectionString {
[OutputType([System.String])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlFirewallRule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlfirewallrule
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlfirewallrule
#>
function Get-AzMySqlFirewallRule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlFlexibleServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserver
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserver
#>
function Get-AzMySqlFlexibleServer {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverconfiguration
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverconfiguration
#>
function Get-AzMySqlFlexibleServerConfiguration {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IConfigurationAutoGenerated])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ INPUTOBJECT <IMySqlIdentity>: The server for the connection string.
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverconnectionstring
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverconnectionstring
#>
function Get-AzMySqlFlexibleServerConnectionString {
[OutputType([System.String])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlFlexibleServerDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverdatabase
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverdatabase
#>
function Get-AzMySqlFlexibleServerDatabase {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IDatabase])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverfirewallrule
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverfirewallrule
#>
function Get-AzMySqlFlexibleServerFirewallRule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Standard_E64ds_v4 MemoryOptimized 8192 64
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.ICapabilityProperties
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverlocationbasedcapability
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverlocationbasedcapability
#>
function Get-AzMySqlFlexibleServerLocationBasedCapability {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.ICapabilityProperties])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlFlexibleServerReplica.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mysql-test westus2 mysql_test 5.7 5120 Stand
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlflexibleserverreplica
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlflexibleserverreplica
#>
function Get-AzMySqlFlexibleServerReplica {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlReplica.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mysql-test-replica eastus mysql_test 5.7 10240 G
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlreplica
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlreplica
#>
function Get-AzMySqlReplica {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
Expand Down
2 changes: 1 addition & 1 deletion src/MySql/exports/Get-AzMySqlServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ INPUTOBJECT <IMySqlIdentity>: Identity Parameter
[SubscriptionId <String>]: The ID of the target subscription.
[VirtualNetworkRuleName <String>]: The name of the virtual network rule.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.mysql/get-azmysqlserver
https://docs.microsoft.com/powershell/module/az.mysql/get-azmysqlserver
#>
function Get-AzMySqlServer {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServer])]
Expand Down
Loading