| | | 1 | | // <auto-generated> |
| | | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 4 | | // license information. |
| | | 5 | | // |
| | | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 8 | | // regenerated. |
| | | 9 | | // </auto-generated> |
| | | 10 | | |
| | | 11 | | namespace Microsoft.Azure.Batch.Protocol |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Microsoft.Rest.Azure; |
| | | 15 | | using Models; |
| | | 16 | | using System.Collections; |
| | | 17 | | using System.Collections.Generic; |
| | | 18 | | using System.Threading; |
| | | 19 | | using System.Threading.Tasks; |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Extension methods for TaskOperations. |
| | | 23 | | /// </summary> |
| | | 24 | | public static partial class TaskOperationsExtensions |
| | | 25 | | { |
| | | 26 | | /// <summary> |
| | | 27 | | /// Adds a Task to the specified Job. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <remarks> |
| | | 30 | | /// The maximum lifetime of a Task from addition to completion is 180 days. If |
| | | 31 | | /// a Task has not completed within 180 days of being added it will be |
| | | 32 | | /// terminated by the Batch service and left in whatever state it was in at |
| | | 33 | | /// that time. |
| | | 34 | | /// </remarks> |
| | | 35 | | /// <param name='operations'> |
| | | 36 | | /// The operations group for this extension method. |
| | | 37 | | /// </param> |
| | | 38 | | /// <param name='jobId'> |
| | | 39 | | /// The ID of the Job to which the Task is to be added. |
| | | 40 | | /// </param> |
| | | 41 | | /// <param name='task'> |
| | | 42 | | /// The Task to be added. |
| | | 43 | | /// </param> |
| | | 44 | | /// <param name='taskAddOptions'> |
| | | 45 | | /// Additional parameters for the operation |
| | | 46 | | /// </param> |
| | | 47 | | public static TaskAddHeaders Add(this ITaskOperations operations, string jobId, TaskAddParameter task, TaskA |
| | | 48 | | { |
| | 0 | 49 | | return operations.AddAsync(jobId, task, taskAddOptions).GetAwaiter().GetResult(); |
| | | 50 | | } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Adds a Task to the specified Job. |
| | | 54 | | /// </summary> |
| | | 55 | | /// <remarks> |
| | | 56 | | /// The maximum lifetime of a Task from addition to completion is 180 days. If |
| | | 57 | | /// a Task has not completed within 180 days of being added it will be |
| | | 58 | | /// terminated by the Batch service and left in whatever state it was in at |
| | | 59 | | /// that time. |
| | | 60 | | /// </remarks> |
| | | 61 | | /// <param name='operations'> |
| | | 62 | | /// The operations group for this extension method. |
| | | 63 | | /// </param> |
| | | 64 | | /// <param name='jobId'> |
| | | 65 | | /// The ID of the Job to which the Task is to be added. |
| | | 66 | | /// </param> |
| | | 67 | | /// <param name='task'> |
| | | 68 | | /// The Task to be added. |
| | | 69 | | /// </param> |
| | | 70 | | /// <param name='taskAddOptions'> |
| | | 71 | | /// Additional parameters for the operation |
| | | 72 | | /// </param> |
| | | 73 | | /// <param name='cancellationToken'> |
| | | 74 | | /// The cancellation token. |
| | | 75 | | /// </param> |
| | | 76 | | public static async Task<TaskAddHeaders> AddAsync(this ITaskOperations operations, string jobId, TaskAddPara |
| | | 77 | | { |
| | 0 | 78 | | using (var _result = await operations.AddWithHttpMessagesAsync(jobId, task, taskAddOptions, null, cancel |
| | | 79 | | { |
| | 0 | 80 | | return _result.Headers; |
| | | 81 | | } |
| | 0 | 82 | | } |
| | | 83 | | |
| | | 84 | | /// <summary> |
| | | 85 | | /// Lists all of the Tasks that are associated with the specified Job. |
| | | 86 | | /// </summary> |
| | | 87 | | /// <remarks> |
| | | 88 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 89 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 90 | | /// information about subtasks. |
| | | 91 | | /// </remarks> |
| | | 92 | | /// <param name='operations'> |
| | | 93 | | /// The operations group for this extension method. |
| | | 94 | | /// </param> |
| | | 95 | | /// <param name='jobId'> |
| | | 96 | | /// The ID of the Job. |
| | | 97 | | /// </param> |
| | | 98 | | /// <param name='taskListOptions'> |
| | | 99 | | /// Additional parameters for the operation |
| | | 100 | | /// </param> |
| | | 101 | | public static IPage<CloudTask> List(this ITaskOperations operations, string jobId, TaskListOptions taskListO |
| | | 102 | | { |
| | 0 | 103 | | return operations.ListAsync(jobId, taskListOptions).GetAwaiter().GetResult(); |
| | | 104 | | } |
| | | 105 | | |
| | | 106 | | /// <summary> |
| | | 107 | | /// Lists all of the Tasks that are associated with the specified Job. |
| | | 108 | | /// </summary> |
| | | 109 | | /// <remarks> |
| | | 110 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 111 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 112 | | /// information about subtasks. |
| | | 113 | | /// </remarks> |
| | | 114 | | /// <param name='operations'> |
| | | 115 | | /// The operations group for this extension method. |
| | | 116 | | /// </param> |
| | | 117 | | /// <param name='jobId'> |
| | | 118 | | /// The ID of the Job. |
| | | 119 | | /// </param> |
| | | 120 | | /// <param name='taskListOptions'> |
| | | 121 | | /// Additional parameters for the operation |
| | | 122 | | /// </param> |
| | | 123 | | /// <param name='cancellationToken'> |
| | | 124 | | /// The cancellation token. |
| | | 125 | | /// </param> |
| | | 126 | | public static async Task<IPage<CloudTask>> ListAsync(this ITaskOperations operations, string jobId, TaskList |
| | | 127 | | { |
| | 0 | 128 | | using (var _result = await operations.ListWithHttpMessagesAsync(jobId, taskListOptions, null, cancellati |
| | | 129 | | { |
| | 0 | 130 | | return _result.Body; |
| | | 131 | | } |
| | 0 | 132 | | } |
| | | 133 | | |
| | | 134 | | /// <summary> |
| | | 135 | | /// Adds a collection of Tasks to the specified Job. |
| | | 136 | | /// </summary> |
| | | 137 | | /// <remarks> |
| | | 138 | | /// Note that each Task must have a unique ID. The Batch service may not return |
| | | 139 | | /// the results for each Task in the same order the Tasks were submitted in |
| | | 140 | | /// this request. If the server times out or the connection is closed during |
| | | 141 | | /// the request, the request may have been partially or fully processed, or not |
| | | 142 | | /// at all. In such cases, the user should re-issue the request. Note that it |
| | | 143 | | /// is up to the user to correctly handle failures when re-issuing a request. |
| | | 144 | | /// For example, you should use the same Task IDs during a retry so that if the |
| | | 145 | | /// prior operation succeeded, the retry will not create extra Tasks |
| | | 146 | | /// unexpectedly. If the response contains any Tasks which failed to add, a |
| | | 147 | | /// client can retry the request. In a retry, it is most efficient to resubmit |
| | | 148 | | /// only Tasks that failed to add, and to omit Tasks that were successfully |
| | | 149 | | /// added on the first attempt. The maximum lifetime of a Task from addition to |
| | | 150 | | /// completion is 180 days. If a Task has not completed within 180 days of |
| | | 151 | | /// being added it will be terminated by the Batch service and left in whatever |
| | | 152 | | /// state it was in at that time. |
| | | 153 | | /// </remarks> |
| | | 154 | | /// <param name='operations'> |
| | | 155 | | /// The operations group for this extension method. |
| | | 156 | | /// </param> |
| | | 157 | | /// <param name='jobId'> |
| | | 158 | | /// The ID of the Job to which the Task collection is to be added. |
| | | 159 | | /// </param> |
| | | 160 | | /// <param name='value'> |
| | | 161 | | /// The collection of Tasks to add. The maximum count of Tasks is 100. The |
| | | 162 | | /// total serialized size of this collection must be less than 1MB. If it is |
| | | 163 | | /// greater than 1MB (for example if each Task has 100's of resource files or |
| | | 164 | | /// environment variables), the request will fail with code |
| | | 165 | | /// 'RequestBodyTooLarge' and should be retried again with fewer Tasks. |
| | | 166 | | /// </param> |
| | | 167 | | /// <param name='taskAddCollectionOptions'> |
| | | 168 | | /// Additional parameters for the operation |
| | | 169 | | /// </param> |
| | | 170 | | public static TaskAddCollectionResult AddCollection(this ITaskOperations operations, string jobId, IList<Tas |
| | | 171 | | { |
| | 0 | 172 | | return operations.AddCollectionAsync(jobId, value, taskAddCollectionOptions).GetAwaiter().GetResult(); |
| | | 173 | | } |
| | | 174 | | |
| | | 175 | | /// <summary> |
| | | 176 | | /// Adds a collection of Tasks to the specified Job. |
| | | 177 | | /// </summary> |
| | | 178 | | /// <remarks> |
| | | 179 | | /// Note that each Task must have a unique ID. The Batch service may not return |
| | | 180 | | /// the results for each Task in the same order the Tasks were submitted in |
| | | 181 | | /// this request. If the server times out or the connection is closed during |
| | | 182 | | /// the request, the request may have been partially or fully processed, or not |
| | | 183 | | /// at all. In such cases, the user should re-issue the request. Note that it |
| | | 184 | | /// is up to the user to correctly handle failures when re-issuing a request. |
| | | 185 | | /// For example, you should use the same Task IDs during a retry so that if the |
| | | 186 | | /// prior operation succeeded, the retry will not create extra Tasks |
| | | 187 | | /// unexpectedly. If the response contains any Tasks which failed to add, a |
| | | 188 | | /// client can retry the request. In a retry, it is most efficient to resubmit |
| | | 189 | | /// only Tasks that failed to add, and to omit Tasks that were successfully |
| | | 190 | | /// added on the first attempt. The maximum lifetime of a Task from addition to |
| | | 191 | | /// completion is 180 days. If a Task has not completed within 180 days of |
| | | 192 | | /// being added it will be terminated by the Batch service and left in whatever |
| | | 193 | | /// state it was in at that time. |
| | | 194 | | /// </remarks> |
| | | 195 | | /// <param name='operations'> |
| | | 196 | | /// The operations group for this extension method. |
| | | 197 | | /// </param> |
| | | 198 | | /// <param name='jobId'> |
| | | 199 | | /// The ID of the Job to which the Task collection is to be added. |
| | | 200 | | /// </param> |
| | | 201 | | /// <param name='value'> |
| | | 202 | | /// The collection of Tasks to add. The maximum count of Tasks is 100. The |
| | | 203 | | /// total serialized size of this collection must be less than 1MB. If it is |
| | | 204 | | /// greater than 1MB (for example if each Task has 100's of resource files or |
| | | 205 | | /// environment variables), the request will fail with code |
| | | 206 | | /// 'RequestBodyTooLarge' and should be retried again with fewer Tasks. |
| | | 207 | | /// </param> |
| | | 208 | | /// <param name='taskAddCollectionOptions'> |
| | | 209 | | /// Additional parameters for the operation |
| | | 210 | | /// </param> |
| | | 211 | | /// <param name='cancellationToken'> |
| | | 212 | | /// The cancellation token. |
| | | 213 | | /// </param> |
| | | 214 | | public static async Task<TaskAddCollectionResult> AddCollectionAsync(this ITaskOperations operations, string |
| | | 215 | | { |
| | 0 | 216 | | using (var _result = await operations.AddCollectionWithHttpMessagesAsync(jobId, value, taskAddCollection |
| | | 217 | | { |
| | 0 | 218 | | return _result.Body; |
| | | 219 | | } |
| | 0 | 220 | | } |
| | | 221 | | |
| | | 222 | | /// <summary> |
| | | 223 | | /// Deletes a Task from the specified Job. |
| | | 224 | | /// </summary> |
| | | 225 | | /// <remarks> |
| | | 226 | | /// When a Task is deleted, all of the files in its directory on the Compute |
| | | 227 | | /// Node where it ran are also deleted (regardless of the retention time). For |
| | | 228 | | /// multi-instance Tasks, the delete Task operation applies synchronously to |
| | | 229 | | /// the primary task; subtasks and their files are then deleted asynchronously |
| | | 230 | | /// in the background. |
| | | 231 | | /// </remarks> |
| | | 232 | | /// <param name='operations'> |
| | | 233 | | /// The operations group for this extension method. |
| | | 234 | | /// </param> |
| | | 235 | | /// <param name='jobId'> |
| | | 236 | | /// The ID of the Job from which to delete the Task. |
| | | 237 | | /// </param> |
| | | 238 | | /// <param name='taskId'> |
| | | 239 | | /// The ID of the Task to delete. |
| | | 240 | | /// </param> |
| | | 241 | | /// <param name='taskDeleteOptions'> |
| | | 242 | | /// Additional parameters for the operation |
| | | 243 | | /// </param> |
| | | 244 | | public static TaskDeleteHeaders Delete(this ITaskOperations operations, string jobId, string taskId, TaskDel |
| | | 245 | | { |
| | 0 | 246 | | return operations.DeleteAsync(jobId, taskId, taskDeleteOptions).GetAwaiter().GetResult(); |
| | | 247 | | } |
| | | 248 | | |
| | | 249 | | /// <summary> |
| | | 250 | | /// Deletes a Task from the specified Job. |
| | | 251 | | /// </summary> |
| | | 252 | | /// <remarks> |
| | | 253 | | /// When a Task is deleted, all of the files in its directory on the Compute |
| | | 254 | | /// Node where it ran are also deleted (regardless of the retention time). For |
| | | 255 | | /// multi-instance Tasks, the delete Task operation applies synchronously to |
| | | 256 | | /// the primary task; subtasks and their files are then deleted asynchronously |
| | | 257 | | /// in the background. |
| | | 258 | | /// </remarks> |
| | | 259 | | /// <param name='operations'> |
| | | 260 | | /// The operations group for this extension method. |
| | | 261 | | /// </param> |
| | | 262 | | /// <param name='jobId'> |
| | | 263 | | /// The ID of the Job from which to delete the Task. |
| | | 264 | | /// </param> |
| | | 265 | | /// <param name='taskId'> |
| | | 266 | | /// The ID of the Task to delete. |
| | | 267 | | /// </param> |
| | | 268 | | /// <param name='taskDeleteOptions'> |
| | | 269 | | /// Additional parameters for the operation |
| | | 270 | | /// </param> |
| | | 271 | | /// <param name='cancellationToken'> |
| | | 272 | | /// The cancellation token. |
| | | 273 | | /// </param> |
| | | 274 | | public static async Task<TaskDeleteHeaders> DeleteAsync(this ITaskOperations operations, string jobId, strin |
| | | 275 | | { |
| | 0 | 276 | | using (var _result = await operations.DeleteWithHttpMessagesAsync(jobId, taskId, taskDeleteOptions, null |
| | | 277 | | { |
| | 0 | 278 | | return _result.Headers; |
| | | 279 | | } |
| | 0 | 280 | | } |
| | | 281 | | |
| | | 282 | | /// <summary> |
| | | 283 | | /// Gets information about the specified Task. |
| | | 284 | | /// </summary> |
| | | 285 | | /// <remarks> |
| | | 286 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 287 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 288 | | /// information about subtasks. |
| | | 289 | | /// </remarks> |
| | | 290 | | /// <param name='operations'> |
| | | 291 | | /// The operations group for this extension method. |
| | | 292 | | /// </param> |
| | | 293 | | /// <param name='jobId'> |
| | | 294 | | /// The ID of the Job that contains the Task. |
| | | 295 | | /// </param> |
| | | 296 | | /// <param name='taskId'> |
| | | 297 | | /// The ID of the Task to get information about. |
| | | 298 | | /// </param> |
| | | 299 | | /// <param name='taskGetOptions'> |
| | | 300 | | /// Additional parameters for the operation |
| | | 301 | | /// </param> |
| | | 302 | | public static CloudTask Get(this ITaskOperations operations, string jobId, string taskId, TaskGetOptions tas |
| | | 303 | | { |
| | 0 | 304 | | return operations.GetAsync(jobId, taskId, taskGetOptions).GetAwaiter().GetResult(); |
| | | 305 | | } |
| | | 306 | | |
| | | 307 | | /// <summary> |
| | | 308 | | /// Gets information about the specified Task. |
| | | 309 | | /// </summary> |
| | | 310 | | /// <remarks> |
| | | 311 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 312 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 313 | | /// information about subtasks. |
| | | 314 | | /// </remarks> |
| | | 315 | | /// <param name='operations'> |
| | | 316 | | /// The operations group for this extension method. |
| | | 317 | | /// </param> |
| | | 318 | | /// <param name='jobId'> |
| | | 319 | | /// The ID of the Job that contains the Task. |
| | | 320 | | /// </param> |
| | | 321 | | /// <param name='taskId'> |
| | | 322 | | /// The ID of the Task to get information about. |
| | | 323 | | /// </param> |
| | | 324 | | /// <param name='taskGetOptions'> |
| | | 325 | | /// Additional parameters for the operation |
| | | 326 | | /// </param> |
| | | 327 | | /// <param name='cancellationToken'> |
| | | 328 | | /// The cancellation token. |
| | | 329 | | /// </param> |
| | | 330 | | public static async Task<CloudTask> GetAsync(this ITaskOperations operations, string jobId, string taskId, T |
| | | 331 | | { |
| | 0 | 332 | | using (var _result = await operations.GetWithHttpMessagesAsync(jobId, taskId, taskGetOptions, null, canc |
| | | 333 | | { |
| | 0 | 334 | | return _result.Body; |
| | | 335 | | } |
| | 0 | 336 | | } |
| | | 337 | | |
| | | 338 | | /// <summary> |
| | | 339 | | /// Updates the properties of the specified Task. |
| | | 340 | | /// </summary> |
| | | 341 | | /// <param name='operations'> |
| | | 342 | | /// The operations group for this extension method. |
| | | 343 | | /// </param> |
| | | 344 | | /// <param name='jobId'> |
| | | 345 | | /// The ID of the Job containing the Task. |
| | | 346 | | /// </param> |
| | | 347 | | /// <param name='taskId'> |
| | | 348 | | /// The ID of the Task to update. |
| | | 349 | | /// </param> |
| | | 350 | | /// <param name='constraints'> |
| | | 351 | | /// Constraints that apply to this Task. If omitted, the Task is given the |
| | | 352 | | /// default constraints. For multi-instance Tasks, updating the retention time |
| | | 353 | | /// applies only to the primary Task and not subtasks. |
| | | 354 | | /// </param> |
| | | 355 | | /// <param name='taskUpdateOptions'> |
| | | 356 | | /// Additional parameters for the operation |
| | | 357 | | /// </param> |
| | | 358 | | public static TaskUpdateHeaders Update(this ITaskOperations operations, string jobId, string taskId, TaskCon |
| | | 359 | | { |
| | 0 | 360 | | return operations.UpdateAsync(jobId, taskId, constraints, taskUpdateOptions).GetAwaiter().GetResult(); |
| | | 361 | | } |
| | | 362 | | |
| | | 363 | | /// <summary> |
| | | 364 | | /// Updates the properties of the specified Task. |
| | | 365 | | /// </summary> |
| | | 366 | | /// <param name='operations'> |
| | | 367 | | /// The operations group for this extension method. |
| | | 368 | | /// </param> |
| | | 369 | | /// <param name='jobId'> |
| | | 370 | | /// The ID of the Job containing the Task. |
| | | 371 | | /// </param> |
| | | 372 | | /// <param name='taskId'> |
| | | 373 | | /// The ID of the Task to update. |
| | | 374 | | /// </param> |
| | | 375 | | /// <param name='constraints'> |
| | | 376 | | /// Constraints that apply to this Task. If omitted, the Task is given the |
| | | 377 | | /// default constraints. For multi-instance Tasks, updating the retention time |
| | | 378 | | /// applies only to the primary Task and not subtasks. |
| | | 379 | | /// </param> |
| | | 380 | | /// <param name='taskUpdateOptions'> |
| | | 381 | | /// Additional parameters for the operation |
| | | 382 | | /// </param> |
| | | 383 | | /// <param name='cancellationToken'> |
| | | 384 | | /// The cancellation token. |
| | | 385 | | /// </param> |
| | | 386 | | public static async Task<TaskUpdateHeaders> UpdateAsync(this ITaskOperations operations, string jobId, strin |
| | | 387 | | { |
| | 0 | 388 | | using (var _result = await operations.UpdateWithHttpMessagesAsync(jobId, taskId, constraints, taskUpdate |
| | | 389 | | { |
| | 0 | 390 | | return _result.Headers; |
| | | 391 | | } |
| | 0 | 392 | | } |
| | | 393 | | |
| | | 394 | | /// <summary> |
| | | 395 | | /// Lists all of the subtasks that are associated with the specified |
| | | 396 | | /// multi-instance Task. |
| | | 397 | | /// </summary> |
| | | 398 | | /// <remarks> |
| | | 399 | | /// If the Task is not a multi-instance Task then this returns an empty |
| | | 400 | | /// collection. |
| | | 401 | | /// </remarks> |
| | | 402 | | /// <param name='operations'> |
| | | 403 | | /// The operations group for this extension method. |
| | | 404 | | /// </param> |
| | | 405 | | /// <param name='jobId'> |
| | | 406 | | /// The ID of the Job. |
| | | 407 | | /// </param> |
| | | 408 | | /// <param name='taskId'> |
| | | 409 | | /// The ID of the Task. |
| | | 410 | | /// </param> |
| | | 411 | | /// <param name='taskListSubtasksOptions'> |
| | | 412 | | /// Additional parameters for the operation |
| | | 413 | | /// </param> |
| | | 414 | | public static CloudTaskListSubtasksResult ListSubtasks(this ITaskOperations operations, string jobId, string |
| | | 415 | | { |
| | 0 | 416 | | return operations.ListSubtasksAsync(jobId, taskId, taskListSubtasksOptions).GetAwaiter().GetResult(); |
| | | 417 | | } |
| | | 418 | | |
| | | 419 | | /// <summary> |
| | | 420 | | /// Lists all of the subtasks that are associated with the specified |
| | | 421 | | /// multi-instance Task. |
| | | 422 | | /// </summary> |
| | | 423 | | /// <remarks> |
| | | 424 | | /// If the Task is not a multi-instance Task then this returns an empty |
| | | 425 | | /// collection. |
| | | 426 | | /// </remarks> |
| | | 427 | | /// <param name='operations'> |
| | | 428 | | /// The operations group for this extension method. |
| | | 429 | | /// </param> |
| | | 430 | | /// <param name='jobId'> |
| | | 431 | | /// The ID of the Job. |
| | | 432 | | /// </param> |
| | | 433 | | /// <param name='taskId'> |
| | | 434 | | /// The ID of the Task. |
| | | 435 | | /// </param> |
| | | 436 | | /// <param name='taskListSubtasksOptions'> |
| | | 437 | | /// Additional parameters for the operation |
| | | 438 | | /// </param> |
| | | 439 | | /// <param name='cancellationToken'> |
| | | 440 | | /// The cancellation token. |
| | | 441 | | /// </param> |
| | | 442 | | public static async Task<CloudTaskListSubtasksResult> ListSubtasksAsync(this ITaskOperations operations, str |
| | | 443 | | { |
| | 0 | 444 | | using (var _result = await operations.ListSubtasksWithHttpMessagesAsync(jobId, taskId, taskListSubtasksO |
| | | 445 | | { |
| | 0 | 446 | | return _result.Body; |
| | | 447 | | } |
| | 0 | 448 | | } |
| | | 449 | | |
| | | 450 | | /// <summary> |
| | | 451 | | /// Terminates the specified Task. |
| | | 452 | | /// </summary> |
| | | 453 | | /// <remarks> |
| | | 454 | | /// When the Task has been terminated, it moves to the completed state. For |
| | | 455 | | /// multi-instance Tasks, the terminate Task operation applies synchronously to |
| | | 456 | | /// the primary task; subtasks are then terminated asynchronously in the |
| | | 457 | | /// background. |
| | | 458 | | /// </remarks> |
| | | 459 | | /// <param name='operations'> |
| | | 460 | | /// The operations group for this extension method. |
| | | 461 | | /// </param> |
| | | 462 | | /// <param name='jobId'> |
| | | 463 | | /// The ID of the Job containing the Task. |
| | | 464 | | /// </param> |
| | | 465 | | /// <param name='taskId'> |
| | | 466 | | /// The ID of the Task to terminate. |
| | | 467 | | /// </param> |
| | | 468 | | /// <param name='taskTerminateOptions'> |
| | | 469 | | /// Additional parameters for the operation |
| | | 470 | | /// </param> |
| | | 471 | | public static TaskTerminateHeaders Terminate(this ITaskOperations operations, string jobId, string taskId, T |
| | | 472 | | { |
| | 0 | 473 | | return operations.TerminateAsync(jobId, taskId, taskTerminateOptions).GetAwaiter().GetResult(); |
| | | 474 | | } |
| | | 475 | | |
| | | 476 | | /// <summary> |
| | | 477 | | /// Terminates the specified Task. |
| | | 478 | | /// </summary> |
| | | 479 | | /// <remarks> |
| | | 480 | | /// When the Task has been terminated, it moves to the completed state. For |
| | | 481 | | /// multi-instance Tasks, the terminate Task operation applies synchronously to |
| | | 482 | | /// the primary task; subtasks are then terminated asynchronously in the |
| | | 483 | | /// background. |
| | | 484 | | /// </remarks> |
| | | 485 | | /// <param name='operations'> |
| | | 486 | | /// The operations group for this extension method. |
| | | 487 | | /// </param> |
| | | 488 | | /// <param name='jobId'> |
| | | 489 | | /// The ID of the Job containing the Task. |
| | | 490 | | /// </param> |
| | | 491 | | /// <param name='taskId'> |
| | | 492 | | /// The ID of the Task to terminate. |
| | | 493 | | /// </param> |
| | | 494 | | /// <param name='taskTerminateOptions'> |
| | | 495 | | /// Additional parameters for the operation |
| | | 496 | | /// </param> |
| | | 497 | | /// <param name='cancellationToken'> |
| | | 498 | | /// The cancellation token. |
| | | 499 | | /// </param> |
| | | 500 | | public static async Task<TaskTerminateHeaders> TerminateAsync(this ITaskOperations operations, string jobId, |
| | | 501 | | { |
| | 0 | 502 | | using (var _result = await operations.TerminateWithHttpMessagesAsync(jobId, taskId, taskTerminateOptions |
| | | 503 | | { |
| | 0 | 504 | | return _result.Headers; |
| | | 505 | | } |
| | 0 | 506 | | } |
| | | 507 | | |
| | | 508 | | /// <summary> |
| | | 509 | | /// Reactivates a Task, allowing it to run again even if its retry count has |
| | | 510 | | /// been exhausted. |
| | | 511 | | /// </summary> |
| | | 512 | | /// <remarks> |
| | | 513 | | /// Reactivation makes a Task eligible to be retried again up to its maximum |
| | | 514 | | /// retry count. The Task's state is changed to active. As the Task is no |
| | | 515 | | /// longer in the completed state, any previous exit code or failure |
| | | 516 | | /// information is no longer available after reactivation. Each time a Task is |
| | | 517 | | /// reactivated, its retry count is reset to 0. Reactivation will fail for |
| | | 518 | | /// Tasks that are not completed or that previously completed successfully |
| | | 519 | | /// (with an exit code of 0). Additionally, it will fail if the Job has |
| | | 520 | | /// completed (or is terminating or deleting). |
| | | 521 | | /// </remarks> |
| | | 522 | | /// <param name='operations'> |
| | | 523 | | /// The operations group for this extension method. |
| | | 524 | | /// </param> |
| | | 525 | | /// <param name='jobId'> |
| | | 526 | | /// The ID of the Job containing the Task. |
| | | 527 | | /// </param> |
| | | 528 | | /// <param name='taskId'> |
| | | 529 | | /// The ID of the Task to reactivate. |
| | | 530 | | /// </param> |
| | | 531 | | /// <param name='taskReactivateOptions'> |
| | | 532 | | /// Additional parameters for the operation |
| | | 533 | | /// </param> |
| | | 534 | | public static TaskReactivateHeaders Reactivate(this ITaskOperations operations, string jobId, string taskId, |
| | | 535 | | { |
| | 0 | 536 | | return operations.ReactivateAsync(jobId, taskId, taskReactivateOptions).GetAwaiter().GetResult(); |
| | | 537 | | } |
| | | 538 | | |
| | | 539 | | /// <summary> |
| | | 540 | | /// Reactivates a Task, allowing it to run again even if its retry count has |
| | | 541 | | /// been exhausted. |
| | | 542 | | /// </summary> |
| | | 543 | | /// <remarks> |
| | | 544 | | /// Reactivation makes a Task eligible to be retried again up to its maximum |
| | | 545 | | /// retry count. The Task's state is changed to active. As the Task is no |
| | | 546 | | /// longer in the completed state, any previous exit code or failure |
| | | 547 | | /// information is no longer available after reactivation. Each time a Task is |
| | | 548 | | /// reactivated, its retry count is reset to 0. Reactivation will fail for |
| | | 549 | | /// Tasks that are not completed or that previously completed successfully |
| | | 550 | | /// (with an exit code of 0). Additionally, it will fail if the Job has |
| | | 551 | | /// completed (or is terminating or deleting). |
| | | 552 | | /// </remarks> |
| | | 553 | | /// <param name='operations'> |
| | | 554 | | /// The operations group for this extension method. |
| | | 555 | | /// </param> |
| | | 556 | | /// <param name='jobId'> |
| | | 557 | | /// The ID of the Job containing the Task. |
| | | 558 | | /// </param> |
| | | 559 | | /// <param name='taskId'> |
| | | 560 | | /// The ID of the Task to reactivate. |
| | | 561 | | /// </param> |
| | | 562 | | /// <param name='taskReactivateOptions'> |
| | | 563 | | /// Additional parameters for the operation |
| | | 564 | | /// </param> |
| | | 565 | | /// <param name='cancellationToken'> |
| | | 566 | | /// The cancellation token. |
| | | 567 | | /// </param> |
| | | 568 | | public static async Task<TaskReactivateHeaders> ReactivateAsync(this ITaskOperations operations, string jobI |
| | | 569 | | { |
| | 0 | 570 | | using (var _result = await operations.ReactivateWithHttpMessagesAsync(jobId, taskId, taskReactivateOptio |
| | | 571 | | { |
| | 0 | 572 | | return _result.Headers; |
| | | 573 | | } |
| | 0 | 574 | | } |
| | | 575 | | |
| | | 576 | | /// <summary> |
| | | 577 | | /// Lists all of the Tasks that are associated with the specified Job. |
| | | 578 | | /// </summary> |
| | | 579 | | /// <remarks> |
| | | 580 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 581 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 582 | | /// information about subtasks. |
| | | 583 | | /// </remarks> |
| | | 584 | | /// <param name='operations'> |
| | | 585 | | /// The operations group for this extension method. |
| | | 586 | | /// </param> |
| | | 587 | | /// <param name='nextPageLink'> |
| | | 588 | | /// The NextLink from the previous successful call to List operation. |
| | | 589 | | /// </param> |
| | | 590 | | /// <param name='taskListNextOptions'> |
| | | 591 | | /// Additional parameters for the operation |
| | | 592 | | /// </param> |
| | | 593 | | public static IPage<CloudTask> ListNext(this ITaskOperations operations, string nextPageLink, TaskListNextOp |
| | | 594 | | { |
| | 0 | 595 | | return operations.ListNextAsync(nextPageLink, taskListNextOptions).GetAwaiter().GetResult(); |
| | | 596 | | } |
| | | 597 | | |
| | | 598 | | /// <summary> |
| | | 599 | | /// Lists all of the Tasks that are associated with the specified Job. |
| | | 600 | | /// </summary> |
| | | 601 | | /// <remarks> |
| | | 602 | | /// For multi-instance Tasks, information such as affinityId, executionInfo and |
| | | 603 | | /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve |
| | | 604 | | /// information about subtasks. |
| | | 605 | | /// </remarks> |
| | | 606 | | /// <param name='operations'> |
| | | 607 | | /// The operations group for this extension method. |
| | | 608 | | /// </param> |
| | | 609 | | /// <param name='nextPageLink'> |
| | | 610 | | /// The NextLink from the previous successful call to List operation. |
| | | 611 | | /// </param> |
| | | 612 | | /// <param name='taskListNextOptions'> |
| | | 613 | | /// Additional parameters for the operation |
| | | 614 | | /// </param> |
| | | 615 | | /// <param name='cancellationToken'> |
| | | 616 | | /// The cancellation token. |
| | | 617 | | /// </param> |
| | | 618 | | public static async Task<IPage<CloudTask>> ListNextAsync(this ITaskOperations operations, string nextPageLin |
| | | 619 | | { |
| | 0 | 620 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, taskListNextOptions, n |
| | | 621 | | { |
| | 0 | 622 | | return _result.Body; |
| | | 623 | | } |
| | 0 | 624 | | } |
| | | 625 | | |
| | | 626 | | } |
| | | 627 | | } |