/// <summary>
 /// Retrieve a list of credentials.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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 <IPage <Credential> > ListByAutomationAccountAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update a credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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='credentialName'>
 /// The parameters supplied to the Update credential operation.
 /// </param>
 /// <param name='parameters'>
 /// The parameters supplied to the Update credential operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Credential> UpdateAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, 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);
 }
示例#4
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>
 /// Delete the credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='credentialName'>
 /// Required. The name of credential.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this ICredentialOperations operations, string automationAccount, string credentialName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).DeleteAsync(automationAccount, credentialName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve a list of credentials.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.ICredentialOperations.
 /// </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 list credential operation.
 /// </returns>
 public static CredentialListResponse List(this ICredentialOperations operations, string resourceGroupName, string automationAccount)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).ListAsync(resourceGroupName, automationAccount);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Update a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.ICredentialOperations.
 /// </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 patch credential operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Patch(this ICredentialOperations operations, string resourceGroupName, string automationAccount, CredentialPatchParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).PatchAsync(resourceGroupName, automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the create credential
 /// operation.
 /// </param>
 /// <returns>
 /// The response model for the create credential operation.
 /// </returns>
 public static CredentialCreateResponse Create(this ICredentialOperations operations, string automationAccount, CredentialCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).CreateAsync(automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve next list of credentials.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The link to retrieve next set of items.
 /// </param>
 /// <returns>
 /// The response model for the list credential operation.
 /// </returns>
 public static CredentialListResponse ListNext(this ICredentialOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the create credential
 /// operation.
 /// </param>
 /// <returns>
 /// The response model for the create credential operation.
 /// </returns>
 public static Task <CredentialCreateResponse> CreateAsync(this ICredentialOperations operations, string automationAccount, CredentialCreateParameters parameters)
 {
     return(operations.CreateAsync(automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Update a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.ICredentialOperations.
 /// </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 patch credential operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> PatchAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccount, CredentialPatchParameters parameters)
 {
     return(operations.PatchAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve the credential identified by credential name.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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='credentialName'>
 /// The name of credential.
 /// </param>
 public static Credential Get(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName)
 {
     return(operations.GetAsync(resourceGroupName, automationAccountName, credentialName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete the credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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='credentialName'>
 /// The name of credential.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Delete the credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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='credentialName'>
 /// The name of credential.
 /// </param>
 public static void Delete(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName)
 {
     operations.DeleteAsync(resourceGroupName, automationAccountName, credentialName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Retrieve a list of credentials.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </summary>
 /// <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 <Credential> ListByAutomationAccountNext(this ICredentialOperations operations, string nextPageLink)
 {
     return(operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete the credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='credentialName'>
 /// Required. The name of credential.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this ICredentialOperations operations, string automationAccount, string credentialName)
 {
     return(operations.DeleteAsync(automationAccount, credentialName, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve a list of credentials.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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 IPage <Credential> ListByAutomationAccount(this ICredentialOperations operations, string resourceGroupName, string automationAccountName)
 {
     return(operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve the credential identified by credential name.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='credentialName'>
 /// Required. The name of credential.
 /// </param>
 /// <returns>
 /// The response model for the get credential operation.
 /// </returns>
 public static Task <CredentialGetResponse> GetAsync(this ICredentialOperations operations, string automationAccount, string credentialName)
 {
     return(operations.GetAsync(automationAccount, credentialName, CancellationToken.None));
 }
 /// <summary>
 /// Update a credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </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='credentialName'>
 /// The parameters supplied to the Update credential operation.
 /// </param>
 /// <param name='parameters'>
 /// The parameters supplied to the Update credential operation.
 /// </param>
 public static Credential Update(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters)
 {
     return(operations.UpdateAsync(resourceGroupName, automationAccountName, credentialName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve next list of credentials.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The link to retrieve next set of items.
 /// </param>
 /// <returns>
 /// The response model for the list credential operation.
 /// </returns>
 public static Task <CredentialListResponse> ListNextAsync(this ICredentialOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve a list of credentials.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <returns>
 /// The response model for the list credential operation.
 /// </returns>
 public static Task <CredentialListResponse> ListAsync(this ICredentialOperations operations, string automationAccount)
 {
     return(operations.ListAsync(automationAccount, CancellationToken.None));
 }