diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/UnitTests/GetAzureAutomationCredentialTest.cs b/src/ServiceManagement/Automation/Commands.Automation.Test/UnitTests/GetAzureAutomationCredentialTest.cs index 03d1c06011cb..90594d48ef62 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/UnitTests/GetAzureAutomationCredentialTest.cs +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/UnitTests/GetAzureAutomationCredentialTest.cs @@ -69,7 +69,7 @@ public void GetAzureAutomationCredentialByAllSuccessfull() // Setup string accountName = "automation"; - this.mockAutomationClient.Setup(f => f.ListCredentials(accountName)).Returns((string a) => new List()); + this.mockAutomationClient.Setup(f => f.ListCredentials(accountName)).Returns((string a) => new List()); // Test this.cmdlet.AutomationAccountName = accountName; diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationCredential.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationCredential.cs index 3120bb960664..1155918c4b03 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationCredential.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationCredential.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet /// Gets a Credential for automation. /// [Cmdlet(VerbsCommon.Get, "AzureAutomationCredential", DefaultParameterSetName = AutomationCmdletParameterSets.ByAll)] - [OutputType(typeof(PSCredential))] + [OutputType(typeof(CredentialInfo))] public class GetAzureAutomationCredential : AzureAutomationBaseCmdlet { /// @@ -41,10 +41,10 @@ public class GetAzureAutomationCredential : AzureAutomationBaseCmdlet [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] protected override void AutomationExecuteCmdlet() { - IEnumerable ret = null; + IEnumerable ret = null; if (!string.IsNullOrEmpty(this.Name)) { - ret = new List + ret = new List { this.AutomationClient.GetCredential(this.AutomationAccountName, this.Name) }; diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJob.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJob.cs index c6ab3a61e7ae..3edf9c173bcd 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJob.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJob.cs @@ -33,7 +33,7 @@ public class GetAzureAutomationJob : AzureAutomationBaseCmdlet /// [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByJobId, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The job id.")] [Alias("JobId")] - public Guid? Id { get; set; } + public Guid Id { get; set; } /// /// Gets or sets the runbook name of the job. @@ -42,11 +42,11 @@ public class GetAzureAutomationJob : AzureAutomationBaseCmdlet public string RunbookName { get; set; } /// - /// Gets or sets the runbook name of the job. + /// Gets or sets the status of a job. /// [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookName, Mandatory = false, HelpMessage = "The runbook name of the job.")] - [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter jobs so that job start time >= StartTime.")] - [ValidateSet("Completed", "Failed", "Queued", "Starting", "Resuming", "Running", "Stopped", "Stopping", "Suspended", "Suspending", "Activating", "Blocked", "Removing")] + [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter jobs based on their status.")] + [ValidateSet("Completed", "Failed", "Queued", "Starting", "Resuming", "Running", "Stopped", "Stopping", "Suspended", "Suspending", "Activating")] public string Status { get; set; } /// @@ -54,14 +54,14 @@ public class GetAzureAutomationJob : AzureAutomationBaseCmdlet /// [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookName, Mandatory = false, HelpMessage = "Filter jobs so that job start time >= StartTime.")] [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter jobs so that job start time >= StartTime.")] - public DateTime? StartTime { get; set; } + public DateTimeOffset? StartTime { get; set; } /// /// Gets or sets the end time filter. /// [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookName, Mandatory = false, HelpMessage = "Filter jobs so that job end time <= EndTime.")] [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter jobs so that job end time <= EndTime.")] - public DateTime? EndTime { get; set; } + public DateTimeOffset? EndTime { get; set; } /// /// Execute this cmdlet. @@ -71,10 +71,10 @@ protected override void AutomationExecuteCmdlet() { IEnumerable jobs; - if (this.Id.HasValue) + if (this.Id != null && !Guid.Empty.Equals(this.Id)) { // ByJobId - jobs = new List { this.AutomationClient.GetJob(this.AutomationAccountName, this.Id.Value) }; + jobs = new List { this.AutomationClient.GetJob(this.AutomationAccountName, this.Id) }; } else if (this.RunbookName != null) { diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJobOutput.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJobOutput.cs index 5b97b3a7138b..1801b86ac6a0 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJobOutput.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationJobOutput.cs @@ -39,7 +39,7 @@ public class GetAzureAutomationJobOutput : AzureAutomationBaseCmdlet public string Stream { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Retrieves output created after this time")] - public DateTime? StartTime { get; set; } + public DateTimeOffset? StartTime { get; set; } /// /// Execute this cmdlet. diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCredential.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCredential.cs index aa1b504abb29..61f930c47291 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCredential.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCredential.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet /// Create a new Credential for automation. /// [Cmdlet(VerbsCommon.New, "AzureAutomationCredential", DefaultParameterSetName = AutomationCmdletParameterSets.ByName)] - [OutputType(typeof(PSCredential))] + [OutputType(typeof(CredentialInfo))] public class NewAzureAutomationCredential : AzureAutomationBaseCmdlet { /// diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationModule.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationModule.cs index cd4c20ab60d2..cc8402cd29e2 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationModule.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationModule.cs @@ -18,6 +18,7 @@ using System.Security.Permissions; using Microsoft.Azure.Commands.Automation.Model; using Microsoft.Azure.Commands.Automation.Common; +using System.Collections; namespace Microsoft.Azure.Commands.Automation.Cmdlet { @@ -48,7 +49,8 @@ public class NewAzureAutomationModule : AzureAutomationBaseCmdlet /// Gets or sets the module tags. /// [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The module tags.")] - public IDictionary Tags { get; set; } + [Alias("Tag")] + public IDictionary Tags { get; set; } /// /// Execute this cmdlet. diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationCredential.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationCredential.cs index b616dd8a24b4..be8cc9b99381 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationCredential.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationCredential.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet /// Sets a Credential for automation. /// [Cmdlet(VerbsCommon.Set, "AzureAutomationCredential", DefaultParameterSetName = AutomationCmdletParameterSets.ByName)] - [OutputType(typeof(PSCredential))] + [OutputType(typeof(CredentialInfo))] public class SetAzureAutomationCredential : AzureAutomationBaseCmdlet { /// diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationModule.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationModule.cs index fe47bc3d08be..f4f601935ff6 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationModule.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationModule.cs @@ -18,6 +18,8 @@ using System.Security.Permissions; using Microsoft.Azure.Commands.Automation.Model; using Microsoft.Azure.Commands.Automation.Common; +using System.Collections; +using System.Linq; namespace Microsoft.Azure.Commands.Automation.Cmdlet { @@ -41,7 +43,15 @@ public class SetAzureAutomationModule : AzureAutomationBaseCmdlet /// [Parameter(ParameterSetName = AutomationCmdletParameterSets.ByName, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The module tags.")] [ValidateNotNullOrEmpty] - public IDictionary Tags { get; set; } + [Alias("Tag")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the contentLink + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, + HelpMessage = "The ContentLinkUri.")] + public Uri ContentLinkUri { get; set; } /// /// Execute this cmdlet. @@ -49,8 +59,8 @@ public class SetAzureAutomationModule : AzureAutomationBaseCmdlet [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] protected override void AutomationExecuteCmdlet() { - var updatedModule = this.AutomationClient.UpdateModule(this.AutomationAccountName, Tags, Name); - + var updatedModule = this.AutomationClient.UpdateModule(this.AutomationAccountName, Tags, Name, ContentLinkUri); + this.WriteObject(updatedModule); } } diff --git a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj index f9e8504f8759..d478cac0ee0c 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj +++ b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj @@ -175,7 +175,7 @@ - + diff --git a/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs index 849dbe6bba85..2a8f4b4eaedc 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs @@ -35,7 +35,7 @@ using Job = Microsoft.Azure.Commands.Automation.Model.Job; using Variable = Microsoft.Azure.Commands.Automation.Model.Variable; using JobStream = Microsoft.Azure.Commands.Automation.Model.JobStream; -using Credential = Microsoft.Azure.Commands.Automation.Model.Credential; +using Credential = Microsoft.Azure.Commands.Automation.Model.CredentialInfo; using Module = Microsoft.Azure.Commands.Automation.Model.Module; using JobSchedule = Microsoft.Azure.Commands.Automation.Model.JobSchedule; using Certificate = Microsoft.Azure.Commands.Automation.Model.Certificate; @@ -524,7 +524,7 @@ public IEnumerable ListVariables(string automationAccountName) #region Credentials - public Credential CreateCredential(string automationAccountName, string name, string userName, string password, + public CredentialInfo CreateCredential(string automationAccountName, string name, string userName, string password, string description) { var credentialCreateParams = new AutomationManagement.Models.CredentialCreateParameters(); @@ -532,10 +532,8 @@ public Credential CreateCredential(string automationAccountName, string name, st credentialCreateParams.Properties = new AutomationManagement.Models.CredentialCreateProperties(); if (description != null) credentialCreateParams.Properties.Description = description; - if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) - { - new AzureAutomationOperationException(string.Format(Resources.ParameterEmpty, "Username or Password")); - } + Requires.Argument("userName", userName).NotNull(); + Requires.Argument("password", password).NotNull(); credentialCreateParams.Properties.UserName = userName; credentialCreateParams.Properties.Password = password; @@ -548,10 +546,10 @@ public Credential CreateCredential(string automationAccountName, string name, st new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Create", "credential", name, automationAccountName)); } - return new Credential(automationAccountName, createdCredential.Credential); + return new CredentialInfo(automationAccountName, createdCredential.Credential); } - public Credential UpdateCredential(string automationAccountName, string name, string userName, string password, + public CredentialInfo UpdateCredential(string automationAccountName, string name, string userName, string password, string description) { var credentialUpdateParams = new AutomationManagement.Models.CredentialUpdateParameters(); @@ -559,9 +557,6 @@ public Credential UpdateCredential(string automationAccountName, string name, st credentialUpdateParams.Properties = new AutomationManagement.Models.CredentialUpdateProperties(); if (description != null) credentialUpdateParams.Properties.Description = description; - Requires.Argument("userName", userName).NotNull(); - Requires.Argument("password", password).NotNull(); - credentialUpdateParams.Properties.UserName = userName; credentialUpdateParams.Properties.Password = password; @@ -579,7 +574,7 @@ public Credential UpdateCredential(string automationAccountName, string name, st return updatedCredential; } - public Credential GetCredential(string automationAccountName, string name) + public CredentialInfo GetCredential(string automationAccountName, string name) { var credential = this.automationManagementClient.PsCredentials.Get(automationAccountName, name).Credential; if (credential == null) @@ -587,7 +582,7 @@ public Credential GetCredential(string automationAccountName, string name) throw new ResourceNotFoundException(typeof(Credential), string.Format(CultureInfo.CurrentCulture, Resources.CredentialNotFound, name)); } - return new Credential(automationAccountName, credential); + return new CredentialInfo(automationAccountName, credential); } private Credential CreateCredentialFromCredentialModel(AutomationManagement.Models.Credential credential) @@ -632,13 +627,15 @@ public void DeleteCredential(string automationAccountName, string name) #region Modules public Module CreateModule(string automationAccountName, Uri contentLink, string moduleName, - IDictionary Tags) + IDictionary tags) { + IDictionary moduleTags = null; + if (tags != null) moduleTags = tags.Cast().ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.ToString()); var createdModule = this.automationManagementClient.Modules.Create(automationAccountName, new AutomationManagement.Models.ModuleCreateParameters() { Name = moduleName, - Tags = Tags, + Tags = moduleTags, Properties = new AutomationManagement.Models.ModuleCreateProperties() { ContentLink = new AutomationManagement.Models.ContentLink() @@ -678,25 +675,47 @@ public IEnumerable ListModules(string automationAccountName) return modulesModels.Select(c => new Module(automationAccountName, c)); } - public Module UpdateModule(string automationAccountName, IDictionary tags, string name) + public Module UpdateModule(string automationAccountName, IDictionary tags, string name, Uri contentLinkUri) { - var existingModule = this.GetModule(automationAccountName, name); + if(tags != null && contentLinkUri != null) + { + var moduleCreateParameters = new AutomationManagement.Models.ModuleCreateParameters(); + + moduleCreateParameters.Name = name; + moduleCreateParameters.Tags = tags.Cast().ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.ToString()); - var moduleUpdateParameters = new AutomationManagement.Models.ModuleUpdateParameters(); - moduleUpdateParameters.Name = name; - if (tags != null) moduleUpdateParameters.Tags = tags; - moduleUpdateParameters.Location = existingModule.Location; + moduleCreateParameters.Properties = new ModuleCreateProperties(); + moduleCreateParameters.Properties.ContentLink = new AutomationManagement.Models.ContentLink(); + moduleCreateParameters.Properties.ContentLink.Uri = contentLinkUri; - var updatedModule = this.automationManagementClient.Modules.Update(automationAccountName, - moduleUpdateParameters); + this.automationManagementClient.Modules.Create(automationAccountName, + moduleCreateParameters); - if (updatedModule == null || updatedModule.StatusCode != HttpStatusCode.OK) + } + else if (contentLinkUri != null) { - new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Update", - "Module", name, automationAccountName)); + var moduleUpdateParameters = new AutomationManagement.Models.ModuleUpdateParameters(); + + moduleUpdateParameters.Name = name; + moduleUpdateParameters.Properties = new ModuleUpdateProperties(); + moduleUpdateParameters.Properties.ContentLink = new AutomationManagement.Models.ContentLink(); + moduleUpdateParameters.Properties.ContentLink.Uri = contentLinkUri; + + this.automationManagementClient.Modules.Update(automationAccountName, moduleUpdateParameters); + } + else if(tags != null) + { + var moduleUpdateParameters = new AutomationManagement.Models.ModuleUpdateParameters(); + + moduleUpdateParameters.Name = name; + moduleUpdateParameters.Tags = tags.Cast().ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.ToString()); + moduleUpdateParameters.Properties = new ModuleUpdateProperties(); + + this.automationManagementClient.Modules.Update(automationAccountName, moduleUpdateParameters); } - return new Module(automationAccountName, updatedModule.Module); + var updatedModule = this.automationManagementClient.Modules.Get(automationAccountName, name).Module; + return new Module(automationAccountName, updatedModule); } public void DeleteModule(string automationAccountName, string name) @@ -719,7 +738,7 @@ public void DeleteModule(string automationAccountName, string name) #endregion #region Jobs - public IEnumerable GetJobStream(string automationAccountName, Guid jobId, DateTime? time, + public IEnumerable GetJobStream(string automationAccountName, Guid jobId, DateTimeOffset? time, string streamType) { var listParams = new AutomationManagement.Models.JobStreamListParameters(); @@ -750,20 +769,8 @@ public Job GetJob(string automationAccountName, Guid Id) return new Job(automationAccountName, job); } - public IEnumerable ListJobsByRunbookName(string automationAccountName, string runbookName, DateTime? startTime, DateTime? endTime, string jobStatus) + public IEnumerable ListJobsByRunbookName(string automationAccountName, string runbookName, DateTimeOffset? startTime, DateTimeOffset? endTime, string jobStatus) { - // Assume local time if DateTimeKind.Unspecified - if (startTime.HasValue && startTime.Value.Kind == DateTimeKind.Unspecified) - { - startTime = DateTime.SpecifyKind(startTime.Value, DateTimeKind.Local); - } - - - if (endTime.HasValue && endTime.Value.Kind == DateTimeKind.Unspecified) - { - endTime = DateTime.SpecifyKind(endTime.Value, DateTimeKind.Local); - } - IEnumerable jobModels; if (startTime.HasValue && endTime.HasValue) @@ -837,20 +844,8 @@ public IEnumerable ListJobsByRunbookName(string automationAccountName, stri return jobModels.Select(jobModel => new Job(automationAccountName, jobModel)); } - public IEnumerable ListJobs(string automationAccountName, DateTime? startTime, DateTime? endTime, string jobStatus) + public IEnumerable ListJobs(string automationAccountName, DateTimeOffset? startTime, DateTimeOffset? endTime, string jobStatus) { - // Assume local time if DateTimeKind.Unspecified - if (startTime.HasValue && startTime.Value.Kind == DateTimeKind.Unspecified) - { - startTime = DateTime.SpecifyKind(startTime.Value, DateTimeKind.Local); - } - - - if (endTime.HasValue && endTime.Value.Kind == DateTimeKind.Unspecified) - { - endTime = DateTime.SpecifyKind(endTime.Value, DateTimeKind.Local); - } - IEnumerable jobModels; if (startTime.HasValue && endTime.HasValue) @@ -1419,7 +1414,7 @@ private AutomationManagement.Models.Schedule GetScheduleModel(string automationA return scheduleModel; } - private string FormatDateTime(DateTime dateTime) + private string FormatDateTime(DateTimeOffset dateTime) { return string.Format(CultureInfo.InvariantCulture, "{0:O}", dateTime.ToUniversalTime()); } diff --git a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs index fa520861a46f..117229a7f85e 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs @@ -27,7 +27,7 @@ public interface IAutomationClient #region JobStreams - IEnumerable GetJobStream(string automationAccountname, Guid jobId, DateTime? time, string streamType); + IEnumerable GetJobStream(string automationAccountname, Guid jobId, DateTimeOffset? time, string streamType); #endregion @@ -85,13 +85,13 @@ public interface IAutomationClient #region Credentials - Credential CreateCredential(string automationAccountName, string name, string userName, string password, string description); + CredentialInfo CreateCredential(string automationAccountName, string name, string userName, string password, string description); - Credential UpdateCredential(string automationAccountName, string name, string userName, string password, string description); + CredentialInfo UpdateCredential(string automationAccountName, string name, string userName, string password, string description); - Credential GetCredential(string automationAccountName, string name); + CredentialInfo GetCredential(string automationAccountName, string name); - IEnumerable ListCredentials(string automationAccountName); + IEnumerable ListCredentials(string automationAccountName); void DeleteCredential(string automationAccountName, string name); @@ -99,11 +99,11 @@ public interface IAutomationClient #region Modules - Module CreateModule(string automationAccountName, Uri contentLink, string moduleName, IDictionary tags); + Module CreateModule(string automationAccountName, Uri contentLink, string moduleName, IDictionary tags); Module GetModule(string automationAccountName, string name); - Module UpdateModule(string automationAccountName, IDictionary tags, string name); + Module UpdateModule(string automationAccountName, IDictionary tags, string name, Uri contentLink); IEnumerable ListModules(string automationAccountName); @@ -115,9 +115,9 @@ public interface IAutomationClient Job GetJob(string automationAccountName, Guid id); - IEnumerable ListJobsByRunbookName(string automationAccountName, string runbookName, DateTime? startTime, DateTime? endTime, string jobStatus); + IEnumerable ListJobsByRunbookName(string automationAccountName, string runbookName, DateTimeOffset? startTime, DateTimeOffset? endTime, string jobStatus); - IEnumerable ListJobs(string automationAccountName, DateTime? startTime, DateTime? endTime, string jobStatus); + IEnumerable ListJobs(string automationAccountName, DateTimeOffset? startTime, DateTimeOffset? endTime, string jobStatus); void ResumeJob(string automationAccountName, Guid id); diff --git a/src/ServiceManagement/Automation/Commands.Automation/Model/Credential.cs b/src/ServiceManagement/Automation/Commands.Automation/Model/CredentialInfo.cs similarity index 91% rename from src/ServiceManagement/Automation/Commands.Automation/Model/Credential.cs rename to src/ServiceManagement/Automation/Commands.Automation/Model/CredentialInfo.cs index cfd84c1b76b3..fe85c734ed8b 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Model/Credential.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Model/CredentialInfo.cs @@ -18,15 +18,15 @@ namespace Microsoft.Azure.Commands.Automation.Model { - public class Credential + public class CredentialInfo { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The Credential. /// - public Credential(string accountAcccountName, Azure.Management.Automation.Models.Credential credential) + public CredentialInfo(string accountAcccountName, Azure.Management.Automation.Models.Credential credential) { Requires.Argument("credential", credential).NotNull(); this.AutomationAccountName = accountAcccountName; @@ -41,9 +41,9 @@ public Credential(string accountAcccountName, Azure.Management.Automation.Models } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Credential() + public CredentialInfo() { } diff --git a/src/ServiceManagement/Automation/Commands.Automation/Model/Job.cs b/src/ServiceManagement/Automation/Commands.Automation/Model/Job.cs index c57f48498ac7..cd79632c65ee 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Model/Job.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Model/Job.cs @@ -55,7 +55,7 @@ public Job(string accountName, Azure.Management.Automation.Models.Job job) this.Exception = job.Properties.Exception; this.EndTime = job.Properties.EndTime; this.LastStatusModifiedTime = job.Properties.LastStatusModifiedTime; - this.Parameters = job.Properties.Parameters ?? new Dictionary(); + this.JobParameters = job.Properties.Parameters ?? new Dictionary(); } /// @@ -133,7 +133,7 @@ public Job() /// /// Gets or sets the parameters of the job. /// - public IDictionary Parameters { get; set; } + public IDictionary JobParameters { get; set; } /// /// Gets or sets the runbook. diff --git a/src/ServiceManagement/Automation/Commands.Automation/Model/Module.cs b/src/ServiceManagement/Automation/Commands.Automation/Model/Module.cs index f893ba6a4e57..f8b4bedf2b13 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Model/Module.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Model/Module.cs @@ -37,9 +37,9 @@ public Module(string automationAccountName, Azure.Management.Automation.Models.M this.Tags = module.Tags ?? new Dictionary(); if (module.Properties == null) return; - + this.CreationTime = module.Properties.CreationTime.ToLocalTime(); - this.LastPublishTime = module.Properties.LastModifiedTime.ToLocalTime(); + this.LastModifiedTime = module.Properties.LastModifiedTime.ToLocalTime(); this.IsGlobal = module.Properties.IsGlobal; this.Version = module.Properties.Version; this.ProvisioningState = module.Properties.ProvisioningState.ToString(); @@ -107,11 +107,47 @@ public Module() /// /// Gets or sets the LastPublishTime. /// - public DateTimeOffset LastPublishTime { get; set; } + public DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the ProvisioningState. /// public string ProvisioningState { get; set; } + + /// + /// Gets or sets the ContentLink. + /// + public ContentLink ContentLink { get; set; } + } + + public class ContentLink + { + /// + /// Gets or sets the Uri. + /// + public Uri Uri { get; set; } + + /// + /// Gets or sets the Content hash. + /// + public ContentHash ContentHash { get; set; } + + /// + /// Gets or sets the Version. + /// + public string Version { get; set; } + } + + public class ContentHash + { + /// + /// Gets or sets the Algorithm. + /// + public string Algorithm { get; set; } + + /// + /// Gets or sets the Value. + /// + public string Value { get; set; } } }