Skip to content

Commit a01e161

Browse files
authored
Merge pull request #4060 from hyonholee/warnings
Set obsolete parameters and cmdlets for upcoming Compute breaking change.
2 parents ff54489 + 6a06fba commit a01e161

File tree

6 files changed

+37
-1
lines changed

6 files changed

+37
-1
lines changed

src/ResourceManager/Compute/Commands.Compute/AvailabilitySets/NewAzureAvailabilitySetCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.Azure.Commands.Compute.Common;
1717
using Microsoft.Azure.Commands.Compute.Models;
1818
using Microsoft.Azure.Management.Compute.Models;
19+
using System;
1920
using System.Management.Automation;
2021

2122
namespace Microsoft.Azure.Commands.Compute
@@ -72,6 +73,7 @@ public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
7273
[Parameter(
7374
ValueFromPipelineByPropertyName = true,
7475
HelpMessage = "Managed Availability Set")]
76+
[Obsolete("This parameter is obsolete. Please use Sku parameter instead.", false)]
7577
public SwitchParameter Managed { get; set; }
7678

7779
public override void ExecuteCmdlet()

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<ErrorReport>prompt</ErrorReport>
2626
<WarningLevel>4</WarningLevel>
2727
<RunCodeAnalysis>true</RunCodeAnalysis>
28-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
28+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
2929
<Prefer32Bit>false</Prefer32Bit>
3030
</PropertyGroup>
3131
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">

src/ResourceManager/Compute/Commands.Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,41 @@ public class NewAzureRmDiskUpdateConfigCommand : Microsoft.Azure.Commands.Resour
5959
[Parameter(
6060
Mandatory = false,
6161
ValueFromPipelineByPropertyName = true)]
62+
[Obsolete("This parameter is obsolete. CreateOption cannot be changed during updating a disk." +
63+
"To set CreateOption of a disk, use New-AzureRmDiskConfig command.",
64+
false)]
6265
public DiskCreateOption? CreateOption { get; set; }
6366

6467
[Parameter(
6568
Mandatory = false,
6669
ValueFromPipelineByPropertyName = true)]
70+
[Obsolete("This parameter is obsolete. StorageAccountId cannot be changed during updating a disk." +
71+
"To set StorageAccountId of a disk, use New-AzureRmDiskConfig command.",
72+
false)]
6773
public string StorageAccountId { get; set; }
6874

6975
[Parameter(
7076
Mandatory = false,
7177
ValueFromPipelineByPropertyName = true)]
78+
[Obsolete("This parameter is obsolete. ImageReference cannot be changed during updating a disk." +
79+
"To set ImageReference of a disk, use New-AzureRmDiskConfig command.",
80+
false)]
7281
public ImageDiskReference ImageReference { get; set; }
7382

7483
[Parameter(
7584
Mandatory = false,
7685
ValueFromPipelineByPropertyName = true)]
86+
[Obsolete("This parameter is obsolete. SourceUri cannot be changed during updating a disk." +
87+
"To set SourceUri of a disk, use New-AzureRmDiskConfig command.",
88+
false)]
7789
public string SourceUri { get; set; }
7890

7991
[Parameter(
8092
Mandatory = false,
8193
ValueFromPipelineByPropertyName = true)]
94+
[Obsolete("This parameter is obsolete. SourceResourceId cannot be changed during updating a disk." +
95+
"To set SourceResourceId of a disk, use New-AzureRmDiskConfig command.",
96+
false)]
8297
public string SourceResourceId { get; set; }
8398

8499
[Parameter(

src/ResourceManager/Compute/Commands.Compute/Generated/Disk/Config/SetAzureRmDiskUpdateImageReferenceCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
namespace Microsoft.Azure.Commands.Compute.Automation
3030
{
31+
[Obsolete("This cmdlet will be removed in an upcoming release. Updating the image reference of a disk is not supported." +
32+
"To set the image reference of a disk, please use Set-AzureRmDiskImageReference command." )]
3133
[Cmdlet("Set", "AzureRmDiskUpdateImageReference", SupportsShouldProcess = true)]
3234
[OutputType(typeof(DiskUpdate))]
3335
public class SetAzureRmDiskUpdateImageReferenceCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet

src/ResourceManager/Compute/Commands.Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,41 @@ public class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Commands.Re
5959
[Parameter(
6060
Mandatory = false,
6161
ValueFromPipelineByPropertyName = true)]
62+
[Obsolete("This parameter is obsolete. CreateOption cannot be changed during updating a snapshot." +
63+
"To set the CreateOption of a snapshot, use New-AzureRmSnapshotConfig command.",
64+
false)]
6265
public DiskCreateOption? CreateOption { get; set; }
6366

6467
[Parameter(
6568
Mandatory = false,
6669
ValueFromPipelineByPropertyName = true)]
70+
[Obsolete("This parameter is obsolete. StorageAccountId cannot be changed during updating a snapshot." +
71+
"To set the StorageAccountId of a snapshot, use New-AzureRmSnapshotConfig command.",
72+
false)]
6773
public string StorageAccountId { get; set; }
6874

6975
[Parameter(
7076
Mandatory = false,
7177
ValueFromPipelineByPropertyName = true)]
78+
[Obsolete("This parameter is obsolete. ImageReference cannot be changed during updating a snapshot." +
79+
"To set the ImageReference of a snapshot, use New-AzureRmSnapshotConfig command.",
80+
false)]
7281
public ImageDiskReference ImageReference { get; set; }
7382

7483
[Parameter(
7584
Mandatory = false,
7685
ValueFromPipelineByPropertyName = true)]
86+
[Obsolete("This parameter is obsolete. SourceUri cannot be changed during updating a snapshot." +
87+
"To set the SourceUri of a snapshot, use New-AzureRmSnapshotConfig command.",
88+
false)]
7789
public string SourceUri { get; set; }
7890

7991
[Parameter(
8092
Mandatory = false,
8193
ValueFromPipelineByPropertyName = true)]
94+
[Obsolete("This parameter is obsolete. SourceResourceId cannot be changed during updating a snapshot." +
95+
"To set the SourceResourceId of a snapshot, use New-AzureRmSnapshotConfig command.",
96+
false)]
8297
public string SourceResourceId { get; set; }
8398

8499
[Parameter(

src/ResourceManager/Compute/Commands.Compute/Generated/Snapshot/Config/SetAzureRmSnapshotUpdateImageReferenceCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
namespace Microsoft.Azure.Commands.Compute.Automation
3030
{
31+
[Obsolete("This cmdlet will be removed in the upcoming release. Updating the image reference of a snapshot is not supported." +
32+
"To set image reference of a snapshot, please use Set-AzureRmSnapshotImageReference command.")]
3133
[Cmdlet("Set", "AzureRmSnapshotUpdateImageReference", SupportsShouldProcess = true)]
3234
[OutputType(typeof(SnapshotUpdate))]
3335
public class SetAzureRmSnapshotUpdateImageReferenceCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet

0 commit comments

Comments
 (0)