Skip to content

. #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
Dec 6, 2015
Merged

. #231

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
55b6e3a
Job Stream cmdlet
safeermohammed Nov 1, 2015
d4e9046
Job Stream record cmdlet
safeermohammed Nov 1, 2015
6288a03
Job Stream record cmdlet
safeermohammed Nov 1, 2015
452c2fc
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
safeermohammed Nov 1, 2015
16cfc67
Job Stream record cmdlet
safeermohammed Nov 1, 2015
b796518
#5038091 Add AuthorizationKey parameter in virtualnetworkgatewayconne…
dihan0604 Nov 4, 2015
85c69b0
Fixed the cmdlet to use ARM template v2.6
balukambala Nov 4, 2015
9ecd189
removed extra "
balukambala Nov 4, 2015
e4a314a
fixed casing + datetime string
balukambala Nov 5, 2015
0b126a9
Sending date in iso format
balukambala Nov 5, 2015
d5709a7
Correcting typo
safeermohammed Nov 6, 2015
c7ddff5
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 9, 2015
4c5410b
Merge pull request #9 from balukambala/dev
balukambala Nov 9, 2015
e7c2cc2
Merge branch 'dev' of https://github.com/AzureAutomationTeam/azure-po…
safeermohammed Nov 9, 2015
ffc29c3
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 11, 2015
151e3aa
#4321482 PS for ER Authorization
dihan0604 Nov 12, 2015
e989b39
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 12, 2015
1015341
JobStreamRecord
safeermohammed Nov 13, 2015
0ae93b4
Adding x-ms-activity-id header to RequestSettings
adamblev Nov 16, 2015
37ea2cc
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 17, 2015
2c01a81
fix typo
dihan0604 Nov 17, 2015
bb0a6a4
Merge pull request #10 from adamblev/dev
adamblev Nov 17, 2015
ebb7b94
Saving changes before pull
safeermohammed Nov 18, 2015
448ff80
Merge branch 'dev' of https://github.com/azure/azure-powershell into dev
safeermohammed Nov 18, 2015
587c9b4
Job output changes for returned object
safeermohammed Nov 21, 2015
903de67
Add testing for authorization APIs
dihan0604 Nov 25, 2015
d52cd35
Hashtable for jobRecords
safeermohammed Nov 26, 2015
0d87453
Merge branch 'dev' of https://github.com/azureautomationteam/azure-po…
safeermohammed Nov 26, 2015
33164a5
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 29, 2015
252c72f
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Nov 29, 2015
74ead18
Add recorded tests
dihan0604 Nov 30, 2015
65e4504
Merge branch 'dev' of https://github.com/dihan0604/azure-powershell i…
dihan0604 Nov 30, 2015
a736a0c
upgrade network version in test
dihan0604 Nov 30, 2015
0e862f5
Re-record test
dihan0604 Nov 30, 2015
3e4c31c
Update test record
dihan0604 Nov 30, 2015
e03e23b
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Dec 2, 2015
fe652ea
ER stats API PS for RDFE
dihan0604 Dec 2, 2015
4aa91b2
Added tests
safeermohammed Dec 3, 2015
3637d82
update APIs and Versions
dihan0604 Dec 4, 2015
44502c9
fix merge conflict
dihan0604 Dec 4, 2015
4866cf1
update pacakge
dihan0604 Dec 4, 2015
c21d1ae
Revert "Added tests"
safeermohammed Dec 4, 2015
ee95641
Removed test per azure team
safeermohammed Dec 4, 2015
524ab10
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
dihan0604 Dec 4, 2015
041c21b
Update Auth test
dihan0604 Dec 4, 2015
6c743e0
Add test cases for AzureRmVMDiagnosticsExtension command
yantang-msft Dec 4, 2015
2e5a292
Add extra parameter in connection API
dihan0604 Dec 5, 2015
db806ae
Merge pull request #1400 from dihan0604/dev
jianghaolu Dec 5, 2015
b22b122
Merge pull request #1393 from AzureAutomationTeam/dev
jianghaolu Dec 5, 2015
3d52731
Merge pull request #1414 from yantang-msft/dev
jianghaolu Dec 5, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
<Compile Include="Model\DscOnboardingMetaconfig.cs" />
<Compile Include="Model\Job.cs" />
<Compile Include="Model\JobSchedule.cs" />
<Compile Include="Model\JobStreamRecord.cs" />
<Compile Include="Model\JobStream.cs" />
<Compile Include="Model\Module.cs" />
<Compile Include="Model\NodeConfiguration.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,13 @@ public IEnumerable<JobStream> GetJobStream(string resourceGroupName, string auto
stream => this.CreateJobStreamFromJobStreamModel(stream, resourceGroupName, automationAccountName, jobId));
}

public JobStreamRecord GetJobStreamRecord(string resourceGroupName, string automationAccountName, Guid jobId, string jobStreamId)
{
var response = this.automationManagementClient.JobStreams.Get(resourceGroupName, automationAccountName, jobId, jobStreamId);

return new JobStreamRecord(response.JobStream, resourceGroupName, automationAccountName, jobId);
}

public Job GetJob(string resourceGroupName, string automationAccountName, Guid Id)
{
var job = this.automationManagementClient.Jobs.Get(resourceGroupName, automationAccountName, Id).Job;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ public void RegisterDscNode(string resourceGroupName,
templateParameters.Add("rebootNodeIfNeeded", rebootFlag);
templateParameters.Add("actionAfterReboot", actionAfterReboot);
templateParameters.Add("allowModuleOverwrite", moduleOverwriteFlag);
templateParameters.Add("timestamp", DateTimeOffset.UtcNow.ToString("o"));

// invoke the New-AzureRmResourceGroupDeployment cmdlet
using (Pipeline pipe = Runspace.DefaultRunspace.CreateNestedPipeline())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class Constants

public const string ClientRequestIdHeaderName = "x-ms-client-request-id";

public const string ActivityIdHeaderName = "x-ms-activity-id";

// default schedule expiry time for daily schedule, consistent with UX
// 12/31/9999 12:00:00 AM
public static readonly DateTimeOffset DefaultScheduleExpiryTime = DateTimeOffset.MaxValue;
Expand All @@ -59,13 +61,15 @@ public class AutomationAccountState

public const int PsCommandValueDepth = 10;

public const int JobSummaryLength = 80;

// The template file is a json
public const string TemplateFile = @"https://eus2oaasibizamarketprod1.blob.core.windows.net/automationdscpreview/azuredeploy.json";
public const string TemplateFile = @"https://eus2oaasibizamarketprod1.blob.core.windows.net/automationdscpreview/azuredeployV2.json";

// The metaconfig file
public const string ModulesUrl = @"https://eus2oaasibizamarketprod1.blob.core.windows.net/automationdscpreview/RegistrationMetaConfig.zip";
public const string ModulesUrl = @"https://eus2oaasibizamarketprod1.blob.core.windows.net/automationdscpreview/RegistrationMetaConfigV2.zip";

public const string ConfigurationFunction = @"RegistrationMetaConfig.ps1\RegistrationMetaConfig";
public const string ConfigurationFunction = @"RegistrationMetaConfigV2.ps1\RegistrationMetaConfigV2";


public static class RunbookType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ Model.Webhook CreateWebhook(
IEnumerable<JobStream> GetJobStream(string resourceGroupName, string automationAccountName, Guid jobId,
DateTimeOffset? time, string streamType, ref string nextLink);

JobStreamRecord GetJobStreamRecord(string resourceGroupName, string automationAccountName, Guid jobId, string jobStreamId);

#endregion

#region Certificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -31,6 +32,11 @@ public RequestSettings(IAutomationManagementClient automationClient)
client = ((AutomationManagementClient)automationClient);
client.HttpClient.DefaultRequestHeaders.Remove(Constants.ClientRequestIdHeaderName);
client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientRequestIdHeaderName, Guid.NewGuid().ToString());

client.HttpClient.DefaultRequestHeaders.Remove(Constants.ActivityIdHeaderName);
var activityId = Guid.NewGuid();
EventProvider.SetActivityId(ref activityId);
client.HttpClient.DefaultRequestHeaders.Add(Constants.ActivityIdHeaderName, activityId.ToString());
}

public void Dispose()
Expand All @@ -43,6 +49,7 @@ protected virtual void Dispose(bool disposing)
if (disposing)
{
client.HttpClient.DefaultRequestHeaders.Remove(Constants.ClientRequestIdHeaderName);
client.HttpClient.DefaultRequestHeaders.Remove(Constants.ActivityIdHeaderName);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Job(string resourceGroupName, string accountName, Azure.Management.Automa

if (job.Properties == null) return;

this.Id = job.Properties.JobId;
this.JobId = job.Properties.JobId;
this.CreationTime = job.Properties.CreationTime.ToLocalTime();
this.LastModifiedTime = job.Properties.LastModifiedTime.ToLocalTime();
this.StartTime = job.Properties.StartTime.HasValue ? job.Properties.StartTime.Value.ToLocalTime() : (DateTimeOffset?)null;
Expand Down Expand Up @@ -105,7 +105,7 @@ public Job()
/// <summary>
/// Gets or sets the job id.
/// </summary>
public Guid Id { get; set; }
public Guid JobId { get; set; }

/// <summary>
/// Gets or sets the tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Management.Automation;
using Microsoft.Azure.Commands.Automation.Common;

using AutomationManagement = Microsoft.Azure.Management.Automation;
Expand Down Expand Up @@ -45,13 +47,19 @@ public JobStream(AutomationManagement.Models.JobStream jobStream, string resourc
{
Requires.Argument("jobStream", jobStream).NotNull();

this.JobStreamId = jobStream.Properties.JobStreamId;
this.StreamRecordId = jobStream.Properties.JobStreamId;
this.Type = jobStream.Properties.StreamType;
this.Text = jobStream.Properties.Summary;
this.Time = jobStream.Properties.Time;
this.AutomationAccountName = automationAccountName;
this.ResourceGroupName = resourceGroupName;
this.Id = jobId;
this.JobId = jobId;

if (!String.IsNullOrWhiteSpace(jobStream.Properties.Summary))
{
this.Summary = jobStream.Properties.Summary.Length > Constants.JobSummaryLength ?
jobStream.Properties.Summary.Substring(0, Constants.JobSummaryLength) + "..." :
jobStream.Properties.Summary;
}
}

/// <summary>
Expand All @@ -74,22 +82,22 @@ public JobStream()
/// <summary>
/// Gets or sets the Job Id.
/// </summary>
public Guid Id { get; set; }
public Guid JobId { get; set; }

/// <summary>
/// Gets or sets the stream id
/// Gets or sets the stream record id
/// </summary>
public string JobStreamId { get; set; }
public string StreamRecordId { get; set; }

/// <summary>
/// Gets or sets the stream time.
/// </summary>
public DateTimeOffset Time { get; set; }

/// <summary>
/// Gets or sets the stream text.
/// Gets or sets the summary.
/// </summary>
public string Text { get; set; }
public string Summary { get; set; }

/// <summary>
/// Gets or sets the stream Type.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.Azure.Commands.Automation.Common;

using AutomationManagement = Microsoft.Azure.Management.Automation;

namespace Microsoft.Azure.Commands.Automation.Model
{
/// <summary>
/// The Job Stream Record.
/// </summary>
public class JobStreamRecord : JobStream
{
/// <summary>
/// Initializes a new instance of the <see cref="JobStreamRecord"/> class.
/// </summary>
/// <param name="jobStream">
/// The job stream.
/// </param>
/// <param name="resourceGroupName">
/// The resource group name.
/// </param>
/// <param name="automationAccountName">
/// The automation account name
/// </param>
/// <param name="jobId">
/// The job Id
/// </param>
/// <exception cref="System.ArgumentException">
/// </exception>
public JobStreamRecord(AutomationManagement.Models.JobStream jobStream, string resourceGroupName, string automationAccountName, Guid jobId ) : base (jobStream, resourceGroupName, automationAccountName, jobId)
{
this.Value = new Hashtable();
foreach (var kvp in jobStream.Properties.Value)
{
object paramValue;
try
{
paramValue = ((object)PowerShellJsonConverter.Deserialize(kvp.Value.ToString()));
}
catch (CmdletInvocationException exception)
{
if (!exception.Message.Contains("Invalid JSON primitive"))
throw;

paramValue = kvp.Value;
}
this.Value.Add(kvp.Key, paramValue);
}
}

/// <summary>
/// Initializes a new instance of the <see cref="JobStreamRecord"/> class.
/// </summary>
public JobStreamRecord()
{
}

/// <summary>
/// Gets or sets the stream values.
/// </summary>
public Hashtable Value { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<Compile Include="Common\ComputeTestController.cs" />
<Compile Include="ScenarioTests\AddVhdTests.cs" />
<Compile Include="ScenarioTests\ComputeCloudExceptionTests.cs" />
<Compile Include="ScenarioTests\DiagnosticsExtensionTests.cs" />
<Compile Include="ScenarioTests\DscExtensionTests.cs" />
<Compile Include="ScenarioTests\VirtualMachineBootDiagnosticsTests.cs" />
<Compile Include="ScenarioTests\VMDynamicTests.cs" />
Expand Down Expand Up @@ -236,6 +237,9 @@
<None Include="ScenarioTests\VirtualMachineBootDiagnosticsTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\DiagnosticsExtensionTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\VMDynamicTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -268,6 +272,15 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.ComputeCloudExceptionTests\RunComputeCloudExceptionTests.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiagnosticsExtensionTests\TestDiagnosticsExtensionBasic.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiagnosticsExtensionTests\TestDiagnosticsExtensionCantListSepcifyStorageAccountKey.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiagnosticsExtensionTests\TestDiagnosticsExtensionSepcifyStorageAccountName.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DscExtensionTests\TestGetAzureRmVMDscExtension.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -392,6 +405,11 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="ConfigFiles\DiagnosticsExtensionConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<PublicConfig>
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="2048" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Error" />
<Directories scheduledTransferPeriod="PT1M">
<IISLogs containerName="wad-iis-logfiles" />
<FailedRequestLogs containerName="wad-failedrequestlogs" />
</Directories>
<PerformanceCounters scheduledTransferPeriod="PT2M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT1M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT1M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT3M" />
</PerformanceCounters>
<WindowsEventLog scheduledTransferPeriod="PT1M">
<DataSource name="Application!*[System[(Level=1 or Level=2)]]" />
<DataSource name="Windows Azure!*[System[(Level=1 or Level=2)]]" />
</WindowsEventLog>
<CrashDumps>
<CrashDumpConfiguration processName="WaIISHost.exe" />
<CrashDumpConfiguration processName="WaWorkerHost.exe" />
<CrashDumpConfiguration processName="w3wp.exe" />
</CrashDumps>
<Logs scheduledTransferPeriod="PT3M" />
</DiagnosticMonitorConfiguration>
</WadCfg>
<StorageAccount>definedinconfigstorage</StorageAccount>
</PublicConfig>
Loading