| | | 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 | | /// Specifies details of a Job Manager Task. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <remarks> |
| | | 22 | | /// The Job Manager Task is automatically started when the Job is created. |
| | | 23 | | /// The Batch service tries to schedule the Job Manager Task before any |
| | | 24 | | /// other Tasks in the Job. When shrinking a Pool, the Batch service tries |
| | | 25 | | /// to preserve Nodes where Job Manager Tasks are running for as long as |
| | | 26 | | /// possible (that is, Compute Nodes running 'normal' Tasks are removed |
| | | 27 | | /// before Compute Nodes running Job Manager Tasks). When a Job Manager |
| | | 28 | | /// Task fails and needs to be restarted, the system tries to schedule it |
| | | 29 | | /// at the highest priority. If there are no idle Compute Nodes available, |
| | | 30 | | /// the system may terminate one of the running Tasks in the Pool and |
| | | 31 | | /// return it to the queue in order to make room for the Job Manager Task |
| | | 32 | | /// to restart. Note that a Job Manager Task in one Job does not have |
| | | 33 | | /// priority over Tasks in other Jobs. Across Jobs, only Job level |
| | | 34 | | /// priorities are observed. For example, if a Job Manager in a priority 0 |
| | | 35 | | /// Job needs to be restarted, it will not displace Tasks of a priority 1 |
| | | 36 | | /// Job. Batch will retry Tasks when a recovery operation is triggered on a |
| | | 37 | | /// Node. Examples of recovery operations include (but are not limited to) |
| | | 38 | | /// when an unhealthy Node is rebooted or a Compute Node disappeared due to |
| | | 39 | | /// host failure. Retries due to recovery operations are independent of and |
| | | 40 | | /// are not counted against the maxTaskRetryCount. Even if the |
| | | 41 | | /// maxTaskRetryCount is 0, an internal retry due to a recovery operation |
| | | 42 | | /// may occur. Because of this, all Tasks should be idempotent. This means |
| | | 43 | | /// Tasks need to tolerate being interrupted and restarted without causing |
| | | 44 | | /// any corruption or duplicate data. The best practice for long running |
| | | 45 | | /// Tasks is to use some form of checkpointing. |
| | | 46 | | /// </remarks> |
| | | 47 | | public partial class JobManagerTask |
| | | 48 | | { |
| | | 49 | | /// <summary> |
| | | 50 | | /// Initializes a new instance of the JobManagerTask class. |
| | | 51 | | /// </summary> |
| | 924 | 52 | | public JobManagerTask() |
| | | 53 | | { |
| | | 54 | | CustomInit(); |
| | 924 | 55 | | } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Initializes a new instance of the JobManagerTask class. |
| | | 59 | | /// </summary> |
| | | 60 | | /// <param name="id">A string that uniquely identifies the Job Manager |
| | | 61 | | /// Task within the Job.</param> |
| | | 62 | | /// <param name="commandLine">The command line of the Job Manager |
| | | 63 | | /// Task.</param> |
| | | 64 | | /// <param name="displayName">The display name of the Job Manager |
| | | 65 | | /// Task.</param> |
| | | 66 | | /// <param name="containerSettings">The settings for the container |
| | | 67 | | /// under which the Job Manager Task runs.</param> |
| | | 68 | | /// <param name="resourceFiles">A list of files that the Batch service |
| | | 69 | | /// will download to the Compute Node before running the command |
| | | 70 | | /// line.</param> |
| | | 71 | | /// <param name="outputFiles">A list of files that the Batch service |
| | | 72 | | /// will upload from the Compute Node after running the command |
| | | 73 | | /// line.</param> |
| | | 74 | | /// <param name="environmentSettings">A list of environment variable |
| | | 75 | | /// settings for the Job Manager Task.</param> |
| | | 76 | | /// <param name="constraints">Constraints that apply to the Job Manager |
| | | 77 | | /// Task.</param> |
| | | 78 | | /// <param name="killJobOnCompletion">Whether completion of the Job |
| | | 79 | | /// Manager Task signifies completion of the entire Job.</param> |
| | | 80 | | /// <param name="userIdentity">The user identity under which the Job |
| | | 81 | | /// Manager Task runs.</param> |
| | | 82 | | /// <param name="runExclusive">Whether the Job Manager Task requires |
| | | 83 | | /// exclusive use of the Compute Node where it runs.</param> |
| | | 84 | | /// <param name="applicationPackageReferences">A list of Application |
| | | 85 | | /// Packages that the Batch service will deploy to the Compute Node |
| | | 86 | | /// before running the command line.</param> |
| | | 87 | | /// <param name="authenticationTokenSettings">The settings for an |
| | | 88 | | /// authentication token that the Task can use to perform Batch service |
| | | 89 | | /// operations.</param> |
| | | 90 | | /// <param name="allowLowPriorityNode">Whether the Job Manager Task may |
| | | 91 | | /// run on a low-priority Compute Node.</param> |
| | 0 | 92 | | public JobManagerTask(string id, string commandLine, string displayName = default(string), TaskContainerSettings |
| | | 93 | | { |
| | 0 | 94 | | Id = id; |
| | 0 | 95 | | DisplayName = displayName; |
| | 0 | 96 | | CommandLine = commandLine; |
| | 0 | 97 | | ContainerSettings = containerSettings; |
| | 0 | 98 | | ResourceFiles = resourceFiles; |
| | 0 | 99 | | OutputFiles = outputFiles; |
| | 0 | 100 | | EnvironmentSettings = environmentSettings; |
| | 0 | 101 | | Constraints = constraints; |
| | 0 | 102 | | KillJobOnCompletion = killJobOnCompletion; |
| | 0 | 103 | | UserIdentity = userIdentity; |
| | 0 | 104 | | RunExclusive = runExclusive; |
| | 0 | 105 | | ApplicationPackageReferences = applicationPackageReferences; |
| | 0 | 106 | | AuthenticationTokenSettings = authenticationTokenSettings; |
| | 0 | 107 | | AllowLowPriorityNode = allowLowPriorityNode; |
| | | 108 | | CustomInit(); |
| | 0 | 109 | | } |
| | | 110 | | |
| | | 111 | | /// <summary> |
| | | 112 | | /// An initialization method that performs custom operations like setting defaults |
| | | 113 | | /// </summary> |
| | | 114 | | partial void CustomInit(); |
| | | 115 | | |
| | | 116 | | /// <summary> |
| | | 117 | | /// Gets or sets a string that uniquely identifies the Job Manager Task |
| | | 118 | | /// within the Job. |
| | | 119 | | /// </summary> |
| | | 120 | | /// <remarks> |
| | | 121 | | /// The ID can contain any combination of alphanumeric characters |
| | | 122 | | /// including hyphens and underscores and cannot contain more than 64 |
| | | 123 | | /// characters. |
| | | 124 | | /// </remarks> |
| | | 125 | | [JsonProperty(PropertyName = "id")] |
| | 2197 | 126 | | public string Id { get; set; } |
| | | 127 | | |
| | | 128 | | /// <summary> |
| | | 129 | | /// Gets or sets the display name of the Job Manager Task. |
| | | 130 | | /// </summary> |
| | | 131 | | /// <remarks> |
| | | 132 | | /// It need not be unique and can contain any Unicode characters up to |
| | | 133 | | /// a maximum length of 1024. |
| | | 134 | | /// </remarks> |
| | | 135 | | [JsonProperty(PropertyName = "displayName")] |
| | 2225 | 136 | | public string DisplayName { get; set; } |
| | | 137 | | |
| | | 138 | | /// <summary> |
| | | 139 | | /// Gets or sets the command line of the Job Manager Task. |
| | | 140 | | /// </summary> |
| | | 141 | | /// <remarks> |
| | | 142 | | /// The command line does not run under a shell, and therefore cannot |
| | | 143 | | /// take advantage of shell features such as environment variable |
| | | 144 | | /// expansion. If you want to take advantage of such features, you |
| | | 145 | | /// should invoke the shell in the command line, for example using "cmd |
| | | 146 | | /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the |
| | | 147 | | /// command line refers to file paths, it should use a relative path |
| | | 148 | | /// (relative to the Task working directory), or use the Batch provided |
| | | 149 | | /// environment variable |
| | | 150 | | /// (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). |
| | | 151 | | /// </remarks> |
| | | 152 | | [JsonProperty(PropertyName = "commandLine")] |
| | 2196 | 153 | | public string CommandLine { get; set; } |
| | | 154 | | |
| | | 155 | | /// <summary> |
| | | 156 | | /// Gets or sets the settings for the container under which the Job |
| | | 157 | | /// Manager Task runs. |
| | | 158 | | /// </summary> |
| | | 159 | | /// <remarks> |
| | | 160 | | /// If the Pool that will run this Task has containerConfiguration set, |
| | | 161 | | /// this must be set as well. If the Pool that will run this Task |
| | | 162 | | /// doesn't have containerConfiguration set, this must not be set. When |
| | | 163 | | /// this is specified, all directories recursively below the |
| | | 164 | | /// AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the |
| | | 165 | | /// node) are mapped into the container, all Task environment variables |
| | | 166 | | /// are mapped into the container, and the Task command line is |
| | | 167 | | /// executed in the container. Files produced in the container outside |
| | | 168 | | /// of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, |
| | | 169 | | /// meaning that Batch file APIs will not be able to access those |
| | | 170 | | /// files. |
| | | 171 | | /// </remarks> |
| | | 172 | | [JsonProperty(PropertyName = "containerSettings")] |
| | 2225 | 173 | | public TaskContainerSettings ContainerSettings { get; set; } |
| | | 174 | | |
| | | 175 | | /// <summary> |
| | | 176 | | /// Gets or sets a list of files that the Batch service will download |
| | | 177 | | /// to the Compute Node before running the command line. |
| | | 178 | | /// </summary> |
| | | 179 | | /// <remarks> |
| | | 180 | | /// Files listed under this element are located in the Task's working |
| | | 181 | | /// directory. There is a maximum size for the list of resource files. |
| | | 182 | | /// When the max size is exceeded, the request will fail and the |
| | | 183 | | /// response error code will be RequestEntityTooLarge. If this occurs, |
| | | 184 | | /// the collection of ResourceFiles must be reduced in size. This can |
| | | 185 | | /// be achieved using .zip files, Application Packages, or Docker |
| | | 186 | | /// Containers. |
| | | 187 | | /// </remarks> |
| | | 188 | | [JsonProperty(PropertyName = "resourceFiles")] |
| | 2182 | 189 | | public IList<ResourceFile> ResourceFiles { get; set; } |
| | | 190 | | |
| | | 191 | | /// <summary> |
| | | 192 | | /// Gets or sets a list of files that the Batch service will upload |
| | | 193 | | /// from the Compute Node after running the command line. |
| | | 194 | | /// </summary> |
| | | 195 | | /// <remarks> |
| | | 196 | | /// For multi-instance Tasks, the files will only be uploaded from the |
| | | 197 | | /// Compute Node on which the primary Task is executed. |
| | | 198 | | /// </remarks> |
| | | 199 | | [JsonProperty(PropertyName = "outputFiles")] |
| | 2205 | 200 | | public IList<OutputFile> OutputFiles { get; set; } |
| | | 201 | | |
| | | 202 | | /// <summary> |
| | | 203 | | /// Gets or sets a list of environment variable settings for the Job |
| | | 204 | | /// Manager Task. |
| | | 205 | | /// </summary> |
| | | 206 | | [JsonProperty(PropertyName = "environmentSettings")] |
| | 2201 | 207 | | public IList<EnvironmentSetting> EnvironmentSettings { get; set; } |
| | | 208 | | |
| | | 209 | | /// <summary> |
| | | 210 | | /// Gets or sets constraints that apply to the Job Manager Task. |
| | | 211 | | /// </summary> |
| | | 212 | | [JsonProperty(PropertyName = "constraints")] |
| | 2210 | 213 | | public TaskConstraints Constraints { get; set; } |
| | | 214 | | |
| | | 215 | | /// <summary> |
| | | 216 | | /// Gets or sets whether completion of the Job Manager Task signifies |
| | | 217 | | /// completion of the entire Job. |
| | | 218 | | /// </summary> |
| | | 219 | | /// <remarks> |
| | | 220 | | /// If true, when the Job Manager Task completes, the Batch service |
| | | 221 | | /// marks the Job as complete. If any Tasks are still running at this |
| | | 222 | | /// time (other than Job Release), those Tasks are terminated. If |
| | | 223 | | /// false, the completion of the Job Manager Task does not affect the |
| | | 224 | | /// Job status. In this case, you should either use the |
| | | 225 | | /// onAllTasksComplete attribute to terminate the Job, or have a client |
| | | 226 | | /// or user terminate the Job explicitly. An example of this is if the |
| | | 227 | | /// Job Manager creates a set of Tasks but then takes no further role |
| | | 228 | | /// in their execution. The default value is true. If you are using the |
| | | 229 | | /// onAllTasksComplete and onTaskFailure attributes to control Job |
| | | 230 | | /// lifetime, and using the Job Manager Task only to create the Tasks |
| | | 231 | | /// for the Job (not to monitor progress), then it is important to set |
| | | 232 | | /// killJobOnCompletion to false. |
| | | 233 | | /// </remarks> |
| | | 234 | | [JsonProperty(PropertyName = "killJobOnCompletion")] |
| | 2205 | 235 | | public bool? KillJobOnCompletion { get; set; } |
| | | 236 | | |
| | | 237 | | /// <summary> |
| | | 238 | | /// Gets or sets the user identity under which the Job Manager Task |
| | | 239 | | /// runs. |
| | | 240 | | /// </summary> |
| | | 241 | | /// <remarks> |
| | | 242 | | /// If omitted, the Task runs as a non-administrative user unique to |
| | | 243 | | /// the Task. |
| | | 244 | | /// </remarks> |
| | | 245 | | [JsonProperty(PropertyName = "userIdentity")] |
| | 2191 | 246 | | public UserIdentity UserIdentity { get; set; } |
| | | 247 | | |
| | | 248 | | /// <summary> |
| | | 249 | | /// Gets or sets whether the Job Manager Task requires exclusive use of |
| | | 250 | | /// the Compute Node where it runs. |
| | | 251 | | /// </summary> |
| | | 252 | | /// <remarks> |
| | | 253 | | /// If true, no other Tasks will run on the same Node for as long as |
| | | 254 | | /// the Job Manager is running. If false, other Tasks can run |
| | | 255 | | /// simultaneously with the Job Manager on a Compute Node. The Job |
| | | 256 | | /// Manager Task counts normally against the Compute Node's concurrent |
| | | 257 | | /// Task limit, so this is only relevant if the Compute Node allows |
| | | 258 | | /// multiple concurrent Tasks. The default value is true. |
| | | 259 | | /// </remarks> |
| | | 260 | | [JsonProperty(PropertyName = "runExclusive")] |
| | 2202 | 261 | | public bool? RunExclusive { get; set; } |
| | | 262 | | |
| | | 263 | | /// <summary> |
| | | 264 | | /// Gets or sets a list of Application Packages that the Batch service |
| | | 265 | | /// will deploy to the Compute Node before running the command line. |
| | | 266 | | /// </summary> |
| | | 267 | | /// <remarks> |
| | | 268 | | /// Application Packages are downloaded and deployed to a shared |
| | | 269 | | /// directory, not the Task working directory. Therefore, if a |
| | | 270 | | /// referenced Application Package is already on the Compute Node, and |
| | | 271 | | /// is up to date, then it is not re-downloaded; the existing copy on |
| | | 272 | | /// the Compute Node is used. If a referenced Application Package |
| | | 273 | | /// cannot be installed, for example because the package has been |
| | | 274 | | /// deleted or because download failed, the Task fails. |
| | | 275 | | /// </remarks> |
| | | 276 | | [JsonProperty(PropertyName = "applicationPackageReferences")] |
| | 2201 | 277 | | public IList<ApplicationPackageReference> ApplicationPackageReferences { get; set; } |
| | | 278 | | |
| | | 279 | | /// <summary> |
| | | 280 | | /// Gets or sets the settings for an authentication token that the Task |
| | | 281 | | /// can use to perform Batch service operations. |
| | | 282 | | /// </summary> |
| | | 283 | | /// <remarks> |
| | | 284 | | /// If this property is set, the Batch service provides the Task with |
| | | 285 | | /// an authentication token which can be used to authenticate Batch |
| | | 286 | | /// service operations without requiring an Account access key. The |
| | | 287 | | /// token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment |
| | | 288 | | /// variable. The operations that the Task can carry out using the |
| | | 289 | | /// token depend on the settings. For example, a Task can request Job |
| | | 290 | | /// permissions in order to add other Tasks to the Job, or check the |
| | | 291 | | /// status of the Job or of other Tasks under the Job. |
| | | 292 | | /// </remarks> |
| | | 293 | | [JsonProperty(PropertyName = "authenticationTokenSettings")] |
| | 2203 | 294 | | public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } |
| | | 295 | | |
| | | 296 | | /// <summary> |
| | | 297 | | /// Gets or sets whether the Job Manager Task may run on a low-priority |
| | | 298 | | /// Compute Node. |
| | | 299 | | /// </summary> |
| | | 300 | | /// <remarks> |
| | | 301 | | /// The default value is true. |
| | | 302 | | /// </remarks> |
| | | 303 | | [JsonProperty(PropertyName = "allowLowPriorityNode")] |
| | 2223 | 304 | | public bool? AllowLowPriorityNode { get; set; } |
| | | 305 | | |
| | | 306 | | } |
| | | 307 | | } |