Exemple #1
0
 /// <summary>
 /// Undo draft edit to last known published state identified by runbook name.
 /// <see href="http://aka.ms/azureautomationsdk/runbookdraftoperations" />
 /// </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='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RunbookDraftUndoEditResult> UndoEditAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UndoEditWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the AutomationManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AutomationManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._activities         = new ActivityOperations(this);
     this._automationAccounts = new AutomationAccountOperations(this);
     this._certificates       = new CertificateOperations(this);
     this._cloudServices      = new CloudServiceOperations(this);
     this._connections        = new ConnectionOperations(this);
     this._connectionTypes    = new ConnectionTypeOperations(this);
     this._psCredentials      = new CredentialOperations(this);
     this._jobs              = new JobOperations(this);
     this._jobSchedules      = new JobScheduleOperations(this);
     this._jobStreams        = new JobStreamOperations(this);
     this._modules           = new ModuleOperations(this);
     this._runbookDraft      = new RunbookDraftOperations(this);
     this._runbooks          = new RunbookOperations(this);
     this._schedules         = new ScheduleOperations(this);
     this._testJobs          = new TestJobOperations(this);
     this._variables         = new VariableOperations(this);
     this._resourceNamespace = "automation";
     this._apiVersion        = "2013-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemple #3
0
        /// <summary>
        /// Retrieve the content of runbook draft identified by runbook name.
        /// <see href="http://aka.ms/azureautomationsdk/runbookdraftoperations" />
        /// </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='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <Stream> GetContentAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken))
        {
            var _result = await operations.GetContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false);

            _result.Request.Dispose();
            return(_result.Body);
        }
 /// <summary>
 /// Initializes a new instance of the AutomationManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AutomationManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._activities = new ActivityOperations(this);
     this._agentRegistrationInformation = new AgentRegistrationOperation(this);
     this._automationAccounts           = new AutomationAccountOperations(this);
     this._certificates       = new CertificateOperations(this);
     this._connections        = new ConnectionOperations(this);
     this._connectionTypes    = new ConnectionTypeOperations(this);
     this._psCredentials      = new CredentialOperations(this);
     this._compilationJobs    = new DscCompilationJobOperations(this);
     this._configurations     = new DscConfigurationOperations(this);
     this._nodeConfigurations = new DscNodeConfigurationOperations(this);
     this._nodes       = new DscNodeOperations(this);
     this._nodeReports = new DscNodeReportsOperations(this);
     this._hybridRunbookWorkerGroups = new HybridRunbookWorkerGroupOperations(this);
     this._jobs              = new JobOperations(this);
     this._jobSchedules      = new JobScheduleOperations(this);
     this._jobStreams        = new JobStreamOperations(this);
     this._modules           = new ModuleOperations(this);
     this._runbookDraft      = new RunbookDraftOperations(this);
     this._runbooks          = new RunbookOperations(this);
     this._schedules         = new ScheduleOperations(this);
     this._statistics        = new StatisticsOperations(this);
     this._testJobs          = new TestJobOperations(this);
     this._typeFields        = new TypeFieldOperations(this);
     this._usages            = new UsageOperations(this);
     this._variables         = new VariableOperations(this);
     this._webhooks          = new WebhookOperations(this);
     this._resourceNamespace = "Microsoft.Automation";
     this._apiVersion        = "2014-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Retrieve the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookDraftOperations.
 /// </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 parameters supplied to the publish runbook operation.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static LongRunningOperationResultResponse BeginPublish(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccount, RunbookDraftPublishParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookDraftOperations)s).BeginPublishAsync(resourceGroupName, automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookDraftOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookName'>
 /// Required. The runbook name.
 /// </param>
 /// <returns>
 /// The response model for the undoedit runbook operation.
 /// </returns>
 public static RunbookDraftUndoEditResponse UndoEdit(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccount, string runbookName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookDraftOperations)s).UndoEditAsync(resourceGroupName, automationAccount, runbookName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #7
0
 /// <summary>
 /// Updates the runbook draft with runbookStream as its content.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IRunbookDraftOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The runbook draft update parameters.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static LongRunningOperationResultResponse Update(this IRunbookDraftOperations operations, string automationAccount, RunbookDraftUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookDraftOperations)s).UpdateAsync(automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #8
0
 /// <summary>
 /// Replaces the runbook draft content.
 /// <see href="http://aka.ms/azureautomationsdk/runbookdraftoperations" />
 /// </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='runbookContent'>
 /// The runbook draft content.
 /// </param>
 public static Stream ReplaceContent(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, Stream runbookContent)
 {
     return(operations.ReplaceContentAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).GetAwaiter().GetResult());
 }
Exemple #9
0
 /// <summary>
 /// Undo draft edit to last known published state identified by runbook name.
 /// <see href="http://aka.ms/azureautomationsdk/runbookdraftoperations" />
 /// </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>
 public static RunbookDraftUndoEditResult UndoEdit(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName)
 {
     return(operations.UndoEditAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookDraftOperations.
 /// </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 parameters supplied to the publish runbook operation.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static Task <LongRunningOperationResultResponse> BeginPublishAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccount, RunbookDraftPublishParameters parameters)
 {
     return(operations.BeginPublishAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve the runbook identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookDraftOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookName'>
 /// Required. The runbook name.
 /// </param>
 /// <returns>
 /// The response model for the undoedit runbook operation.
 /// </returns>
 public static Task <RunbookDraftUndoEditResponse> UndoEditAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccount, string runbookName)
 {
     return(operations.UndoEditAsync(resourceGroupName, automationAccount, runbookName, CancellationToken.None));
 }
Exemple #12
0
 /// <summary>
 /// Updates the runbook draft with runbookStream as its content.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IRunbookDraftOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The runbook draft update parameters.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static Task <LongRunningOperationResultResponse> UpdateAsync(this IRunbookDraftOperations operations, string automationAccount, RunbookDraftUpdateParameters parameters)
 {
     return(operations.UpdateAsync(automationAccount, parameters, CancellationToken.None));
 }
Exemple #13
0
 /// <summary>
 /// Retrieve the runbook draft identified by runbook name.  (see
 /// http://aka.ms/azureautomationsdk/runbookdraftoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IRunbookDraftOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookName'>
 /// Required. The runbook name.
 /// </param>
 /// <returns>
 /// The response model for the get runbook draft operation.
 /// </returns>
 public static Task <RunbookDraftGetResponse> GetAsync(this IRunbookDraftOperations operations, string automationAccount, string runbookName)
 {
     return(operations.GetAsync(automationAccount, runbookName, CancellationToken.None));
 }