| | 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.Models |
| | 12 | | { |
| | 13 | | using Newtonsoft.Json; |
| | 14 | | using System.Collections; |
| | 15 | | using System.Collections.Generic; |
| | 16 | | using System.Linq; |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// An Azure Batch Task. |
| | 20 | | /// </summary> |
| | 21 | | /// <remarks> |
| | 22 | | /// Batch will retry Tasks when a recovery operation is triggered on a |
| | 23 | | /// Node. Examples of recovery operations include (but are not limited to) |
| | 24 | | /// when an unhealthy Node is rebooted or a Compute Node disappeared due to |
| | 25 | | /// host failure. Retries due to recovery operations are independent of and |
| | 26 | | /// are not counted against the maxTaskRetryCount. Even if the |
| | 27 | | /// maxTaskRetryCount is 0, an internal retry due to a recovery operation |
| | 28 | | /// may occur. Because of this, all Tasks should be idempotent. This means |
| | 29 | | /// Tasks need to tolerate being interrupted and restarted without causing |
| | 30 | | /// any corruption or duplicate data. The best practice for long running |
| | 31 | | /// Tasks is to use some form of checkpointing. |
| | 32 | | /// </remarks> |
| | 33 | | public partial class CloudTask |
| | 34 | | { |
| | 35 | | /// <summary> |
| | 36 | | /// Initializes a new instance of the CloudTask class. |
| | 37 | | /// </summary> |
| 1003 | 38 | | public CloudTask() |
| | 39 | | { |
| | 40 | | CustomInit(); |
| 1003 | 41 | | } |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// Initializes a new instance of the CloudTask class. |
| | 45 | | /// </summary> |
| | 46 | | /// <param name="id">A string that uniquely identifies the Task within |
| | 47 | | /// the Job.</param> |
| | 48 | | /// <param name="displayName">A display name for the Task.</param> |
| | 49 | | /// <param name="url">The URL of the Task.</param> |
| | 50 | | /// <param name="eTag">The ETag of the Task.</param> |
| | 51 | | /// <param name="lastModified">The last modified time of the |
| | 52 | | /// Task.</param> |
| | 53 | | /// <param name="creationTime">The creation time of the Task.</param> |
| | 54 | | /// <param name="exitConditions">How the Batch service should respond |
| | 55 | | /// when the Task completes.</param> |
| | 56 | | /// <param name="state">The current state of the Task.</param> |
| | 57 | | /// <param name="stateTransitionTime">The time at which the Task |
| | 58 | | /// entered its current state.</param> |
| | 59 | | /// <param name="previousState">The previous state of the Task.</param> |
| | 60 | | /// <param name="previousStateTransitionTime">The time at which the |
| | 61 | | /// Task entered its previous state.</param> |
| | 62 | | /// <param name="commandLine">The command line of the Task.</param> |
| | 63 | | /// <param name="containerSettings">The settings for the container |
| | 64 | | /// under which the Task runs.</param> |
| | 65 | | /// <param name="resourceFiles">A list of files that the Batch service |
| | 66 | | /// will download to the Compute Node before running the command |
| | 67 | | /// line.</param> |
| | 68 | | /// <param name="outputFiles">A list of files that the Batch service |
| | 69 | | /// will upload from the Compute Node after running the command |
| | 70 | | /// line.</param> |
| | 71 | | /// <param name="environmentSettings">A list of environment variable |
| | 72 | | /// settings for the Task.</param> |
| | 73 | | /// <param name="affinityInfo">A locality hint that can be used by the |
| | 74 | | /// Batch service to select a Compute Node on which to start the new |
| | 75 | | /// Task.</param> |
| | 76 | | /// <param name="constraints">The execution constraints that apply to |
| | 77 | | /// this Task.</param> |
| | 78 | | /// <param name="userIdentity">The user identity under which the Task |
| | 79 | | /// runs.</param> |
| | 80 | | /// <param name="executionInfo">Information about the execution of the |
| | 81 | | /// Task.</param> |
| | 82 | | /// <param name="nodeInfo">Information about the Compute Node on which |
| | 83 | | /// the Task ran.</param> |
| | 84 | | /// <param name="multiInstanceSettings">An object that indicates that |
| | 85 | | /// the Task is a multi-instance Task, and contains information about |
| | 86 | | /// how to run the multi-instance Task.</param> |
| | 87 | | /// <param name="stats">Resource usage statistics for the Task.</param> |
| | 88 | | /// <param name="dependsOn">The Tasks that this Task depends |
| | 89 | | /// on.</param> |
| | 90 | | /// <param name="applicationPackageReferences">A list of Packages that |
| | 91 | | /// the Batch service will deploy to the Compute Node before running |
| | 92 | | /// the command line.</param> |
| | 93 | | /// <param name="authenticationTokenSettings">The settings for an |
| | 94 | | /// authentication token that the Task can use to perform Batch service |
| | 95 | | /// operations.</param> |
| 18 | 96 | | public CloudTask(string id = default(string), string displayName = default(string), string url = default(string) |
| | 97 | | { |
| 18 | 98 | | Id = id; |
| 18 | 99 | | DisplayName = displayName; |
| 18 | 100 | | Url = url; |
| 18 | 101 | | ETag = eTag; |
| 18 | 102 | | LastModified = lastModified; |
| 18 | 103 | | CreationTime = creationTime; |
| 18 | 104 | | ExitConditions = exitConditions; |
| 18 | 105 | | State = state; |
| 18 | 106 | | StateTransitionTime = stateTransitionTime; |
| 18 | 107 | | PreviousState = previousState; |
| 18 | 108 | | PreviousStateTransitionTime = previousStateTransitionTime; |
| 18 | 109 | | CommandLine = commandLine; |
| 18 | 110 | | ContainerSettings = containerSettings; |
| 18 | 111 | | ResourceFiles = resourceFiles; |
| 18 | 112 | | OutputFiles = outputFiles; |
| 18 | 113 | | EnvironmentSettings = environmentSettings; |
| 18 | 114 | | AffinityInfo = affinityInfo; |
| 18 | 115 | | Constraints = constraints; |
| 18 | 116 | | UserIdentity = userIdentity; |
| 18 | 117 | | ExecutionInfo = executionInfo; |
| 18 | 118 | | NodeInfo = nodeInfo; |
| 18 | 119 | | MultiInstanceSettings = multiInstanceSettings; |
| 18 | 120 | | Stats = stats; |
| 18 | 121 | | DependsOn = dependsOn; |
| 18 | 122 | | ApplicationPackageReferences = applicationPackageReferences; |
| 18 | 123 | | AuthenticationTokenSettings = authenticationTokenSettings; |
| | 124 | | CustomInit(); |
| 18 | 125 | | } |
| | 126 | |
|
| | 127 | | /// <summary> |
| | 128 | | /// An initialization method that performs custom operations like setting defaults |
| | 129 | | /// </summary> |
| | 130 | | partial void CustomInit(); |
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// Gets or sets a string that uniquely identifies the Task within the |
| | 134 | | /// Job. |
| | 135 | | /// </summary> |
| | 136 | | /// <remarks> |
| | 137 | | /// The ID can contain any combination of alphanumeric characters |
| | 138 | | /// including hyphens and underscores, and cannot contain more than 64 |
| | 139 | | /// characters. |
| | 140 | | /// </remarks> |
| | 141 | | [JsonProperty(PropertyName = "id")] |
| 2546 | 142 | | public string Id { get; set; } |
| | 143 | |
|
| | 144 | | /// <summary> |
| | 145 | | /// Gets or sets a display name for the Task. |
| | 146 | | /// </summary> |
| | 147 | | /// <remarks> |
| | 148 | | /// The display name need not be unique and can contain any Unicode |
| | 149 | | /// characters up to a maximum length of 1024. |
| | 150 | | /// </remarks> |
| | 151 | | [JsonProperty(PropertyName = "displayName")] |
| 2509 | 152 | | public string DisplayName { get; set; } |
| | 153 | |
|
| | 154 | | /// <summary> |
| | 155 | | /// Gets or sets the URL of the Task. |
| | 156 | | /// </summary> |
| | 157 | | [JsonProperty(PropertyName = "url")] |
| 2551 | 158 | | public string Url { get; set; } |
| | 159 | |
|
| | 160 | | /// <summary> |
| | 161 | | /// Gets or sets the ETag of the Task. |
| | 162 | | /// </summary> |
| | 163 | | /// <remarks> |
| | 164 | | /// This is an opaque string. You can use it to detect whether the Task |
| | 165 | | /// has changed between requests. In particular, you can be pass the |
| | 166 | | /// ETag when updating a Task to specify that your changes should take |
| | 167 | | /// effect only if nobody else has modified the Task in the meantime. |
| | 168 | | /// </remarks> |
| | 169 | | [JsonProperty(PropertyName = "eTag")] |
| 2550 | 170 | | public string ETag { get; set; } |
| | 171 | |
|
| | 172 | | /// <summary> |
| | 173 | | /// Gets or sets the last modified time of the Task. |
| | 174 | | /// </summary> |
| | 175 | | [JsonProperty(PropertyName = "lastModified")] |
| 2543 | 176 | | public System.DateTime? LastModified { get; set; } |
| | 177 | |
|
| | 178 | | /// <summary> |
| | 179 | | /// Gets or sets the creation time of the Task. |
| | 180 | | /// </summary> |
| | 181 | | [JsonProperty(PropertyName = "creationTime")] |
| 2500 | 182 | | public System.DateTime? CreationTime { get; set; } |
| | 183 | |
|
| | 184 | | /// <summary> |
| | 185 | | /// Gets or sets how the Batch service should respond when the Task |
| | 186 | | /// completes. |
| | 187 | | /// </summary> |
| | 188 | | [JsonProperty(PropertyName = "exitConditions")] |
| 2543 | 189 | | public ExitConditions ExitConditions { get; set; } |
| | 190 | |
|
| | 191 | | /// <summary> |
| | 192 | | /// Gets or sets the current state of the Task. |
| | 193 | | /// </summary> |
| | 194 | | /// <remarks> |
| | 195 | | /// Possible values include: 'active', 'preparing', 'running', |
| | 196 | | /// 'completed' |
| | 197 | | /// </remarks> |
| | 198 | | [JsonProperty(PropertyName = "state")] |
| 2556 | 199 | | public TaskState? State { get; set; } |
| | 200 | |
|
| | 201 | | /// <summary> |
| | 202 | | /// Gets or sets the time at which the Task entered its current state. |
| | 203 | | /// </summary> |
| | 204 | | [JsonProperty(PropertyName = "stateTransitionTime")] |
| 2530 | 205 | | public System.DateTime? StateTransitionTime { get; set; } |
| | 206 | |
|
| | 207 | | /// <summary> |
| | 208 | | /// Gets or sets the previous state of the Task. |
| | 209 | | /// </summary> |
| | 210 | | /// <remarks> |
| | 211 | | /// This property is not set if the Task is in its initial Active |
| | 212 | | /// state. Possible values include: 'active', 'preparing', 'running', |
| | 213 | | /// 'completed' |
| | 214 | | /// </remarks> |
| | 215 | | [JsonProperty(PropertyName = "previousState")] |
| 2518 | 216 | | public TaskState? PreviousState { get; set; } |
| | 217 | |
|
| | 218 | | /// <summary> |
| | 219 | | /// Gets or sets the time at which the Task entered its previous state. |
| | 220 | | /// </summary> |
| | 221 | | /// <remarks> |
| | 222 | | /// This property is not set if the Task is in its initial Active |
| | 223 | | /// state. |
| | 224 | | /// </remarks> |
| | 225 | | [JsonProperty(PropertyName = "previousStateTransitionTime")] |
| 2532 | 226 | | public System.DateTime? PreviousStateTransitionTime { get; set; } |
| | 227 | |
|
| | 228 | | /// <summary> |
| | 229 | | /// Gets or sets the command line of the Task. |
| | 230 | | /// </summary> |
| | 231 | | /// <remarks> |
| | 232 | | /// For multi-instance Tasks, the command line is executed as the |
| | 233 | | /// primary Task, after the primary Task and all subtasks have finished |
| | 234 | | /// executing the coordination command line. The command line does not |
| | 235 | | /// run under a shell, and therefore cannot take advantage of shell |
| | 236 | | /// features such as environment variable expansion. If you want to |
| | 237 | | /// take advantage of such features, you should invoke the shell in the |
| | 238 | | /// command line, for example using "cmd /c MyCommand" in Windows or |
| | 239 | | /// "/bin/sh -c MyCommand" in Linux. If the command line refers to file |
| | 240 | | /// paths, it should use a relative path (relative to the Task working |
| | 241 | | /// directory), or use the Batch provided environment variable |
| | 242 | | /// (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). |
| | 243 | | /// </remarks> |
| | 244 | | [JsonProperty(PropertyName = "commandLine")] |
| 2538 | 245 | | public string CommandLine { get; set; } |
| | 246 | |
|
| | 247 | | /// <summary> |
| | 248 | | /// Gets or sets the settings for the container under which the Task |
| | 249 | | /// runs. |
| | 250 | | /// </summary> |
| | 251 | | /// <remarks> |
| | 252 | | /// If the Pool that will run this Task has containerConfiguration set, |
| | 253 | | /// this must be set as well. If the Pool that will run this Task |
| | 254 | | /// doesn't have containerConfiguration set, this must not be set. When |
| | 255 | | /// this is specified, all directories recursively below the |
| | 256 | | /// AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the |
| | 257 | | /// node) are mapped into the container, all Task environment variables |
| | 258 | | /// are mapped into the container, and the Task command line is |
| | 259 | | /// executed in the container. Files produced in the container outside |
| | 260 | | /// of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, |
| | 261 | | /// meaning that Batch file APIs will not be able to access those |
| | 262 | | /// files. |
| | 263 | | /// </remarks> |
| | 264 | | [JsonProperty(PropertyName = "containerSettings")] |
| 2534 | 265 | | public TaskContainerSettings ContainerSettings { get; set; } |
| | 266 | |
|
| | 267 | | /// <summary> |
| | 268 | | /// Gets or sets a list of files that the Batch service will download |
| | 269 | | /// to the Compute Node before running the command line. |
| | 270 | | /// </summary> |
| | 271 | | /// <remarks> |
| | 272 | | /// For multi-instance Tasks, the resource files will only be |
| | 273 | | /// downloaded to the Compute Node on which the primary Task is |
| | 274 | | /// executed. There is a maximum size for the list of resource files. |
| | 275 | | /// When the max size is exceeded, the request will fail and the |
| | 276 | | /// response error code will be RequestEntityTooLarge. If this occurs, |
| | 277 | | /// the collection of ResourceFiles must be reduced in size. This can |
| | 278 | | /// be achieved using .zip files, Application Packages, or Docker |
| | 279 | | /// Containers. |
| | 280 | | /// </remarks> |
| | 281 | | [JsonProperty(PropertyName = "resourceFiles")] |
| 2531 | 282 | | public IList<ResourceFile> ResourceFiles { get; set; } |
| | 283 | |
|
| | 284 | | /// <summary> |
| | 285 | | /// Gets or sets a list of files that the Batch service will upload |
| | 286 | | /// from the Compute Node after running the command line. |
| | 287 | | /// </summary> |
| | 288 | | /// <remarks> |
| | 289 | | /// For multi-instance Tasks, the files will only be uploaded from the |
| | 290 | | /// Compute Node on which the primary Task is executed. |
| | 291 | | /// </remarks> |
| | 292 | | [JsonProperty(PropertyName = "outputFiles")] |
| 2540 | 293 | | public IList<OutputFile> OutputFiles { get; set; } |
| | 294 | |
|
| | 295 | | /// <summary> |
| | 296 | | /// Gets or sets a list of environment variable settings for the Task. |
| | 297 | | /// </summary> |
| | 298 | | [JsonProperty(PropertyName = "environmentSettings")] |
| 2527 | 299 | | public IList<EnvironmentSetting> EnvironmentSettings { get; set; } |
| | 300 | |
|
| | 301 | | /// <summary> |
| | 302 | | /// Gets or sets a locality hint that can be used by the Batch service |
| | 303 | | /// to select a Compute Node on which to start the new Task. |
| | 304 | | /// </summary> |
| | 305 | | [JsonProperty(PropertyName = "affinityInfo")] |
| 2548 | 306 | | public AffinityInformation AffinityInfo { get; set; } |
| | 307 | |
|
| | 308 | | /// <summary> |
| | 309 | | /// Gets or sets the execution constraints that apply to this Task. |
| | 310 | | /// </summary> |
| | 311 | | [JsonProperty(PropertyName = "constraints")] |
| 2545 | 312 | | public TaskConstraints Constraints { get; set; } |
| | 313 | |
|
| | 314 | | /// <summary> |
| | 315 | | /// Gets or sets the user identity under which the Task runs. |
| | 316 | | /// </summary> |
| | 317 | | /// <remarks> |
| | 318 | | /// If omitted, the Task runs as a non-administrative user unique to |
| | 319 | | /// the Task. |
| | 320 | | /// </remarks> |
| | 321 | | [JsonProperty(PropertyName = "userIdentity")] |
| 2544 | 322 | | public UserIdentity UserIdentity { get; set; } |
| | 323 | |
|
| | 324 | | /// <summary> |
| | 325 | | /// Gets or sets information about the execution of the Task. |
| | 326 | | /// </summary> |
| | 327 | | [JsonProperty(PropertyName = "executionInfo")] |
| 2557 | 328 | | public TaskExecutionInformation ExecutionInfo { get; set; } |
| | 329 | |
|
| | 330 | | /// <summary> |
| | 331 | | /// Gets or sets information about the Compute Node on which the Task |
| | 332 | | /// ran. |
| | 333 | | /// </summary> |
| | 334 | | [JsonProperty(PropertyName = "nodeInfo")] |
| 2524 | 335 | | public ComputeNodeInformation NodeInfo { get; set; } |
| | 336 | |
|
| | 337 | | /// <summary> |
| | 338 | | /// Gets or sets an object that indicates that the Task is a |
| | 339 | | /// multi-instance Task, and contains information about how to run the |
| | 340 | | /// multi-instance Task. |
| | 341 | | /// </summary> |
| | 342 | | [JsonProperty(PropertyName = "multiInstanceSettings")] |
| 2557 | 343 | | public MultiInstanceSettings MultiInstanceSettings { get; set; } |
| | 344 | |
|
| | 345 | | /// <summary> |
| | 346 | | /// Gets or sets resource usage statistics for the Task. |
| | 347 | | /// </summary> |
| | 348 | | [JsonProperty(PropertyName = "stats")] |
| 2516 | 349 | | public TaskStatistics Stats { get; set; } |
| | 350 | |
|
| | 351 | | /// <summary> |
| | 352 | | /// Gets or sets the Tasks that this Task depends on. |
| | 353 | | /// </summary> |
| | 354 | | /// <remarks> |
| | 355 | | /// This Task will not be scheduled until all Tasks that it depends on |
| | 356 | | /// have completed successfully. If any of those Tasks fail and exhaust |
| | 357 | | /// their retry counts, this Task will never be scheduled. |
| | 358 | | /// </remarks> |
| | 359 | | [JsonProperty(PropertyName = "dependsOn")] |
| 2546 | 360 | | public TaskDependencies DependsOn { get; set; } |
| | 361 | |
|
| | 362 | | /// <summary> |
| | 363 | | /// Gets or sets a list of Packages that the Batch service will deploy |
| | 364 | | /// to the Compute Node before running the command line. |
| | 365 | | /// </summary> |
| | 366 | | /// <remarks> |
| | 367 | | /// Application packages are downloaded and deployed to a shared |
| | 368 | | /// directory, not the Task working directory. Therefore, if a |
| | 369 | | /// referenced package is already on the Node, and is up to date, then |
| | 370 | | /// it is not re-downloaded; the existing copy on the Compute Node is |
| | 371 | | /// used. If a referenced Package cannot be installed, for example |
| | 372 | | /// because the package has been deleted or because download failed, |
| | 373 | | /// the Task fails. |
| | 374 | | /// </remarks> |
| | 375 | | [JsonProperty(PropertyName = "applicationPackageReferences")] |
| 2538 | 376 | | public IList<ApplicationPackageReference> ApplicationPackageReferences { get; set; } |
| | 377 | |
|
| | 378 | | /// <summary> |
| | 379 | | /// Gets or sets the settings for an authentication token that the Task |
| | 380 | | /// can use to perform Batch service operations. |
| | 381 | | /// </summary> |
| | 382 | | /// <remarks> |
| | 383 | | /// If this property is set, the Batch service provides the Task with |
| | 384 | | /// an authentication token which can be used to authenticate Batch |
| | 385 | | /// service operations without requiring an Account access key. The |
| | 386 | | /// token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment |
| | 387 | | /// variable. The operations that the Task can carry out using the |
| | 388 | | /// token depend on the settings. For example, a Task can request Job |
| | 389 | | /// permissions in order to add other Tasks to the Job, or check the |
| | 390 | | /// status of the Job or of other Tasks under the Job. |
| | 391 | | /// </remarks> |
| | 392 | | [JsonProperty(PropertyName = "authenticationTokenSettings")] |
| 2550 | 393 | | public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } |
| | 394 | |
|
| | 395 | | } |
| | 396 | | } |