/// <summary> /// Create the runbook identified by runbook name. (see /// http://aka.ms/azureautomationsdk/runbookoperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IRunbookOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='parameters'> /// Required. The create or update parameters for runbook. /// </param> /// <returns> /// The response model for the runbook create response. /// </returns> public static Task <RunbookCreateOrUpdateResponse> CreateOrUpdateAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccount, RunbookCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None)); }
/// <summary> /// Create 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 create or update parameters for runbook. Provide either content link /// for a published runbook or draft, not both. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Runbook> CreateOrUpdateAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create the runbook identified by runbook name. (see /// http://aka.ms/azureautomationsdk/runbookoperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IRunbookOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='parameters'> /// Required. The create or update parameters for runbook. /// </param> /// <returns> /// The response model for the runbook create response. /// </returns> public static RunbookCreateOrUpdateResponse CreateOrUpdate(this IRunbookOperations operations, string resourceGroupName, string automationAccount, RunbookCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IRunbookOperations)s).CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Create 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 create or update parameters for runbook. Provide either content link /// for a published runbook or draft, not both. /// </param> public static Runbook CreateOrUpdate(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, runbookName, parameters).GetAwaiter().GetResult()); }