| | 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; |
| | 16 | | using System; |
| | 17 | | using System.Collections.Generic; |
| | 18 | | using System.Linq; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. |
| | 22 | | /// </summary> |
| | 23 | | public partial class VirtualMachineConfiguration : ITransportObjectProvider<Models.VirtualMachineConfiguration>, IPr |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<ContainerConfiguration> ContainerConfigurationProperty; |
| | 28 | | public readonly PropertyAccessor<IList<DataDisk>> DataDisksProperty; |
| | 29 | | public readonly PropertyAccessor<DiskEncryptionConfiguration> DiskEncryptionConfigurationProperty; |
| | 30 | | public readonly PropertyAccessor<ImageReference> ImageReferenceProperty; |
| | 31 | | public readonly PropertyAccessor<string> LicenseTypeProperty; |
| | 32 | | public readonly PropertyAccessor<string> NodeAgentSkuIdProperty; |
| | 33 | | public readonly PropertyAccessor<WindowsConfiguration> WindowsConfigurationProperty; |
| | 34 | |
|
| 266 | 35 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 36 | | { |
| 266 | 37 | | this.ContainerConfigurationProperty = this.CreatePropertyAccessor<ContainerConfiguration>(nameof(Contain |
| 266 | 38 | | this.DataDisksProperty = this.CreatePropertyAccessor<IList<DataDisk>>(nameof(DataDisks), BindingAccess.R |
| 266 | 39 | | this.DiskEncryptionConfigurationProperty = this.CreatePropertyAccessor<DiskEncryptionConfiguration>(name |
| 266 | 40 | | this.ImageReferenceProperty = this.CreatePropertyAccessor<ImageReference>(nameof(ImageReference), Bindin |
| 266 | 41 | | this.LicenseTypeProperty = this.CreatePropertyAccessor<string>(nameof(LicenseType), BindingAccess.Read | |
| 266 | 42 | | this.NodeAgentSkuIdProperty = this.CreatePropertyAccessor<string>(nameof(NodeAgentSkuId), BindingAccess. |
| 266 | 43 | | this.WindowsConfigurationProperty = this.CreatePropertyAccessor<WindowsConfiguration>(nameof(WindowsConf |
| 266 | 44 | | } |
| | 45 | |
|
| 583 | 46 | | public PropertyContainer(Models.VirtualMachineConfiguration protocolObject) : base(BindingState.Bound) |
| | 47 | | { |
| 583 | 48 | | this.ContainerConfigurationProperty = this.CreatePropertyAccessor( |
| 867 | 49 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ContainerConfiguration, o => new Containe |
| 583 | 50 | | nameof(ContainerConfiguration), |
| 583 | 51 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 52 | | this.DataDisksProperty = this.CreatePropertyAccessor( |
| 583 | 53 | | DataDisk.ConvertFromProtocolCollection(protocolObject.DataDisks), |
| 583 | 54 | | nameof(DataDisks), |
| 583 | 55 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 56 | | this.DiskEncryptionConfigurationProperty = this.CreatePropertyAccessor( |
| 878 | 57 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DiskEncryptionConfiguration, o => new Dis |
| 583 | 58 | | nameof(DiskEncryptionConfiguration), |
| 583 | 59 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 60 | | this.ImageReferenceProperty = this.CreatePropertyAccessor( |
| 880 | 61 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ImageReference, o => new ImageReference(o |
| 583 | 62 | | nameof(ImageReference), |
| 583 | 63 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 64 | | this.LicenseTypeProperty = this.CreatePropertyAccessor( |
| 583 | 65 | | protocolObject.LicenseType, |
| 583 | 66 | | nameof(LicenseType), |
| 583 | 67 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 68 | | this.NodeAgentSkuIdProperty = this.CreatePropertyAccessor( |
| 583 | 69 | | protocolObject.NodeAgentSKUId, |
| 583 | 70 | | nameof(NodeAgentSkuId), |
| 583 | 71 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 72 | | this.WindowsConfigurationProperty = this.CreatePropertyAccessor( |
| 861 | 73 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.WindowsConfiguration, o => new WindowsCon |
| 583 | 74 | | nameof(WindowsConfiguration), |
| 583 | 75 | | BindingAccess.Read | BindingAccess.Write); |
| 583 | 76 | | } |
| | 77 | | } |
| | 78 | |
|
| | 79 | | private readonly PropertyContainer propertyContainer; |
| | 80 | |
|
| | 81 | | #region Constructors |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Initializes a new instance of the <see cref="VirtualMachineConfiguration"/> class. |
| | 85 | | /// </summary> |
| | 86 | | /// <param name='imageReference'>A reference to the Azure Virtual Machines Marketplace Image or the custom Virtu |
| | 87 | | /// <param name='nodeAgentSkuId'>The SKU of Batch Node Agent to be provisioned on the compute node.</param> |
| 266 | 88 | | public VirtualMachineConfiguration( |
| 266 | 89 | | ImageReference imageReference, |
| 266 | 90 | | string nodeAgentSkuId) |
| | 91 | | { |
| 266 | 92 | | this.propertyContainer = new PropertyContainer(); |
| 266 | 93 | | this.ImageReference = imageReference; |
| 266 | 94 | | this.NodeAgentSkuId = nodeAgentSkuId; |
| 266 | 95 | | } |
| | 96 | |
|
| 583 | 97 | | internal VirtualMachineConfiguration(Models.VirtualMachineConfiguration protocolObject) |
| | 98 | | { |
| 583 | 99 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 583 | 100 | | } |
| | 101 | |
|
| | 102 | | #endregion Constructors |
| | 103 | |
|
| | 104 | | #region VirtualMachineConfiguration |
| | 105 | |
|
| | 106 | | /// <summary> |
| | 107 | | /// Gets or sets the container configuration for the pool. |
| | 108 | | /// </summary> |
| | 109 | | /// <remarks> |
| | 110 | | /// If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular t |
| | 111 | | /// and job manager tasks run on this pool must specify <see cref="TaskContainerSettings" />, and all other task |
| | 112 | | /// may specify it. |
| | 113 | | /// </remarks> |
| | 114 | | public ContainerConfiguration ContainerConfiguration |
| | 115 | | { |
| 1114 | 116 | | get { return this.propertyContainer.ContainerConfigurationProperty.Value; } |
| 267 | 117 | | set { this.propertyContainer.ContainerConfigurationProperty.Value = value; } |
| | 118 | | } |
| | 119 | |
|
| | 120 | | /// <summary> |
| | 121 | | /// Gets or sets the configuration for data disks attached to the Comptue Nodes in the pool. |
| | 122 | | /// </summary> |
| | 123 | | /// <remarks> |
| | 124 | | /// This property must be specified if the Compute Nodes in the pool need to have empty data disks attached to t |
| | 125 | | /// This cannot be updated. |
| | 126 | | /// </remarks> |
| | 127 | | public IList<DataDisk> DataDisks |
| | 128 | | { |
| 1114 | 129 | | get { return this.propertyContainer.DataDisksProperty.Value; } |
| | 130 | | set |
| | 131 | | { |
| 130 | 132 | | this.propertyContainer.DataDisksProperty.Value = ConcurrentChangeTrackedModifiableList<DataDisk>.Transfo |
| 129 | 133 | | } |
| | 134 | | } |
| | 135 | |
|
| | 136 | | /// <summary> |
| | 137 | | /// Gets or sets the disk encryption configuration for the pool. |
| | 138 | | /// </summary> |
| | 139 | | /// <remarks> |
| | 140 | | /// If specified, encryption is performed on each node in the pool during node provisioning. |
| | 141 | | /// </remarks> |
| | 142 | | public DiskEncryptionConfiguration DiskEncryptionConfiguration |
| | 143 | | { |
| 1114 | 144 | | get { return this.propertyContainer.DiskEncryptionConfigurationProperty.Value; } |
| 247 | 145 | | set { this.propertyContainer.DiskEncryptionConfigurationProperty.Value = value; } |
| | 146 | | } |
| | 147 | |
|
| | 148 | | /// <summary> |
| | 149 | | /// Gets or sets a reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image |
| | 150 | | /// to use. |
| | 151 | | /// </summary> |
| | 152 | | public ImageReference ImageReference |
| | 153 | | { |
| 1114 | 154 | | get { return this.propertyContainer.ImageReferenceProperty.Value; } |
| 771 | 155 | | set { this.propertyContainer.ImageReferenceProperty.Value = value; } |
| | 156 | | } |
| | 157 | |
|
| | 158 | | /// <summary> |
| | 159 | | /// Gets or sets the type of on-premises license to be used when deploying the operating system. |
| | 160 | | /// </summary> |
| | 161 | | /// <remarks> |
| | 162 | | /// This only applies to images that contain the Windows operating system, and should only be used when you hold |
| | 163 | | /// valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discou |
| | 164 | | /// is applied. Values are: 'Windows_Server' - The on-premises license is for Windows Server. 'Windows_Client' - |
| | 165 | | /// The on-premises license is for Windows Client. |
| | 166 | | /// </remarks> |
| | 167 | | public string LicenseType |
| | 168 | | { |
| 1114 | 169 | | get { return this.propertyContainer.LicenseTypeProperty.Value; } |
| 239 | 170 | | set { this.propertyContainer.LicenseTypeProperty.Value = value; } |
| | 171 | | } |
| | 172 | |
|
| | 173 | | /// <summary> |
| | 174 | | /// Gets or sets the SKU of Batch Node Agent to be provisioned on the compute node. |
| | 175 | | /// </summary> |
| | 176 | | /// <remarks> |
| | 177 | | /// The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control i |
| | 178 | | /// between the node and the Batch service. There are different implementations of the node agent, known as SKUs |
| | 179 | | /// for different operating systems. |
| | 180 | | /// </remarks> |
| | 181 | | public string NodeAgentSkuId |
| | 182 | | { |
| 1114 | 183 | | get { return this.propertyContainer.NodeAgentSkuIdProperty.Value; } |
| 795 | 184 | | set { this.propertyContainer.NodeAgentSkuIdProperty.Value = value; } |
| | 185 | | } |
| | 186 | |
|
| | 187 | | /// <summary> |
| | 188 | | /// Gets or sets windows operating system settings on the Virtual Machine. This property must not be specified i |
| | 189 | | /// the ImageReference property specifies a Linux OS image. |
| | 190 | | /// </summary> |
| | 191 | | public WindowsConfiguration WindowsConfiguration |
| | 192 | | { |
| 1114 | 193 | | get { return this.propertyContainer.WindowsConfigurationProperty.Value; } |
| 275 | 194 | | set { this.propertyContainer.WindowsConfigurationProperty.Value = value; } |
| | 195 | | } |
| | 196 | |
|
| | 197 | | #endregion // VirtualMachineConfiguration |
| | 198 | |
|
| | 199 | | #region IPropertyMetadata |
| | 200 | |
|
| | 201 | | bool IModifiable.HasBeenModified |
| | 202 | | { |
| 0 | 203 | | get { return this.propertyContainer.HasBeenModified; } |
| | 204 | | } |
| | 205 | |
|
| | 206 | | bool IReadOnly.IsReadOnly |
| | 207 | | { |
| 0 | 208 | | get { return this.propertyContainer.IsReadOnly; } |
| 984 | 209 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 210 | | } |
| | 211 | |
|
| | 212 | | #endregion //IPropertyMetadata |
| | 213 | |
|
| | 214 | | #region Internal/private methods |
| | 215 | | /// <summary> |
| | 216 | | /// Return a protocol object of the requested type. |
| | 217 | | /// </summary> |
| | 218 | | /// <returns>The protocol object of the requested type.</returns> |
| | 219 | | Models.VirtualMachineConfiguration ITransportObjectProvider<Models.VirtualMachineConfiguration>.GetTransportObje |
| | 220 | | { |
| 265 | 221 | | Models.VirtualMachineConfiguration result = new Models.VirtualMachineConfiguration() |
| 265 | 222 | | { |
| 398 | 223 | | ContainerConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.ContainerConfiguration, (o) => |
| 265 | 224 | | DataDisks = UtilitiesInternal.ConvertToProtocolCollection(this.DataDisks), |
| 388 | 225 | | DiskEncryptionConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.DiskEncryptionConfigurati |
| 530 | 226 | | ImageReference = UtilitiesInternal.CreateObjectWithNullCheck(this.ImageReference, (o) => o.GetTransportO |
| 265 | 227 | | LicenseType = this.LicenseType, |
| 265 | 228 | | NodeAgentSKUId = this.NodeAgentSkuId, |
| 402 | 229 | | WindowsConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.WindowsConfiguration, (o) => o.G |
| 265 | 230 | | }; |
| | 231 | |
|
| 265 | 232 | | return result; |
| | 233 | | } |
| | 234 | |
|
| | 235 | |
|
| | 236 | | #endregion // Internal/private methods |
| | 237 | | } |
| | 238 | | } |