Skip to content

Commit adea80f

Browse files
committed
Add copyright headers, rename cmdlet param AzureSqlDatabase->AzureSqlDatabaseObject
1 parent 1050daa commit adea80f

6 files changed

+92
-38
lines changed

src/Sql/Sql/Database Backup/Cmdlet/AzureSqlDatabaseBackupShortTermRetentionPolicyCmdletBase.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
216
using System.Collections.Generic;
317
using Microsoft.Azure.Commands.Sql.Backup.Services;
418
using Microsoft.Azure.Commands.Sql.Common;
@@ -41,7 +55,8 @@ public abstract class AzureSqlDatabaseBackupShortTermRetentionPolicyCmdletBase :
4155
ValueFromPipeline = true,
4256
HelpMessage = "The database object to get the policy for.")]
4357
[ValidateNotNullOrEmpty]
44-
public AzureSqlDatabaseModel AzureSqlDatabase { get; set; }
58+
[Alias("AzureSqlDatabase")]
59+
public AzureSqlDatabaseModel AzureSqlDatabaseObject { get; set; }
4560

4661
/// <summary>
4762
/// Gets or sets the Database object to get the policy for.
@@ -102,11 +117,11 @@ protected override AzureSqlDatabaseBackupAdapter InitModelAdapter(IAzureSubscrip
102117

103118
public override void ExecuteCmdlet()
104119
{
105-
if (AzureSqlDatabase != null)
120+
if (AzureSqlDatabaseObject != null)
106121
{
107-
this.ResourceGroupName = AzureSqlDatabase.ResourceGroupName;
108-
this.ServerName = AzureSqlDatabase.ServerName;
109-
this.DatabaseName = AzureSqlDatabase.DatabaseName;
122+
this.ResourceGroupName = AzureSqlDatabaseObject.ResourceGroupName;
123+
this.ServerName = AzureSqlDatabaseObject.ServerName;
124+
this.DatabaseName = AzureSqlDatabaseObject.DatabaseName;
110125
}
111126
else if (!string.IsNullOrEmpty(ResourceId))
112127
{

src/Sql/Sql/Database Backup/Cmdlet/GetAzureRmSqlDatabaseBackupShortTermRetentionPolicy.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
using System.Collections.Generic;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Collections.Generic;
216
using System.Management.Automation;
317
using Microsoft.Azure.Commands.Sql.Backup.Model;
4-
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
518

619
namespace Microsoft.Azure.Commands.Sql.Backup.Cmdlet
720
{

src/Sql/Sql/Database Backup/Cmdlet/SetAzureRmSqlDatabaseBackupShortTermRetentionPolicy.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System.Collections.Generic;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Collections.Generic;
216
using System.Linq;
317
using System.Management.Automation;
418
using Microsoft.Azure.Commands.Sql.Backup.Model;

src/Sql/Sql/Database Backup/Model/AzureSqlDatabaseBackupShortTermRetentionPolicyModel.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
namespace Microsoft.Azure.Commands.Sql.Backup.Model
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
namespace Microsoft.Azure.Commands.Sql.Backup.Model
216
{
317
public class AzureSqlDatabaseBackupShortTermRetentionPolicyModel
418
{

src/Sql/Sql/help/Get-AzSqlDatabaseBackupShortTermRetentionPolicy.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Get-AzSqlDatabaseBackupShortTermRetentionPolicy [-ResourceGroupName] <String> [-
2020

2121
### PolicyByInputObjectSet
2222
```
23-
Get-AzSqlDatabaseBackupShortTermRetentionPolicy -AzureSqlDatabase <AzureSqlDatabaseModel>
23+
Get-AzSqlDatabaseBackupShortTermRetentionPolicy -AzureSqlDatabaseObject <AzureSqlDatabaseModel>
2424
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2525
```
2626

@@ -56,17 +56,17 @@ ResourceGroupName ServerName DatabaseName RetentionDays
5656
resourcegroup01 server01 database01 35
5757
```
5858

59-
This command gets the short term retention policy for database01.
59+
This command gets the short term retention policy for database01 via piping in a database object.
6060

6161
## PARAMETERS
6262

63-
### -AzureSqlDatabase
63+
### -AzureSqlDatabaseObject
6464
The database object to get the policy for.
6565

6666
```yaml
67-
Type: AzureSqlDatabaseModel
67+
Type: Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel
6868
Parameter Sets: PolicyByInputObjectSet
69-
Aliases:
69+
Aliases: AzureSqlDatabase
7070

7171
Required: True
7272
Position: Named
@@ -79,7 +79,7 @@ Accept wildcard characters: False
7979
The name of the Azure SQL Database to use.
8080
8181
```yaml
82-
Type: String
82+
Type: System.String
8383
Parameter Sets: PolicyByResourceServerDatabaseSet
8484
Aliases:
8585

@@ -94,7 +94,7 @@ Accept wildcard characters: False
9494
The credentials, account, tenant, and subscription used for communication with Azure.
9595
9696
```yaml
97-
Type: IAzureContextContainer
97+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
9898
Parameter Sets: (All)
9999
Aliases: AzContext, AzureRmContext, AzureCredential
100100

@@ -109,7 +109,7 @@ Accept wildcard characters: False
109109
The name of the resource group.
110110
111111
```yaml
112-
Type: String
112+
Type: System.String
113113
Parameter Sets: PolicyByResourceServerDatabaseSet
114114
Aliases:
115115

@@ -124,7 +124,7 @@ Accept wildcard characters: False
124124
The short term retention policy resource Id.
125125
126126
```yaml
127-
Type: String
127+
Type: System.String
128128
Parameter Sets: PolicyByResourceIdSet
129129
Aliases:
130130

@@ -139,7 +139,7 @@ Accept wildcard characters: False
139139
The name of the Azure SQL Server the database is in.
140140
141141
```yaml
142-
Type: String
142+
Type: System.String
143143
Parameter Sets: PolicyByResourceServerDatabaseSet
144144
Aliases:
145145

@@ -151,8 +151,7 @@ Accept wildcard characters: False
151151
```
152152
153153
### CommonParameters
154-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
155-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
154+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
156155
157156
## INPUTS
158157

src/Sql/Sql/help/Set-AzSqlDatabaseBackupShortTermRetentionPolicy.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Set-AzSqlDatabaseBackupShortTermRetentionPolicy [-RetentionDays] <Int32> [-Resou
2222
### PolicyByInputObjectSet
2323
```
2424
Set-AzSqlDatabaseBackupShortTermRetentionPolicy [-RetentionDays] <Int32>
25-
-AzureSqlDatabase <AzureSqlDatabaseModel> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
26-
[<CommonParameters>]
25+
-AzureSqlDatabaseObject <AzureSqlDatabaseModel> [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
26+
[-Confirm] [<CommonParameters>]
2727
```
2828

2929
### PolicyByResourceIdSet
@@ -56,17 +56,17 @@ PS C:\> Get-AzSqlDatabase -ResourceGroupName resourcegroup01 -ServerName server0
5656
resourcegroup01 server01 database01 35
5757
```
5858

59-
This command sets the short term retention policy for database01 to 35 days.
59+
This command sets the short term retention policy for database01 to 35 days via piping in a database object.
6060

6161
## PARAMETERS
6262

63-
### -AzureSqlDatabase
63+
### -AzureSqlDatabaseObject
6464
The database object to get the policy for.
6565

6666
```yaml
67-
Type: AzureSqlDatabaseModel
67+
Type: Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel
6868
Parameter Sets: PolicyByInputObjectSet
69-
Aliases:
69+
Aliases: AzureSqlDatabase
7070

7171
Required: True
7272
Position: Named
@@ -79,7 +79,7 @@ Accept wildcard characters: False
7979
The name of the Azure SQL Database to use.
8080
8181
```yaml
82-
Type: String
82+
Type: System.String
8383
Parameter Sets: PolicyByResourceServerDatabaseSet
8484
Aliases:
8585

@@ -94,7 +94,7 @@ Accept wildcard characters: False
9494
The credentials, account, tenant, and subscription used for communication with Azure.
9595
9696
```yaml
97-
Type: IAzureContextContainer
97+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
9898
Parameter Sets: (All)
9999
Aliases: AzContext, AzureRmContext, AzureCredential
100100

@@ -109,7 +109,7 @@ Accept wildcard characters: False
109109
The name of the resource group.
110110
111111
```yaml
112-
Type: String
112+
Type: System.String
113113
Parameter Sets: PolicyByResourceServerDatabaseSet
114114
Aliases:
115115

@@ -124,7 +124,7 @@ Accept wildcard characters: False
124124
The short term retention policy resource Id.
125125
126126
```yaml
127-
Type: String
127+
Type: System.String
128128
Parameter Sets: PolicyByResourceIdSet
129129
Aliases:
130130

@@ -139,7 +139,7 @@ Accept wildcard characters: False
139139
The backup retention setting, in days.
140140
141141
```yaml
142-
Type: Int32
142+
Type: System.Int32
143143
Parameter Sets: (All)
144144
Aliases:
145145

@@ -154,7 +154,7 @@ Accept wildcard characters: False
154154
The name of the Azure SQL Server the database is in.
155155
156156
```yaml
157-
Type: String
157+
Type: System.String
158158
Parameter Sets: PolicyByResourceServerDatabaseSet
159159
Aliases:
160160

@@ -169,7 +169,7 @@ Accept wildcard characters: False
169169
Prompts you for confirmation before running the cmdlet.
170170
171171
```yaml
172-
Type: SwitchParameter
172+
Type: System.Management.Automation.SwitchParameter
173173
Parameter Sets: (All)
174174
Aliases: cf
175175

@@ -185,7 +185,7 @@ Shows what would happen if the cmdlet runs.
185185
The cmdlet is not run.
186186
187187
```yaml
188-
Type: SwitchParameter
188+
Type: System.Management.Automation.SwitchParameter
189189
Parameter Sets: (All)
190190
Aliases: wi
191191

@@ -197,8 +197,7 @@ Accept wildcard characters: False
197197
```
198198
199199
### CommonParameters
200-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
201-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
200+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
202201
203202
## INPUTS
204203

0 commit comments

Comments
 (0)