/// <summary>
        ///     Initializes a new instance of the <see cref="NodeConfigurationDeployment" /> class.
        /// </summary>
        /// <param name="resourceGroupName">
        ///     The resource group name.
        /// </param>
        /// <param name="accountName">
        ///     The account name.
        /// </param>
        /// <param name="automationJob">
        ///     The Job. (optional)
        /// </param>
        /// <param name="automationJobSchedule">
        ///     The Job Schedule. (optional)
        /// </param>
        /// <param name="nodeConfiguraionName">
        ///     The Node Configuration Name
        /// </param>
        /// <param name="nodeGroups">
        ///     The list of Node Groups with status. (optional)
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// </exception>
        public NodeConfigurationDeployment(string resourceGroupName, string accountName, string nodeConfiguraionName,
                                           Management.Automation.Models.Job automationJob   = null, Management.Automation.Models.JobSchedule automationJobSchedule = null,
                                           IList <IDictionary <string, string> > nodeGroups = null)
        {
            Requires.Argument("accountName", accountName).NotNull();
            Requires.Argument("resourceGroupName", resourceGroupName).NotNull();

            ResourceGroupName     = resourceGroupName;
            AutomationAccountName = accountName;
            NodeConfigurationName = nodeConfiguraionName;

            if (automationJob == null && automationJobSchedule == null)
            {
                return;
            }
            else
            {
                if (automationJob != null)
                {
                    JobId     = automationJob.JobId;
                    JobStatus = automationJob.Status;
                    Job       = new Job(resourceGroupName, accountName, automationJob);
                }
                else
                {
                    JobScheduleId = Guid.Parse(automationJobSchedule.Id);
                    JobSchedule   = new JobSchedule(resourceGroupName, accountName, automationJobSchedule);
                }
            }

            if (nodeGroups != null)
            {
                NodeStatus = nodeGroups;
            }
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="NodeConfigurationDeployment" /> class.
        /// </summary>
        /// <param name="resourceGroupName">
        ///     The resource group name.
        /// </param>
        /// <param name="accountName">
        ///     The account name.
        /// </param>
        /// <param name="automationJob">
        ///     The Job. (optional)
        /// </param>
        /// <param name="automationJobSchedule">
        ///     The Job Schedule. (optional)
        /// </param>
        /// <param name="nodeGroups">
        ///     The list of Node Groups with status. (optional)
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// </exception>
        public NodeConfigurationDeployment(string resourceGroupName, string accountName, string nodeConfiguraionName,
                                           Management.Automation.Models.Job automationJob   = null,
                                           IList <IDictionary <string, string> > nodeGroups = null)
        {
            Requires.Argument("accountName", accountName).NotNull();
            Requires.Argument("resourceGroupName", resourceGroupName).NotNull();

            ResourceGroupName     = resourceGroupName;
            AutomationAccountName = accountName;
            NodeConfigurationName = nodeConfiguraionName;

            if (automationJob != null && automationJob.Properties == null)
            {
                return;
            }

            JobId     = automationJob.Properties.JobId;
            JobStatus = automationJob.Properties.Status;
            this.Job  = new Job(resourceGroupName, accountName, automationJob);


            if (nodeGroups != null)
            {
                this.NodeStatus = nodeGroups;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="NodeConfigurationDeployment" /> class.
        /// </summary>
        /// <param name="resourceGroupName">
        ///     The resource group name.
        /// </param>
        /// <param name="accountName">
        ///     The account name.
        /// </param>
        /// <param name="nodeConfiguraionName">
        ///     The node configuration name.
        /// </param>
        /// <param name="automationJob">
        ///     The Job.
        /// </param>
        /// <param name="automationJobSchedule">
        ///     The Job Schedule. (optional)
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// </exception>
        public NodeConfigurationDeployment(string resourceGroupName, string accountName, string nodeConfiguraionName,
                                           Management.Automation.Models.Job automationJob = null, Management.Automation.Models.JobSchedule automationJobSchedule = null)
        {
            Requires.Argument("accountName", accountName).NotNull();
            Requires.Argument("resourceGroupName", resourceGroupName).NotNull();

            ResourceGroupName     = resourceGroupName;
            AutomationAccountName = accountName;
            NodeConfigurationName = nodeConfiguraionName;

            if (automationJob == null && automationJobSchedule == null)
            {
                return;
            }
            else
            {
                if (automationJob != null)
                {
                    JobId     = automationJob.Properties.JobId;
                    JobStatus = automationJob.Properties.Status;
                    Job       = new Job(resourceGroupName, accountName, automationJob);
                }
                else
                {
                    JobScheduleId = automationJobSchedule.Properties.Id;
                    JobStatus     = Scheduled;
                    JobSchedule   = new JobSchedule(resourceGroupName, accountName, automationJobSchedule);
                }
            }

            NodeConfigurationName = nodeConfiguraionName;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="NodeConfigurationDeployment" /> class.
        /// </summary>
        /// <param name="resourceGroupName">
        ///     The resource group name.
        /// </param>
        /// <param name="accountName">
        ///     The account name.
        /// </param>
        /// <param name="automationJob">
        ///     The Job.
        /// </param>
        /// <param name="automationJobSchedule">
        ///     The Job Schedule. (optional)
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// </exception>
        public NodeConfigurationDeployment(string resourceGroupName, string accountName,
                                           string nodeConfiguraionName, Management.Automation.Models.Job automationJob = null)
        {
            Requires.Argument("accountName", accountName).NotNull();
            Requires.Argument("resourceGroupName", resourceGroupName).NotNull();

            ResourceGroupName     = resourceGroupName;
            AutomationAccountName = accountName;

            if (automationJob != null && automationJob.Properties == null)
            {
                return;
            }
            JobId    = automationJob.Properties.JobId;
            this.Job = new Job(resourceGroupName, accountName, automationJob);

            this.NodeConfigurationName = nodeConfiguraionName;
        }