< Summary

Class:Azure.ResourceManager.Compute.Models.RollingUpgradePolicy
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradePolicy.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradePolicy.Serialization.cs
Covered lines:0
Uncovered lines:48
Coverable lines:48
Total lines:129
Line coverage:0% (0 of 48)
Covered branches:0
Total branches:26
Branch coverage:0% (0 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_MaxBatchInstancePercent()-0%100%
get_MaxUnhealthyInstancePercent()-0%100%
get_MaxUnhealthyUpgradedInstancePercent()-0%100%
get_PauseTimeBetweenBatches()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRollingUpgradePolicy(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradePolicy.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.ResourceManager.Compute.Models
 9{
 10    /// <summary> The configuration parameters used while performing a rolling upgrade. </summary>
 11    public partial class RollingUpgradePolicy
 12    {
 13        /// <summary> Initializes a new instance of RollingUpgradePolicy. </summary>
 014        public RollingUpgradePolicy()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RollingUpgradePolicy. </summary>
 19        /// <param name="maxBatchInstancePercent"> The maximum percent of total virtual machine instances that will be u
 20        /// <param name="maxUnhealthyInstancePercent"> The maximum percentage of the total virtual machine instances in 
 21        /// <param name="maxUnhealthyUpgradedInstancePercent"> The maximum percentage of upgraded virtual machine instan
 22        /// <param name="pauseTimeBetweenBatches"> The wait time between completing the update for all virtual machines 
 023        internal RollingUpgradePolicy(int? maxBatchInstancePercent, int? maxUnhealthyInstancePercent, int? maxUnhealthyU
 24        {
 025            MaxBatchInstancePercent = maxBatchInstancePercent;
 026            MaxUnhealthyInstancePercent = maxUnhealthyInstancePercent;
 027            MaxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent;
 028            PauseTimeBetweenBatches = pauseTimeBetweenBatches;
 029        }
 30
 31        /// <summary> The maximum percent of total virtual machine instances that will be upgraded simultaneously by the
 032        public int? MaxBatchInstancePercent { get; set; }
 33        /// <summary> The maximum percentage of the total virtual machine instances in the scale set that can be simulta
 034        public int? MaxUnhealthyInstancePercent { get; set; }
 35        /// <summary> The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealt
 036        public int? MaxUnhealthyUpgradedInstancePercent { get; set; }
 37        /// <summary> The wait time between completing the update for all virtual machines in one batch and starting the
 038        public string PauseTimeBetweenBatches { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradePolicy.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class RollingUpgradePolicy : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (MaxBatchInstancePercent != null)
 19            {
 020                writer.WritePropertyName("maxBatchInstancePercent");
 021                writer.WriteNumberValue(MaxBatchInstancePercent.Value);
 22            }
 023            if (MaxUnhealthyInstancePercent != null)
 24            {
 025                writer.WritePropertyName("maxUnhealthyInstancePercent");
 026                writer.WriteNumberValue(MaxUnhealthyInstancePercent.Value);
 27            }
 028            if (MaxUnhealthyUpgradedInstancePercent != null)
 29            {
 030                writer.WritePropertyName("maxUnhealthyUpgradedInstancePercent");
 031                writer.WriteNumberValue(MaxUnhealthyUpgradedInstancePercent.Value);
 32            }
 033            if (PauseTimeBetweenBatches != null)
 34            {
 035                writer.WritePropertyName("pauseTimeBetweenBatches");
 036                writer.WriteStringValue(PauseTimeBetweenBatches);
 37            }
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static RollingUpgradePolicy DeserializeRollingUpgradePolicy(JsonElement element)
 42        {
 043            int? maxBatchInstancePercent = default;
 044            int? maxUnhealthyInstancePercent = default;
 045            int? maxUnhealthyUpgradedInstancePercent = default;
 046            string pauseTimeBetweenBatches = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("maxBatchInstancePercent"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    maxBatchInstancePercent = property.Value.GetInt32();
 056                    continue;
 57                }
 058                if (property.NameEquals("maxUnhealthyInstancePercent"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    maxUnhealthyInstancePercent = property.Value.GetInt32();
 065                    continue;
 66                }
 067                if (property.NameEquals("maxUnhealthyUpgradedInstancePercent"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    maxUnhealthyUpgradedInstancePercent = property.Value.GetInt32();
 074                    continue;
 75                }
 076                if (property.NameEquals("pauseTimeBetweenBatches"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    pauseTimeBetweenBatches = property.Value.GetString();
 83                    continue;
 84                }
 85            }
 086            return new RollingUpgradePolicy(maxBatchInstancePercent, maxUnhealthyInstancePercent, maxUnhealthyUpgradedIn
 87        }
 88    }
 89}