Skip to content

Commit

Permalink
BREAKING CHANGE: SqlServerEndpoint: Added the property State (#1535)
Browse files Browse the repository at this point in the history
- SqlServerEndpointState
  - This resource is now deprecated. The functionality is covered by a
    property in the resource _SqlServerEndpoint_ (issue #968).
- SqlServerEndpoint
  - BREAKING CHANGE: A new required property `EndpointType` was added to
    support different types of endpoints in the future. For now the only
    endpoint type that is supported is the database mirror endpoint type
    (`DatabaseMirroring`).
  - Added the property `State` to be able to specify if the endpoint should
    be running, stopped, or disabled. _This property was moved from the now_
    _deprecated DSC resource `SqlServerEndpointState`_.
  - BREAKING CHANGE: Now the properties are only enforced if they are
    specified in the configuration.
- CommonTestHelper
  - The test helper function `New-SQLSelfSignedCertificate` was changed
    to install the dependent module `PSPKI` through `RequiredModules.psd1`.
  • Loading branch information
johlju authored May 13, 2020
1 parent 083850c commit 4c0dcc6
Show file tree
Hide file tree
Showing 26 changed files with 432 additions and 577 deletions.
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ The documentation, examples, unit test, and integration tests have been
removed for these deprecated resources. These resources will be removed
in a future release.

- SqlServerNetwork
- This resource is now deprecated. The functionality is now covered by
the resources _SqlServerProtocol_ and _SqlServerProtocolTcpIp_.
- SqlDatabaseOwner
- This resource is now deprecated. The functionality is now covered by
a property in the resource _SqlDatabase_ ([issue #966](https://github.com/dsccommunity/SqlServerDsc/issues/966)).
- SqlDatabaseRecoveryModel
- This resource is now deprecated. The functionality is now covered by
a property in the resource _SqlDatabase_ ([issue #967](https://github.com/dsccommunity/SqlServerDsc/issues/967)).
- SqlServerEndpointState
- This resource is now deprecated. The functionality is covered by a
property in the resource _SqlServerEndpoint_ ([issue #968](https://github.com/dsccommunity/SqlServerDsc/issues/968)).
- SqlServerNetwork
- This resource is now deprecated. The functionality is now covered by
the resources _SqlServerProtocol_ and _SqlServerProtocolTcpIp_.

### Added

Expand All @@ -38,6 +41,14 @@ in a future release.
- Added new resource SqlServerProtocolTcpIp ([issue #1378](https://github.com/dsccommunity/SqlServerDsc/issues/1378)).
- Fixing a problem with the latest ModuleBuild 1.7.0 that breaks the CI
pipeline.
- SqlServerEndpoint
- BREAKING CHANGE: A new required property `EndpointType` was added to
support different types of endpoints in the future. For now the only
endpoint type that is supported is the database mirror endpoint type
(`DatabaseMirroring`).
- Added the property `State` to be able to specify if the endpoint should
be running, stopped, or disabled. _This property was moved from the now_
_deprecated DSC resource `SqlServerEndpointState`_.
- SqlSetup
- A read only property `IsClustered` was added that can be used to determine
if the instance is clustered.
Expand Down Expand Up @@ -72,6 +83,9 @@ in a future release.
- SqlServerDsc.Common
- The helper function `Invoke-InstallationMediaCopy` was changed to
handle a breaking change in PowerShell 7 ([issue #1530](https://github.com/dsccommunity/SqlServerDsc/issues/1530)).
- CommonTestHelper
- The test helper function `New-SQLSelfSignedCertificate` was changed
to install the dependent module `PSPKI` through `RequiredModules.psd1`.
- SqlAlwaysOnService
- BREAKING CHANGE: The parameter `ServerName` is now non-mandatory and
defaults to `$env:COMPUTERNAME` ([issue #319](https://github.com/dsccommunity/SqlServerDsc/issues/319)).
Expand Down Expand Up @@ -118,6 +132,8 @@ in a future release.
- SqlServerDatabaseMail
- Normalize parameter descriptive text for default values.
- SqlServerEndpoint
- BREAKING CHANGE: Now the properties are only enforced if they are
specified in the configuration.
- Normalize parameter descriptive text for default values.
- SqlServerEndpointPermission
- BREAKING CHANGE: The parameter `ServerName` is now non-mandatory and
Expand Down
59 changes: 18 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ The documentation, examples, unit test, and integration tests have been removed
for these deprecated resources. These resources will be removed
in a future release.

* SqlDatabaseOwner _(replaced by a property in [**SqlDatabase**](#sqldatabase)_.
* SqlDatabaseRecoveryModel _(replaced by a property in [**SqlDatabase**](#sqldatabase)_.
* SqlDatabaseOwner _(replaced by a property in [**SqlDatabase**](#sqldatabase))_.
* SqlDatabaseRecoveryModel _(replaced by a property in [**SqlDatabase**](#sqldatabase))_.
* SqlServerEndpointState _(replaced by [**SqlServerEndpoint**](#sqlserverendpoint))_.
* SqlServerNetwork _(replaced by [**SqlServerProtocol**](#sqlserverprotocol) and_
_[**SqlServerProtocolTcpIp**](#sqlserverprotocoltcpip))_.

Expand Down Expand Up @@ -119,7 +120,6 @@ in a future release.
is present or absent.
* [**SqlServerEndpointPermission**](#sqlserverendpointpermission) Grant or revoke
permission on the endpoint.
* [**SqlServerEndpointState**](#sqlserverendpointstate) Change state of the endpoint.
* [**SqlServerLogin**](#sqlserverlogin) resource to manage SQL logins.
* [**SqlServerMaxDop**](#sqlservermaxdop) resource to manage MaxDegree of Parallelism
for SQL Server.
Expand Down Expand Up @@ -1248,10 +1248,10 @@ All issues are not listed here, see [here for all open issues](https://github.co
This resource is used to create an endpoint. Currently it only supports creating
a database mirror endpoint which can be used by, for example, AlwaysOn.

>Note: The endpoint will be started after creation, but will not be enforced. Please
use [**SqlServerEndpointState**](#sqlserverendpointstate) to make sure the endpoint
remains in started state. To set connect permission to the endpoint, please use
the resource [**SqlServerEndpointPermission**](#sqlserverendpointpermission).
>Note: The endpoint will be started after creation, but will not be enforced
>unless the the parameter `State` is specified.
>To set connect permission to the endpoint, please use
>the resource [**SqlServerEndpointPermission**](#sqlserverendpointpermission).
#### Requirements

Expand All @@ -1266,17 +1266,26 @@ the resource [**SqlServerEndpointPermission**](#sqlserverendpointpermission).
#### Parameters

* **`[String]` EndpointName** _(Key)_: The name of the endpoint.
* **`[String]` InstanceName** _(Key)_: The name of the SQL instance to be configured.
* **`[String]` EndpointType** _(Required)_: Specifies the type of endpoint. Currently
the only type that is supported is the Database Mirror type. { *DatabaseMirroring* }.
* **`[String]` Ensure** _(Write)_: If the endpoint should be present or absent.
Default values is 'Present'. { *Present* | Absent }.
* **`[Uint16]` Port** _(Write)_: The network port the endpoint is listening on.
Default value is 5022.
Default value is 5022, but default value is only used during endpoint creation,
it is not enforce.
* **`[String]` ServerName** _(Write)_: The host name of the SQL Server to be configured.
Default value is $env:COMPUTERNAME.
* **`[String]` InstanceName** _(Key)_: The name of the SQL instance to be configured.
* **`[String]` IpAddress** _(Write)_: The network IP address the endpoint is listening
on. Default value is '0.0.0.0' which means listen on any valid IP address.
The default value is only used during endpoint creation, it is not enforce.
* **`[String]` Owner** _(Write)_: The owner of the endpoint. Default is the
login used for the creation.
* **`[String]` State** _(Write)_: Specifies the state of the endpoint. Valid
states are Started, Stopped, or Disabled. When an endpoint is created and
the state is not specified then the endpoint will be started after it is
created. The state will not be enforced unless the parameter is specified.
{ Started | Stopped | Disabled }.

#### Examples

Expand Down Expand Up @@ -1320,38 +1329,6 @@ This resource is used to give connect permission to an endpoint for a user (logi

All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/SqlServerDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SqlServerEndpointPermission).

### SqlServerEndpointState

This resource is used to set the state of an endpoint.

>Note: Currently this resource can only be used with Database Mirror endpoints.
#### Requirements

* Target machine must be running Windows Server 2012 or later.
* Target machine must be running SQL Server Database Engine 2012 or later.
* Target machine must have access to the SQLPS PowerShell module or the SqlServer
PowerShell module.

#### Parameters

* **`[String]` InstanceName** _(Key)_: The name of the SQL instance to be configured.
* **`[String]` ServerName** _(Write)_: The host name of the SQL Server to be configured.
Default value is $env:COMPUTERNAME.
* **`[String]` Name** _(Key)_: The name of the endpoint.
* **`[String]` State** _(Write)_: The state of the endpoint. Valid states are Started,
Stopped or Disabled. Default value is 'Started'.
{ *Started* | Stopped | Disabled }.

#### Examples

* [Make sure that an endpoint is started](/source/Examples/Resources/SqlServerEndpointState/1-MakeSureEndpointIsStarted.ps1)
* [Make sure that an endpoint is stopped](/source/Examples/Resources/SqlServerEndpointState/2-MakeSureEndpointIsStopped.ps1)

#### Known issues

All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/SqlServerDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SqlServerEndpointState).

### SqlServerLogin

No description.
Expand Down
1 change: 1 addition & 0 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

# Dependency for integration tests
LoopbackAdapter = 'latest'
PSPKI = 'latest'

# Prerequisites modules needed for examples or integration tests
PSDscResources = '2.12.0.0'
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ stages:
'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerNetwork.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerLogin.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerEndPoint.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerDatabaseMail.Integration.Tests.ps1'
'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
Expand Down Expand Up @@ -211,7 +211,7 @@ stages:
# Group 2
'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerLogin.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerEndPoint.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServerDatabaseMail.Integration.Tests.ps1'
'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
Expand Down
3 changes: 3 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Pester:
- source/DSCResources/MSFT_SqlServerNetwork
- source/DSCResources/MSFT_SqlDatabaseOwner
- source/DSCResources/MSFT_SqlDatabaseRecoveryModel
- source/DSCResources/MSFT_SqlServerEndpointState
Script:
- tests/Unit
ExcludeTag:
Expand All @@ -81,12 +82,14 @@ DscTest:
- source/DSCResources/MSFT_SqlServerNetwork
- source/DSCResources/MSFT_SqlDatabaseOwner
- source/DSCResources/MSFT_SqlDatabaseRecoveryModel
- source/DSCResources/MSFT_SqlServerEndpointState
ExcludeModuleFile:
- Modules/DscResource.Common
# Deprecated resources
- DSCResources/MSFT_SqlServerNetwork
- DSCResources/MSFT_SqlDatabaseOwner
- DSCResources/MSFT_SqlDatabaseRecoveryModel
- DSCResources/MSFT_SqlServerEndpointState

Resolve-Dependency:
Gallery: 'PSGallery'
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ ignore:
- 'source/DSCResources/MSFT_SqlServerNetwork'
- 'source/DSCResources/MSFT_SqlDatabaseOwner'
- 'source/DSCResources/MSFT_SqlDatabaseRecoveryModel'
- 'source/DSCResources/MSFT_SqlServerEndpointState'
Loading

0 comments on commit 4c0dcc6

Please sign in to comment.