Skip to content

Commit

Permalink
Merge pull request #616 from Azure/dev
Browse files Browse the repository at this point in the history
huangpf PR: dev <- Azure:dev
  • Loading branch information
huangpf authored Sep 21, 2016
2 parents c686737 + 1f46316 commit 45bb38e
Show file tree
Hide file tree
Showing 151 changed files with 19,386 additions and 10,093 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2016.09.16 version 2.2.0
* Network
- New switch parameter added for network interface to enable/Disable accelerated networking -New-AzureRmNetworkInterface -EnableAcceleratedNetworking

## 2016.09.08 version 2.1.0
* Compute
* Add support for querying encryption status from the AzureDiskEncryptionForLinux extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
string accountName = "automation";
string runbookName = "runbook";
string scheduleName = "schedule";
string runOn = "hybridWorkerGroup";

this.mockAutomationClient.Setup(
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null));
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn));

// Test
this.cmdlet.ResourceGroupName = resourceGroupName;
Expand All @@ -62,7 +63,7 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
this.cmdlet.ExecuteCmdlet();

// Assert
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null), Times.Once());
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn), Times.Once());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,23 @@ public class RegisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
HelpMessage = "The runbook parameters.")]
public IDictionary Parameters { get; set; }

/// <summary>
/// Gets or sets the optional hybrid agent friendly name upon which the runbook should be executed.
/// </summary>
[Alias("HybridWorker")]
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The name of the hybrid runbook worker group.")]
public string RunOn { get; set; }

/// <summary>
/// Execute this cmdlet.
/// </summary>
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void AutomationProcessRecord()
{
JobSchedule jobSchedule;

jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters);

{
var jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters, this.RunOn);

this.WriteObject(jobSchedule);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ public IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGr
}

public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName,
string scheduleName, IDictionary parameters)
string scheduleName, IDictionary parameters, string runOn)
{
var processedParameters = this.ProcessRunbookParameters(resourceGroupName, automationAccountName, runbookName, parameters);
var sdkJobSchedule = this.automationManagementClient.JobSchedules.Create(
Expand All @@ -1519,7 +1519,8 @@ public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string aut
{
Schedule = new ScheduleAssociationProperty { Name = scheduleName },
Runbook = new RunbookAssociationProperty { Name = runbookName },
Parameters = processedParameters
Parameters = processedParameters,
RunOn = runOn
}
}).JobSchedule;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ IEnumerable<JobStream> GetJobStream(string resourceGroupName, string automationA
IEnumerable<JobSchedule> ListJobSchedulesByRunbookName(string resourceGroupName, string automationAccountName, string runbookName);

IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGroupName, string automationAccountName, string scheduleName);

JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters);
JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters, string RunOn);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public JobSchedule(string resourceGroupName, string automationAccountName, Azure
this.RunbookName = jobSchedule.Properties.Runbook.Name;
this.ScheduleName = jobSchedule.Properties.Schedule.Name;
this.Parameters = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
this.RunOn = jobSchedule.Properties.RunOn;
foreach (var kvp in jobSchedule.Properties.Parameters.Where(kvp => 0 != String.Compare(kvp.Key, Constants.JobStartedByParameterName, CultureInfo.InvariantCulture,
CompareOptions.IgnoreCase)))
{
Expand All @@ -65,6 +66,8 @@ public JobSchedule()
/// </summary>
public string ResourceGroupName { get; set; }

public string RunOn { get; set; }

/// <summary>
/// Gets or sets the automation account name.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.13.0.4-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.1.1-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>

<Reference Include="Microsoft.Azure.Management.Network, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.7.1.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -398,6 +398,12 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVirtualMachineSingleNetworkInterface.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVirtualMachineSingleNetworkInterfaceWithAcceleratedNetworking.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVMNicWithAcceleratedNetworkingValidations.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineProfileTests\TestVirtualMachineProfileWithoutAUC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,19 @@ public void TestEffectiveRoutesAndNsg()
{
ComputeTestController.NewInstance.RunPsTest("Test-EffectiveRoutesAndNsg");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineSingleNetworkInterfaceWithAcceleratedNetworking()
{
ComputeTestController.NewInstance.RunPsTest("Test-SingleNetworkInterfaceWithAcceleratedNetworking");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVMNicWithAcceleratedNetworkingValidations()
{
ComputeTestController.NewInstance.RunPsTest("Test-VMNicWithAcceleratedNetworkingValidations");
}
}
}
Loading

0 comments on commit 45bb38e

Please sign in to comment.