Skip to content

Commit 32728fd

Browse files
committed
Obsolete properties and cmdlet arguments
- Added obsolete attribute to cmdlet arguments and properties that will be removed in the upcoming breaking change release.
1 parent df27fee commit 32728fd

20 files changed

+89
-32
lines changed

src/ResourceManager/AzureBatch/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
- Marked cmdlet parameters and type properties obsolete in
22+
preparation for upcoming breaking change release (Version 4.0.0)
2123

2224
## Version 3.4.0
2325

src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
<Compile Include="Models\NodeFileOperationParameters.cs" />
198198
<Compile Include="Models\PoolOperationParameters.cs" />
199199
<Compile Include="Models\PSBatchLocationQuotas.cs" />
200+
<Compile Include="Models\PSCloudPool.cs" />
200201
<Compile Include="Models\PSPagedEnumerable.cs" />
201202
<Compile Include="Models.Generated\PSAutoPoolSpecification.cs" />
202203
<Compile Include="Models.Generated\PSAutoScaleRun.cs" />

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSCloudPool.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ public PSNetworkConfiguration NetworkConfiguration
364364
this.networkConfiguration = value;
365365
}
366366
}
367-
367+
368+
[Obsolete("The ResizeError property will be removed in an upcoming breaking change release. Please use the ResizeErrors property instead.")]
368369
public PSResizeError ResizeError
369370
{
370371
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSCloudTask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ public IList<PSResourceFile> ResourceFiles
401401
this.resourceFiles = value;
402402
}
403403
}
404-
404+
405+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
405406
public System.Boolean? RunElevated
406407
{
407408
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSJobManagerTask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ public IList<PSResourceFile> ResourceFiles
238238
this.resourceFiles = value;
239239
}
240240
}
241-
241+
242+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
242243
public System.Boolean? RunElevated
243244
{
244245
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSJobPreparationTask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public IList<PSResourceFile> ResourceFiles
189189
this.resourceFiles = value;
190190
}
191191
}
192-
192+
193+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
193194
public System.Boolean? RunElevated
194195
{
195196
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSJobPreparationTaskExecutionInformation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public partial class PSJobPreparationTaskExecutionInformation
3333
{
3434

3535
internal Microsoft.Azure.Batch.JobPreparationTaskExecutionInformation omObject;
36-
36+
#pragma warning disable CS0618
3737
private PSTaskSchedulingError schedulingError;
38-
38+
#pragma warning restore CS0618
3939
internal PSJobPreparationTaskExecutionInformation(Microsoft.Azure.Batch.JobPreparationTaskExecutionInformation omObject)
4040
{
4141
if ((omObject == null))
@@ -76,7 +76,8 @@ public int RetryCount
7676
return this.omObject.RetryCount;
7777
}
7878
}
79-
79+
80+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
8081
public PSTaskSchedulingError SchedulingError
8182
{
8283
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSJobReleaseTask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ public System.TimeSpan? RetentionTime
174174
this.omObject.RetentionTime = value;
175175
}
176176
}
177-
177+
178+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
178179
public System.Boolean? RunElevated
179180
{
180181
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSJobReleaseTaskExecutionInformation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public partial class PSJobReleaseTaskExecutionInformation
3333
{
3434

3535
internal Microsoft.Azure.Batch.JobReleaseTaskExecutionInformation omObject;
36-
36+
#pragma warning disable CS0618
3737
private PSTaskSchedulingError schedulingError;
38-
38+
#pragma warning restore CS0618
3939
internal PSJobReleaseTaskExecutionInformation(Microsoft.Azure.Batch.JobReleaseTaskExecutionInformation omObject)
4040
{
4141
if ((omObject == null))
@@ -60,7 +60,8 @@ public System.Int32? ExitCode
6060
return this.omObject.ExitCode;
6161
}
6262
}
63-
63+
64+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
6465
public PSTaskSchedulingError SchedulingError
6566
{
6667
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSMultiInstanceSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public partial class PSMultiInstanceSettings
3535
internal Microsoft.Azure.Batch.MultiInstanceSettings omObject;
3636

3737
private IList<PSResourceFile> commonResourceFiles;
38-
38+
39+
[Obsolete("This will be removed in a future version and replaced a constructor which takes CoordinationCommandLine")]
3940
public PSMultiInstanceSettings(int numberOfInstances)
4041
{
4142
this.omObject = new Microsoft.Azure.Batch.MultiInstanceSettings(numberOfInstances);

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSStartTask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public IList<PSResourceFile> ResourceFiles
150150
this.resourceFiles = value;
151151
}
152152
}
153-
153+
154+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
154155
public System.Boolean? RunElevated
155156
{
156157
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSStartTaskInformation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public partial class PSStartTaskInformation
3333
{
3434

3535
internal Microsoft.Azure.Batch.StartTaskInformation omObject;
36-
36+
#pragma warning disable CS0618
3737
private PSTaskSchedulingError schedulingError;
38-
38+
#pragma warning restore CS0618
3939
internal PSStartTaskInformation(Microsoft.Azure.Batch.StartTaskInformation omObject)
4040
{
4141
if ((omObject == null))
@@ -76,7 +76,8 @@ public int RetryCount
7676
return this.omObject.RetryCount;
7777
}
7878
}
79-
79+
80+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
8081
public PSTaskSchedulingError SchedulingError
8182
{
8283
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSSubtaskInformation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public partial class PSSubtaskInformation
3535
internal Microsoft.Azure.Batch.SubtaskInformation omObject;
3636

3737
private PSComputeNodeInformation computeNodeInformation;
38-
38+
#pragma warning disable CS0618
3939
private PSTaskSchedulingError schedulingError;
40-
40+
#pragma warning restore CS0618
4141
internal PSSubtaskInformation(Microsoft.Azure.Batch.SubtaskInformation omObject)
4242
{
4343
if ((omObject == null))
@@ -99,7 +99,8 @@ public System.DateTime? PreviousStateTransitionTime
9999
return this.omObject.PreviousStateTransitionTime;
100100
}
101101
}
102-
102+
103+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
103104
public PSTaskSchedulingError SchedulingError
104105
{
105106
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSTaskExecutionInformation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public partial class PSTaskExecutionInformation
3333
{
3434

3535
internal Microsoft.Azure.Batch.TaskExecutionInformation omObject;
36-
36+
#pragma warning disable CS0618
3737
private PSTaskSchedulingError schedulingError;
38-
38+
#pragma warning restore CS0618
3939
internal PSTaskExecutionInformation(Microsoft.Azure.Batch.TaskExecutionInformation omObject)
4040
{
4141
if ((omObject == null))
@@ -92,7 +92,8 @@ public int RetryCount
9292
return this.omObject.RetryCount;
9393
}
9494
}
95-
95+
96+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
9697
public PSTaskSchedulingError SchedulingError
9798
{
9899
get

src/ResourceManager/AzureBatch/Commands.Batch/Models.Generated/PSTaskSchedulingError.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ namespace Microsoft.Azure.Commands.Batch.Models
2727
using System.Collections;
2828
using System.Collections.Generic;
2929
using Microsoft.Azure.Batch;
30-
31-
30+
31+
32+
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")]
3233
public partial class PSTaskSchedulingError
3334
{
3435

src/ResourceManager/AzureBatch/Commands.Batch/Models/BatchClient.Tasks.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ public void CreateTask(NewTaskParameters parameters)
9191

9292
CloudTask task = new CloudTask(parameters.TaskId, parameters.CommandLine);
9393
task.DisplayName = parameters.DisplayName;
94+
#pragma warning disable CS0618
9495
task.RunElevated = parameters.RunElevated;
95-
96+
#pragma warning restore CS0618
9697
if (parameters.EnvironmentSettings != null)
9798
{
9899
task.EnvironmentSettings = new List<EnvironmentSetting>();

src/ResourceManager/AzureBatch/Commands.Batch/Models/NewTaskParameters.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public NewTaskParameters(BatchAccountContext context, string jobId, PSCloudJob j
6060
/// <summary>
6161
/// Whether to run the task in elevated mode.
6262
/// </summary>
63+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
6364
public bool RunElevated { get; set; }
6465

6566
/// <summary>
@@ -87,6 +88,7 @@ public NewTaskParameters(BatchAccountContext context, string jobId, PSCloudJob j
8788
/// </summary>
8889
public PSApplicationPackageReference[] ApplicationPackageReferences { get; set; }
8990

91+
/// <summary>
9092
/// How the Batch service should respond when the task completes.
9193
/// </summary>
9294
public PSExitConditions ExitConditions { get; set; }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.Azure.Commands.Batch.Models
8+
{
9+
public partial class PSCloudPool
10+
{
11+
public IList<PSResizeError> ResizeErrors => this.resizeError == null ? null : new List<PSResizeError> {this.resizeError};
12+
}
13+
}

src/ResourceManager/AzureBatch/Commands.Batch/Tasks/NewBatchTaskCommand.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System;
1516
using Microsoft.Azure.Batch;
1617
using Microsoft.Azure.Commands.Batch.Models;
1718
using System.Collections;
@@ -69,6 +70,7 @@ public class NewBatchTaskCommand : BatchObjectModelCmdletBase
6970

7071
[Parameter(ParameterSetName = JobIdAndSingleAddParameterSet)]
7172
[Parameter(ParameterSetName = JobObjectAndSingleAddParameterSet)]
73+
[Obsolete("RunElevated will be removed in a future version and replaced with UserIdentity")]
7274
public SwitchParameter RunElevated { get; set; }
7375

7476
[Parameter(ParameterSetName = JobIdAndSingleAddParameterSet)]
@@ -124,7 +126,9 @@ public override void ExecuteCmdlet()
124126
CommandLine = this.CommandLine,
125127
ResourceFiles = this.ResourceFiles,
126128
EnvironmentSettings = this.EnvironmentSettings,
129+
#pragma warning disable CS0618
127130
RunElevated = this.RunElevated.IsPresent,
131+
#pragma warning restore CS0618
128132
AffinityInformation = this.AffinityInformation,
129133
Constraints = this.Constraints,
130134
MultiInstanceSettings = this.MultiInstanceSettings,

src/ResourceManager/AzureBatch/documentation/upcoming-breaking-changes.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,36 @@
2929

3030
## Release 5.0.0 - November 2017
3131

32+
- `PSCloudPool` `ResizeError` was replaced by `ResizeErrors`.
33+
- `PSJobPreparationTaskExecutionInformation`, `PSJobReleaseTaskExecutionInformation`, `PSStartTaskInformation`, `PSTaskExecutionInformation`, and `PSSubtaskInformation`
34+
no longer have a `SchedulingError` property, they instead have a `FailureInformation` property. `FailureInformation` is returned any time there is a task failure.
35+
This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature.
36+
- `PSMultiInstanceSettings` constructor no longer takes a required `numberOfInstances` parameter, instead it takes a required `coordinationCommandLine` parameter.
37+
3238
The following cmdlets were affected this release:
3339

34-
**New-AzureRmBatchCertificate**
40+
**New-AzureBatchCertificate**
3541
- Parameter "Password" being replaced in favor of a Secure string
3642

3743
```powershell
3844
3945
# Old
40-
# New-AzureRmBatchCertificate [other required parameters] -Password "plain-text string"
46+
# New-AzureBatchCertificate [other required parameters] -Password "plain-text string"
4147
4248
# New
43-
# New-AzureRmBatchCertificate [other required parameters] -Password $SecureStringVariable
49+
# New-AzureBatchCertificate [other required parameters] -Password $SecureStringVariable
4450
```
4551

46-
**New-AzureRmBatchComputeNodeUser**
52+
**New-AzureBatchComputeNodeUser**
4753
- Parameter "Password" being replaced in favor of a Secure string
4854

4955
```powershell
5056
5157
# Old
52-
# New-AzureRmBatchComputeNodeUser [other required parameters] -Password "plain-text string"
58+
# New-AzureBatchComputeNodeUser [other required parameters] -Password "plain-text string"
5359
5460
# New
55-
# New-AzureRmBatchComputeNodeUser [other required parameters] -Password $SecureStringVariable
61+
# New-AzureBatchComputeNodeUser [other required parameters] -Password $SecureStringVariable
5662
```
5763

5864
**Set-AzureRmBatchComputeNodeUser**
@@ -65,4 +71,19 @@ The following cmdlets were affected this release:
6571
6672
# New
6773
# Set-AzureRmBatchComputeNodeUser [other required parameters] -Password $SecureStringVariable
68-
```
74+
```
75+
76+
**New-AzureBatchTask**
77+
- Removed the `RunElevated` switch and replaced it with `UserIdentity`.
78+
79+
```powershell
80+
# Old
81+
New-AzureBatchTask -Id $taskId1 -JobId $jobId -CommandLine "cmd /c echo hello" -RunElevated $TRUE
82+
83+
# New
84+
$autoUser = New-Object Microsoft.Azure.Commands.Batch.Models.PSAutoUserSpecification -ArgumentList @("Task", "Admin")
85+
$userIdentity = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserIdentity $autoUser
86+
New-AzureBatchTask -Id $taskId1 -JobId $jobId -CommandLine "cmd /c echo hello" -UserIdentity $userIdentity
87+
```
88+
89+
This additionally impacts the `RunElevated` property on `PSCloudTask`, `PSStartTask`, `PSJobManagerTask`, `PSJobPreparationTask`, and `PSJobReleaseTask`.

0 commit comments

Comments
 (0)