Skip to content

Commit

Permalink
Changes to SqlAG
Browse files Browse the repository at this point in the history
- The read-only property SQLServerNetName was removed in favor of EndpointHostName (issue dsccommunity#924).
  Get-TargetResource will return the value of property NetName as the default value if
  EndpointHostName parameter is not assigned a value.
  • Loading branch information
johlju committed Dec 7, 2017
1 parent 17a5698 commit 2925249
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- The read-only property SQLServerNetName was removed in favor of EndpointHostName
([issue #924](https://github.com/PowerShell/SqlServerDsc/issues/924)).
Get-TargetResource will return the value of property [NetName](https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.netname(v=sql.105).aspx)
as the default value if EndpointHostName parameter is not assigned a value.
- Changes to SqlAGDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
Expand Down
4 changes: 2 additions & 2 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function Get-TargetResource
$alwaysOnAvailabilityGroupResource.HealthCheckTimeout = $availabilityGroup.HealthCheckTimeout
$alwaysOnAvailabilityGroupResource.EndpointURL = $availabilityGroup.AvailabilityReplicas[$serverObject.DomainInstanceName].EndpointUrl
$alwaysOnAvailabilityGroupResource.EndpointPort = $endpointPort
$alwaysOnAvailabilityGroupResource.SQLServerNetName = $serverObject.NetName
$alwaysOnAvailabilityGroupResource.EndpointHostName = $serverObject.NetName
$alwaysOnAvailabilityGroupResource.Version = $sqlMajorVersion

# Add properties that are only present in SQL 2016 or newer
Expand Down Expand Up @@ -700,7 +700,7 @@ function Test-TargetResource

if ( -not $EndpointHostName )
{
$EndpointHostName = $getTargetResourceResult.SQLServerNetName
$EndpointHostName = $getTargetResourceResult.EndpointHostName
}

# Verify the hostname in the endpoint URL is correct
Expand Down
1 change: 0 additions & 1 deletion DSCResources/MSFT_SqlAG/MSFT_SqlAG.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class MSFT_SqlAG : OMI_BaseResource
[Write, Description("Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server Instance.")] Boolean ProcessOnlyOnActiveNode;
[Read, Description("Gets the Endpoint URL of the availability group replica endpoint.")] String EndpointUrl;
[Read, Description("Gets the port the database mirroring endpoint is listening on.")] UInt32 EndpointPort;
[Read, Description("Gets the hostname the SQL Server instance is listening on.")] String SQLServerNetName;
[Read, Description("Gets the major version of the SQL Server instance.")] UInt32 Version;
[Read, Description("Determines if the current node is actively hosting the SQL Server instance.")] Boolean IsActiveNode;
};
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ It will also manage the Availability Group replica on the specified node.
availability group replica endpoint.
* **`[Uint32]` EndpointPort** _(Read)_: Gets the port the database mirroring
endpoint is listening on
* **`[String]` SQLServerNetName** _(Read)_: Gets the hostname the SQL Server
instance is listening on.
* **`[Uint32]` Version** _(Read)_: Gets the major version of the SQL Server
instance.
* **`[Boolean]` IsActiveNode** _(Read)_: Determines if the current node is
Expand Down

0 comments on commit 2925249

Please sign in to comment.