| | 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 network configuration for a pool. |
| | 22 | | /// </summary> |
| | 23 | | public partial class NetworkConfiguration : ITransportObjectProvider<Models.NetworkConfiguration>, IPropertyMetadata |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<Common.DynamicVNetAssignmentScope?> DynamicVNetAssignmentScopeProperty; |
| | 28 | | public readonly PropertyAccessor<PoolEndpointConfiguration> EndpointConfigurationProperty; |
| | 29 | | public readonly PropertyAccessor<PublicIPAddressConfiguration> PublicIPAddressConfigurationProperty; |
| | 30 | | public readonly PropertyAccessor<string> SubnetIdProperty; |
| | 31 | |
|
| 256 | 32 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 33 | | { |
| 256 | 34 | | this.DynamicVNetAssignmentScopeProperty = this.CreatePropertyAccessor<Common.DynamicVNetAssignmentScope? |
| 256 | 35 | | this.EndpointConfigurationProperty = this.CreatePropertyAccessor<PoolEndpointConfiguration>(nameof(Endpo |
| 256 | 36 | | this.PublicIPAddressConfigurationProperty = this.CreatePropertyAccessor<PublicIPAddressConfiguration>(na |
| 256 | 37 | | this.SubnetIdProperty = this.CreatePropertyAccessor<string>(nameof(SubnetId), BindingAccess.Read | Bindi |
| 256 | 38 | | } |
| | 39 | |
|
| 579 | 40 | | public PropertyContainer(Models.NetworkConfiguration protocolObject) : base(BindingState.Bound) |
| | 41 | | { |
| 579 | 42 | | this.DynamicVNetAssignmentScopeProperty = this.CreatePropertyAccessor( |
| 579 | 43 | | UtilitiesInternal.MapNullableEnum<Models.DynamicVNetAssignmentScope, Common.DynamicVNetAssignmentSco |
| 579 | 44 | | nameof(DynamicVNetAssignmentScope), |
| 579 | 45 | | BindingAccess.Read); |
| 579 | 46 | | this.EndpointConfigurationProperty = this.CreatePropertyAccessor( |
| 874 | 47 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.EndpointConfiguration, o => new PoolEndpo |
| 579 | 48 | | nameof(EndpointConfiguration), |
| 579 | 49 | | BindingAccess.Read); |
| 579 | 50 | | this.PublicIPAddressConfigurationProperty = this.CreatePropertyAccessor( |
| 901 | 51 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.PublicIPAddressConfiguration, o => new Pu |
| 579 | 52 | | nameof(PublicIPAddressConfiguration), |
| 579 | 53 | | BindingAccess.Read); |
| 579 | 54 | | this.SubnetIdProperty = this.CreatePropertyAccessor( |
| 579 | 55 | | protocolObject.SubnetId, |
| 579 | 56 | | nameof(SubnetId), |
| 579 | 57 | | BindingAccess.Read); |
| 579 | 58 | | } |
| | 59 | | } |
| | 60 | |
|
| | 61 | | private readonly PropertyContainer propertyContainer; |
| | 62 | |
|
| | 63 | | #region Constructors |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Initializes a new instance of the <see cref="NetworkConfiguration"/> class. |
| | 67 | | /// </summary> |
| 256 | 68 | | public NetworkConfiguration() |
| | 69 | | { |
| 256 | 70 | | this.propertyContainer = new PropertyContainer(); |
| 256 | 71 | | } |
| | 72 | |
|
| 579 | 73 | | internal NetworkConfiguration(Models.NetworkConfiguration protocolObject) |
| | 74 | | { |
| 579 | 75 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 579 | 76 | | } |
| | 77 | |
|
| | 78 | | #endregion Constructors |
| | 79 | |
|
| | 80 | | #region NetworkConfiguration |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Gets or sets the scope of the dynamic VNet assignment. |
| | 84 | | /// </summary> |
| | 85 | | /// <remarks> |
| | 86 | | /// This property can only be specified for pools created with a <see cref="CloudPool.VirtualMachineConfiguratio |
| | 87 | | /// </remarks> |
| | 88 | | public Common.DynamicVNetAssignmentScope? DynamicVNetAssignmentScope |
| | 89 | | { |
| 1090 | 90 | | get { return this.propertyContainer.DynamicVNetAssignmentScopeProperty.Value; } |
| 267 | 91 | | set { this.propertyContainer.DynamicVNetAssignmentScopeProperty.Value = value; } |
| | 92 | | } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets the configuration for endpoints on compute nodes in the Batch pool. |
| | 96 | | /// </summary> |
| | 97 | | /// <remarks> |
| | 98 | | /// This property can only be specified for pools created with a <see cref="CloudPool.VirtualMachineConfiguratio |
| | 99 | | /// </remarks> |
| | 100 | | public PoolEndpointConfiguration EndpointConfiguration |
| | 101 | | { |
| 1090 | 102 | | get { return this.propertyContainer.EndpointConfigurationProperty.Value; } |
| 247 | 103 | | set { this.propertyContainer.EndpointConfigurationProperty.Value = value; } |
| | 104 | | } |
| | 105 | |
|
| | 106 | | /// <summary> |
| | 107 | | /// Gets or sets the Public IPAddress configuration for Compute Nodes in the Batch Pool. |
| | 108 | | /// </summary> |
| | 109 | | /// <remarks> |
| | 110 | | /// Public IP configuration property is only supported on Pools created with a <see cref="CloudPool.VirtualMachi |
| | 111 | | /// </remarks> |
| | 112 | | public PublicIPAddressConfiguration PublicIPAddressConfiguration |
| | 113 | | { |
| 1090 | 114 | | get { return this.propertyContainer.PublicIPAddressConfigurationProperty.Value; } |
| 273 | 115 | | set { this.propertyContainer.PublicIPAddressConfigurationProperty.Value = value; } |
| | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> |
| | 119 | | /// Gets or sets the ARM resource identifier of the virtual network subnet which the compute nodes of the pool w |
| | 120 | | /// join. |
| | 121 | | /// </summary> |
| | 122 | | /// <remarks> |
| | 123 | | /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified su |
| | 124 | | /// should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't h |
| | 125 | | /// enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The |
| | 126 | | /// 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Acces |
| | 127 | | /// Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Bat |
| | 128 | | /// service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified |
| | 129 | | /// VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specifie |
| | 130 | | /// subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For |
| | 131 | | /// created via <see cref="CloudPool.VirtualMachineConfiguration"/> only only ARM virtual networks ('Microsoft. |
| | 132 | | /// are supported, but for pools created with <see cref="CloudPool.CloudServiceConfiguration"/> both ARM and cla |
| | 133 | | /// virtual networks are supported. If the specified VNet has any associated Network Security Groups (NSG), then |
| | 134 | | /// a few reserved system ports must be enabled for inbound communication. For pools created with a <see cref="C |
| | 135 | | /// enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with |
| | 136 | | /// a <see cref="CloudPool.CloudServiceConfiguration"/>, enable ports 10100, 20100, and 30100. Also enable outbo |
| | 137 | | /// connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch |
| | 138 | | /// </remarks> |
| | 139 | | public string SubnetId |
| | 140 | | { |
| 1090 | 141 | | get { return this.propertyContainer.SubnetIdProperty.Value; } |
| 271 | 142 | | set { this.propertyContainer.SubnetIdProperty.Value = value; } |
| | 143 | | } |
| | 144 | |
|
| | 145 | | #endregion // NetworkConfiguration |
| | 146 | |
|
| | 147 | | #region IPropertyMetadata |
| | 148 | |
|
| | 149 | | bool IModifiable.HasBeenModified |
| | 150 | | { |
| 0 | 151 | | get { return this.propertyContainer.HasBeenModified; } |
| | 152 | | } |
| | 153 | |
|
| | 154 | | bool IReadOnly.IsReadOnly |
| | 155 | | { |
| 0 | 156 | | get { return this.propertyContainer.IsReadOnly; } |
| 1160 | 157 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 158 | | } |
| | 159 | |
|
| | 160 | | #endregion //IPropertyMetadata |
| | 161 | |
|
| | 162 | | #region Internal/private methods |
| | 163 | | /// <summary> |
| | 164 | | /// Return a protocol object of the requested type. |
| | 165 | | /// </summary> |
| | 166 | | /// <returns>The protocol object of the requested type.</returns> |
| | 167 | | Models.NetworkConfiguration ITransportObjectProvider<Models.NetworkConfiguration>.GetTransportObject() |
| | 168 | | { |
| 255 | 169 | | Models.NetworkConfiguration result = new Models.NetworkConfiguration() |
| 255 | 170 | | { |
| 255 | 171 | | DynamicVNetAssignmentScope = UtilitiesInternal.MapNullableEnum<Common.DynamicVNetAssignmentScope, Models |
| 378 | 172 | | EndpointConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.EndpointConfiguration, (o) => o |
| 391 | 173 | | PublicIPAddressConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.PublicIPAddressConfigura |
| 255 | 174 | | SubnetId = this.SubnetId, |
| 255 | 175 | | }; |
| | 176 | |
|
| 255 | 177 | | return result; |
| | 178 | | } |
| | 179 | |
|
| | 180 | |
|
| | 181 | | #endregion // Internal/private methods |
| | 182 | | } |
| | 183 | | } |