| | 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.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for JobOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class JobOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Gets lifetime summary statistics for all of the Jobs in the specified |
| | 26 | | /// Account. |
| | 27 | | /// </summary> |
| | 28 | | /// <remarks> |
| | 29 | | /// Statistics are aggregated across all Jobs that have ever existed in the |
| | 30 | | /// Account, from Account creation to the last update time of the statistics. |
| | 31 | | /// The statistics may not be immediately available. The Batch service performs |
| | 32 | | /// periodic roll-up of statistics. The typical delay is about 30 minutes. |
| | 33 | | /// </remarks> |
| | 34 | | /// <param name='operations'> |
| | 35 | | /// The operations group for this extension method. |
| | 36 | | /// </param> |
| | 37 | | /// <param name='jobGetAllLifetimeStatisticsOptions'> |
| | 38 | | /// Additional parameters for the operation |
| | 39 | | /// </param> |
| | 40 | | public static JobStatistics GetAllLifetimeStatistics(this IJobOperations operations, JobGetAllLifetimeStatis |
| | 41 | | { |
| 0 | 42 | | return operations.GetAllLifetimeStatisticsAsync(jobGetAllLifetimeStatisticsOptions).GetAwaiter().GetResu |
| | 43 | | } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Gets lifetime summary statistics for all of the Jobs in the specified |
| | 47 | | /// Account. |
| | 48 | | /// </summary> |
| | 49 | | /// <remarks> |
| | 50 | | /// Statistics are aggregated across all Jobs that have ever existed in the |
| | 51 | | /// Account, from Account creation to the last update time of the statistics. |
| | 52 | | /// The statistics may not be immediately available. The Batch service performs |
| | 53 | | /// periodic roll-up of statistics. The typical delay is about 30 minutes. |
| | 54 | | /// </remarks> |
| | 55 | | /// <param name='operations'> |
| | 56 | | /// The operations group for this extension method. |
| | 57 | | /// </param> |
| | 58 | | /// <param name='jobGetAllLifetimeStatisticsOptions'> |
| | 59 | | /// Additional parameters for the operation |
| | 60 | | /// </param> |
| | 61 | | /// <param name='cancellationToken'> |
| | 62 | | /// The cancellation token. |
| | 63 | | /// </param> |
| | 64 | | public static async Task<JobStatistics> GetAllLifetimeStatisticsAsync(this IJobOperations operations, JobGet |
| | 65 | | { |
| 0 | 66 | | using (var _result = await operations.GetAllLifetimeStatisticsWithHttpMessagesAsync(jobGetAllLifetimeSta |
| | 67 | | { |
| 0 | 68 | | return _result.Body; |
| | 69 | | } |
| 0 | 70 | | } |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Deletes a Job. |
| | 74 | | /// </summary> |
| | 75 | | /// <remarks> |
| | 76 | | /// Deleting a Job also deletes all Tasks that are part of that Job, and all |
| | 77 | | /// Job statistics. This also overrides the retention period for Task data; |
| | 78 | | /// that is, if the Job contains Tasks which are still retained on Compute |
| | 79 | | /// Nodes, the Batch services deletes those Tasks' working directories and all |
| | 80 | | /// their contents. When a Delete Job request is received, the Batch service |
| | 81 | | /// sets the Job to the deleting state. All update operations on a Job that is |
| | 82 | | /// in deleting state will fail with status code 409 (Conflict), with |
| | 83 | | /// additional information indicating that the Job is being deleted. |
| | 84 | | /// </remarks> |
| | 85 | | /// <param name='operations'> |
| | 86 | | /// The operations group for this extension method. |
| | 87 | | /// </param> |
| | 88 | | /// <param name='jobId'> |
| | 89 | | /// The ID of the Job to delete. |
| | 90 | | /// </param> |
| | 91 | | /// <param name='jobDeleteOptions'> |
| | 92 | | /// Additional parameters for the operation |
| | 93 | | /// </param> |
| | 94 | | public static JobDeleteHeaders Delete(this IJobOperations operations, string jobId, JobDeleteOptions jobDele |
| | 95 | | { |
| 0 | 96 | | return operations.DeleteAsync(jobId, jobDeleteOptions).GetAwaiter().GetResult(); |
| | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// Deletes a Job. |
| | 101 | | /// </summary> |
| | 102 | | /// <remarks> |
| | 103 | | /// Deleting a Job also deletes all Tasks that are part of that Job, and all |
| | 104 | | /// Job statistics. This also overrides the retention period for Task data; |
| | 105 | | /// that is, if the Job contains Tasks which are still retained on Compute |
| | 106 | | /// Nodes, the Batch services deletes those Tasks' working directories and all |
| | 107 | | /// their contents. When a Delete Job request is received, the Batch service |
| | 108 | | /// sets the Job to the deleting state. All update operations on a Job that is |
| | 109 | | /// in deleting state will fail with status code 409 (Conflict), with |
| | 110 | | /// additional information indicating that the Job is being deleted. |
| | 111 | | /// </remarks> |
| | 112 | | /// <param name='operations'> |
| | 113 | | /// The operations group for this extension method. |
| | 114 | | /// </param> |
| | 115 | | /// <param name='jobId'> |
| | 116 | | /// The ID of the Job to delete. |
| | 117 | | /// </param> |
| | 118 | | /// <param name='jobDeleteOptions'> |
| | 119 | | /// Additional parameters for the operation |
| | 120 | | /// </param> |
| | 121 | | /// <param name='cancellationToken'> |
| | 122 | | /// The cancellation token. |
| | 123 | | /// </param> |
| | 124 | | public static async Task<JobDeleteHeaders> DeleteAsync(this IJobOperations operations, string jobId, JobDele |
| | 125 | | { |
| 0 | 126 | | using (var _result = await operations.DeleteWithHttpMessagesAsync(jobId, jobDeleteOptions, null, cancell |
| | 127 | | { |
| 0 | 128 | | return _result.Headers; |
| | 129 | | } |
| 0 | 130 | | } |
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// Gets information about the specified Job. |
| | 134 | | /// </summary> |
| | 135 | | /// <param name='operations'> |
| | 136 | | /// The operations group for this extension method. |
| | 137 | | /// </param> |
| | 138 | | /// <param name='jobId'> |
| | 139 | | /// The ID of the Job. |
| | 140 | | /// </param> |
| | 141 | | /// <param name='jobGetOptions'> |
| | 142 | | /// Additional parameters for the operation |
| | 143 | | /// </param> |
| | 144 | | public static CloudJob Get(this IJobOperations operations, string jobId, JobGetOptions jobGetOptions = defau |
| | 145 | | { |
| 0 | 146 | | return operations.GetAsync(jobId, jobGetOptions).GetAwaiter().GetResult(); |
| | 147 | | } |
| | 148 | |
|
| | 149 | | /// <summary> |
| | 150 | | /// Gets information about the specified Job. |
| | 151 | | /// </summary> |
| | 152 | | /// <param name='operations'> |
| | 153 | | /// The operations group for this extension method. |
| | 154 | | /// </param> |
| | 155 | | /// <param name='jobId'> |
| | 156 | | /// The ID of the Job. |
| | 157 | | /// </param> |
| | 158 | | /// <param name='jobGetOptions'> |
| | 159 | | /// Additional parameters for the operation |
| | 160 | | /// </param> |
| | 161 | | /// <param name='cancellationToken'> |
| | 162 | | /// The cancellation token. |
| | 163 | | /// </param> |
| | 164 | | public static async Task<CloudJob> GetAsync(this IJobOperations operations, string jobId, JobGetOptions jobG |
| | 165 | | { |
| 0 | 166 | | using (var _result = await operations.GetWithHttpMessagesAsync(jobId, jobGetOptions, null, cancellationT |
| | 167 | | { |
| 0 | 168 | | return _result.Body; |
| | 169 | | } |
| 0 | 170 | | } |
| | 171 | |
|
| | 172 | | /// <summary> |
| | 173 | | /// Updates the properties of the specified Job. |
| | 174 | | /// </summary> |
| | 175 | | /// <remarks> |
| | 176 | | /// This replaces only the Job properties specified in the request. For |
| | 177 | | /// example, if the Job has constraints, and a request does not specify the |
| | 178 | | /// constraints element, then the Job keeps the existing constraints. |
| | 179 | | /// </remarks> |
| | 180 | | /// <param name='operations'> |
| | 181 | | /// The operations group for this extension method. |
| | 182 | | /// </param> |
| | 183 | | /// <param name='jobId'> |
| | 184 | | /// The ID of the Job whose properties you want to update. |
| | 185 | | /// </param> |
| | 186 | | /// <param name='jobPatchParameter'> |
| | 187 | | /// The parameters for the request. |
| | 188 | | /// </param> |
| | 189 | | /// <param name='jobPatchOptions'> |
| | 190 | | /// Additional parameters for the operation |
| | 191 | | /// </param> |
| | 192 | | public static JobPatchHeaders Patch(this IJobOperations operations, string jobId, JobPatchParameter jobPatch |
| | 193 | | { |
| 0 | 194 | | return operations.PatchAsync(jobId, jobPatchParameter, jobPatchOptions).GetAwaiter().GetResult(); |
| | 195 | | } |
| | 196 | |
|
| | 197 | | /// <summary> |
| | 198 | | /// Updates the properties of the specified Job. |
| | 199 | | /// </summary> |
| | 200 | | /// <remarks> |
| | 201 | | /// This replaces only the Job properties specified in the request. For |
| | 202 | | /// example, if the Job has constraints, and a request does not specify the |
| | 203 | | /// constraints element, then the Job keeps the existing constraints. |
| | 204 | | /// </remarks> |
| | 205 | | /// <param name='operations'> |
| | 206 | | /// The operations group for this extension method. |
| | 207 | | /// </param> |
| | 208 | | /// <param name='jobId'> |
| | 209 | | /// The ID of the Job whose properties you want to update. |
| | 210 | | /// </param> |
| | 211 | | /// <param name='jobPatchParameter'> |
| | 212 | | /// The parameters for the request. |
| | 213 | | /// </param> |
| | 214 | | /// <param name='jobPatchOptions'> |
| | 215 | | /// Additional parameters for the operation |
| | 216 | | /// </param> |
| | 217 | | /// <param name='cancellationToken'> |
| | 218 | | /// The cancellation token. |
| | 219 | | /// </param> |
| | 220 | | public static async Task<JobPatchHeaders> PatchAsync(this IJobOperations operations, string jobId, JobPatchP |
| | 221 | | { |
| 0 | 222 | | using (var _result = await operations.PatchWithHttpMessagesAsync(jobId, jobPatchParameter, jobPatchOptio |
| | 223 | | { |
| 0 | 224 | | return _result.Headers; |
| | 225 | | } |
| 0 | 226 | | } |
| | 227 | |
|
| | 228 | | /// <summary> |
| | 229 | | /// Updates the properties of the specified Job. |
| | 230 | | /// </summary> |
| | 231 | | /// <remarks> |
| | 232 | | /// This fully replaces all the updatable properties of the Job. For example, |
| | 233 | | /// if the Job has constraints associated with it and if constraints is not |
| | 234 | | /// specified with this request, then the Batch service will remove the |
| | 235 | | /// existing constraints. |
| | 236 | | /// </remarks> |
| | 237 | | /// <param name='operations'> |
| | 238 | | /// The operations group for this extension method. |
| | 239 | | /// </param> |
| | 240 | | /// <param name='jobId'> |
| | 241 | | /// The ID of the Job whose properties you want to update. |
| | 242 | | /// </param> |
| | 243 | | /// <param name='jobUpdateParameter'> |
| | 244 | | /// The parameters for the request. |
| | 245 | | /// </param> |
| | 246 | | /// <param name='jobUpdateOptions'> |
| | 247 | | /// Additional parameters for the operation |
| | 248 | | /// </param> |
| | 249 | | public static JobUpdateHeaders Update(this IJobOperations operations, string jobId, JobUpdateParameter jobUp |
| | 250 | | { |
| 0 | 251 | | return operations.UpdateAsync(jobId, jobUpdateParameter, jobUpdateOptions).GetAwaiter().GetResult(); |
| | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> |
| | 255 | | /// Updates the properties of the specified Job. |
| | 256 | | /// </summary> |
| | 257 | | /// <remarks> |
| | 258 | | /// This fully replaces all the updatable properties of the Job. For example, |
| | 259 | | /// if the Job has constraints associated with it and if constraints is not |
| | 260 | | /// specified with this request, then the Batch service will remove the |
| | 261 | | /// existing constraints. |
| | 262 | | /// </remarks> |
| | 263 | | /// <param name='operations'> |
| | 264 | | /// The operations group for this extension method. |
| | 265 | | /// </param> |
| | 266 | | /// <param name='jobId'> |
| | 267 | | /// The ID of the Job whose properties you want to update. |
| | 268 | | /// </param> |
| | 269 | | /// <param name='jobUpdateParameter'> |
| | 270 | | /// The parameters for the request. |
| | 271 | | /// </param> |
| | 272 | | /// <param name='jobUpdateOptions'> |
| | 273 | | /// Additional parameters for the operation |
| | 274 | | /// </param> |
| | 275 | | /// <param name='cancellationToken'> |
| | 276 | | /// The cancellation token. |
| | 277 | | /// </param> |
| | 278 | | public static async Task<JobUpdateHeaders> UpdateAsync(this IJobOperations operations, string jobId, JobUpda |
| | 279 | | { |
| 0 | 280 | | using (var _result = await operations.UpdateWithHttpMessagesAsync(jobId, jobUpdateParameter, jobUpdateOp |
| | 281 | | { |
| 0 | 282 | | return _result.Headers; |
| | 283 | | } |
| 0 | 284 | | } |
| | 285 | |
|
| | 286 | | /// <summary> |
| | 287 | | /// Disables the specified Job, preventing new Tasks from running. |
| | 288 | | /// </summary> |
| | 289 | | /// <remarks> |
| | 290 | | /// The Batch Service immediately moves the Job to the disabling state. Batch |
| | 291 | | /// then uses the disableTasks parameter to determine what to do with the |
| | 292 | | /// currently running Tasks of the Job. The Job remains in the disabling state |
| | 293 | | /// until the disable operation is completed and all Tasks have been dealt with |
| | 294 | | /// according to the disableTasks option; the Job then moves to the disabled |
| | 295 | | /// state. No new Tasks are started under the Job until it moves back to active |
| | 296 | | /// state. If you try to disable a Job that is in any state other than active, |
| | 297 | | /// disabling, or disabled, the request fails with status code 409. |
| | 298 | | /// </remarks> |
| | 299 | | /// <param name='operations'> |
| | 300 | | /// The operations group for this extension method. |
| | 301 | | /// </param> |
| | 302 | | /// <param name='jobId'> |
| | 303 | | /// The ID of the Job to disable. |
| | 304 | | /// </param> |
| | 305 | | /// <param name='disableTasks'> |
| | 306 | | /// What to do with active Tasks associated with the Job. Possible values |
| | 307 | | /// include: 'requeue', 'terminate', 'wait' |
| | 308 | | /// </param> |
| | 309 | | /// <param name='jobDisableOptions'> |
| | 310 | | /// Additional parameters for the operation |
| | 311 | | /// </param> |
| | 312 | | public static JobDisableHeaders Disable(this IJobOperations operations, string jobId, DisableJobOption disab |
| | 313 | | { |
| 0 | 314 | | return operations.DisableAsync(jobId, disableTasks, jobDisableOptions).GetAwaiter().GetResult(); |
| | 315 | | } |
| | 316 | |
|
| | 317 | | /// <summary> |
| | 318 | | /// Disables the specified Job, preventing new Tasks from running. |
| | 319 | | /// </summary> |
| | 320 | | /// <remarks> |
| | 321 | | /// The Batch Service immediately moves the Job to the disabling state. Batch |
| | 322 | | /// then uses the disableTasks parameter to determine what to do with the |
| | 323 | | /// currently running Tasks of the Job. The Job remains in the disabling state |
| | 324 | | /// until the disable operation is completed and all Tasks have been dealt with |
| | 325 | | /// according to the disableTasks option; the Job then moves to the disabled |
| | 326 | | /// state. No new Tasks are started under the Job until it moves back to active |
| | 327 | | /// state. If you try to disable a Job that is in any state other than active, |
| | 328 | | /// disabling, or disabled, the request fails with status code 409. |
| | 329 | | /// </remarks> |
| | 330 | | /// <param name='operations'> |
| | 331 | | /// The operations group for this extension method. |
| | 332 | | /// </param> |
| | 333 | | /// <param name='jobId'> |
| | 334 | | /// The ID of the Job to disable. |
| | 335 | | /// </param> |
| | 336 | | /// <param name='disableTasks'> |
| | 337 | | /// What to do with active Tasks associated with the Job. Possible values |
| | 338 | | /// include: 'requeue', 'terminate', 'wait' |
| | 339 | | /// </param> |
| | 340 | | /// <param name='jobDisableOptions'> |
| | 341 | | /// Additional parameters for the operation |
| | 342 | | /// </param> |
| | 343 | | /// <param name='cancellationToken'> |
| | 344 | | /// The cancellation token. |
| | 345 | | /// </param> |
| | 346 | | public static async Task<JobDisableHeaders> DisableAsync(this IJobOperations operations, string jobId, Disab |
| | 347 | | { |
| 0 | 348 | | using (var _result = await operations.DisableWithHttpMessagesAsync(jobId, disableTasks, jobDisableOption |
| | 349 | | { |
| 0 | 350 | | return _result.Headers; |
| | 351 | | } |
| 0 | 352 | | } |
| | 353 | |
|
| | 354 | | /// <summary> |
| | 355 | | /// Enables the specified Job, allowing new Tasks to run. |
| | 356 | | /// </summary> |
| | 357 | | /// <remarks> |
| | 358 | | /// When you call this API, the Batch service sets a disabled Job to the |
| | 359 | | /// enabling state. After the this operation is completed, the Job moves to the |
| | 360 | | /// active state, and scheduling of new Tasks under the Job resumes. The Batch |
| | 361 | | /// service does not allow a Task to remain in the active state for more than |
| | 362 | | /// 180 days. Therefore, if you enable a Job containing active Tasks which were |
| | 363 | | /// added more than 180 days ago, those Tasks will not run. |
| | 364 | | /// </remarks> |
| | 365 | | /// <param name='operations'> |
| | 366 | | /// The operations group for this extension method. |
| | 367 | | /// </param> |
| | 368 | | /// <param name='jobId'> |
| | 369 | | /// The ID of the Job to enable. |
| | 370 | | /// </param> |
| | 371 | | /// <param name='jobEnableOptions'> |
| | 372 | | /// Additional parameters for the operation |
| | 373 | | /// </param> |
| | 374 | | public static JobEnableHeaders Enable(this IJobOperations operations, string jobId, JobEnableOptions jobEnab |
| | 375 | | { |
| 0 | 376 | | return operations.EnableAsync(jobId, jobEnableOptions).GetAwaiter().GetResult(); |
| | 377 | | } |
| | 378 | |
|
| | 379 | | /// <summary> |
| | 380 | | /// Enables the specified Job, allowing new Tasks to run. |
| | 381 | | /// </summary> |
| | 382 | | /// <remarks> |
| | 383 | | /// When you call this API, the Batch service sets a disabled Job to the |
| | 384 | | /// enabling state. After the this operation is completed, the Job moves to the |
| | 385 | | /// active state, and scheduling of new Tasks under the Job resumes. The Batch |
| | 386 | | /// service does not allow a Task to remain in the active state for more than |
| | 387 | | /// 180 days. Therefore, if you enable a Job containing active Tasks which were |
| | 388 | | /// added more than 180 days ago, those Tasks will not run. |
| | 389 | | /// </remarks> |
| | 390 | | /// <param name='operations'> |
| | 391 | | /// The operations group for this extension method. |
| | 392 | | /// </param> |
| | 393 | | /// <param name='jobId'> |
| | 394 | | /// The ID of the Job to enable. |
| | 395 | | /// </param> |
| | 396 | | /// <param name='jobEnableOptions'> |
| | 397 | | /// Additional parameters for the operation |
| | 398 | | /// </param> |
| | 399 | | /// <param name='cancellationToken'> |
| | 400 | | /// The cancellation token. |
| | 401 | | /// </param> |
| | 402 | | public static async Task<JobEnableHeaders> EnableAsync(this IJobOperations operations, string jobId, JobEnab |
| | 403 | | { |
| 0 | 404 | | using (var _result = await operations.EnableWithHttpMessagesAsync(jobId, jobEnableOptions, null, cancell |
| | 405 | | { |
| 0 | 406 | | return _result.Headers; |
| | 407 | | } |
| 0 | 408 | | } |
| | 409 | |
|
| | 410 | | /// <summary> |
| | 411 | | /// Terminates the specified Job, marking it as completed. |
| | 412 | | /// </summary> |
| | 413 | | /// <remarks> |
| | 414 | | /// When a Terminate Job request is received, the Batch service sets the Job to |
| | 415 | | /// the terminating state. The Batch service then terminates any running Tasks |
| | 416 | | /// associated with the Job and runs any required Job release Tasks. Then the |
| | 417 | | /// Job moves into the completed state. If there are any Tasks in the Job in |
| | 418 | | /// the active state, they will remain in the active state. Once a Job is |
| | 419 | | /// terminated, new Tasks cannot be added and any remaining active Tasks will |
| | 420 | | /// not be scheduled. |
| | 421 | | /// </remarks> |
| | 422 | | /// <param name='operations'> |
| | 423 | | /// The operations group for this extension method. |
| | 424 | | /// </param> |
| | 425 | | /// <param name='jobId'> |
| | 426 | | /// The ID of the Job to terminate. |
| | 427 | | /// </param> |
| | 428 | | /// <param name='terminateReason'> |
| | 429 | | /// The text you want to appear as the Job's TerminateReason. The default is |
| | 430 | | /// 'UserTerminate'. |
| | 431 | | /// </param> |
| | 432 | | /// <param name='jobTerminateOptions'> |
| | 433 | | /// Additional parameters for the operation |
| | 434 | | /// </param> |
| | 435 | | public static JobTerminateHeaders Terminate(this IJobOperations operations, string jobId, string terminateRe |
| | 436 | | { |
| 0 | 437 | | return operations.TerminateAsync(jobId, terminateReason, jobTerminateOptions).GetAwaiter().GetResult(); |
| | 438 | | } |
| | 439 | |
|
| | 440 | | /// <summary> |
| | 441 | | /// Terminates the specified Job, marking it as completed. |
| | 442 | | /// </summary> |
| | 443 | | /// <remarks> |
| | 444 | | /// When a Terminate Job request is received, the Batch service sets the Job to |
| | 445 | | /// the terminating state. The Batch service then terminates any running Tasks |
| | 446 | | /// associated with the Job and runs any required Job release Tasks. Then the |
| | 447 | | /// Job moves into the completed state. If there are any Tasks in the Job in |
| | 448 | | /// the active state, they will remain in the active state. Once a Job is |
| | 449 | | /// terminated, new Tasks cannot be added and any remaining active Tasks will |
| | 450 | | /// not be scheduled. |
| | 451 | | /// </remarks> |
| | 452 | | /// <param name='operations'> |
| | 453 | | /// The operations group for this extension method. |
| | 454 | | /// </param> |
| | 455 | | /// <param name='jobId'> |
| | 456 | | /// The ID of the Job to terminate. |
| | 457 | | /// </param> |
| | 458 | | /// <param name='terminateReason'> |
| | 459 | | /// The text you want to appear as the Job's TerminateReason. The default is |
| | 460 | | /// 'UserTerminate'. |
| | 461 | | /// </param> |
| | 462 | | /// <param name='jobTerminateOptions'> |
| | 463 | | /// Additional parameters for the operation |
| | 464 | | /// </param> |
| | 465 | | /// <param name='cancellationToken'> |
| | 466 | | /// The cancellation token. |
| | 467 | | /// </param> |
| | 468 | | public static async Task<JobTerminateHeaders> TerminateAsync(this IJobOperations operations, string jobId, s |
| | 469 | | { |
| 0 | 470 | | using (var _result = await operations.TerminateWithHttpMessagesAsync(jobId, terminateReason, jobTerminat |
| | 471 | | { |
| 0 | 472 | | return _result.Headers; |
| | 473 | | } |
| 0 | 474 | | } |
| | 475 | |
|
| | 476 | | /// <summary> |
| | 477 | | /// Adds a Job to the specified Account. |
| | 478 | | /// </summary> |
| | 479 | | /// <remarks> |
| | 480 | | /// The Batch service supports two ways to control the work done as part of a |
| | 481 | | /// Job. In the first approach, the user specifies a Job Manager Task. The |
| | 482 | | /// Batch service launches this Task when it is ready to start the Job. The Job |
| | 483 | | /// Manager Task controls all other Tasks that run under this Job, by using the |
| | 484 | | /// Task APIs. In the second approach, the user directly controls the execution |
| | 485 | | /// of Tasks under an active Job, by using the Task APIs. Also note: when |
| | 486 | | /// naming Jobs, avoid including sensitive information such as user names or |
| | 487 | | /// secret project names. This information may appear in telemetry logs |
| | 488 | | /// accessible to Microsoft Support engineers. |
| | 489 | | /// </remarks> |
| | 490 | | /// <param name='operations'> |
| | 491 | | /// The operations group for this extension method. |
| | 492 | | /// </param> |
| | 493 | | /// <param name='job'> |
| | 494 | | /// The Job to be added. |
| | 495 | | /// </param> |
| | 496 | | /// <param name='jobAddOptions'> |
| | 497 | | /// Additional parameters for the operation |
| | 498 | | /// </param> |
| | 499 | | public static JobAddHeaders Add(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOpt |
| | 500 | | { |
| 0 | 501 | | return operations.AddAsync(job, jobAddOptions).GetAwaiter().GetResult(); |
| | 502 | | } |
| | 503 | |
|
| | 504 | | /// <summary> |
| | 505 | | /// Adds a Job to the specified Account. |
| | 506 | | /// </summary> |
| | 507 | | /// <remarks> |
| | 508 | | /// The Batch service supports two ways to control the work done as part of a |
| | 509 | | /// Job. In the first approach, the user specifies a Job Manager Task. The |
| | 510 | | /// Batch service launches this Task when it is ready to start the Job. The Job |
| | 511 | | /// Manager Task controls all other Tasks that run under this Job, by using the |
| | 512 | | /// Task APIs. In the second approach, the user directly controls the execution |
| | 513 | | /// of Tasks under an active Job, by using the Task APIs. Also note: when |
| | 514 | | /// naming Jobs, avoid including sensitive information such as user names or |
| | 515 | | /// secret project names. This information may appear in telemetry logs |
| | 516 | | /// accessible to Microsoft Support engineers. |
| | 517 | | /// </remarks> |
| | 518 | | /// <param name='operations'> |
| | 519 | | /// The operations group for this extension method. |
| | 520 | | /// </param> |
| | 521 | | /// <param name='job'> |
| | 522 | | /// The Job to be added. |
| | 523 | | /// </param> |
| | 524 | | /// <param name='jobAddOptions'> |
| | 525 | | /// Additional parameters for the operation |
| | 526 | | /// </param> |
| | 527 | | /// <param name='cancellationToken'> |
| | 528 | | /// The cancellation token. |
| | 529 | | /// </param> |
| | 530 | | public static async Task<JobAddHeaders> AddAsync(this IJobOperations operations, JobAddParameter job, JobAdd |
| | 531 | | { |
| 0 | 532 | | using (var _result = await operations.AddWithHttpMessagesAsync(job, jobAddOptions, null, cancellationTok |
| | 533 | | { |
| 0 | 534 | | return _result.Headers; |
| | 535 | | } |
| 0 | 536 | | } |
| | 537 | |
|
| | 538 | | /// <summary> |
| | 539 | | /// Lists all of the Jobs in the specified Account. |
| | 540 | | /// </summary> |
| | 541 | | /// <param name='operations'> |
| | 542 | | /// The operations group for this extension method. |
| | 543 | | /// </param> |
| | 544 | | /// <param name='jobListOptions'> |
| | 545 | | /// Additional parameters for the operation |
| | 546 | | /// </param> |
| | 547 | | public static IPage<CloudJob> List(this IJobOperations operations, JobListOptions jobListOptions = default(J |
| | 548 | | { |
| 0 | 549 | | return operations.ListAsync(jobListOptions).GetAwaiter().GetResult(); |
| | 550 | | } |
| | 551 | |
|
| | 552 | | /// <summary> |
| | 553 | | /// Lists all of the Jobs in the specified Account. |
| | 554 | | /// </summary> |
| | 555 | | /// <param name='operations'> |
| | 556 | | /// The operations group for this extension method. |
| | 557 | | /// </param> |
| | 558 | | /// <param name='jobListOptions'> |
| | 559 | | /// Additional parameters for the operation |
| | 560 | | /// </param> |
| | 561 | | /// <param name='cancellationToken'> |
| | 562 | | /// The cancellation token. |
| | 563 | | /// </param> |
| | 564 | | public static async Task<IPage<CloudJob>> ListAsync(this IJobOperations operations, JobListOptions jobListOp |
| | 565 | | { |
| 0 | 566 | | using (var _result = await operations.ListWithHttpMessagesAsync(jobListOptions, null, cancellationToken) |
| | 567 | | { |
| 0 | 568 | | return _result.Body; |
| | 569 | | } |
| 0 | 570 | | } |
| | 571 | |
|
| | 572 | | /// <summary> |
| | 573 | | /// Lists the Jobs that have been created under the specified Job Schedule. |
| | 574 | | /// </summary> |
| | 575 | | /// <param name='operations'> |
| | 576 | | /// The operations group for this extension method. |
| | 577 | | /// </param> |
| | 578 | | /// <param name='jobScheduleId'> |
| | 579 | | /// The ID of the Job Schedule from which you want to get a list of Jobs. |
| | 580 | | /// </param> |
| | 581 | | /// <param name='jobListFromJobScheduleOptions'> |
| | 582 | | /// Additional parameters for the operation |
| | 583 | | /// </param> |
| | 584 | | public static IPage<CloudJob> ListFromJobSchedule(this IJobOperations operations, string jobScheduleId, JobL |
| | 585 | | { |
| 0 | 586 | | return operations.ListFromJobScheduleAsync(jobScheduleId, jobListFromJobScheduleOptions).GetAwaiter().Ge |
| | 587 | | } |
| | 588 | |
|
| | 589 | | /// <summary> |
| | 590 | | /// Lists the Jobs that have been created under the specified Job Schedule. |
| | 591 | | /// </summary> |
| | 592 | | /// <param name='operations'> |
| | 593 | | /// The operations group for this extension method. |
| | 594 | | /// </param> |
| | 595 | | /// <param name='jobScheduleId'> |
| | 596 | | /// The ID of the Job Schedule from which you want to get a list of Jobs. |
| | 597 | | /// </param> |
| | 598 | | /// <param name='jobListFromJobScheduleOptions'> |
| | 599 | | /// Additional parameters for the operation |
| | 600 | | /// </param> |
| | 601 | | /// <param name='cancellationToken'> |
| | 602 | | /// The cancellation token. |
| | 603 | | /// </param> |
| | 604 | | public static async Task<IPage<CloudJob>> ListFromJobScheduleAsync(this IJobOperations operations, string jo |
| | 605 | | { |
| 0 | 606 | | using (var _result = await operations.ListFromJobScheduleWithHttpMessagesAsync(jobScheduleId, jobListFro |
| | 607 | | { |
| 0 | 608 | | return _result.Body; |
| | 609 | | } |
| 0 | 610 | | } |
| | 611 | |
|
| | 612 | | /// <summary> |
| | 613 | | /// Lists the execution status of the Job Preparation and Job Release Task for |
| | 614 | | /// the specified Job across the Compute Nodes where the Job has run. |
| | 615 | | /// </summary> |
| | 616 | | /// <remarks> |
| | 617 | | /// This API returns the Job Preparation and Job Release Task status on all |
| | 618 | | /// Compute Nodes that have run the Job Preparation or Job Release Task. This |
| | 619 | | /// includes Compute Nodes which have since been removed from the Pool. If this |
| | 620 | | /// API is invoked on a Job which has no Job Preparation or Job Release Task, |
| | 621 | | /// the Batch service returns HTTP status code 409 (Conflict) with an error |
| | 622 | | /// code of JobPreparationTaskNotSpecified. |
| | 623 | | /// </remarks> |
| | 624 | | /// <param name='operations'> |
| | 625 | | /// The operations group for this extension method. |
| | 626 | | /// </param> |
| | 627 | | /// <param name='jobId'> |
| | 628 | | /// The ID of the Job. |
| | 629 | | /// </param> |
| | 630 | | /// <param name='jobListPreparationAndReleaseTaskStatusOptions'> |
| | 631 | | /// Additional parameters for the operation |
| | 632 | | /// </param> |
| | 633 | | public static IPage<JobPreparationAndReleaseTaskExecutionInformation> ListPreparationAndReleaseTaskStatus(th |
| | 634 | | { |
| 0 | 635 | | return operations.ListPreparationAndReleaseTaskStatusAsync(jobId, jobListPreparationAndReleaseTaskStatus |
| | 636 | | } |
| | 637 | |
|
| | 638 | | /// <summary> |
| | 639 | | /// Lists the execution status of the Job Preparation and Job Release Task for |
| | 640 | | /// the specified Job across the Compute Nodes where the Job has run. |
| | 641 | | /// </summary> |
| | 642 | | /// <remarks> |
| | 643 | | /// This API returns the Job Preparation and Job Release Task status on all |
| | 644 | | /// Compute Nodes that have run the Job Preparation or Job Release Task. This |
| | 645 | | /// includes Compute Nodes which have since been removed from the Pool. If this |
| | 646 | | /// API is invoked on a Job which has no Job Preparation or Job Release Task, |
| | 647 | | /// the Batch service returns HTTP status code 409 (Conflict) with an error |
| | 648 | | /// code of JobPreparationTaskNotSpecified. |
| | 649 | | /// </remarks> |
| | 650 | | /// <param name='operations'> |
| | 651 | | /// The operations group for this extension method. |
| | 652 | | /// </param> |
| | 653 | | /// <param name='jobId'> |
| | 654 | | /// The ID of the Job. |
| | 655 | | /// </param> |
| | 656 | | /// <param name='jobListPreparationAndReleaseTaskStatusOptions'> |
| | 657 | | /// Additional parameters for the operation |
| | 658 | | /// </param> |
| | 659 | | /// <param name='cancellationToken'> |
| | 660 | | /// The cancellation token. |
| | 661 | | /// </param> |
| | 662 | | public static async Task<IPage<JobPreparationAndReleaseTaskExecutionInformation>> ListPreparationAndReleaseT |
| | 663 | | { |
| 0 | 664 | | using (var _result = await operations.ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(jobId, jo |
| | 665 | | { |
| 0 | 666 | | return _result.Body; |
| | 667 | | } |
| 0 | 668 | | } |
| | 669 | |
|
| | 670 | | /// <summary> |
| | 671 | | /// Gets the Task counts for the specified Job. |
| | 672 | | /// </summary> |
| | 673 | | /// <remarks> |
| | 674 | | /// Task counts provide a count of the Tasks by active, running or completed |
| | 675 | | /// Task state, and a count of Tasks which succeeded or failed. Tasks in the |
| | 676 | | /// preparing state are counted as running. |
| | 677 | | /// </remarks> |
| | 678 | | /// <param name='operations'> |
| | 679 | | /// The operations group for this extension method. |
| | 680 | | /// </param> |
| | 681 | | /// <param name='jobId'> |
| | 682 | | /// The ID of the Job. |
| | 683 | | /// </param> |
| | 684 | | /// <param name='jobGetTaskCountsOptions'> |
| | 685 | | /// Additional parameters for the operation |
| | 686 | | /// </param> |
| | 687 | | public static TaskCounts GetTaskCounts(this IJobOperations operations, string jobId, JobGetTaskCountsOptions |
| | 688 | | { |
| 0 | 689 | | return operations.GetTaskCountsAsync(jobId, jobGetTaskCountsOptions).GetAwaiter().GetResult(); |
| | 690 | | } |
| | 691 | |
|
| | 692 | | /// <summary> |
| | 693 | | /// Gets the Task counts for the specified Job. |
| | 694 | | /// </summary> |
| | 695 | | /// <remarks> |
| | 696 | | /// Task counts provide a count of the Tasks by active, running or completed |
| | 697 | | /// Task state, and a count of Tasks which succeeded or failed. Tasks in the |
| | 698 | | /// preparing state are counted as running. |
| | 699 | | /// </remarks> |
| | 700 | | /// <param name='operations'> |
| | 701 | | /// The operations group for this extension method. |
| | 702 | | /// </param> |
| | 703 | | /// <param name='jobId'> |
| | 704 | | /// The ID of the Job. |
| | 705 | | /// </param> |
| | 706 | | /// <param name='jobGetTaskCountsOptions'> |
| | 707 | | /// Additional parameters for the operation |
| | 708 | | /// </param> |
| | 709 | | /// <param name='cancellationToken'> |
| | 710 | | /// The cancellation token. |
| | 711 | | /// </param> |
| | 712 | | public static async Task<TaskCounts> GetTaskCountsAsync(this IJobOperations operations, string jobId, JobGet |
| | 713 | | { |
| 0 | 714 | | using (var _result = await operations.GetTaskCountsWithHttpMessagesAsync(jobId, jobGetTaskCountsOptions, |
| | 715 | | { |
| 0 | 716 | | return _result.Body; |
| | 717 | | } |
| 0 | 718 | | } |
| | 719 | |
|
| | 720 | | /// <summary> |
| | 721 | | /// Lists all of the Jobs in the specified Account. |
| | 722 | | /// </summary> |
| | 723 | | /// <param name='operations'> |
| | 724 | | /// The operations group for this extension method. |
| | 725 | | /// </param> |
| | 726 | | /// <param name='nextPageLink'> |
| | 727 | | /// The NextLink from the previous successful call to List operation. |
| | 728 | | /// </param> |
| | 729 | | /// <param name='jobListNextOptions'> |
| | 730 | | /// Additional parameters for the operation |
| | 731 | | /// </param> |
| | 732 | | public static IPage<CloudJob> ListNext(this IJobOperations operations, string nextPageLink, JobListNextOptio |
| | 733 | | { |
| 0 | 734 | | return operations.ListNextAsync(nextPageLink, jobListNextOptions).GetAwaiter().GetResult(); |
| | 735 | | } |
| | 736 | |
|
| | 737 | | /// <summary> |
| | 738 | | /// Lists all of the Jobs in the specified Account. |
| | 739 | | /// </summary> |
| | 740 | | /// <param name='operations'> |
| | 741 | | /// The operations group for this extension method. |
| | 742 | | /// </param> |
| | 743 | | /// <param name='nextPageLink'> |
| | 744 | | /// The NextLink from the previous successful call to List operation. |
| | 745 | | /// </param> |
| | 746 | | /// <param name='jobListNextOptions'> |
| | 747 | | /// Additional parameters for the operation |
| | 748 | | /// </param> |
| | 749 | | /// <param name='cancellationToken'> |
| | 750 | | /// The cancellation token. |
| | 751 | | /// </param> |
| | 752 | | public static async Task<IPage<CloudJob>> ListNextAsync(this IJobOperations operations, string nextPageLink, |
| | 753 | | { |
| 0 | 754 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, jobListNextOptions, nu |
| | 755 | | { |
| 0 | 756 | | return _result.Body; |
| | 757 | | } |
| 0 | 758 | | } |
| | 759 | |
|
| | 760 | | /// <summary> |
| | 761 | | /// Lists the Jobs that have been created under the specified Job Schedule. |
| | 762 | | /// </summary> |
| | 763 | | /// <param name='operations'> |
| | 764 | | /// The operations group for this extension method. |
| | 765 | | /// </param> |
| | 766 | | /// <param name='nextPageLink'> |
| | 767 | | /// The NextLink from the previous successful call to List operation. |
| | 768 | | /// </param> |
| | 769 | | /// <param name='jobListFromJobScheduleNextOptions'> |
| | 770 | | /// Additional parameters for the operation |
| | 771 | | /// </param> |
| | 772 | | public static IPage<CloudJob> ListFromJobScheduleNext(this IJobOperations operations, string nextPageLink, J |
| | 773 | | { |
| 0 | 774 | | return operations.ListFromJobScheduleNextAsync(nextPageLink, jobListFromJobScheduleNextOptions).GetAwait |
| | 775 | | } |
| | 776 | |
|
| | 777 | | /// <summary> |
| | 778 | | /// Lists the Jobs that have been created under the specified Job Schedule. |
| | 779 | | /// </summary> |
| | 780 | | /// <param name='operations'> |
| | 781 | | /// The operations group for this extension method. |
| | 782 | | /// </param> |
| | 783 | | /// <param name='nextPageLink'> |
| | 784 | | /// The NextLink from the previous successful call to List operation. |
| | 785 | | /// </param> |
| | 786 | | /// <param name='jobListFromJobScheduleNextOptions'> |
| | 787 | | /// Additional parameters for the operation |
| | 788 | | /// </param> |
| | 789 | | /// <param name='cancellationToken'> |
| | 790 | | /// The cancellation token. |
| | 791 | | /// </param> |
| | 792 | | public static async Task<IPage<CloudJob>> ListFromJobScheduleNextAsync(this IJobOperations operations, strin |
| | 793 | | { |
| 0 | 794 | | using (var _result = await operations.ListFromJobScheduleNextWithHttpMessagesAsync(nextPageLink, jobList |
| | 795 | | { |
| 0 | 796 | | return _result.Body; |
| | 797 | | } |
| 0 | 798 | | } |
| | 799 | |
|
| | 800 | | /// <summary> |
| | 801 | | /// Lists the execution status of the Job Preparation and Job Release Task for |
| | 802 | | /// the specified Job across the Compute Nodes where the Job has run. |
| | 803 | | /// </summary> |
| | 804 | | /// <remarks> |
| | 805 | | /// This API returns the Job Preparation and Job Release Task status on all |
| | 806 | | /// Compute Nodes that have run the Job Preparation or Job Release Task. This |
| | 807 | | /// includes Compute Nodes which have since been removed from the Pool. If this |
| | 808 | | /// API is invoked on a Job which has no Job Preparation or Job Release Task, |
| | 809 | | /// the Batch service returns HTTP status code 409 (Conflict) with an error |
| | 810 | | /// code of JobPreparationTaskNotSpecified. |
| | 811 | | /// </remarks> |
| | 812 | | /// <param name='operations'> |
| | 813 | | /// The operations group for this extension method. |
| | 814 | | /// </param> |
| | 815 | | /// <param name='nextPageLink'> |
| | 816 | | /// The NextLink from the previous successful call to List operation. |
| | 817 | | /// </param> |
| | 818 | | /// <param name='jobListPreparationAndReleaseTaskStatusNextOptions'> |
| | 819 | | /// Additional parameters for the operation |
| | 820 | | /// </param> |
| | 821 | | public static IPage<JobPreparationAndReleaseTaskExecutionInformation> ListPreparationAndReleaseTaskStatusNex |
| | 822 | | { |
| 0 | 823 | | return operations.ListPreparationAndReleaseTaskStatusNextAsync(nextPageLink, jobListPreparationAndReleas |
| | 824 | | } |
| | 825 | |
|
| | 826 | | /// <summary> |
| | 827 | | /// Lists the execution status of the Job Preparation and Job Release Task for |
| | 828 | | /// the specified Job across the Compute Nodes where the Job has run. |
| | 829 | | /// </summary> |
| | 830 | | /// <remarks> |
| | 831 | | /// This API returns the Job Preparation and Job Release Task status on all |
| | 832 | | /// Compute Nodes that have run the Job Preparation or Job Release Task. This |
| | 833 | | /// includes Compute Nodes which have since been removed from the Pool. If this |
| | 834 | | /// API is invoked on a Job which has no Job Preparation or Job Release Task, |
| | 835 | | /// the Batch service returns HTTP status code 409 (Conflict) with an error |
| | 836 | | /// code of JobPreparationTaskNotSpecified. |
| | 837 | | /// </remarks> |
| | 838 | | /// <param name='operations'> |
| | 839 | | /// The operations group for this extension method. |
| | 840 | | /// </param> |
| | 841 | | /// <param name='nextPageLink'> |
| | 842 | | /// The NextLink from the previous successful call to List operation. |
| | 843 | | /// </param> |
| | 844 | | /// <param name='jobListPreparationAndReleaseTaskStatusNextOptions'> |
| | 845 | | /// Additional parameters for the operation |
| | 846 | | /// </param> |
| | 847 | | /// <param name='cancellationToken'> |
| | 848 | | /// The cancellation token. |
| | 849 | | /// </param> |
| | 850 | | public static async Task<IPage<JobPreparationAndReleaseTaskExecutionInformation>> ListPreparationAndReleaseT |
| | 851 | | { |
| 0 | 852 | | using (var _result = await operations.ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(nextP |
| | 853 | | { |
| 0 | 854 | | return _result.Body; |
| | 855 | | } |
| 0 | 856 | | } |
| | 857 | |
|
| | 858 | | } |
| | 859 | | } |