< Summary

Class:Microsoft.Azure.Batch.JobReleaseTask
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\JobReleaseTask.cs
C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\JobReleaseTask.cs
Covered lines:85
Uncovered lines:4
Coverable lines:89
Total lines:274
Line coverage:95.5% (85 of 89)
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%
.ctor(...)-100%100%
get_CommandLine()-100%100%
set_CommandLine(...)-100%100%
get_ContainerSettings()-100%100%
set_ContainerSettings(...)-100%100%
get_EnvironmentSettings()-100%100%
set_EnvironmentSettings(...)-100%100%
get_Id()-100%100%
set_Id(...)-100%100%
get_MaxWallClockTime()-100%100%
set_MaxWallClockTime(...)-100%100%
get_ResourceFiles()-100%100%
set_ResourceFiles(...)-100%100%
get_RetentionTime()-100%100%
set_RetentionTime(...)-100%100%
get_UserIdentity()-100%100%
set_UserIdentity(...)-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.JobReleaseTask>.GetTransportObject()-100%100%
.ctor()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\JobReleaseTask.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
 21814{
 15    using Models = Microsoft.Azure.Batch.Protocol.Models;
 21816    using System;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// A Job Release task to run on job completion on any compute node where the job has run.
 22    /// </summary>
 23    public partial class JobReleaseTask : ITransportObjectProvider<Models.JobReleaseTask>, IPropertyMetadata
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<string> CommandLineProperty;
 28            public readonly PropertyAccessor<TaskContainerSettings> ContainerSettingsProperty;
 29            public readonly PropertyAccessor<IList<EnvironmentSetting>> EnvironmentSettingsProperty;
 30            public readonly PropertyAccessor<string> IdProperty;
 31            public readonly PropertyAccessor<TimeSpan?> MaxWallClockTimeProperty;
 32            public readonly PropertyAccessor<IList<ResourceFile>> ResourceFilesProperty;
 33            public readonly PropertyAccessor<TimeSpan?> RetentionTimeProperty;
 34            public readonly PropertyAccessor<UserIdentity> UserIdentityProperty;
 35
 21836            public PropertyContainer() : base(BindingState.Unbound)
 37            {
 21838                this.CommandLineProperty = this.CreatePropertyAccessor<string>(nameof(CommandLine), BindingAccess.Read |
 21839                this.ContainerSettingsProperty = this.CreatePropertyAccessor<TaskContainerSettings>(nameof(ContainerSett
 21840                this.EnvironmentSettingsProperty = this.CreatePropertyAccessor<IList<EnvironmentSetting>>(nameof(Environ
 21841                this.IdProperty = this.CreatePropertyAccessor<string>(nameof(Id), BindingAccess.Read | BindingAccess.Wri
 21842                this.MaxWallClockTimeProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(MaxWallClockTime), Binding
 21843                this.ResourceFilesProperty = this.CreatePropertyAccessor<IList<ResourceFile>>(nameof(ResourceFiles), Bin
 21844                this.RetentionTimeProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(RetentionTime), BindingAccess
 21845                this.UserIdentityProperty = this.CreatePropertyAccessor<UserIdentity>(nameof(UserIdentity), BindingAcces
 21846            }
 47
 75648            public PropertyContainer(Models.JobReleaseTask protocolObject) : base(BindingState.Bound)
 49            {
 75650                this.CommandLineProperty = this.CreatePropertyAccessor(
 75651                    protocolObject.CommandLine,
 75652                    nameof(CommandLine),
 75653                    BindingAccess.Read | BindingAccess.Write);
 75654                this.ContainerSettingsProperty = this.CreatePropertyAccessor(
 111855                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ContainerSettings, o => new TaskContainer
 75656                    nameof(ContainerSettings),
 75657                    BindingAccess.Read);
 75658                this.EnvironmentSettingsProperty = this.CreatePropertyAccessor(
 75659                    EnvironmentSetting.ConvertFromProtocolCollection(protocolObject.EnvironmentSettings),
 75660                    nameof(EnvironmentSettings),
 75661                    BindingAccess.Read | BindingAccess.Write);
 75662                this.IdProperty = this.CreatePropertyAccessor(
 75663                    protocolObject.Id,
 75664                    nameof(Id),
 75665                    BindingAccess.Read | BindingAccess.Write);
 75666                this.MaxWallClockTimeProperty = this.CreatePropertyAccessor(
 75667                    protocolObject.MaxWallClockTime,
 75668                    nameof(MaxWallClockTime),
 75669                    BindingAccess.Read | BindingAccess.Write);
 75670                this.ResourceFilesProperty = this.CreatePropertyAccessor(
 75671                    ResourceFile.ConvertFromProtocolCollection(protocolObject.ResourceFiles),
 75672                    nameof(ResourceFiles),
 75673                    BindingAccess.Read | BindingAccess.Write);
 75674                this.RetentionTimeProperty = this.CreatePropertyAccessor(
 75675                    protocolObject.RetentionTime,
 75676                    nameof(RetentionTime),
 75677                    BindingAccess.Read | BindingAccess.Write);
 75678                this.UserIdentityProperty = this.CreatePropertyAccessor(
 115479                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.UserIdentity, o => new UserIdentity(o)),
 75680                    nameof(UserIdentity),
 75681                    BindingAccess.Read | BindingAccess.Write);
 75682            }
 83        }
 84
 85        private readonly PropertyContainer propertyContainer;
 86
 87        #region Constructors
 88
 89        /// <summary>
 90        /// Initializes a new instance of the <see cref="JobReleaseTask"/> class.
 91        /// </summary>
 92        /// <param name='commandLine'>The command line of the task.</param>
 21893        public JobReleaseTask(
 21894            string commandLine)
 95        {
 21896            this.propertyContainer = new PropertyContainer();
 21897            this.CommandLine = commandLine;
 21898        }
 99
 756100        internal JobReleaseTask(Models.JobReleaseTask protocolObject)
 101        {
 756102            this.propertyContainer = new PropertyContainer(protocolObject);
 756103        }
 104
 105        #endregion Constructors
 106
 107        #region JobReleaseTask
 108
 109        /// <summary>
 110        /// Gets or sets the command line of the task.
 111        /// </summary>
 112        /// <remarks>
 113        /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as e
 114        /// variable expansion. If you want to take advantage of such features, you should invoke the shell in the comma
 115        /// line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command lin
 116        /// refers to file paths, it should use a relative path (relative to the task working directory), or use the Bat
 117        /// provided environment variables (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-
 118        /// </remarks>
 119        public string CommandLine
 120        {
 1191121            get { return this.propertyContainer.CommandLineProperty.Value; }
 645122            set { this.propertyContainer.CommandLineProperty.Value = value; }
 123        }
 124
 125        /// <summary>
 126        /// Gets or sets the settings for the container under which the task runs.
 127        /// </summary>
 128        /// <remarks>
 129        /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batc
 130        /// directories on the node) are mapped into the container, all task environment variables are mapped into the c
 131        /// and the task command line is executed in the container. Files produced in the container outside of AZ_BATCH_
 132        /// might not be reflected to the host disk, meaning that Batch file APIs will not be able to access them.
 133        /// </remarks>
 134        public TaskContainerSettings ContainerSettings
 135        {
 1191136            get { return this.propertyContainer.ContainerSettingsProperty.Value; }
 211137            set { this.propertyContainer.ContainerSettingsProperty.Value = value; }
 138        }
 139
 140        /// <summary>
 141        /// Gets or sets the collection of EnvironmentSetting instances.
 142        /// </summary>
 143        public IList<EnvironmentSetting> EnvironmentSettings
 144        {
 1191145            get { return this.propertyContainer.EnvironmentSettingsProperty.Value; }
 146            set
 147            {
 110148                this.propertyContainer.EnvironmentSettingsProperty.Value = ConcurrentChangeTrackedModifiableList<Environ
 109149            }
 150        }
 151
 152        /// <summary>
 153        /// Gets or sets the id of the task.
 154        /// </summary>
 155        public string Id
 156        {
 1191157            get { return this.propertyContainer.IdProperty.Value; }
 209158            set { this.propertyContainer.IdProperty.Value = value; }
 159        }
 160
 161        /// <summary>
 162        /// Gets or sets the maximum duration of time for which a task is allowed to run from the time it is created.
 163        /// </summary>
 164        public TimeSpan? MaxWallClockTime
 165        {
 1191166            get { return this.propertyContainer.MaxWallClockTimeProperty.Value; }
 219167            set { this.propertyContainer.MaxWallClockTimeProperty.Value = value; }
 168        }
 169
 170        /// <summary>
 171        /// Gets or sets a list of files that the Batch service will download to the compute node before running the com
 172        /// line.
 173        /// </summary>
 174        /// <remarks>
 175        /// There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail
 176        /// and the response error code will be RequestEntityTooLarge. If this occurs, the collection of resource files 
 177        /// be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers.
 178        /// </remarks>
 179        public IList<ResourceFile> ResourceFiles
 180        {
 1191181            get { return this.propertyContainer.ResourceFilesProperty.Value; }
 182            set
 183            {
 109184                this.propertyContainer.ResourceFilesProperty.Value = ConcurrentChangeTrackedModifiableList<ResourceFile>
 108185            }
 186        }
 187
 188        /// <summary>
 189        /// Gets or sets the duration of time for which files in the task's working directory are retained, from the tim
 190        /// it completes execution. After this duration, the task's working directory is reclaimed.
 191        /// </summary>
 192        /// <remarks>
 193        /// The default is 7 days, i.e. the task directory will be retained for 7 days unless the compute node is remove
 194        /// or the job is deleted.
 195        /// </remarks>
 196        public TimeSpan? RetentionTime
 197        {
 1191198            get { return this.propertyContainer.RetentionTimeProperty.Value; }
 213199            set { this.propertyContainer.RetentionTimeProperty.Value = value; }
 200        }
 201
 202        /// <summary>
 203        /// Gets or sets the user identity under which the task runs.
 204        /// </summary>
 205        /// <remarks>
 206        /// If omitted, the task runs as a non-administrative user unique to the task.
 207        /// </remarks>
 208        public UserIdentity UserIdentity
 209        {
 1191210            get { return this.propertyContainer.UserIdentityProperty.Value; }
 189211            set { this.propertyContainer.UserIdentityProperty.Value = value; }
 212        }
 213
 214        #endregion // JobReleaseTask
 215
 216        #region IPropertyMetadata
 217
 218        bool IModifiable.HasBeenModified
 219        {
 0220            get { return this.propertyContainer.HasBeenModified; }
 221        }
 222
 223        bool IReadOnly.IsReadOnly
 224        {
 0225            get { return this.propertyContainer.IsReadOnly; }
 1018226            set { this.propertyContainer.IsReadOnly = value; }
 227        }
 228
 229        #endregion //IPropertyMetadata
 230
 231        #region Internal/private methods
 232        /// <summary>
 233        /// Return a protocol object of the requested type.
 234        /// </summary>
 235        /// <returns>The protocol object of the requested type.</returns>
 236        Models.JobReleaseTask ITransportObjectProvider<Models.JobReleaseTask>.GetTransportObject()
 237        {
 217238            Models.JobReleaseTask result = new Models.JobReleaseTask()
 217239            {
 217240                CommandLine = this.CommandLine,
 322241                ContainerSettings = UtilitiesInternal.CreateObjectWithNullCheck(this.ContainerSettings, (o) => o.GetTran
 217242                EnvironmentSettings = UtilitiesInternal.ConvertToProtocolCollection(this.EnvironmentSettings),
 217243                Id = this.Id,
 217244                MaxWallClockTime = this.MaxWallClockTime,
 217245                ResourceFiles = UtilitiesInternal.ConvertToProtocolCollection(this.ResourceFiles),
 217246                RetentionTime = this.RetentionTime,
 311247                UserIdentity = UtilitiesInternal.CreateObjectWithNullCheck(this.UserIdentity, (o) => o.GetTransportObjec
 217248            };
 249
 217250            return result;
 251        }
 252
 253
 254        #endregion // Internal/private methods
 255    }
 256}

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\JobReleaseTask.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
 5namespace Microsoft.Azure.Batch
 6{
 7    using System;
 8
 9    public partial class JobReleaseTask
 10    {
 11        /// <summary>
 12        /// Initializes a new instance of the <see cref="JobReleaseTask"/> class.
 13        /// </summary>
 014        public JobReleaseTask() : this(commandLine: null)
 15        {
 016        }
 17    }
 18}