-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First version of MySql flexible servers
- Loading branch information
Showing
690 changed files
with
97,295 additions
and
5,888 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
|
||
# ---------------------------------------------------------------------------------- | ||
# | ||
# 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. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
function New-AzMySqlFlexibleServer { | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20200701Preview.IServerAutoGenerated])] | ||
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Description('Creates a new server.')] | ||
param( | ||
[Parameter(Mandatory, HelpMessage = 'The name of the server.')] | ||
[Alias('ServerName')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] | ||
[System.String] | ||
${Name}, | ||
|
||
[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')] | ||
[System.String] | ||
${ResourceGroupName}, | ||
|
||
[Parameter(HelpMessage='The subscription ID that identifies an Azure subscription.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] | ||
[System.String] | ||
${SubscriptionId}, | ||
|
||
[Parameter(HelpMessage = 'The location the resource resides in.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.String] | ||
${Location}, | ||
|
||
[Parameter(Mandatory, HelpMessage = 'Administrator username for the server. Once set, it cannot be changed.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.String] | ||
${AdministratorUserName}, | ||
|
||
[Parameter(Mandatory, HelpMessage = 'The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.Security.SecureString] | ||
[ValidateNotNullOrEmpty()] | ||
${AdministratorLoginPassword}, | ||
|
||
[Parameter(HelpMessage = 'The name of the sku, typically, tier + family + cores, e.g. Standard_B1ms, Standard_D2ds_v4.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.String] | ||
${Sku}, | ||
|
||
[Parameter(HelpMessage = 'Compute tier of the server. Accepted values: Burstable, GeneralPurpose, Memory Optimized. Default: Burstable.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.String] | ||
${SkuTier}, | ||
|
||
[Parameter(HelpMessage = "Backup retention days for the server. Day count is between 7 and 35.")] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.Int32] | ||
${BackupRetentionDay}, | ||
|
||
[Parameter(HelpMessage = 'Max storage allowed for a server.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[System.Int32] | ||
${StorageInMb}, | ||
|
||
[Parameter(HelpMessage = 'Application-specific metadata in the form of key-value pairs.')] | ||
[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] | ||
${Tag}, | ||
|
||
[Parameter(HelpMessage = 'Server version.')] | ||
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.ServerVersion])] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.ServerVersion] | ||
${Version}, | ||
|
||
[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')] | ||
[Alias('AzureRMContext', 'AzureCredential')] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Azure')] | ||
[System.Management.Automation.PSObject] | ||
${DefaultProfile}, | ||
|
||
[Parameter(HelpMessage = 'Run the command as a job.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
${AsJob}, | ||
|
||
[Parameter(DontShow, HelpMessage = 'Wait for .NET debugger to attach.')] | ||
[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[]] | ||
# 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(HelpMessage = 'Run the command asynchronously.')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
${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('Name')) { | ||
$PSBoundParameters.ServerName = $PSBoundParameters['Name'] | ||
$null = $PSBoundParameters.Remove('Name') | ||
} | ||
|
||
if ($PSBoundParameters.ContainsKey('Sku')) { | ||
$PSBoundParameters.SkuName = $PSBoundParameters['Sku'] | ||
$null = $PSBoundParameters.Remove('Sku') | ||
} | ||
else { | ||
$PSBoundParameters.SkuName = 'Standard_B1ms' | ||
} | ||
|
||
if ($PSBoundParameters.ContainsKey('BackupRetentionDay')) { | ||
$PSBoundParameters.StorageProfileBackupRetentionDay = $PSBoundParameters['BackupRetentionDay'] | ||
$null = $PSBoundParameters.Remove('BackupRetentionDay') | ||
} | ||
else { | ||
$PSBoundParameters.StorageProfileBackupRetentionDay = 7 | ||
} | ||
|
||
if ($PSBoundParameters.ContainsKey('StorageInMb')) { | ||
$PSBoundParameters.StorageProfileStorageMb = $PSBoundParameters['StorageInMb'] | ||
$null = $PSBoundParameters.Remove('StorageInMb') | ||
} | ||
else { | ||
$PSBoundParameters.StorageProfileStorageMb = 10240 | ||
} | ||
|
||
if (!$PSBoundParameters.ContainsKey('Version')) { | ||
$PSBoundParameters.Version = '5.7' | ||
} | ||
|
||
if (!$PSBoundParameters.ContainsKey('SkuTier')) { | ||
$PSBoundParameters.SkuTier = 'Burstable' | ||
} | ||
|
||
if (!$PSBoundParameters.ContainsKey('Location')) { | ||
$PSBoundParameters.Location = 'westus2' | ||
} | ||
|
||
if ($PSBoundParameters.ContainsKey('AdministratorUserName')) { | ||
$PSBoundParameters.AdministratorLogin = $PSBoundParameters['AdministratorUserName'] | ||
$null = $PSBoundParameters.Remove('AdministratorUserName') | ||
} | ||
|
||
$PSBoundParameters.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.MySql.Support.CreateMode]::Default | ||
$PSBoundParameters.AdministratorLoginPassword = . "$PSScriptRoot/../utils/Unprotect-SecureString.ps1" $PSBoundParameters['AdministratorLoginPassword'] | ||
|
||
Az.MySql.internal\New-AzMySqlFlexibleServer @PSBoundParameters | ||
} catch { | ||
throw | ||
} | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.