/// <summary> /// Create the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='watcherName'> /// The watcher name. /// </param> /// <param name='parameters'> /// The create or update parameters for watcher. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Watcher> CreateOrUpdateAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName, Watcher parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, watcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve a list of watchers. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Watcher> > ListByAutomationAccountNextAsync(this IWatcherOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve a list of watchers. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Watcher> > ListByAutomationAccountAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, ODataQuery <Watcher> odataQuery = default(ODataQuery <Watcher>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Stop the watcher identified by watcherName. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='watcherName'> /// Required. The watcher name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse Stop(this IWatcherOperations operations, string resourceGroupName, string automationAccount, string watcherName) { return(Task.Factory.StartNew((object s) => { return ((IWatcherOperations)s).StopAsync(resourceGroupName, automationAccount, watcherName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Retrieve next list of watchers. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </param> /// <param name='nextLink'> /// Required. The link to retrieve next set of items. /// </param> /// <returns> /// The response model for the list watcher operation. /// </returns> public static WatcherListResponse ListNext(this IWatcherOperations operations, string nextLink) { return(Task.Factory.StartNew((object s) => { return ((IWatcherOperations)s).ListNextAsync(nextLink); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Create the watcher identified by watcher name. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </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 watcher. /// </param> /// <returns> /// The response model for the create or update watcher operation. /// </returns> public static WatcherCreateOrUpdateResponse CreateOrUpdate(this IWatcherOperations operations, string resourceGroupName, string automationAccount, WatcherCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWatcherOperations)s).CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <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._linkedWorkspace = new LinkedWorkspaceOperations(this); this._modules = new ModuleOperations(this); this._objectDataTypes = new ObjectDataTypeOperations(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._watcherActions = new WatcherActionOperations(this); this._watchers = new WatcherOperations(this); this._watcherStreams = new WatcherStreamOperations(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> /// Stop the watcher identified by watcherName. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='watcherName'> /// Required. The watcher name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> StopAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccount, string watcherName) { return(operations.StopAsync(resourceGroupName, automationAccount, watcherName, CancellationToken.None)); }
/// <summary> /// Retrieve next list of watchers. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </param> /// <param name='nextLink'> /// Required. The link to retrieve next set of items. /// </param> /// <returns> /// The response model for the list watcher operation. /// </returns> public static Task <WatcherListResponse> ListNextAsync(this IWatcherOperations operations, string nextLink) { return(operations.ListNextAsync(nextLink, CancellationToken.None)); }
/// <summary> /// Retrieve a list of watchers. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </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 watcher operation. /// </returns> public static Task <WatcherListResponse> ListAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccount) { return(operations.ListAsync(resourceGroupName, automationAccount, CancellationToken.None)); }
/// <summary> /// Resume the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='watcherName'> /// The watcher name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task StopAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.StopWithHttpMessagesAsync(resourceGroupName, automationAccountName, watcherName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Create the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='watcherName'> /// The watcher name. /// </param> /// <param name='parameters'> /// The create or update parameters for watcher. /// </param> public static Watcher CreateOrUpdate(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName, Watcher parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, watcherName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a list of watchers. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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 <Watcher> ListByAutomationAccountNext(this IWatcherOperations operations, string nextPageLink) { return(operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a list of watchers. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <Watcher> ListByAutomationAccount(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, ODataQuery <Watcher> odataQuery = default(ODataQuery <Watcher>)) { return(operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='watcherName'> /// The watcher name. /// </param> public static Watcher Get(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName) { return(operations.GetAsync(resourceGroupName, automationAccountName, watcherName).GetAwaiter().GetResult()); }
/// <summary> /// Create the watcher identified by watcher name. (see /// http://aka.ms/azureautomationsdk/watcheroperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IWatcherOperations. /// </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 watcher. /// </param> /// <returns> /// The response model for the create or update watcher operation. /// </returns> public static Task <WatcherCreateOrUpdateResponse> CreateOrUpdateAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccount, WatcherCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None)); }
/// <summary> /// Resume the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </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='watcherName'> /// The watcher name. /// </param> public static void Stop(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName) { operations.StopAsync(resourceGroupName, automationAccountName, watcherName).GetAwaiter().GetResult(); }