示例#1
0
        public Runbook UpdateRunbook(string automationAccountName, string runbookName, string description,
                                     IDictionary <string, string> tags, bool?logProgress, bool?logVerbose)
        {
            var runbookUpdateParameters = new RunbookUpdateParameters();

            runbookUpdateParameters.Name = runbookName;
            if (tags != null)
            {
                runbookUpdateParameters.Tags = tags;
            }
            runbookUpdateParameters.Properties = new RunbookUpdateProperties();
            if (description != null)
            {
                runbookUpdateParameters.Properties.Description = description;
            }
            if (logProgress.HasValue)
            {
                runbookUpdateParameters.Properties.LogProgress = logProgress.Value;
            }
            if (logVerbose.HasValue)
            {
                runbookUpdateParameters.Properties.LogVerbose = logVerbose.Value;
            }

            var runbook =
                this.automationManagementClient.Runbooks.Update(automationAccountName, runbookUpdateParameters).Runbook;

            return(new Runbook(automationAccountName, runbook));
        }
示例#2
0
 /// <summary>
 /// Update the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IRunbookOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The update parameters for runbook.
 /// </param>
 /// <returns>
 /// The response model for the get runbook operation.
 /// </returns>
 public static Task <RunbookGetResponse> UpdateAsync(this IRunbookOperations operations, string automationAccount, RunbookUpdateParameters parameters)
 {
     return(operations.UpdateAsync(automationAccount, parameters, CancellationToken.None));
 }
示例#3
0
 /// <summary>
 /// Update the runbook identified by runbook name.
 /// <see href="http://aka.ms/azureautomationsdk/runbookoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 /// <param name='automationAccountName'>
 /// The name of the automation account.
 /// </param>
 /// <param name='runbookName'>
 /// The runbook name.
 /// </param>
 /// <param name='parameters'>
 /// The update parameters for runbook.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Runbook> UpdateAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#4
0
 /// <summary>
 /// Update the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IRunbookOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The update parameters for runbook.
 /// </param>
 /// <returns>
 /// The response model for the get runbook operation.
 /// </returns>
 public static RunbookGetResponse Update(this IRunbookOperations operations, string automationAccount, RunbookUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookOperations)s).UpdateAsync(automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Update the runbook identified by runbook name.
 /// <see href="http://aka.ms/azureautomationsdk/runbookoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 /// <param name='automationAccountName'>
 /// The name of the automation account.
 /// </param>
 /// <param name='runbookName'>
 /// The runbook name.
 /// </param>
 /// <param name='parameters'>
 /// The update parameters for runbook.
 /// </param>
 public static Runbook Update(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters)
 {
     return(operations.UpdateAsync(resourceGroupName, automationAccountName, runbookName, parameters).GetAwaiter().GetResult());
 }