/// <summary>
 /// Lists the Automation Accounts within an Azure subscription.
 /// </summary>
 /// <remarks>
 /// Retrieve a list of accounts within a given subscription.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <AutomationAccount> > ListNextAsync(this IAutomationAccountOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 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);
 }
 /// <summary>
 /// Update an automation account.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </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='parameters'>
 /// Parameters supplied to the update automation account.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AutomationAccount> UpdateAsync(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName, AutomationAccountUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         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 next list of accounts.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The link to retrieve next set of items.
 /// </param>
 /// <returns>
 /// The response model for the list account operation.
 /// </returns>
 public static AutomationAccountListResponse ListNext(this IAutomationAccountOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IAutomationAccountOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='clouldServiceName'>
 /// Required. Cloud service name.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create automation account.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself.  If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request.  If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static LongRunningOperationStatusResponse BeginCreate(this IAutomationAccountOperations operations, string clouldServiceName, AutomationAccountCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IAutomationAccountOperations)s).BeginCreateAsync(clouldServiceName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create or update automation
 /// account.
 /// </param>
 /// <returns>
 /// The response model for the create or update account operation.
 /// </returns>
 public static AutomationAccountCreateOrUpdateResponse CreateOrUpdate(this IAutomationAccountOperations operations, string resourceGroupName, AutomationAccountCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IAutomationAccountOperations)s).CreateOrUpdateAsync(resourceGroupName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve the account by account name.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <returns>
 /// The response model for the get account operation.
 /// </returns>
 public static AutomationAccountGetResponse Get(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccount)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IAutomationAccountOperations)s).GetAsync(resourceGroupName, automationAccount);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve the account by account name.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <returns>
 /// The response model for the get account operation.
 /// </returns>
 public static Task <AutomationAccountGetResponse> GetAsync(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccount)
 {
     return(operations.GetAsync(resourceGroupName, automationAccount, CancellationToken.None));
 }
 /// <summary>
 /// Lists the Automation Accounts within an Azure subscription.
 /// </summary>
 /// <remarks>
 /// Retrieve a list of accounts within a given subscription.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <AutomationAccount> ListNext(this IAutomationAccountOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists the Automation Accounts within an Azure subscription.
 /// </summary>
 /// <remarks>
 /// Retrieve a list of accounts within a given subscription.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <AutomationAccount> List(this IAutomationAccountOperations operations)
 {
     return(operations.ListAsync().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve a list of accounts within a given resource group.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <AutomationAccount> > ListByResourceGroupAsync(this IAutomationAccountOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieve a list of accounts within a given resource group.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 public static IPage <AutomationAccount> ListByResourceGroup(this IAutomationAccountOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get information about an Automation Account.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </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>
 public static AutomationAccount Get(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName)
 {
     return(operations.GetAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete an automation account.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </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='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Retrieve a list of accounts.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Optional. The name of the resource group
 /// </param>
 /// <returns>
 /// The response model for the list account operation.
 /// </returns>
 public static Task <AutomationAccountListResponse> ListAsync(this IAutomationAccountOperations operations, string resourceGroupName)
 {
     return(operations.ListAsync(resourceGroupName, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve next list of accounts.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The link to retrieve next set of items.
 /// </param>
 /// <returns>
 /// The response model for the list account operation.
 /// </returns>
 public static Task <AutomationAccountListResponse> ListNextAsync(this IAutomationAccountOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='clouldServiceName'>
 /// Required. Cloud service name.
 /// </param>
 /// <param name='automationAccountName'>
 /// Required. Automation account name.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself.  If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request.  If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <LongRunningOperationStatusResponse> DeleteAsync(this IAutomationAccountOperations operations, string clouldServiceName, string automationAccountName)
 {
     return(operations.DeleteAsync(clouldServiceName, automationAccountName, CancellationToken.None));
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create or update automation
 /// account.
 /// </param>
 /// <returns>
 /// The response model for the create or update account operation.
 /// </returns>
 public static Task <AutomationAccountCreateOrUpdateResponse> CreateOrUpdateAsync(this IAutomationAccountOperations operations, string resourceGroupName, AutomationAccountCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the patch automation account.
 /// </param>
 /// <returns>
 /// The response model for the create account operation.
 /// </returns>
 public static Task <AutomationAccountPatchResponse> PatchAsync(this IAutomationAccountOperations operations, string resourceGroupName, AutomationAccountPatchParameters parameters)
 {
     return(operations.PatchAsync(resourceGroupName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Create or update automation account.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </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='parameters'>
 /// Parameters supplied to the create or update automation account.
 /// </param>
 public static AutomationAccount CreateOrUpdate(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName, AutomationAccountCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='clouldServiceName'>
 /// Required. Cloud service name.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create automation account.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself.  If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request.  If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <LongRunningOperationStatusResponse> BeginCreateAsync(this IAutomationAccountOperations operations, string clouldServiceName, AutomationAccountCreateParameters parameters)
 {
     return(operations.BeginCreateAsync(clouldServiceName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Delete an automation account.
 /// <see href="http://aka.ms/azureautomationsdk/automationaccountoperations" />
 /// </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>
 public static void Delete(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName)
 {
     operations.DeleteAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Create an automation account.  (see
 /// http://aka.ms/azureautomationsdk/automationaccountoperations for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IAutomationAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccountName'>
 /// Required. Automation account name.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IAutomationAccountOperations operations, string resourceGroupName, string automationAccountName)
 {
     return(operations.DeleteAsync(resourceGroupName, automationAccountName, CancellationToken.None));
 }