| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | 3 | | // |
| | 4 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 5 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 6 | | // regenerated. |
| | 7 | |
|
| | 8 | | // |
| | 9 | | // This file was autogenerated by a tool. |
| | 10 | | // Do not modify it. |
| | 11 | | // |
| | 12 | |
|
| | 13 | | namespace Microsoft.Azure.Batch |
| | 14 | | { |
| | 15 | | using Models = Microsoft.Azure.Batch.Protocol.Models; |
| 1 | 16 | | using System; |
| 219 | 17 | | using System.Collections.Generic; |
| | 18 | | using System.Linq; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// The specification for a pool. |
| | 22 | | /// </summary> |
| | 23 | | public partial class PoolSpecification : ITransportObjectProvider<Models.PoolSpecification>, IPropertyMetadata |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<IList<string>> ApplicationLicensesProperty; |
| | 28 | | public readonly PropertyAccessor<IList<ApplicationPackageReference>> ApplicationPackageReferencesProperty; |
| | 29 | | public readonly PropertyAccessor<bool?> AutoScaleEnabledProperty; |
| | 30 | | public readonly PropertyAccessor<TimeSpan?> AutoScaleEvaluationIntervalProperty; |
| | 31 | | public readonly PropertyAccessor<string> AutoScaleFormulaProperty; |
| | 32 | | public readonly PropertyAccessor<IList<CertificateReference>> CertificateReferencesProperty; |
| | 33 | | public readonly PropertyAccessor<CloudServiceConfiguration> CloudServiceConfigurationProperty; |
| | 34 | | public readonly PropertyAccessor<string> DisplayNameProperty; |
| | 35 | | public readonly PropertyAccessor<bool?> InterComputeNodeCommunicationEnabledProperty; |
| | 36 | | public readonly PropertyAccessor<int?> MaxTasksPerComputeNodeProperty; |
| | 37 | | public readonly PropertyAccessor<IList<MetadataItem>> MetadataProperty; |
| | 38 | | public readonly PropertyAccessor<IList<MountConfiguration>> MountConfigurationProperty; |
| | 39 | | public readonly PropertyAccessor<NetworkConfiguration> NetworkConfigurationProperty; |
| | 40 | | public readonly PropertyAccessor<TimeSpan?> ResizeTimeoutProperty; |
| | 41 | | public readonly PropertyAccessor<StartTask> StartTaskProperty; |
| | 42 | | public readonly PropertyAccessor<int?> TargetDedicatedComputeNodesProperty; |
| | 43 | | public readonly PropertyAccessor<int?> TargetLowPriorityComputeNodesProperty; |
| | 44 | | public readonly PropertyAccessor<TaskSchedulingPolicy> TaskSchedulingPolicyProperty; |
| | 45 | | public readonly PropertyAccessor<IList<UserAccount>> UserAccountsProperty; |
| | 46 | | public readonly PropertyAccessor<VirtualMachineConfiguration> VirtualMachineConfigurationProperty; |
| | 47 | | public readonly PropertyAccessor<string> VirtualMachineSizeProperty; |
| | 48 | |
|
| 210 | 49 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 50 | | { |
| 210 | 51 | | this.ApplicationLicensesProperty = this.CreatePropertyAccessor<IList<string>>(nameof(ApplicationLicenses |
| 210 | 52 | | this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor<IList<ApplicationPackageReferenc |
| 210 | 53 | | this.AutoScaleEnabledProperty = this.CreatePropertyAccessor<bool?>(nameof(AutoScaleEnabled), BindingAcce |
| 210 | 54 | | this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(AutoScaleEvalua |
| 210 | 55 | | this.AutoScaleFormulaProperty = this.CreatePropertyAccessor<string>(nameof(AutoScaleFormula), BindingAcc |
| 210 | 56 | | this.CertificateReferencesProperty = this.CreatePropertyAccessor<IList<CertificateReference>>(nameof(Cer |
| 210 | 57 | | this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor<CloudServiceConfiguration>(nameof(C |
| 210 | 58 | | this.DisplayNameProperty = this.CreatePropertyAccessor<string>(nameof(DisplayName), BindingAccess.Read | |
| 210 | 59 | | this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor<bool?>(nameof(InterCompu |
| 210 | 60 | | this.MaxTasksPerComputeNodeProperty = this.CreatePropertyAccessor<int?>(nameof(MaxTasksPerComputeNode), |
| 210 | 61 | | this.MetadataProperty = this.CreatePropertyAccessor<IList<MetadataItem>>(nameof(Metadata), BindingAccess |
| 210 | 62 | | this.MountConfigurationProperty = this.CreatePropertyAccessor<IList<MountConfiguration>>(nameof(MountCon |
| 210 | 63 | | this.NetworkConfigurationProperty = this.CreatePropertyAccessor<NetworkConfiguration>(nameof(NetworkConf |
| 210 | 64 | | this.ResizeTimeoutProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(ResizeTimeout), BindingAccess |
| 210 | 65 | | this.StartTaskProperty = this.CreatePropertyAccessor<StartTask>(nameof(StartTask), BindingAccess.Read | |
| 210 | 66 | | this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(TargetDedicatedCompu |
| 210 | 67 | | this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(TargetLowPriorityC |
| 210 | 68 | | this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor<TaskSchedulingPolicy>(nameof(TaskSchedul |
| 210 | 69 | | this.UserAccountsProperty = this.CreatePropertyAccessor<IList<UserAccount>>(nameof(UserAccounts), Bindin |
| 210 | 70 | | this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor<VirtualMachineConfiguration>(name |
| 210 | 71 | | this.VirtualMachineSizeProperty = this.CreatePropertyAccessor<string>(nameof(VirtualMachineSize), Bindin |
| 210 | 72 | | } |
| | 73 | |
|
| 198 | 74 | | public PropertyContainer(Models.PoolSpecification protocolObject) : base(BindingState.Bound) |
| | 75 | | { |
| 198 | 76 | | this.ApplicationLicensesProperty = this.CreatePropertyAccessor( |
| 548 | 77 | | UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ApplicationLicenses, o => o), |
| 198 | 78 | | nameof(ApplicationLicenses), |
| 198 | 79 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 80 | | this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor( |
| 198 | 81 | | ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReference |
| 198 | 82 | | nameof(ApplicationPackageReferences), |
| 198 | 83 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 84 | | this.AutoScaleEnabledProperty = this.CreatePropertyAccessor( |
| 198 | 85 | | protocolObject.EnableAutoScale, |
| 198 | 86 | | nameof(AutoScaleEnabled), |
| 198 | 87 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 88 | | this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor( |
| 198 | 89 | | protocolObject.AutoScaleEvaluationInterval, |
| 198 | 90 | | nameof(AutoScaleEvaluationInterval), |
| 198 | 91 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 92 | | this.AutoScaleFormulaProperty = this.CreatePropertyAccessor( |
| 198 | 93 | | protocolObject.AutoScaleFormula, |
| 198 | 94 | | nameof(AutoScaleFormula), |
| 198 | 95 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 96 | | this.CertificateReferencesProperty = this.CreatePropertyAccessor( |
| 198 | 97 | | CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences), |
| 198 | 98 | | nameof(CertificateReferences), |
| 198 | 99 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 100 | | this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor( |
| 295 | 101 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new Cloud |
| 198 | 102 | | nameof(CloudServiceConfiguration), |
| 198 | 103 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 104 | | this.DisplayNameProperty = this.CreatePropertyAccessor( |
| 198 | 105 | | protocolObject.DisplayName, |
| 198 | 106 | | nameof(DisplayName), |
| 198 | 107 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 108 | | this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor( |
| 198 | 109 | | protocolObject.EnableInterNodeCommunication, |
| 198 | 110 | | nameof(InterComputeNodeCommunicationEnabled), |
| 198 | 111 | | BindingAccess.Read); |
| 198 | 112 | | this.MaxTasksPerComputeNodeProperty = this.CreatePropertyAccessor( |
| 198 | 113 | | protocolObject.MaxTasksPerNode, |
| 198 | 114 | | nameof(MaxTasksPerComputeNode), |
| 198 | 115 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 116 | | this.MetadataProperty = this.CreatePropertyAccessor( |
| 198 | 117 | | MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata), |
| 198 | 118 | | nameof(Metadata), |
| 198 | 119 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 120 | | this.MountConfigurationProperty = this.CreatePropertyAccessor( |
| 198 | 121 | | Batch.MountConfiguration.ConvertFromProtocolCollectionAndFreeze(protocolObject.MountConfiguration), |
| 198 | 122 | | nameof(MountConfiguration), |
| 198 | 123 | | BindingAccess.Read); |
| 198 | 124 | | this.NetworkConfigurationProperty = this.CreatePropertyAccessor( |
| 279 | 125 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkCon |
| 198 | 126 | | nameof(NetworkConfiguration), |
| 198 | 127 | | BindingAccess.Read); |
| 198 | 128 | | this.ResizeTimeoutProperty = this.CreatePropertyAccessor( |
| 198 | 129 | | protocolObject.ResizeTimeout, |
| 198 | 130 | | nameof(ResizeTimeout), |
| 198 | 131 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 132 | | this.StartTaskProperty = this.CreatePropertyAccessor( |
| 290 | 133 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)), |
| 198 | 134 | | nameof(StartTask), |
| 198 | 135 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 136 | | this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor( |
| 198 | 137 | | protocolObject.TargetDedicatedNodes, |
| 198 | 138 | | nameof(TargetDedicatedComputeNodes), |
| 198 | 139 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 140 | | this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor( |
| 198 | 141 | | protocolObject.TargetLowPriorityNodes, |
| 198 | 142 | | nameof(TargetLowPriorityComputeNodes), |
| 198 | 143 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 144 | | this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor( |
| 285 | 145 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedu |
| 198 | 146 | | nameof(TaskSchedulingPolicy), |
| 198 | 147 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 148 | | this.UserAccountsProperty = this.CreatePropertyAccessor( |
| 198 | 149 | | UserAccount.ConvertFromProtocolCollection(protocolObject.UserAccounts), |
| 198 | 150 | | nameof(UserAccounts), |
| 198 | 151 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 152 | | this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor( |
| 290 | 153 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new Vir |
| 198 | 154 | | nameof(VirtualMachineConfiguration), |
| 198 | 155 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 156 | | this.VirtualMachineSizeProperty = this.CreatePropertyAccessor( |
| 198 | 157 | | protocolObject.VmSize, |
| 198 | 158 | | nameof(VirtualMachineSize), |
| 198 | 159 | | BindingAccess.Read | BindingAccess.Write); |
| 198 | 160 | | } |
| | 161 | | } |
| | 162 | |
|
| | 163 | | private readonly PropertyContainer propertyContainer; |
| | 164 | |
|
| | 165 | | #region Constructors |
| | 166 | |
|
| | 167 | | /// <summary> |
| | 168 | | /// Initializes a new instance of the <see cref="PoolSpecification"/> class. |
| | 169 | | /// </summary> |
| 210 | 170 | | public PoolSpecification() |
| | 171 | | { |
| 210 | 172 | | this.propertyContainer = new PropertyContainer(); |
| 210 | 173 | | } |
| | 174 | |
|
| 198 | 175 | | internal PoolSpecification(Models.PoolSpecification protocolObject) |
| | 176 | | { |
| 198 | 177 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 198 | 178 | | } |
| | 179 | |
|
| | 180 | | #endregion Constructors |
| | 181 | |
|
| | 182 | | #region PoolSpecification |
| | 183 | |
|
| | 184 | | /// <summary> |
| | 185 | | /// Gets or sets the list of application licenses the Batch service will make available on each compute node in |
| | 186 | | /// pool. |
| | 187 | | /// </summary> |
| | 188 | | /// <remarks> |
| | 189 | | /// The list of application licenses must be a subset of available Batch service application licenses. |
| | 190 | | /// </remarks> |
| | 191 | | public IList<string> ApplicationLicenses |
| | 192 | | { |
| 605 | 193 | | get { return this.propertyContainer.ApplicationLicensesProperty.Value; } |
| | 194 | | set |
| | 195 | | { |
| 106 | 196 | | this.propertyContainer.ApplicationLicensesProperty.Value = ConcurrentChangeTrackedList<string>.Transform |
| 105 | 197 | | } |
| | 198 | | } |
| | 199 | |
|
| | 200 | | /// <summary> |
| | 201 | | /// Gets or sets a list of application package references to be installed on each compute node in the pool. |
| | 202 | | /// </summary> |
| | 203 | | public IList<ApplicationPackageReference> ApplicationPackageReferences |
| | 204 | | { |
| 610 | 205 | | get { return this.propertyContainer.ApplicationPackageReferencesProperty.Value; } |
| | 206 | | set |
| | 207 | | { |
| 108 | 208 | | this.propertyContainer.ApplicationPackageReferencesProperty.Value = ConcurrentChangeTrackedModifiableLis |
| 107 | 209 | | } |
| | 210 | | } |
| | 211 | |
|
| | 212 | | /// <summary> |
| | 213 | | /// Gets or sets whether the pool size should automatically adjust over time. |
| | 214 | | /// </summary> |
| | 215 | | /// <remarks> |
| | 216 | | /// <para>If false, one of the <see cref="TargetDedicatedComputeNodes"/> or <see cref="TargetLowPriorityComputeN |
| | 217 | | /// property is required.</para> <para>If true, the <see cref="AutoScaleFormula"/> property is required. The poo |
| | 218 | | /// automatically resizes according to the formula.</para> <para>The default value is false.</para> |
| | 219 | | /// </remarks> |
| | 220 | | public bool? AutoScaleEnabled |
| | 221 | | { |
| 605 | 222 | | get { return this.propertyContainer.AutoScaleEnabledProperty.Value; } |
| 229 | 223 | | set { this.propertyContainer.AutoScaleEnabledProperty.Value = value; } |
| | 224 | | } |
| | 225 | |
|
| | 226 | | /// <summary> |
| | 227 | | /// Gets or sets a time interval at which to automatically adjust the pool size according to the <see cref="Auto |
| | 228 | | /// </summary> |
| | 229 | | /// <remarks> |
| | 230 | | /// The default value is 15 minutes. The minimum allowed value is 5 minutes. |
| | 231 | | /// </remarks> |
| | 232 | | public TimeSpan? AutoScaleEvaluationInterval |
| | 233 | | { |
| 605 | 234 | | get { return this.propertyContainer.AutoScaleEvaluationIntervalProperty.Value; } |
| 205 | 235 | | set { this.propertyContainer.AutoScaleEvaluationIntervalProperty.Value = value; } |
| | 236 | | } |
| | 237 | |
|
| | 238 | | /// <summary> |
| | 239 | | /// Gets or sets a formula for the desired number of compute nodes in the pool. |
| | 240 | | /// </summary> |
| | 241 | | /// <remarks> |
| | 242 | | /// <para>For how to write autoscale formulas, see https://azure.microsoft.com/documentation/articles/batch-auto |
| | 243 | | /// This property is required if <see cref="AutoScaleEnabled"/> is set to true. It must be null if AutoScaleEnab |
| | 244 | | /// is false.</para><para>The formula is checked for validity before the pool is created. If the formula is not |
| | 245 | | /// an exception is thrown when you try to commit the <see cref="PoolSpecification"/>.</para> |
| | 246 | | /// </remarks> |
| | 247 | | public string AutoScaleFormula |
| | 248 | | { |
| 605 | 249 | | get { return this.propertyContainer.AutoScaleFormulaProperty.Value; } |
| 231 | 250 | | set { this.propertyContainer.AutoScaleFormulaProperty.Value = value; } |
| | 251 | | } |
| | 252 | |
|
| | 253 | | /// <summary> |
| | 254 | | /// Gets or sets a list of certificates to be installed on each compute node in the pool. |
| | 255 | | /// </summary> |
| | 256 | | public IList<CertificateReference> CertificateReferences |
| | 257 | | { |
| 605 | 258 | | get { return this.propertyContainer.CertificateReferencesProperty.Value; } |
| | 259 | | set |
| | 260 | | { |
| 111 | 261 | | this.propertyContainer.CertificateReferencesProperty.Value = ConcurrentChangeTrackedModifiableList<Certi |
| 110 | 262 | | } |
| | 263 | | } |
| | 264 | |
|
| | 265 | | /// <summary> |
| | 266 | | /// Gets or sets the <see cref="CloudServiceConfiguration"/> for the pool. |
| | 267 | | /// </summary> |
| | 268 | | /// <remarks> |
| | 269 | | /// This property is mutually exclusive with <see cref="VirtualMachineConfiguration"/>. |
| | 270 | | /// </remarks> |
| | 271 | | public CloudServiceConfiguration CloudServiceConfiguration |
| | 272 | | { |
| 607 | 273 | | get { return this.propertyContainer.CloudServiceConfigurationProperty.Value; } |
| 205 | 274 | | set { this.propertyContainer.CloudServiceConfigurationProperty.Value = value; } |
| | 275 | | } |
| | 276 | |
|
| | 277 | | /// <summary> |
| | 278 | | /// Gets or sets the display name for the pool. |
| | 279 | | /// </summary> |
| | 280 | | public string DisplayName |
| | 281 | | { |
| 606 | 282 | | get { return this.propertyContainer.DisplayNameProperty.Value; } |
| 229 | 283 | | set { this.propertyContainer.DisplayNameProperty.Value = value; } |
| | 284 | | } |
| | 285 | |
|
| | 286 | | /// <summary> |
| | 287 | | /// Gets or sets whether the pool permits direct communication between its compute nodes. |
| | 288 | | /// </summary> |
| | 289 | | /// <remarks> |
| | 290 | | /// Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the |
| | 291 | | /// of the pool. This may result in the pool not reaching its desired size. |
| | 292 | | /// </remarks> |
| | 293 | | public bool? InterComputeNodeCommunicationEnabled |
| | 294 | | { |
| 605 | 295 | | get { return this.propertyContainer.InterComputeNodeCommunicationEnabledProperty.Value; } |
| 209 | 296 | | set { this.propertyContainer.InterComputeNodeCommunicationEnabledProperty.Value = value; } |
| | 297 | | } |
| | 298 | |
|
| | 299 | | /// <summary> |
| | 300 | | /// Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool. |
| | 301 | | /// </summary> |
| | 302 | | /// <remarks> |
| | 303 | | /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the <see cref="Vi |
| | 304 | | /// of the pool or 256. |
| | 305 | | /// </remarks> |
| | 306 | | public int? MaxTasksPerComputeNode |
| | 307 | | { |
| 605 | 308 | | get { return this.propertyContainer.MaxTasksPerComputeNodeProperty.Value; } |
| 230 | 309 | | set { this.propertyContainer.MaxTasksPerComputeNodeProperty.Value = value; } |
| | 310 | | } |
| | 311 | |
|
| | 312 | | /// <summary> |
| | 313 | | /// Gets or sets a list of name-value pairs associated with the pool as metadata. |
| | 314 | | /// </summary> |
| | 315 | | public IList<MetadataItem> Metadata |
| | 316 | | { |
| 605 | 317 | | get { return this.propertyContainer.MetadataProperty.Value; } |
| | 318 | | set |
| | 319 | | { |
| 115 | 320 | | this.propertyContainer.MetadataProperty.Value = ConcurrentChangeTrackedModifiableList<MetadataItem>.Tran |
| 114 | 321 | | } |
| | 322 | | } |
| | 323 | |
|
| | 324 | | /// <summary> |
| | 325 | | /// Gets or sets a list of file systems to mount on each node in the pool. |
| | 326 | | /// </summary> |
| | 327 | | /// <remarks> |
| | 328 | | /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. |
| | 329 | | /// </remarks> |
| | 330 | | public IList<MountConfiguration> MountConfiguration |
| | 331 | | { |
| 605 | 332 | | get { return this.propertyContainer.MountConfigurationProperty.Value; } |
| | 333 | | set |
| | 334 | | { |
| 112 | 335 | | this.propertyContainer.MountConfigurationProperty.Value = ConcurrentChangeTrackedModifiableList<MountCon |
| 111 | 336 | | } |
| | 337 | | } |
| | 338 | |
|
| | 339 | | /// <summary> |
| | 340 | | /// Gets or sets the network configuration of the pool. |
| | 341 | | /// </summary> |
| | 342 | | public NetworkConfiguration NetworkConfiguration |
| | 343 | | { |
| 605 | 344 | | get { return this.propertyContainer.NetworkConfigurationProperty.Value; } |
| 201 | 345 | | set { this.propertyContainer.NetworkConfigurationProperty.Value = value; } |
| | 346 | | } |
| | 347 | |
|
| | 348 | | /// <summary> |
| | 349 | | /// Gets or sets the timeout for allocation of compute nodes to the pool. |
| | 350 | | /// </summary> |
| | 351 | | /// <remarks> |
| | 352 | | /// <para>This timeout applies only to manual scaling; it has no effect when <see cref="AutoScaleEnabled"/> is s |
| | 353 | | /// to true.</para><para>The default value is 15 minutes. The minimum value is 5 minutes.</para> |
| | 354 | | /// </remarks> |
| | 355 | | public TimeSpan? ResizeTimeout |
| | 356 | | { |
| 606 | 357 | | get { return this.propertyContainer.ResizeTimeoutProperty.Value; } |
| 213 | 358 | | set { this.propertyContainer.ResizeTimeoutProperty.Value = value; } |
| | 359 | | } |
| | 360 | |
|
| | 361 | | /// <summary> |
| | 362 | | /// Gets or sets a task to run on each compute node as it joins the pool. The task runs when the node is added t |
| | 363 | | /// the pool or when the node is restarted. |
| | 364 | | /// </summary> |
| | 365 | | public StartTask StartTask |
| | 366 | | { |
| 607 | 367 | | get { return this.propertyContainer.StartTaskProperty.Value; } |
| 209 | 368 | | set { this.propertyContainer.StartTaskProperty.Value = value; } |
| | 369 | | } |
| | 370 | |
|
| | 371 | | /// <summary> |
| | 372 | | /// Gets or sets the desired number of dedicated compute nodes in the pool. |
| | 373 | | /// </summary> |
| | 374 | | /// <remarks> |
| | 375 | | /// This setting cannot be specified if <see cref="AutoScaleEnabled"/> is set to true. At least one of this prop |
| | 376 | | /// and <see cref="TargetLowPriorityComputeNodes"/> must be specified if <see cref="AutoScaleEnabled"/> is false |
| | 377 | | /// If not specified, the default is 0. |
| | 378 | | /// </remarks> |
| | 379 | | public int? TargetDedicatedComputeNodes |
| | 380 | | { |
| 606 | 381 | | get { return this.propertyContainer.TargetDedicatedComputeNodesProperty.Value; } |
| 434 | 382 | | set { this.propertyContainer.TargetDedicatedComputeNodesProperty.Value = value; } |
| | 383 | | } |
| | 384 | |
|
| | 385 | | /// <summary> |
| | 386 | | /// Gets or sets the desired number of low-priority compute nodes in the pool. |
| | 387 | | /// </summary> |
| | 388 | | /// <remarks> |
| | 389 | | /// This setting cannot be specified if <see cref="AutoScaleEnabled"/> is set to true. At least one of <see cref |
| | 390 | | /// and this property must be specified if <see cref="AutoScaleEnabled"/> is false. If not specified, the defaul |
| | 391 | | /// is 0. |
| | 392 | | /// </remarks> |
| | 393 | | public int? TargetLowPriorityComputeNodes |
| | 394 | | { |
| 605 | 395 | | get { return this.propertyContainer.TargetLowPriorityComputeNodesProperty.Value; } |
| 199 | 396 | | set { this.propertyContainer.TargetLowPriorityComputeNodesProperty.Value = value; } |
| | 397 | | } |
| | 398 | |
|
| | 399 | | /// <summary> |
| | 400 | | /// Gets or sets how tasks are distributed among compute nodes in the pool. |
| | 401 | | /// </summary> |
| | 402 | | public TaskSchedulingPolicy TaskSchedulingPolicy |
| | 403 | | { |
| 605 | 404 | | get { return this.propertyContainer.TaskSchedulingPolicyProperty.Value; } |
| 225 | 405 | | set { this.propertyContainer.TaskSchedulingPolicyProperty.Value = value; } |
| | 406 | | } |
| | 407 | |
|
| | 408 | | /// <summary> |
| | 409 | | /// Gets or sets the list of user accounts to be created on each node in the pool. |
| | 410 | | /// </summary> |
| | 411 | | public IList<UserAccount> UserAccounts |
| | 412 | | { |
| 605 | 413 | | get { return this.propertyContainer.UserAccountsProperty.Value; } |
| | 414 | | set |
| | 415 | | { |
| 110 | 416 | | this.propertyContainer.UserAccountsProperty.Value = ConcurrentChangeTrackedModifiableList<UserAccount>.T |
| 109 | 417 | | } |
| | 418 | | } |
| | 419 | |
|
| | 420 | | /// <summary> |
| | 421 | | /// Gets or sets the <see cref="VirtualMachineConfiguration"/> of the pool. |
| | 422 | | /// </summary> |
| | 423 | | /// <remarks> |
| | 424 | | /// This property is mutually exclusive with <see cref="CloudServiceConfiguration"/>. |
| | 425 | | /// </remarks> |
| | 426 | | public VirtualMachineConfiguration VirtualMachineConfiguration |
| | 427 | | { |
| 605 | 428 | | get { return this.propertyContainer.VirtualMachineConfigurationProperty.Value; } |
| 235 | 429 | | set { this.propertyContainer.VirtualMachineConfigurationProperty.Value = value; } |
| | 430 | | } |
| | 431 | |
|
| | 432 | | /// <summary> |
| | 433 | | /// Gets or sets the size of the virtual machines in the pool. All virtual machines in a pool are the same size |
| | 434 | | /// </summary> |
| | 435 | | /// <remarks> |
| | 436 | | /// <para>For information about available sizes of virtual machines in pools, see Choose a VM size for compute n |
| | 437 | | /// in an Azure Batch pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes).</para> |
| | 438 | | /// </remarks> |
| | 439 | | public string VirtualMachineSize |
| | 440 | | { |
| 606 | 441 | | get { return this.propertyContainer.VirtualMachineSizeProperty.Value; } |
| 237 | 442 | | set { this.propertyContainer.VirtualMachineSizeProperty.Value = value; } |
| | 443 | | } |
| | 444 | |
|
| | 445 | | #endregion // PoolSpecification |
| | 446 | |
|
| | 447 | | #region IPropertyMetadata |
| | 448 | |
|
| | 449 | | bool IModifiable.HasBeenModified |
| | 450 | | { |
| 4 | 451 | | get { return this.propertyContainer.HasBeenModified; } |
| | 452 | | } |
| | 453 | |
|
| | 454 | | bool IReadOnly.IsReadOnly |
| | 455 | | { |
| 0 | 456 | | get { return this.propertyContainer.IsReadOnly; } |
| 8 | 457 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 458 | | } |
| | 459 | |
|
| | 460 | | #endregion //IPropertyMetadata |
| | 461 | |
|
| | 462 | | #region Internal/private methods |
| | 463 | | /// <summary> |
| | 464 | | /// Return a protocol object of the requested type. |
| | 465 | | /// </summary> |
| | 466 | | /// <returns>The protocol object of the requested type.</returns> |
| | 467 | | Models.PoolSpecification ITransportObjectProvider<Models.PoolSpecification>.GetTransportObject() |
| | 468 | | { |
| 206 | 469 | | Models.PoolSpecification result = new Models.PoolSpecification() |
| 206 | 470 | | { |
| 206 | 471 | | ApplicationLicenses = this.ApplicationLicenses, |
| 206 | 472 | | ApplicationPackageReferences = UtilitiesInternal.ConvertToProtocolCollection(this.ApplicationPackageRefe |
| 206 | 473 | | EnableAutoScale = this.AutoScaleEnabled, |
| 206 | 474 | | AutoScaleEvaluationInterval = this.AutoScaleEvaluationInterval, |
| 206 | 475 | | AutoScaleFormula = this.AutoScaleFormula, |
| 206 | 476 | | CertificateReferences = UtilitiesInternal.ConvertToProtocolCollection(this.CertificateReferences), |
| 307 | 477 | | CloudServiceConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.CloudServiceConfiguration, |
| 206 | 478 | | DisplayName = this.DisplayName, |
| 206 | 479 | | EnableInterNodeCommunication = this.InterComputeNodeCommunicationEnabled, |
| 206 | 480 | | MaxTasksPerNode = this.MaxTasksPerComputeNode, |
| 206 | 481 | | Metadata = UtilitiesInternal.ConvertToProtocolCollection(this.Metadata), |
| 206 | 482 | | MountConfiguration = UtilitiesInternal.ConvertToProtocolCollection(this.MountConfiguration), |
| 306 | 483 | | NetworkConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.NetworkConfiguration, (o) => o.G |
| 206 | 484 | | ResizeTimeout = this.ResizeTimeout, |
| 310 | 485 | | StartTask = UtilitiesInternal.CreateObjectWithNullCheck(this.StartTask, (o) => o.GetTransportObject()), |
| 206 | 486 | | TargetDedicatedNodes = this.TargetDedicatedComputeNodes, |
| 206 | 487 | | TargetLowPriorityNodes = this.TargetLowPriorityComputeNodes, |
| 318 | 488 | | TaskSchedulingPolicy = UtilitiesInternal.CreateObjectWithNullCheck(this.TaskSchedulingPolicy, (o) => o.G |
| 206 | 489 | | UserAccounts = UtilitiesInternal.ConvertToProtocolCollection(this.UserAccounts), |
| 323 | 490 | | VirtualMachineConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.VirtualMachineConfigurati |
| 206 | 491 | | VmSize = this.VirtualMachineSize, |
| 206 | 492 | | }; |
| | 493 | |
|
| 206 | 494 | | return result; |
| | 495 | | } |
| | 496 | |
|
| | 497 | |
|
| | 498 | | #endregion // Internal/private methods |
| | 499 | | } |
| | 500 | | } |