Skip to content

Commit eea6974

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents 855baef + c4c0705 commit eea6974

File tree

359 files changed

+46081
-38296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+46081
-38296
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2016.09.16 version 2.2.0
2+
* Network
3+
- New switch parameter added for network interface to enable/Disable accelerated networking -New-AzureRmNetworkInterface -EnableAcceleratedNetworking
4+
15
## 2016.09.08 version 2.1.0
26
* Compute
37
* Add support for querying encryption status from the AzureDiskEncryptionForLinux extension

src/ResourceManager/Automation/Commands.Automation.Test/UnitTests/RegisterAzureAutomationScheduledRunbookTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
5050
string accountName = "automation";
5151
string runbookName = "runbook";
5252
string scheduleName = "schedule";
53+
string runOn = "hybridWorkerGroup";
5354

5455
this.mockAutomationClient.Setup(
55-
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null));
56+
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn));
5657

5758
// Test
5859
this.cmdlet.ResourceGroupName = resourceGroupName;
@@ -62,7 +63,7 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
6263
this.cmdlet.ExecuteCmdlet();
6364

6465
// Assert
65-
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null), Times.Once());
66+
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn), Times.Once());
6667
}
6768
}
6869
}

src/ResourceManager/Automation/Commands.Automation/Cmdlet/RegisterAzureAutomationScheduledRunbook.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,23 @@ public class RegisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
5151
HelpMessage = "The runbook parameters.")]
5252
public IDictionary Parameters { get; set; }
5353

54+
/// <summary>
55+
/// Gets or sets the optional hybrid agent friendly name upon which the runbook should be executed.
56+
/// </summary>
57+
[Alias("HybridWorker")]
58+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = false, ValueFromPipelineByPropertyName = true,
59+
HelpMessage = "The name of the hybrid runbook worker group.")]
60+
public string RunOn { get; set; }
61+
5462
/// <summary>
5563
/// Execute this cmdlet.
5664
/// </summary>
5765
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
5866
protected override void AutomationProcessRecord()
59-
{
60-
JobSchedule jobSchedule;
61-
62-
jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
63-
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters);
64-
67+
{
68+
var jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
69+
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters, this.RunOn);
70+
6571
this.WriteObject(jobSchedule);
6672
}
6773
}

src/ResourceManager/Automation/Commands.Automation/Common/AutomationClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ public IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGr
15071507
}
15081508

15091509
public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName,
1510-
string scheduleName, IDictionary parameters)
1510+
string scheduleName, IDictionary parameters, string runOn)
15111511
{
15121512
var processedParameters = this.ProcessRunbookParameters(resourceGroupName, automationAccountName, runbookName, parameters);
15131513
var sdkJobSchedule = this.automationManagementClient.JobSchedules.Create(
@@ -1519,7 +1519,8 @@ public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string aut
15191519
{
15201520
Schedule = new ScheduleAssociationProperty { Name = scheduleName },
15211521
Runbook = new RunbookAssociationProperty { Name = runbookName },
1522-
Parameters = processedParameters
1522+
Parameters = processedParameters,
1523+
RunOn = runOn
15231524
}
15241525
}).JobSchedule;
15251526

src/ResourceManager/Automation/Commands.Automation/Common/IAutomationClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ IEnumerable<JobStream> GetJobStream(string resourceGroupName, string automationA
291291
IEnumerable<JobSchedule> ListJobSchedulesByRunbookName(string resourceGroupName, string automationAccountName, string runbookName);
292292

293293
IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGroupName, string automationAccountName, string scheduleName);
294-
295-
JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters);
294+
295+
JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters, string RunOn);
296296

297297
void UnregisterScheduledRunbook(string resourceGroupName, string automationAccountName, Guid jobScheduleId);
298298

src/ResourceManager/Automation/Commands.Automation/Model/JobSchedule.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public JobSchedule(string resourceGroupName, string automationAccountName, Azure
4646
this.RunbookName = jobSchedule.Properties.Runbook.Name;
4747
this.ScheduleName = jobSchedule.Properties.Schedule.Name;
4848
this.Parameters = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
49+
this.RunOn = jobSchedule.Properties.RunOn;
4950
foreach (var kvp in jobSchedule.Properties.Parameters.Where(kvp => 0 != String.Compare(kvp.Key, Constants.JobStartedByParameterName, CultureInfo.InvariantCulture,
5051
CompareOptions.IgnoreCase)))
5152
{
@@ -65,6 +66,8 @@ public JobSchedule()
6566
/// </summary>
6667
public string ResourceGroupName { get; set; }
6768

69+
public string RunOn { get; set; }
70+
6871
/// <summary>
6972
/// Gets or sets the automation account name.
7073
/// </summary>

src/ResourceManager/AzureBatch/AzureBatch.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.40629.0
2+
# Visual Studio 14
3+
VisualStudioVersion = 14.0.25123.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
66
EndProject

src/ResourceManager/AzureBatch/AzureRM.Batch.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CmdletsToExport = '*'
7676
VariablesToExport = '*'
7777

7878
# Aliases to export from this module
79-
AliasesToExport = @()
79+
AliasesToExport = @('Reactivate-AzureBatchTask')
8080

8181
# List of all modules packaged with this module
8282
ModuleList = @()

src/ResourceManager/AzureBatch/BatchModelGenerator/BatchModelGenerator.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.40629.0
2+
# Visual Studio 14
3+
VisualStudioVersion = 14.0.25123.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatchModelGenerator", "BatchModelGenerator.csproj", "{374701E4-539A-459A-9A00-B04E51652997}"
66
EndProject

src/ResourceManager/AzureBatch/BatchModelGenerator/Program.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public class Program
3131

3232
private static readonly Dictionary<string, string> OMtoPSClassMappings = new Dictionary<string, string>()
3333
{
34-
{"Microsoft.Azure.Batch.NodeAgentSku", "PSNodeAgentSku"},
35-
{"Microsoft.Azure.Batch.ImageReference", "PSImageReference"},
34+
{"Microsoft.Azure.Batch.AffinityInformation", "PSAffinityInformation"},
3635
{"Microsoft.Azure.Batch.AutoPoolSpecification", "PSAutoPoolSpecification"},
3736
{"Microsoft.Azure.Batch.AutoScaleRun", "PSAutoScaleRun"},
3837
{"Microsoft.Azure.Batch.AutoScaleRunError", "PSAutoScaleRunError"},
38+
{"Microsoft.Azure.Batch.ApplicationPackageReference", "PSApplicationPackageReference"},
3939
{"Microsoft.Azure.Batch.Certificate", "PSCertificate"},
4040
{"Microsoft.Azure.Batch.CertificateReference", "PSCertificateReference"},
4141
{"Microsoft.Azure.Batch.CloudJob", "PSCloudJob"},
@@ -49,7 +49,12 @@ public class Program
4949
{"Microsoft.Azure.Batch.ComputeNodeUser", "PSComputeNodeUser"},
5050
{"Microsoft.Azure.Batch.DeleteCertificateError", "PSDeleteCertificateError"},
5151
{"Microsoft.Azure.Batch.EnvironmentSetting", "PSEnvironmentSetting"},
52+
{"Microsoft.Azure.Batch.ExitConditions", "PSExitConditions"},
53+
{"Microsoft.Azure.Batch.ExitCodeRangeMapping", "PSExitCodeRangeMapping"},
54+
{"Microsoft.Azure.Batch.ExitCodeMapping", "PSExitCodeMapping"},
55+
{"Microsoft.Azure.Batch.ExitOptions", "PSExitOptions"},
5256
{"Microsoft.Azure.Batch.FileProperties", "PSFileProperties"},
57+
{"Microsoft.Azure.Batch.ImageReference", "PSImageReference"},
5358
{"Microsoft.Azure.Batch.RemoteLoginSettings", "PSRemoteLoginSettings"},
5459
{"Microsoft.Azure.Batch.JobConstraints", "PSJobConstraints"},
5560
{"Microsoft.Azure.Batch.JobExecutionInformation", "PSJobExecutionInformation"},
@@ -67,6 +72,8 @@ public class Program
6772
{"Microsoft.Azure.Batch.MetadataItem", "PSMetadataItem"},
6873
{"Microsoft.Azure.Batch.MultiInstanceSettings", "PSMultiInstanceSettings"},
6974
{"Microsoft.Azure.Batch.NameValuePair", "PSNameValuePair"},
75+
{"Microsoft.Azure.Batch.NetworkConfiguration", "PSNetworkConfiguration"},
76+
{"Microsoft.Azure.Batch.NodeAgentSku", "PSNodeAgentSku"},
7077
{"Microsoft.Azure.Batch.NodeFile", "PSNodeFile"},
7178
{"Microsoft.Azure.Batch.PoolInformation", "PSPoolInformation"},
7279
{"Microsoft.Azure.Batch.PoolSpecification", "PSPoolSpecification"},
@@ -81,23 +88,16 @@ public class Program
8188
{"Microsoft.Azure.Batch.StartTaskInformation", "PSStartTaskInformation"},
8289
{"Microsoft.Azure.Batch.SubtaskInformation", "PSSubtaskInformation"},
8390
{"Microsoft.Azure.Batch.TaskConstraints", "PSTaskConstraints"},
91+
{"Microsoft.Azure.Batch.TaskDependencies", "PSTaskDependencies"},
8492
{"Microsoft.Azure.Batch.TaskExecutionInformation", "PSTaskExecutionInformation"},
8593
{"Microsoft.Azure.Batch.TaskInformation", "PSTaskInformation"},
8694
{"Microsoft.Azure.Batch.TaskIdRange", "PSTaskIdRange"},
8795
{"Microsoft.Azure.Batch.TaskSchedulingError", "PSTaskSchedulingError"},
8896
{"Microsoft.Azure.Batch.TaskSchedulingPolicy", "PSTaskSchedulingPolicy"},
8997
{"Microsoft.Azure.Batch.TaskStatistics", "PSTaskStatistics"},
9098
{"Microsoft.Azure.Batch.UsageStatistics", "PSUsageStatistics"},
91-
{"Microsoft.Azure.Batch.AffinityInformation", "PSAffinityInformation"},
9299
{"Microsoft.Azure.Batch.VirtualMachineConfiguration", "PSVirtualMachineConfiguration"},
93100
{"Microsoft.Azure.Batch.WindowsConfiguration", "PSWindowsConfiguration"},
94-
{"Microsoft.Azure.Batch.ApplicationPackageReference", "PSApplicationPackageReference"},
95-
{"Microsoft.Azure.Batch.TaskDependencies", "PSTaskDependencies"},
96-
{"Microsoft.Azure.Batch.NetworkConfiguration", "PSNetworkConfiguration"},
97-
{"Microsoft.Azure.Batch.ExitConditions", "PSExitConditions"},
98-
{"Microsoft.Azure.Batch.ExitOptions", "PSExitOptions"},
99-
{"Microsoft.Azure.Batch.ExitCodeRangeMapping", "PSExitCodeRangeMapping"},
100-
{"Microsoft.Azure.Batch.ExitCodeMapping", "PSExitCodeMapping"},
101101
};
102102

103103

src/ResourceManager/AzureBatch/Commands.Batch.Test/BatchTestHelpers.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,19 @@ public static RequestInterceptor CreateFakeGetFileAndPropertiesFromComputeNodeRe
583583
return response;
584584
}
585585

586+
/// <summary>
587+
/// Builds a CloudJobGetResponse object
588+
/// </summary>
589+
public static AzureOperationResponse<ProxyModels.CloudJob, ProxyModels.JobGetHeaders> CreateCloudJobGetResponse(ProxyModels.CloudJob job)
590+
{
591+
var response = new AzureOperationResponse<ProxyModels.CloudJob, ProxyModels.JobGetHeaders>
592+
{
593+
Response = new HttpResponseMessage(HttpStatusCode.OK),
594+
Body = job
595+
};
596+
return response;
597+
}
598+
586599
/// <summary>
587600
/// Builds a CloudJobListResponse object
588601
/// </summary>
@@ -620,6 +633,16 @@ public static RequestInterceptor CreateFakeGetFileAndPropertiesFromComputeNodeRe
620633

621634
return response;
622635
}
636+
/// <summary>
637+
/// Builds a CloudTaskGetResponse object
638+
/// </summary>
639+
public static AzureOperationResponse<ProxyModels.CloudTask, ProxyModels.TaskGetHeaders> CreateCloudTaskGetResponse(ProxyModels.CloudTask task)
640+
{
641+
var response = new AzureOperationResponse<ProxyModels.CloudTask, ProxyModels.TaskGetHeaders>();
642+
response.Response = new HttpResponseMessage(HttpStatusCode.OK);
643+
response.Body = task;
644+
return response;
645+
}
623646

624647
/// <summary>
625648
/// Builds a CloudTaskListResponse object
@@ -798,25 +821,22 @@ public static RequestInterceptor CreateFakeGetFileAndPropertiesFromComputeNodeRe
798821
/// <summary>
799822
/// Fabricates a CloudJob that's in the bound state
800823
/// </summary>
801-
public static CloudJob CreateFakeBoundJob(BatchAccountContext context)
824+
public static CloudJob CreateFakeBoundJob(BatchAccountContext context, ProxyModels.CloudJob cloudJob)
802825
{
803-
string jobId = "testJob";
804-
805826
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
806827
{
807828
JobGetBatchRequest request = (JobGetBatchRequest)baseRequest;
808829

809830
request.ServiceRequestFunc = (cancellationToken) =>
810831
{
811-
var response = new AzureOperationResponse<ProxyModels.CloudJob, ProxyModels.JobGetHeaders>();
812-
response.Body = new ProxyModels.CloudJob(id: jobId, poolInfo: new ProxyModels.PoolInformation());
832+
var response = new AzureOperationResponse<ProxyModels.CloudJob, ProxyModels.JobGetHeaders> { Body = cloudJob };
813833

814834
Task<AzureOperationResponse<ProxyModels.CloudJob, ProxyModels.JobGetHeaders>> task = Task.FromResult(response);
815835
return task;
816836
};
817837
});
818838

819-
return context.BatchOMClient.JobOperations.GetJob(jobId, additionalBehaviors: new BatchClientBehavior[] { interceptor });
839+
return context.BatchOMClient.JobOperations.GetJob(cloudJob.Id, additionalBehaviors: new BatchClientBehavior[] { interceptor });
820840
}
821841

822842
/// <summary>

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
<Reference Include="Hyak.Common">
4545
<HintPath>..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
4646
</Reference>
47-
<Reference Include="Microsoft.Azure.Batch, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
48-
<HintPath>..\..\..\packages\Azure.Batch.5.0.0\lib\net45\Microsoft.Azure.Batch.dll</HintPath>
47+
<Reference Include="Microsoft.Azure.Batch, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
48+
<SpecificVersion>False</SpecificVersion>
49+
<HintPath>..\..\..\packages\Azure.Batch.5.1.0\lib\net45\Microsoft.Azure.Batch.dll</HintPath>
50+
<Private>True</Private>
4951
</Reference>
5052
<Reference Include="Microsoft.Azure.Common">
5153
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
@@ -270,6 +272,7 @@
270272
<Compile Include="JobSchedules\NewBatchJobScheduleCommandTests.cs" />
271273
<Compile Include="JobSchedules\RemoveBatchJobScheduleCommandTests.cs" />
272274
<Compile Include="Tasks\SetBatchTaskCommandTests.cs" />
275+
<Compile Include="Tasks\EnableBatchTaskCommandTests.cs" />
273276
<Compile Include="Tasks\StopBatchTaskCommandTests.cs" />
274277
</ItemGroup>
275278
<ItemGroup>
@@ -526,6 +529,9 @@
526529
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.JobScheduleTests\TestUpdateJobSchedule.json">
527530
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
528531
</None>
532+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.JobTests\IfJobSetsAutoFailure_ItCompletesWhenAnyTaskFails.json" >
533+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
534+
</None>
529535
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.JobTests\TestDeleteJob.json">
530536
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
531537
</None>
@@ -713,4 +719,4 @@
713719
<WCFMetadata Include="Service References\" />
714720
</ItemGroup>
715721
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
716-
</Project>
722+
</Project>

0 commit comments

Comments
 (0)