| | 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 | | /// A Task which is run when a Node joins a Pool in the Azure Batch |
| | 20 | | /// service, or when the Compute Node is rebooted or reimaged. |
| | 21 | | /// </summary> |
| | 22 | | /// <remarks> |
| | 23 | | /// Batch will retry Tasks when a recovery operation is triggered on a |
| | 24 | | /// Node. Examples of recovery operations include (but are not limited to) |
| | 25 | | /// when an unhealthy Node is rebooted or a Compute Node disappeared due to |
| | 26 | | /// host failure. Retries due to recovery operations are independent of and |
| | 27 | | /// are not counted against the maxTaskRetryCount. Even if the |
| | 28 | | /// maxTaskRetryCount is 0, an internal retry due to a recovery operation |
| | 29 | | /// may occur. Because of this, all Tasks should be idempotent. This means |
| | 30 | | /// Tasks need to tolerate being interrupted and restarted without causing |
| | 31 | | /// any corruption or duplicate data. The best practice for long running |
| | 32 | | /// Tasks is to use some form of checkpointing. In some cases the StartTask |
| | 33 | | /// may be re-run even though the Compute Node was not rebooted. Special |
| | 34 | | /// care should be taken to avoid StartTasks which create breakaway process |
| | 35 | | /// or install/launch services from the StartTask working directory, as |
| | 36 | | /// this will block Batch from being able to re-run the StartTask. |
| | 37 | | /// </remarks> |
| | 38 | | public partial class StartTask |
| | 39 | | { |
| | 40 | | /// <summary> |
| | 41 | | /// Initializes a new instance of the StartTask class. |
| | 42 | | /// </summary> |
| 1328 | 43 | | public StartTask() |
| | 44 | | { |
| | 45 | | CustomInit(); |
| 1328 | 46 | | } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Initializes a new instance of the StartTask class. |
| | 50 | | /// </summary> |
| | 51 | | /// <param name="commandLine">The command line of the |
| | 52 | | /// StartTask.</param> |
| | 53 | | /// <param name="containerSettings">The settings for the container |
| | 54 | | /// under which the StartTask runs.</param> |
| | 55 | | /// <param name="resourceFiles">A list of files that the Batch service |
| | 56 | | /// will download to the Compute Node before running the command line. |
| | 57 | | /// There is a maximum size for the list of resource files. When the |
| | 58 | | /// max size is exceeded, the request will fail and the response error |
| | 59 | | /// code will be RequestEntityTooLarge. If this occurs, the collection |
| | 60 | | /// of ResourceFiles must be reduced in size. This can be achieved |
| | 61 | | /// using .zip files, Application Packages, or Docker |
| | 62 | | /// Containers.</param> |
| | 63 | | /// <param name="environmentSettings">A list of environment variable |
| | 64 | | /// settings for the StartTask.</param> |
| | 65 | | /// <param name="userIdentity">The user identity under which the |
| | 66 | | /// StartTask runs.</param> |
| | 67 | | /// <param name="maxTaskRetryCount">The maximum number of times the |
| | 68 | | /// Task may be retried.</param> |
| | 69 | | /// <param name="waitForSuccess">Whether the Batch service should wait |
| | 70 | | /// for the StartTask to complete successfully (that is, to exit with |
| | 71 | | /// exit code 0) before scheduling any Tasks on the Compute |
| | 72 | | /// Node.</param> |
| 4 | 73 | | public StartTask(string commandLine, TaskContainerSettings containerSettings = default(TaskContainerSettings), I |
| | 74 | | { |
| 4 | 75 | | CommandLine = commandLine; |
| 4 | 76 | | ContainerSettings = containerSettings; |
| 4 | 77 | | ResourceFiles = resourceFiles; |
| 4 | 78 | | EnvironmentSettings = environmentSettings; |
| 4 | 79 | | UserIdentity = userIdentity; |
| 4 | 80 | | MaxTaskRetryCount = maxTaskRetryCount; |
| 4 | 81 | | WaitForSuccess = waitForSuccess; |
| | 82 | | CustomInit(); |
| 4 | 83 | | } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// An initialization method that performs custom operations like setting defaults |
| | 87 | | /// </summary> |
| | 88 | | partial void CustomInit(); |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Gets or sets the command line of the StartTask. |
| | 92 | | /// </summary> |
| | 93 | | /// <remarks> |
| | 94 | | /// The command line does not run under a shell, and therefore cannot |
| | 95 | | /// take advantage of shell features such as environment variable |
| | 96 | | /// expansion. If you want to take advantage of such features, you |
| | 97 | | /// should invoke the shell in the command line, for example using "cmd |
| | 98 | | /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the |
| | 99 | | /// command line refers to file paths, it should use a relative path |
| | 100 | | /// (relative to the Task working directory), or use the Batch provided |
| | 101 | | /// environment variable |
| | 102 | | /// (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). |
| | 103 | | /// </remarks> |
| | 104 | | [JsonProperty(PropertyName = "commandLine")] |
| 3187 | 105 | | public string CommandLine { get; set; } |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Gets or sets the settings for the container under which the |
| | 109 | | /// StartTask runs. |
| | 110 | | /// </summary> |
| | 111 | | /// <remarks> |
| | 112 | | /// When this is specified, all directories recursively below the |
| | 113 | | /// AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the |
| | 114 | | /// node) are mapped into the container, all Task environment variables |
| | 115 | | /// are mapped into the container, and the Task command line is |
| | 116 | | /// executed in the container. Files produced in the container outside |
| | 117 | | /// of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, |
| | 118 | | /// meaning that Batch file APIs will not be able to access those |
| | 119 | | /// files. |
| | 120 | | /// </remarks> |
| | 121 | | [JsonProperty(PropertyName = "containerSettings")] |
| 3190 | 122 | | public TaskContainerSettings ContainerSettings { get; set; } |
| | 123 | |
|
| | 124 | | /// <summary> |
| | 125 | | /// Gets or sets a list of files that the Batch service will download |
| | 126 | | /// to the Compute Node before running the command line. There is a |
| | 127 | | /// maximum size for the list of resource files. When the max size is |
| | 128 | | /// exceeded, the request will fail and the response error code will be |
| | 129 | | /// RequestEntityTooLarge. If this occurs, the collection of |
| | 130 | | /// ResourceFiles must be reduced in size. This can be achieved using |
| | 131 | | /// .zip files, Application Packages, or Docker Containers. |
| | 132 | | /// </summary> |
| | 133 | | /// <remarks> |
| | 134 | | /// Files listed under this element are located in the Task's working |
| | 135 | | /// directory. |
| | 136 | | /// </remarks> |
| | 137 | | [JsonProperty(PropertyName = "resourceFiles")] |
| 3192 | 138 | | public IList<ResourceFile> ResourceFiles { get; set; } |
| | 139 | |
|
| | 140 | | /// <summary> |
| | 141 | | /// Gets or sets a list of environment variable settings for the |
| | 142 | | /// StartTask. |
| | 143 | | /// </summary> |
| | 144 | | [JsonProperty(PropertyName = "environmentSettings")] |
| 3183 | 145 | | public IList<EnvironmentSetting> EnvironmentSettings { get; set; } |
| | 146 | |
|
| | 147 | | /// <summary> |
| | 148 | | /// Gets or sets the user identity under which the StartTask runs. |
| | 149 | | /// </summary> |
| | 150 | | /// <remarks> |
| | 151 | | /// If omitted, the Task runs as a non-administrative user unique to |
| | 152 | | /// the Task. |
| | 153 | | /// </remarks> |
| | 154 | | [JsonProperty(PropertyName = "userIdentity")] |
| 3200 | 155 | | public UserIdentity UserIdentity { get; set; } |
| | 156 | |
|
| | 157 | | /// <summary> |
| | 158 | | /// Gets or sets the maximum number of times the Task may be retried. |
| | 159 | | /// </summary> |
| | 160 | | /// <remarks> |
| | 161 | | /// The Batch service retries a Task if its exit code is nonzero. Note |
| | 162 | | /// that this value specifically controls the number of retries. The |
| | 163 | | /// Batch service will try the Task once, and may then retry up to this |
| | 164 | | /// limit. For example, if the maximum retry count is 3, Batch tries |
| | 165 | | /// the Task up to 4 times (one initial try and 3 retries). If the |
| | 166 | | /// maximum retry count is 0, the Batch service does not retry the |
| | 167 | | /// Task. If the maximum retry count is -1, the Batch service retries |
| | 168 | | /// the Task without limit. |
| | 169 | | /// </remarks> |
| | 170 | | [JsonProperty(PropertyName = "maxTaskRetryCount")] |
| 3184 | 171 | | public int? MaxTaskRetryCount { get; set; } |
| | 172 | |
|
| | 173 | | /// <summary> |
| | 174 | | /// Gets or sets whether the Batch service should wait for the |
| | 175 | | /// StartTask to complete successfully (that is, to exit with exit code |
| | 176 | | /// 0) before scheduling any Tasks on the Compute Node. |
| | 177 | | /// </summary> |
| | 178 | | /// <remarks> |
| | 179 | | /// If true and the StartTask fails on a Node, the Batch service |
| | 180 | | /// retries the StartTask up to its maximum retry count |
| | 181 | | /// (maxTaskRetryCount). If the Task has still not completed |
| | 182 | | /// successfully after all retries, then the Batch service marks the |
| | 183 | | /// Node unusable, and will not schedule Tasks to it. This condition |
| | 184 | | /// can be detected via the Compute Node state and failure info |
| | 185 | | /// details. If false, the Batch service will not wait for the |
| | 186 | | /// StartTask to complete. In this case, other Tasks can start |
| | 187 | | /// executing on the Compute Node while the StartTask is still running; |
| | 188 | | /// and even if the StartTask fails, new Tasks will continue to be |
| | 189 | | /// scheduled on the Compute Node. The default is true. |
| | 190 | | /// </remarks> |
| | 191 | | [JsonProperty(PropertyName = "waitForSuccess")] |
| 3208 | 192 | | public bool? WaitForSuccess { get; set; } |
| | 193 | |
|
| | 194 | | } |
| | 195 | | } |