Skip to content

Commit a63303d

Browse files
authored
[Storage] Add breaking change type (#13118)
* [Storage] Add breaking change type * fix ci failure and review comments
1 parent 82ac32c commit a63303d

12 files changed

+25
-17
lines changed

src/Storage/Storage.Management/Blob/DisableAzureStorageBlobRestorePolicy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace Microsoft.Azure.Commands.Management.Storage
2727
/// <summary>
2828
/// Modify Azure Storage service properties
2929
/// </summary>
30-
[CmdletOutputBreakingChange(typeof(PSRestorePolicy), ChangeDescription = "The deprecated property LastEnabledTime will be removed in a future release.")]
3130
[Cmdlet("Disable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + StorageBlobRestorePolicy, SupportsShouldProcess = true, DefaultParameterSetName = AccountNameParameterSet), OutputType(typeof(PSRestorePolicy))]
3231
public class DisableAzStorageBlobRestorePolicyCommand : StorageBlobBaseCmdlet
3332
{

src/Storage/Storage.Management/Blob/EnableAzureStorageBlobRestorePolicy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace Microsoft.Azure.Commands.Management.Storage
2727
/// <summary>
2828
/// Modify Azure Storage service properties
2929
/// </summary>
30-
[CmdletOutputBreakingChange(typeof(PSRestorePolicy), ChangeDescription = "The deprecated property LastEnabledTime will be removed in a future release.")]
3130
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + StorageBlobRestorePolicy, DefaultParameterSetName = AccountNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSRestorePolicy))]
3231
public class EnableAzStorageBlobRestorePolicyCommand : StorageBlobBaseCmdlet
3332
{

src/Storage/Storage.Management/Blob/GetAzureStorageBlobServiceProperties.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace Microsoft.Azure.Commands.Management.Storage
2727
/// <summary>
2828
/// Modify Azure Storage service properties
2929
/// </summary>
30-
[CmdletOutputBreakingChange(typeof(PSBlobServiceProperties), ChangeDescription = "The deprecated property RestorePolicy.LastEnabledTime will be removed in a future release.")]
3130
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + StorageBlobServiceProperty, DefaultParameterSetName = AccountNameParameterSet), OutputType(typeof(PSBlobServiceProperties))]
3231
public class GetAzStorageBlobServicePropertyCommand : StorageBlobBaseCmdlet
3332
{

src/Storage/Storage.Management/Blob/UpdateAzureStorageBlobServiceProperties.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace Microsoft.Azure.Commands.Management.Storage
2727
/// <summary>
2828
/// Modify Azure Storage service properties
2929
/// </summary>
30-
[CmdletOutputBreakingChange(typeof(PSBlobServiceProperties), ChangeDescription = "The deprecated property RestorePolicy.LastEnabledTime will be removed in a future release.")]
3130
[Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + StorageBlobServiceProperty, SupportsShouldProcess = true, DefaultParameterSetName = AccountNameParameterSet), OutputType(typeof(PSBlobServiceProperties))]
3231
public class UpdateAzStorageBlobServicePropertyCommand : StorageBlobBaseCmdlet
3332
{

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Removed obsolete property RestorePolicy.LastEnabledTime
22+
- `Enable-AzStorageBlobRestorePolicy`
23+
- `Disable-AzStorageBlobRestorePolicy`
24+
- `Get-AzStorageBlobServiceProperty`
25+
- `Update-AzStorageBlobServiceProperty`
26+
* Change Type of DaysAfterModificationGreaterThan from int to int?
27+
- `Set-AzStorageAccountManagementPolicy`
28+
- `Get-AzStorageAccountManagementPolicy`
29+
- `Add-AzStorageAccountManagementPolicyAction`
30+
- `New-AzStorageAccountManagementPolicyRule`
2131
* Supported create/update file share with access tier
2232
- `New-AzRmStorageShare`
2333
- `Update-AzRmStorageShare`
@@ -28,7 +38,7 @@
2838
* Supported Container access policy with new permission x,t
2939
- `New-AzStorageContainerStoredAccessPolicy`
3040
- `Set-AzStorageContainerStoredAccessPolicy`
31-
* Changed the output of get/set Container/Share/Queue/Table access policy cmdlet, by change the child property Permission type from enum to String
41+
* Changed the output of get/set Container access policy cmdlet, by change the child property Permission type from enum to String
3242
- `Get-AzStorageContainerStoredAccessPolicy`
3343
- `Set-AzStorageContainerStoredAccessPolicy`
3444
* Fixed a sample script issue of set management policy with json

src/Storage/Storage.Management/Models/PSBlobServiceProperties.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class PSBlobServiceProperties
4141
public PSDeleteRetentionPolicy DeleteRetentionPolicy { get; set; }
4242
[Ps1Xml(Label = "RestorePolicy.Enabled", Target = ViewControl.Table, ScriptBlock = "$_.RestorePolicy.Enabled", Position = 5)]
4343
[Ps1Xml(Label = "RestorePolicy.Days", Target = ViewControl.Table, ScriptBlock = "$_.RestorePolicy.Days", Position = 6)]
44-
[Ps1Xml(Label = "RestorePolicy.LastEnabledTime", Target = ViewControl.Table, ScriptBlock = "$_.RestorePolicy.LastEnabledTime", Position = 7)]
44+
[Ps1Xml(Label = "RestorePolicy.MinRestoreTime", Target = ViewControl.Table, ScriptBlock = "$_.RestorePolicy.MinRestoreTime", Position = 7)]
4545
public PSRestorePolicy RestorePolicy { get; set; }
4646
public PSCorsRules Cors { get; set; }
4747
public bool? IsVersioningEnabled { get; set; }
@@ -161,7 +161,6 @@ public class PSRestorePolicy
161161
{
162162
public bool? Enabled { get; set; }
163163
public int? Days { get; set; }
164-
public DateTime? LastEnabledTime { get; set; }
165164
public DateTime? MinRestoreTime { get; set; }
166165

167166
public PSRestorePolicy()
@@ -172,7 +171,6 @@ public PSRestorePolicy(RestorePolicyProperties policy)
172171
{
173172
this.Enabled = policy.Enabled;
174173
this.Days = policy.Days;
175-
this.LastEnabledTime = policy.LastEnabledTime;
176174
this.MinRestoreTime = policy.MinRestoreTime;
177175

178176
}

src/Storage/Storage.Management/Models/PSDataPolicy.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,12 @@ public ManagementPolicySnapShot ParseManagementPolicySnapShot()
261261
/// </summary>
262262
public class PSDateAfterModification
263263
{
264-
public int DaysAfterModificationGreaterThan { get; set; }
264+
public int? DaysAfterModificationGreaterThan { get; set; }
265265

266266
public PSDateAfterModification()
267-
{ }
267+
{
268+
this.DaysAfterModificationGreaterThan = null;
269+
}
268270

269271
public PSDateAfterModification(int daysAfterModificationGreaterThan)
270272
{
@@ -277,7 +279,7 @@ public PSDateAfterModification(DateAfterModification data)
277279
}
278280
public DateAfterModification ParseDateAfterModification()
279281
{
280-
return new DateAfterModification(this.DaysAfterModificationGreaterThan);
282+
return this.DaysAfterModificationGreaterThan is null? new DateAfterModification() : new DateAfterModification(this.DaysAfterModificationGreaterThan.Value);
281283
}
282284
}
283285

@@ -289,7 +291,9 @@ public class PSDateAfterCreation
289291
public int DaysAfterCreationGreaterThan { get; set; }
290292

291293
public PSDateAfterCreation()
292-
{ }
294+
{
295+
this.DaysAfterCreationGreaterThan = 0;
296+
}
293297

294298
public PSDateAfterCreation(int daysAfterCreationGreaterThan)
295299
{

src/Storage/Storage.Management/StorageAccount/AddAzureStorageAccountManagementPolicyAction.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
namespace Microsoft.Azure.Commands.Management.Storage
2424
{
25-
[CmdletOutputBreakingChange(typeof(PSManagementPolicyActionGroup), ChangeDescription = "The type of sub child property DaysAfterModificationGreaterThan will change from int to int? in a future release.")]
2625
[Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "StorageAccountManagementPolicyAction", DefaultParameterSetName = BaseBlobParameterSet), OutputType(typeof(PSManagementPolicyActionGroup))]
2726
public class AddAzureStorageAccountManagementPolicyActionCommand : StorageAccountBaseCmdlet
2827
{

src/Storage/Storage.Management/StorageAccount/GetAzureStorageAccountManagementPolicy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
namespace Microsoft.Azure.Commands.Management.Storage
2424
{
25-
[CmdletOutputBreakingChange(typeof(PSManagementPolicyActionGroup), ChangeDescription = "The type of sub child property DaysAfterModificationGreaterThan will change from int to int? in a future release.")]
2625
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "StorageAccountManagementPolicy", DefaultParameterSetName = AccountNameParameterSet), OutputType(typeof(PSManagementPolicy))]
2726
public class GetAzureStorageAccountManagementPolicyCommand : StorageAccountBaseCmdlet
2827
{

src/Storage/Storage.Management/StorageAccount/NewAzureStorageAccountManagementPolicyRule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
namespace Microsoft.Azure.Commands.Management.Storage
2323
{
24-
[CmdletOutputBreakingChange(typeof(PSManagementPolicyActionGroup), ChangeDescription = "The type of sub child property DaysAfterModificationGreaterThan will change from int to int? in a future release.")]
2524
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "StorageAccountManagementPolicyRule"), OutputType(typeof(PSManagementPolicyRule))]
2625
public class NewAzureStorageAccountManagementPolicyRuleCommand : StorageAccountBaseCmdlet
2726
{

0 commit comments

Comments
 (0)