< Summary

Class:Microsoft.Azure.Batch.VirtualMachineConfiguration
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\VirtualMachineConfiguration.cs
Covered lines:76
Uncovered lines:2
Coverable lines:78
Total lines:238
Line coverage:97.4% (76 of 78)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
get_ContainerConfiguration()-100%100%
set_ContainerConfiguration(...)-100%100%
get_DataDisks()-100%100%
set_DataDisks(...)-100%100%
get_DiskEncryptionConfiguration()-100%100%
set_DiskEncryptionConfiguration(...)-100%100%
get_ImageReference()-100%100%
set_ImageReference(...)-100%100%
get_LicenseType()-100%100%
set_LicenseType(...)-100%100%
get_NodeAgentSkuId()-100%100%
set_NodeAgentSkuId(...)-100%100%
get_WindowsConfiguration()-100%100%
set_WindowsConfiguration(...)-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-0%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-0%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-100%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.VirtualMachineConfiguration>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\VirtualMachineConfiguration.cs

#LineLine coverage
 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
 13namespace 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
 26635            public PropertyContainer() : base(BindingState.Unbound)
 36            {
 26637                this.ContainerConfigurationProperty = this.CreatePropertyAccessor<ContainerConfiguration>(nameof(Contain
 26638                this.DataDisksProperty = this.CreatePropertyAccessor<IList<DataDisk>>(nameof(DataDisks), BindingAccess.R
 26639                this.DiskEncryptionConfigurationProperty = this.CreatePropertyAccessor<DiskEncryptionConfiguration>(name
 26640                this.ImageReferenceProperty = this.CreatePropertyAccessor<ImageReference>(nameof(ImageReference), Bindin
 26641                this.LicenseTypeProperty = this.CreatePropertyAccessor<string>(nameof(LicenseType), BindingAccess.Read |
 26642                this.NodeAgentSkuIdProperty = this.CreatePropertyAccessor<string>(nameof(NodeAgentSkuId), BindingAccess.
 26643                this.WindowsConfigurationProperty = this.CreatePropertyAccessor<WindowsConfiguration>(nameof(WindowsConf
 26644            }
 45
 58346            public PropertyContainer(Models.VirtualMachineConfiguration protocolObject) : base(BindingState.Bound)
 47            {
 58348                this.ContainerConfigurationProperty = this.CreatePropertyAccessor(
 86749                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ContainerConfiguration, o => new Containe
 58350                    nameof(ContainerConfiguration),
 58351                    BindingAccess.Read | BindingAccess.Write);
 58352                this.DataDisksProperty = this.CreatePropertyAccessor(
 58353                    DataDisk.ConvertFromProtocolCollection(protocolObject.DataDisks),
 58354                    nameof(DataDisks),
 58355                    BindingAccess.Read | BindingAccess.Write);
 58356                this.DiskEncryptionConfigurationProperty = this.CreatePropertyAccessor(
 87857                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DiskEncryptionConfiguration, o => new Dis
 58358                    nameof(DiskEncryptionConfiguration),
 58359                    BindingAccess.Read | BindingAccess.Write);
 58360                this.ImageReferenceProperty = this.CreatePropertyAccessor(
 88061                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ImageReference, o => new ImageReference(o
 58362                    nameof(ImageReference),
 58363                    BindingAccess.Read | BindingAccess.Write);
 58364                this.LicenseTypeProperty = this.CreatePropertyAccessor(
 58365                    protocolObject.LicenseType,
 58366                    nameof(LicenseType),
 58367                    BindingAccess.Read | BindingAccess.Write);
 58368                this.NodeAgentSkuIdProperty = this.CreatePropertyAccessor(
 58369                    protocolObject.NodeAgentSKUId,
 58370                    nameof(NodeAgentSkuId),
 58371                    BindingAccess.Read | BindingAccess.Write);
 58372                this.WindowsConfigurationProperty = this.CreatePropertyAccessor(
 86173                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.WindowsConfiguration, o => new WindowsCon
 58374                    nameof(WindowsConfiguration),
 58375                    BindingAccess.Read | BindingAccess.Write);
 58376            }
 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>
 26688        public VirtualMachineConfiguration(
 26689            ImageReference imageReference,
 26690            string nodeAgentSkuId)
 91        {
 26692            this.propertyContainer = new PropertyContainer();
 26693            this.ImageReference = imageReference;
 26694            this.NodeAgentSkuId = nodeAgentSkuId;
 26695        }
 96
 58397        internal VirtualMachineConfiguration(Models.VirtualMachineConfiguration protocolObject)
 98        {
 58399            this.propertyContainer = new PropertyContainer(protocolObject);
 583100        }
 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        {
 1114116            get { return this.propertyContainer.ContainerConfigurationProperty.Value; }
 267117            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        {
 1114129            get { return this.propertyContainer.DataDisksProperty.Value; }
 130            set
 131            {
 130132                this.propertyContainer.DataDisksProperty.Value = ConcurrentChangeTrackedModifiableList<DataDisk>.Transfo
 129133            }
 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        {
 1114144            get { return this.propertyContainer.DiskEncryptionConfigurationProperty.Value; }
 247145            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        {
 1114154            get { return this.propertyContainer.ImageReferenceProperty.Value; }
 771155            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        {
 1114169            get { return this.propertyContainer.LicenseTypeProperty.Value; }
 239170            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        {
 1114183            get { return this.propertyContainer.NodeAgentSkuIdProperty.Value; }
 795184            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        {
 1114193            get { return this.propertyContainer.WindowsConfigurationProperty.Value; }
 275194            set { this.propertyContainer.WindowsConfigurationProperty.Value = value; }
 195        }
 196
 197        #endregion // VirtualMachineConfiguration
 198
 199        #region IPropertyMetadata
 200
 201        bool IModifiable.HasBeenModified
 202        {
 0203            get { return this.propertyContainer.HasBeenModified; }
 204        }
 205
 206        bool IReadOnly.IsReadOnly
 207        {
 0208            get { return this.propertyContainer.IsReadOnly; }
 984209            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        {
 265221            Models.VirtualMachineConfiguration result = new Models.VirtualMachineConfiguration()
 265222            {
 398223                ContainerConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.ContainerConfiguration, (o) =>
 265224                DataDisks = UtilitiesInternal.ConvertToProtocolCollection(this.DataDisks),
 388225                DiskEncryptionConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.DiskEncryptionConfigurati
 530226                ImageReference = UtilitiesInternal.CreateObjectWithNullCheck(this.ImageReference, (o) => o.GetTransportO
 265227                LicenseType = this.LicenseType,
 265228                NodeAgentSKUId = this.NodeAgentSkuId,
 402229                WindowsConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.WindowsConfiguration, (o) => o.G
 265230            };
 231
 265232            return result;
 233        }
 234
 235
 236        #endregion // Internal/private methods
 237    }
 238}