Skip to content
Draft
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
5 changes: 3 additions & 2 deletions src/PostgreSql/PostgreSql.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - PostgreSql")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.4.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.4.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

11 changes: 1 addition & 10 deletions src/PostgreSql/PostgreSql.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ input-file:
module-version: 0.1.0
title: PostgreSQL
subject-prefix: 'PostgreSQL'

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"
disable-transform-identity-type: true

directive:
- from: swagger-document
Expand Down Expand Up @@ -229,12 +226,6 @@ directive:
subject: Server
set:
parameter-description: Backup retention days for the server. Day count is between 7 and 35.
- from: source-file-csharp
where: $
transform: $ = $.replace(/OperationOrigin System/, 'OperationOrigin System1');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServerPropertiesForCreate Property', 'public Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServerPropertiesForCreate Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('public int StorageProfileBackupRetentionDay', '[System.Management.Automation.ValidateRangeAttribute(7,35)]\n public int StorageProfileBackupRetentionDay');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,44 +81,6 @@
}
]
},
{
"name": "Restart-AzPostgreSqlFlexibleServer",
"description": "Restarts a server.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/restart",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresql/restart-azpostgresqlflexibleserver"
},
"parameterSets": [
{
"parameters": [
"-Name <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Restarts a server.",
"parameters": [
{
"name": "-Name",
"value": "[Path.serverName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Start-AzPostgreSqlFlexibleServer",
"description": "Starts a server.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601
namespace Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models
{
using static Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Extensions;
using System.Security;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Get-AzPostgreSqlConnectionString {

[Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline, HelpMessage = 'The server for the connection string')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServer]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServer]
${InputObject},

[Parameter(Mandatory, HelpMessage = 'Client connection provider.')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Get-AzPostgreSqlFlexibleServerConnectionString {

[Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline, HelpMessage = 'The server for the connection string')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601.IServerAutoGenerated]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerAutoGenerated]
${InputObject},

[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Get the available SKU information for the location
#>

function Get-AzPostgreSqlFlexibleServerLocationBasedCapability {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601.ICapabilityProperties])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.ICapabilityProperties])]
[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Creates a new firewall rule or updates an existing firewall rule.
Creates a new firewall rule or updates an existing firewall rule.
#>
function New-AzPostgreSqlFirewallRule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IFirewallRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IFirewallRule])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $DEFAULT_SUBNET_PREFIX = '10.0.0.0/24'
$AZURE_ARMNAME = '^[^<>%&:\\?/]{1,260}$'

function New-AzPostgreSqlFlexibleServer {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601.IServerAutoGenerated])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerAutoGenerated])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Description('Creates a new server.')]
param(
Expand Down Expand Up @@ -97,14 +97,14 @@ function New-AzPostgreSqlFlexibleServer {

[Parameter(HelpMessage = 'Application-specific metadata in the form of key-value pairs.')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServerForCreateTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerForCreateTags]))]
[System.Collections.Hashtable]
${Tag},

[Parameter(HelpMessage = 'Server version.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.ServerVersion])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("9.5", "9.6", "10", "10.0", "10.2", "11", "13", "12")]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.ServerVersion]
[System.String]
${Version},

[Parameter(HelpMessage = 'The id of an existing private dns zone. You can use the
Expand Down Expand Up @@ -289,17 +289,17 @@ function New-AzPostgreSqlFlexibleServer {

if ($PSBoundParameters.ContainsKey('HaEnabled')){
if ($PSBoundParameters["HaEnabled"] -eq "Enabled"){
$PSBoundParameters.HighAvailabilityMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.HighAvailabilityMode]::ZoneRedundant
$PSBoundParameters.HighAvailabilityMode = 'ZoneRedundant'
}
else {
$PSBoundParameters.HighAvailabilityMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.HighAvailabilityMode]::Disabled
$PSBoundParameters.HighAvailabilityMode = 'Disabled'
}
$null = $PSBoundParameters.Remove('HaEnabled')
}



$PSBoundParameters.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.CreateMode]::Default
$PSBoundParameters.CreateMode = 'Default'

# Handling Vnet & Subnet
$NetworkKeys = 'PublicAccess', 'Subnet', 'Vnet', 'SubnetPrefix', 'VnetPrefix', 'PrivateDnsZone'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Creates a new firewall rule or updates an existing firewall rule.
Creates a new firewall rule or updates an existing firewall rule.
#>
function New-AzPostgreSqlFlexibleServerFirewallRule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IFirewallRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IFirewallRule])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ----------------------------------------------------------------------------------

function New-AzPostgreSqlReplica {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServer])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServer])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Description('Creates a new replica from an existing database.')]
param(
Expand All @@ -38,7 +38,7 @@ function New-AzPostgreSqlReplica {
[Parameter(Mandatory, ValueFromPipeline, HelpMessage = 'The source server object to create replica from.')]
[Alias('InputObject')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServer]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServer]
${Master},

[Parameter(HelpMessage = 'The location the resource resides in.')]
Expand Down Expand Up @@ -109,9 +109,9 @@ function New-AzPostgreSqlReplica {

process {
try {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerForCreate]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerPropertiesForReplica]::new()
$Parameter.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.CreateMode]::Replica
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.ServerForCreate]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.ServerPropertiesForReplica]::new()
$Parameter.CreateMode = 'Replica'

$server = $PSBoundParameters['Master']
$Parameter.Property.SourceServerId = $server.Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ----------------------------------------------------------------------------------

function New-AzPostgreSqlServer {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServer])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServer])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Description('Creates a new server.')]
param(
Expand Down Expand Up @@ -57,15 +57,15 @@ function New-AzPostgreSqlServer {
${Sku},

[Parameter(HelpMessage = 'Enable ssl enforcement or not when connect to server.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.SslEnforcementEnum])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.SslEnforcementEnum]
[System.String]
${SslEnforcement},

[Parameter(HelpMessage = 'Set the minimal TLS version for connections to server when SSL is enabled. Default is TLSEnforcementDisabled.accepted values: TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.MinimalTlsVersionEnum])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("TLS1_0", "TLS1_1", "TLS1_2", "TLSEnforcementDisabled")]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.MinimalTlsVersionEnum]
[System.String]
# Enforce a minimal Tls version for the server.
${MinimalTlsVersion},

Expand All @@ -75,16 +75,16 @@ function New-AzPostgreSqlServer {
${BackupRetentionDay},

[Parameter(HelpMessage = 'Enable Geo-redundant or not for server backup.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.GeoRedundantBackup])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.GeoRedundantBackup]
[System.String]
${GeoRedundantBackup},

[Parameter(HelpMessage = 'Enable Storage Auto Grow.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.StorageAutogrow])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Validateset('Enabled', 'Disabled')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.StorageAutogrow]
[System.String]
${StorageAutogrow},

[Parameter(HelpMessage = 'Max storage allowed for a server.')]
Expand All @@ -94,14 +94,14 @@ function New-AzPostgreSqlServer {

[Parameter(HelpMessage = 'Application-specific metadata in the form of key-value pairs.')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServerForCreateTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerForCreateTags]))]
[System.Collections.Hashtable]
${Tag},

[Parameter(HelpMessage = 'Server version.')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.ServerVersion])]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.PSArgumentCompleterAttribute("9.5", "9.6", "10", "10.0", "10.2", "11", "13", "12")]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.ServerVersion]
[System.String]
${Version},

[Parameter(HelpMessage = 'The credentials, account, tenant, and subscription used for communication with Azure.')]
Expand Down Expand Up @@ -162,8 +162,8 @@ function New-AzPostgreSqlServer {

process {
try {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerForCreate]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerPropertiesForDefaultCreate]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.ServerForCreate]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.ServerPropertiesForDefaultCreate]::new()

if ($PSBoundParameters.ContainsKey('Location')) {
$Parameter.Location = $PSBoundParameters['Location']
Expand All @@ -181,7 +181,7 @@ function New-AzPostgreSqlServer {
}
else
{
$Parameter.SslEnforcement = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.SslEnforcementEnum]::Enable
$Parameter.SslEnforcement = 'Enabled'
}

if ($PSBoundParameters.ContainsKey('MinimalTlsVersion')) {
Expand Down Expand Up @@ -219,7 +219,7 @@ function New-AzPostgreSqlServer {
$null = $PSBoundParameters.Remove('Version')
}

$Parameter.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.CreateMode]::Default
$Parameter.CreateMode = 'Default'

$Parameter.Property.AdministratorLogin = $PSBoundParameters['AdministratorUserName']
$null = $PSBoundParameters.Remove('AdministratorUserName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ----------------------------------------------------------------------------------

function Restore-AzPostgreSqlFlexibleServer_GeoRestore {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601.IServerAutoGenerated])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerAutoGenerated])]
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Description('Restore a PostgreSQL flexible server using Geo-restore')]
param(
Expand Down Expand Up @@ -51,7 +51,7 @@ function Restore-AzPostgreSqlFlexibleServer_GeoRestore {

[Parameter(HelpMessage = 'Application-specific metadata in the form of key-value pairs.')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.IServerForCreateTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerForCreateTags]))]
[System.Collections.Hashtable]
${Tag},

Expand Down Expand Up @@ -113,7 +113,7 @@ function Restore-AzPostgreSqlFlexibleServer_GeoRestore {

process {
try {
$PSBoundParameters.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.CreateMode]::GeoRestore
$PSBoundParameters.CreateMode = 'GeoRestore'
$null = $PSBoundParameters.Remove('UseGeoRestore')

$server = Get-AzPostgreSqlFlexibleServer -ResourceGroupName $PSBoundParameters.ResourceGroupName -Name $PSBoundParameters.SourceServerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Restore a PostgreSQL flexible server from an existing backup
#>
$DELEGATION_SERVICE_NAME = "Microsoft.DBforPostgreSQL/flexibleServers"
function Restore-AzPostgreSqlFlexibleServer_PointInTimeRestore {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20210601.IServerAutoGenerated])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.IServerAutoGenerated])]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Description('Restore a server from an existing backup')]
param(
Expand Down Expand Up @@ -125,7 +125,7 @@ function Restore-AzPostgreSqlFlexibleServer_PointInTimeRestore {

process {
try {
$PSBoundParameters.CreateMode = [Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Support.CreateMode]::PointInTimeRestore
$PSBoundParameters.CreateMode = 'PointInTimeRestore'

$server = Get-AzPostgreSqlFlexibleServer -ResourceGroupName $PSBoundParameters.ResourceGroupName -Name $PSBoundParameters.SourceServerName
$null = $PSBoundParameters.Remove('SourceServerName')
Expand Down
Loading
Loading