/// <summary> /// Reinstalls the operating system on the specified compute node. /// </summary> /// <remarks> /// You can reinstall the operating system on a node only if it is in an idle /// or running state. This API can be invoked only on pools created with the /// cloud service configuration property. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node that you want to restart. /// </param> /// <param name='nodeReimageOption'> /// When to reimage the compute node and what to do with currently running /// tasks. The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// </param> /// <param name='computeNodeReimageOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ComputeNodeReimageHeaders> ReimageAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeReimageOption?nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ReimageWithHttpMessagesAsync(poolId, nodeId, nodeReimageOption, computeNodeReimageOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Lists the compute nodes in the specified pool. /// </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='computeNodeListNextOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ComputeNode> > ListNextAsync(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, computeNodeListNextOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets information about the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node that you want to get information about. /// </param> /// <param name='computeNodeGetOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ComputeNode> GetAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(poolId, nodeId, computeNodeGetOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the Remote Desktop Protocol file for the specified compute node. /// </summary> /// <remarks> /// Before you can access a node by using the RDP file, you must create a user /// account on the node. This API can only be invoked on pools created with a /// cloud service configuration. For pools created with a virtual machine /// configuration, see the GetRemoteLoginSettings API. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node for which you want to get the Remote Desktop /// Protocol file. /// </param> /// <param name='computeNodeGetRemoteDesktopOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Stream> GetRemoteDesktopAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.GetRemoteDesktopWithHttpMessagesAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); return(_result.Body); }
/// <summary> /// Adds a user account to the specified compute node. /// </summary> /// <remarks> /// You can add a user account to a node only when it is in the idle or running /// state. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the machine on which you want to create a user account. /// </param> /// <param name='user'> /// The user account to be created. /// </param> /// <param name='computeNodeAddUserOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ComputeNodeAddUserHeaders> AddUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddUserWithHttpMessagesAsync(poolId, nodeId, user, computeNodeAddUserOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.Application = new ApplicationOperations(this); this.Pool = new PoolOperations(this); this.Account = new AccountOperations(this); this.Job = new JobOperations(this); this.Certificate = new CertificateOperations(this); this.File = new FileOperations(this); this.JobSchedule = new JobScheduleOperations(this); this.Task = new TaskOperations(this); this.ComputeNode = new ComputeNodeOperations(this); this.BaseUri = new System.Uri("https://batch.core.windows.net"); this.ApiVersion = "2016-07-01.3.1"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Application = new ApplicationOperations(this); Pool = new PoolOperations(this); Account = new AccountOperations(this); Job = new JobOperations(this); Certificate = new CertificateOperations(this); File = new FileOperations(this); JobSchedule = new JobScheduleOperations(this); Task = new TaskOperations(this); ComputeNode = new ComputeNodeOperations(this); BaseUri = "{batchUrl}"; ApiVersion = "2020-03-01.11.0"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Gets the Remote Desktop Protocol file for the specified compute node. /// </summary> /// <remarks> /// Before you can access a node by using the RDP file, you must create a user /// account on the node. This API can only be invoked on pools created with a /// cloud service configuration. For pools created with a virtual machine /// configuration, see the GetRemoteLoginSettings API. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node for which you want to get the Remote Desktop /// Protocol file. /// </param> /// <param name='computeNodeGetRemoteDesktopOptions'> /// Additional parameters for the operation /// </param> public static Stream GetRemoteDesktop(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions)) { return(operations.GetRemoteDesktopAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions).GetAwaiter().GetResult()); }
/// <summary> /// Gets the settings required for remote login to a compute node. /// </summary> /// <remarks> /// Before you can remotely login to a node using the remote login settings, /// you must create a user account on the node. This API can be invoked only on /// pools created with the virtual machine configuration property. For pools /// created with a cloud service configuration, see the GetRemoteDesktop API. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node for which to obtain the remote login settings. /// </param> /// <param name='computeNodeGetRemoteLoginSettingsOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeGetRemoteLoginSettingsResult GetRemoteLoginSettings(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions)) { return(operations.GetRemoteLoginSettingsAsync(poolId, nodeId, computeNodeGetRemoteLoginSettingsOptions).GetAwaiter().GetResult()); }
/// <summary> /// Enables task scheduling on the specified compute node. /// </summary> /// <remarks> /// You can enable task scheduling on a node only if its current scheduling /// state is disabled /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node on which you want to enable task scheduling. /// </param> /// <param name='computeNodeEnableSchedulingOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ComputeNodeEnableSchedulingHeaders> EnableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EnableSchedulingWithHttpMessagesAsync(poolId, nodeId, computeNodeEnableSchedulingOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Enables task scheduling on the specified compute node. /// </summary> /// <remarks> /// You can enable task scheduling on a node only if its current scheduling /// state is disabled /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node on which you want to enable task scheduling. /// </param> /// <param name='computeNodeEnableSchedulingOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeEnableSchedulingHeaders EnableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions)) { return(operations.EnableSchedulingAsync(poolId, nodeId, computeNodeEnableSchedulingOptions).GetAwaiter().GetResult()); }
/// <summary> /// Disables task scheduling on the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the compute node on which you want to disable task scheduling. /// </param> /// <param name='nodeDisableSchedulingOption'> /// What to do with currently running tasks when disable task scheduling on /// the compute node. The default value is requeue. Possible values include: /// 'requeue', 'terminate', 'taskcompletion' /// </param> /// <param name='computeNodeDisableSchedulingOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <ComputeNodeDisableSchedulingHeaders> DisableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption?nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.DisableSchedulingWithHttpMessagesAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Lists the compute nodes in the specified pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool from which you want to list nodes. /// </param> /// <param name='computeNodeListOptions'> /// Additional parameters for the operation /// </param> public static IPage <ComputeNode> List(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions)) { return(operations.ListAsync(poolId, computeNodeListOptions).GetAwaiter().GetResult()); }
/// <summary> /// Upload Azure Batch service log files from the specified compute node to /// Azure Blob Storage. /// </summary> /// <remarks> /// This is for gathering Azure Batch service log files in an automated fashion /// from nodes if you are experiencing an error and wish to escalate to Azure /// support. The Azure Batch service log files should be shared with Azure /// support to aid in debugging issues with the Batch service. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node from which you want to upload the Azure Batch /// service log files. /// </param> /// <param name='uploadBatchServiceLogsConfiguration'> /// The Azure Batch service log files upload configuration. /// </param> /// <param name='computeNodeUploadBatchServiceLogsOptions'> /// Additional parameters for the operation /// </param> public static UploadBatchServiceLogsResult UploadBatchServiceLogs(this IComputeNodeOperations operations, string poolId, string nodeId, UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration, ComputeNodeUploadBatchServiceLogsOptions computeNodeUploadBatchServiceLogsOptions = default(ComputeNodeUploadBatchServiceLogsOptions)) { return(operations.UploadBatchServiceLogsAsync(poolId, nodeId, uploadBatchServiceLogsConfiguration, computeNodeUploadBatchServiceLogsOptions).GetAwaiter().GetResult()); }
/// <summary> /// Updates the password and expiration time of a user account on the specified /// compute node. /// </summary> /// <remarks> /// This operation replaces of all the updatable properties of the account. For /// example, if the expiryTime element is not specified, the current value is /// replaced with the default value, not left unmodified. You can update a user /// account on a node only when it is in the idle or running state. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the machine on which you want to update a user account. /// </param> /// <param name='userName'> /// The name of the user account to update. /// </param> /// <param name='nodeUpdateUserParameter'> /// The parameters for the request. /// </param> /// <param name='computeNodeUpdateUserOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeUpdateUserHeaders UpdateUser(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions)) { return(operations.UpdateUserAsync(poolId, nodeId, userName, nodeUpdateUserParameter, computeNodeUpdateUserOptions).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a user account from the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the machine on which you want to delete a user account. /// </param> /// <param name='userName'> /// The name of the user account to delete. /// </param> /// <param name='computeNodeDeleteUserOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeDeleteUserHeaders DeleteUser(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IComputeNodeOperations)s).DeleteUserAsync(poolId, nodeId, userName, computeNodeDeleteUserOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Lists the compute nodes in the specified pool. /// </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='computeNodeListNextOptions'> /// Additional parameters for the operation /// </param> public static Microsoft.Rest.Azure.IPage <ComputeNode> ListNext(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IComputeNodeOperations)s).ListNextAsync(nextPageLink, computeNodeListNextOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Lists the compute nodes in the specified pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool from which you want to list nodes. /// </param> /// <param name='computeNodeListOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Microsoft.Rest.Azure.IPage <ComputeNode> > ListAsync(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(poolId, computeNodeListOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the Remote Desktop Protocol file for the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the compute node for which you want to get the Remote Desktop /// Protocol file. /// </param> /// <param name='computeNodeGetRemoteDesktopOptions'> /// Additional parameters for the operation /// </param> public static System.IO.Stream GetRemoteDesktop(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IComputeNodeOperations)s).GetRemoteDesktopAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the settings required for remote login to a compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the compute node for which to obtain the remote login settings. /// </param> /// <param name='computeNodeGetRemoteLoginSettingsOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <ComputeNodeGetRemoteLoginSettingsResult> GetRemoteLoginSettingsAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetRemoteLoginSettingsWithHttpMessagesAsync(poolId, nodeId, computeNodeGetRemoteLoginSettingsOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Upload Azure Batch service log files from the specified compute node to /// Azure Blob Storage. /// </summary> /// <remarks> /// This is for gathering Azure Batch service log files in an automated fashion /// from nodes if you are experiencing an error and wish to escalate to Azure /// support. The Azure Batch service log files should be shared with Azure /// support to aid in debugging issues with the Batch service. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node from which you want to upload the Azure Batch /// service log files. /// </param> /// <param name='uploadBatchServiceLogsConfiguration'> /// The Azure Batch service log files upload configuration. /// </param> /// <param name='computeNodeUploadBatchServiceLogsOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <UploadBatchServiceLogsResult> UploadBatchServiceLogsAsync(this IComputeNodeOperations operations, string poolId, string nodeId, UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration, ComputeNodeUploadBatchServiceLogsOptions computeNodeUploadBatchServiceLogsOptions = default(ComputeNodeUploadBatchServiceLogsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UploadBatchServiceLogsWithHttpMessagesAsync(poolId, nodeId, uploadBatchServiceLogsConfiguration, computeNodeUploadBatchServiceLogsOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Reinstalls the operating system on the specified compute node. /// </summary> /// <remarks> /// You can reinstall the operating system on a node only if it is in an idle /// or running state. This API can be invoked only on pools created with the /// cloud service configuration property. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node that you want to restart. /// </param> /// <param name='nodeReimageOption'> /// When to reimage the compute node and what to do with currently running /// tasks. The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// </param> /// <param name='computeNodeReimageOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeReimageHeaders Reimage(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeReimageOption?nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions)) { return(operations.ReimageAsync(poolId, nodeId, nodeReimageOption, computeNodeReimageOptions).GetAwaiter().GetResult()); }
/// <summary> /// Lists the compute nodes in the specified pool. /// </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='computeNodeListNextOptions'> /// Additional parameters for the operation /// </param> public static IPage <ComputeNode> ListNext(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions)) { return(operations.ListNextAsync(nextPageLink, computeNodeListNextOptions).GetAwaiter().GetResult()); }
/// <summary> /// Updates the password or expiration time of a user account on the specified /// compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the machine on which you want to update a user account. /// </param> /// <param name='userName'> /// The name of the user account to update. /// </param> /// <param name='nodeUpdateUserParameter'> /// The parameters for the request. /// </param> /// <param name='computeNodeUpdateUserOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <ComputeNodeUpdateUserHeaders> UpdateUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.UpdateUserWithHttpMessagesAsync(poolId, nodeId, userName, nodeUpdateUserParameter, computeNodeUpdateUserOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Adds a user account to the specified compute node. /// </summary> /// <remarks> /// You can add a user account to a node only when it is in the idle or running /// state. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the machine on which you want to create a user account. /// </param> /// <param name='user'> /// The user account to be created. /// </param> /// <param name='computeNodeAddUserOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeAddUserHeaders AddUser(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions)) { return(operations.AddUserAsync(poolId, nodeId, user, computeNodeAddUserOptions).GetAwaiter().GetResult()); }
/// <summary> /// Disables task scheduling on the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the compute node on which you want to disable task scheduling. /// </param> /// <param name='nodeDisableSchedulingOption'> /// What to do with currently running tasks when disable task scheduling on /// the compute node. The default value is requeue. Possible values include: /// 'requeue', 'terminate', 'taskcompletion' /// </param> /// <param name='computeNodeDisableSchedulingOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeDisableSchedulingHeaders DisableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption?nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IComputeNodeOperations)s).DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }