Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: SqlServerDsc: Fix inconsistent parameter names in all resources #917

Merged
merged 33 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4f3b010
Changes to SqlAG
johlju Nov 12, 2017
5efdcc3
Changes to SqlServerLogin
johlju Nov 12, 2017
91ea216
Changes to SqlServerPermission
johlju Nov 12, 2017
d6513cc
Changes to SqlServerEndpoint
johlju Nov 12, 2017
13b91f9
Updated examples
johlju Nov 12, 2017
6268d3d
Fix bugs
johlju Nov 13, 2017
e283953
Fix bugs in SqlAG tests
johlju Nov 14, 2017
1baf0cd
Changes to SqlAGDatabases
johlju Nov 14, 2017
c7a8630
Changes to SqlAGReplica
johlju Nov 14, 2017
db79290
Fix bugs
johlju Nov 14, 2017
7489e85
Changes to SqlServerOwner
johlju Nov 14, 2017
87fbb76
Changes to SqlAGListener
johlju Nov 14, 2017
2f2f327
Changes to SqlAlwaysOnService
johlju Nov 15, 2017
f97914b
Changes to SqlDatabase
johlju Nov 15, 2017
24238ce
Changes to SqlDatabaseDefaultLocation
johlju Nov 15, 2017
9a1e291
Changes to SqlDatabasePermission
johlju Nov 15, 2017
c65a7b8
Changes to SqlDatabaseRecoveryModel
johlju Nov 15, 2017
468b82a
Changes to SqlDatabaseRole
johlju Nov 15, 2017
585ac40
Fix integration tests
johlju Nov 17, 2017
cf8165f
Updated CHANGELOG.md
johlju Nov 17, 2017
35a8214
Changes to SqlServerConfiguration
johlju Nov 17, 2017
30ae6fa
Changes to SqlServerEndpointPermission
johlju Nov 17, 2017
85945a2
Changes to SqlServerEndpointState
johlju Nov 17, 2017
790032d
Changes to SqlServerMaxDop
johlju Nov 17, 2017
69fc0bf
Changes to SqlServerMemory
johlju Nov 17, 2017
db58835
Changes to SqlServerNetwork
johlju Nov 17, 2017
31103de
Changes to SqlServerRole
johlju Nov 17, 2017
517981d
Changes to SqlServerServiceAccount
johlju Nov 17, 2017
f100ba7
Replaced 'SQLServer' with better option in examples and help texts
johlju Nov 18, 2017
b2e93fb
Fix CHANGELOG.md
johlju Nov 28, 2017
6825603
Fix review comments at r1
johlju Dec 1, 2017
e3e354f
Fix review comments at r3
johlju Dec 1, 2017
107cbf9
Fix review comments at r4
johlju Dec 1, 2017
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
71 changes: 68 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,85 @@

- BREAKING CHANGE: Resource module has been renamed to SqlServerDsc
([issue #916](https://github.com/PowerShell/SqlServerDsc/issues/916)).
- BREAKING CHANGE: Significant rename to reduce length of Resource names
- BREAKING CHANGE: Significant rename to reduce length of resource names
- See [issue #851](https://github.com/PowerShell/SqlServerDsc/issues/851) for a
complete table mapping rename changes.
- Impact to all resources
complete table mapping rename changes.
- Impact to all resources.
- Changes to CONTRIBUTING.md
- Added details to the naming convention used in SqlServerDsc.
- Changes to SqlServerDsc
- The examples in the root of the Examples folder are obsolete. A note was
added to the comment-based help in each example stating it is obsolete.
This is a temporary measure until they are replaced.
([issue #904](https://github.com/PowerShell/SqlServerDsc/issues/904)).
- Changes to SqlAG
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlAGDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changed the Get-MatchingDatabaseNames function to be case insensitive when
matching database names. ([issue #912](https://github.com/PowerShell/SqlServerDsc/issues/912))
- Changes to SqlAGListener
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlAGReplica
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlAlwaysOnService
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes SqlDatabaseDefaultLocation
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlDatabasePermission
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlDatabaseRecoveryModel
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlDatabaseRole
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerConfiguration
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerEndpoint
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerEndpointPermission
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerEndpointState
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerLogin
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerMaxDop
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerMemory
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerNetwork
- BREAKING CHANGE: Parameters SQLServer has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerOwner
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerPermission
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerRole
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).
- Changes to SqlServerServiceAccount
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectivly ([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/)).

## 9.0.0.0

Expand Down
52 changes: 26 additions & 26 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Import-Module -Name (Join-Path -Path (Split-Path (Split-Path $PSScriptRoot -Pare
.PARAMETER Name
The name of the availability group.

.PARAMETER SQLServer
.PARAMETER ServerName
Hostname of the SQL Server to be configured.

.PARAMETER SQLInstanceName
.PARAMETER InstanceName
Name of the SQL instance to be configured.
#>
function Get-TargetResource
Expand All @@ -27,15 +27,15 @@ function Get-TargetResource

[Parameter(Mandatory = $true)]
[String]
$SQLServer,
$ServerName,

[Parameter(Mandatory = $true)]
[String]
$SQLInstanceName
$InstanceName
)

# Connect to the instance
$serverObject = Connect-SQL -SQLServer $SQLServer -SQLInstanceName $SQLInstanceName
$serverObject = Connect-SQL -SQLServer $ServerName -SQLInstanceName $InstanceName

# Define current version for check compatibility
$sqlMajorVersion = $serverObject.Version.Major
Expand All @@ -56,8 +56,8 @@ function Get-TargetResource
# Create the return object. Default ensure to Absent.
$alwaysOnAvailabilityGroupResource = @{
Name = $Name
SQLServer = $SQLServer
SQLInstanceName = $SQLInstanceName
ServerName = $ServerName
InstanceName = $InstanceName
Ensure = 'Absent'
IsActiveNode = $isActiveNode
}
Expand Down Expand Up @@ -98,10 +98,10 @@ function Get-TargetResource
.PARAMETER Name
The name of the availability group.

.PARAMETER SQLServer
.PARAMETER ServerName
Hostname of the SQL Server to be configured.

.PARAMETER SQLInstanceName
.PARAMETER InstanceName
Name of the SQL instance to be configured.

.PARAMETER Ensure
Expand Down Expand Up @@ -155,11 +155,11 @@ function Set-TargetResource

[Parameter(Mandatory = $true)]
[String]
$SQLServer,
$ServerName,

[Parameter(Mandatory = $true)]
[String]
$SQLInstanceName,
$InstanceName,

[Parameter()]
[ValidateSet('Present', 'Absent')]
Expand Down Expand Up @@ -235,12 +235,12 @@ function Set-TargetResource
Import-SQLPSModule

# Connect to the instance
$serverObject = Connect-SQL -SQLServer $SQLServer -SQLInstanceName $SQLInstanceName
$serverObject = Connect-SQL -SQLServer $ServerName -SQLInstanceName $InstanceName

# Determine if HADR is enabled on the instance. If not, throw an error
if ( -not $serverObject.IsHadrEnabled )
{
throw New-TerminatingError -ErrorType HadrNotEnabled -FormatArgs $Ensure, $SQLInstanceName -ErrorCategory NotImplemented
throw New-TerminatingError -ErrorType HadrNotEnabled -FormatArgs $Ensure, $InstanceName -ErrorCategory NotImplemented
}

# Define current version for check compatibility
Expand All @@ -265,12 +265,12 @@ function Set-TargetResource
}
catch
{
throw New-TerminatingError -ErrorType RemoveAvailabilityGroupFailed -FormatArgs $availabilityGroup.Name, $SQLInstanceName -ErrorCategory ResourceUnavailable -InnerException $_.Exception
throw New-TerminatingError -ErrorType RemoveAvailabilityGroupFailed -FormatArgs $availabilityGroup.Name, $InstanceName -ErrorCategory ResourceUnavailable -InnerException $_.Exception
}
}
else
{
throw New-TerminatingError -ErrorType InstanceNotPrimaryReplica -FormatArgs $SQLInstanceName, $availabilityGroup.Name -ErrorCategory ResourceUnavailable
throw New-TerminatingError -ErrorType InstanceNotPrimaryReplica -FormatArgs $InstanceName, $availabilityGroup.Name -ErrorCategory ResourceUnavailable
}
}
}
Expand All @@ -284,7 +284,7 @@ function Set-TargetResource
$endpoint = $serverObject.Endpoints | Where-Object { $_.EndpointType -eq 'DatabaseMirroring' }
if ( -not $endpoint )
{
throw New-TerminatingError -ErrorType DatabaseMirroringEndpointNotFound -FormatArgs $SQLServer, $SQLInstanceName -ErrorCategory ObjectNotFound
throw New-TerminatingError -ErrorType DatabaseMirroringEndpointNotFound -FormatArgs $ServerName, $InstanceName -ErrorCategory ObjectNotFound
}

if ( -not $EndpointHostName )
Expand Down Expand Up @@ -327,7 +327,7 @@ function Set-TargetResource
}
catch
{
throw New-TerminatingError -ErrorType CreateAvailabilityGroupReplicaFailed -FormatArgs $newReplicaParams.Name, $SQLInstanceName -ErrorCategory OperationStopped -InnerException $_.Exception
throw New-TerminatingError -ErrorType CreateAvailabilityGroupReplicaFailed -FormatArgs $newReplicaParams.Name, $InstanceName -ErrorCategory OperationStopped -InnerException $_.Exception
}

# Set up the parameters for the new availability group
Expand Down Expand Up @@ -477,10 +477,10 @@ function Set-TargetResource
.PARAMETER Name
The name of the availability group.

.PARAMETER SQLServer
.PARAMETER ServerName
Hostname of the SQL Server to be configured.

.PARAMETER SQLInstanceName
.PARAMETER InstanceName
Name of the SQL instance to be configured.

.PARAMETER Ensure
Expand Down Expand Up @@ -534,11 +534,11 @@ function Test-TargetResource

[Parameter(Mandatory = $true)]
[String]
$SQLServer,
$ServerName,

[Parameter(Mandatory = $true)]
[String]
$SQLInstanceName,
$InstanceName,

[Parameter()]
[ValidateSet('Present', 'Absent')]
Expand Down Expand Up @@ -606,8 +606,8 @@ function Test-TargetResource
)

$getTargetResourceParameters = @{
SQLInstanceName = $SQLInstanceName
SQLServer = $SQLServer
InstanceName = $InstanceName
ServerName = $ServerName
Name = $Name
}

Expand All @@ -622,7 +622,7 @@ function Test-TargetResource
#>
if ( $ProcessOnlyOnActiveNode -and -not $getTargetResourceResult.IsActiveNode )
{
New-VerboseMessage -Message ( 'The node "{0}" is not actively hosting the instance "{1}". Exiting the test.' -f $env:COMPUTERNAME,$SQLInstanceName )
New-VerboseMessage -Message ( 'The node "{0}" is not actively hosting the instance "{1}". Exiting the test.' -f $env:COMPUTERNAME, $InstanceName )
return $result
}

Expand All @@ -647,8 +647,8 @@ function Test-TargetResource
{
$parametersToCheck = @(
'Name',
'SQLServer',
'SQLInstanceName',
'ServerName',
'InstanceName',
'Ensure',
'AutomatedBackupPreference',
'AvailabilityMode',
Expand Down
4 changes: 2 additions & 2 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
class MSFT_SqlAG : OMI_BaseResource
{
[Key, Description("The name of the availability group.")] String Name;
[Required, Description("Hostname of the SQL Server to be configured.")] String SQLServer;
[Key, Description("Name of the SQL instance to be configured.")] String SQLInstanceName;
[Required, Description("Hostname of the SQL Server to be configured.")] String ServerName;
[Key, Description("Name of the SQL instance to be configured.")] String InstanceName;
[Write, Description("Specifies if the availability group should be present or absent. Default is Present."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Specifies the automated backup preference for the availability group. Default is None"), ValueMap{"Primary","SecondaryOnly","Secondary","None"}, Values{"Primary","SecondaryOnly","Secondary","None"}] String AutomatedBackupPreference;
[Write, Description("Specifies the replica availability mode. Default is 'AsynchronousCommit'."), ValueMap{"AsynchronousCommit","SynchronousCommit"}, Values{"AsynchronousCommit","SynchronousCommit"}] String AvailabilityMode;
Expand Down
Loading