/// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ClusterConfigurationUpgradeStatusInfo GetFromJsonProperties(JsonReader reader)
        {
            var upgradeState   = default(UpgradeState?);
            var progressStatus = default(int?);
            var configVersion  = default(string);
            var details        = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("UpgradeState", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeState = UpgradeStateConverter.Deserialize(reader);
                }
                else if (string.Compare("ProgressStatus", propName, StringComparison.Ordinal) == 0)
                {
                    progressStatus = reader.ReadValueAsInt();
                }
                else if (string.Compare("ConfigVersion", propName, StringComparison.Ordinal) == 0)
                {
                    configVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("Details", propName, StringComparison.Ordinal) == 0)
                {
                    details = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ClusterConfigurationUpgradeStatusInfo(
                       upgradeState: upgradeState,
                       progressStatus: progressStatus,
                       configVersion: configVersion,
                       details: details));
        }
예제 #2
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ApplicationUpgradeProgressInfo GetFromJsonProperties(JsonReader reader)
        {
            var name     = default(string);
            var typeName = default(string);
            var targetApplicationTypeVersion = default(string);
            var upgradeDomains                      = default(IEnumerable <UpgradeDomainInfo>);
            var upgradeState                        = default(UpgradeState?);
            var nextUpgradeDomain                   = default(string);
            var rollingUpgradeMode                  = default(UpgradeMode?);
            var upgradeDescription                  = default(ApplicationUpgradeDescription);
            var upgradeDurationInMilliseconds       = default(string);
            var upgradeDomainDurationInMilliseconds = default(string);
            var unhealthyEvaluations                = default(IEnumerable <HealthEvaluationWrapper>);
            var currentUpgradeDomainProgress        = default(CurrentUpgradeDomainProgressInfo);
            var startTimestampUtc                   = default(string);
            var failureTimestampUtc                 = default(string);
            var failureReason                       = default(FailureReason?);
            var upgradeDomainProgressAtFailure      = default(FailureUpgradeDomainProgressInfo);
            var upgradeStatusDetails                = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Name", propName, StringComparison.Ordinal) == 0)
                {
                    name = reader.ReadValueAsString();
                }
                else if (string.Compare("TypeName", propName, StringComparison.Ordinal) == 0)
                {
                    typeName = reader.ReadValueAsString();
                }
                else if (string.Compare("TargetApplicationTypeVersion", propName, StringComparison.Ordinal) == 0)
                {
                    targetApplicationTypeVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeDomains", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDomains = reader.ReadList(UpgradeDomainInfoConverter.Deserialize);
                }
                else if (string.Compare("UpgradeState", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeState = UpgradeStateConverter.Deserialize(reader);
                }
                else if (string.Compare("NextUpgradeDomain", propName, StringComparison.Ordinal) == 0)
                {
                    nextUpgradeDomain = reader.ReadValueAsString();
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.Ordinal) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDescription", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDescription = ApplicationUpgradeDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDurationInMilliseconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDurationInMilliseconds = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeDomainDurationInMilliseconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDomainDurationInMilliseconds = reader.ReadValueAsString();
                }
                else if (string.Compare("UnhealthyEvaluations", propName, StringComparison.Ordinal) == 0)
                {
                    unhealthyEvaluations = reader.ReadList(HealthEvaluationWrapperConverter.Deserialize);
                }
                else if (string.Compare("CurrentUpgradeDomainProgress", propName, StringComparison.Ordinal) == 0)
                {
                    currentUpgradeDomainProgress = CurrentUpgradeDomainProgressInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("StartTimestampUtc", propName, StringComparison.Ordinal) == 0)
                {
                    startTimestampUtc = reader.ReadValueAsString();
                }
                else if (string.Compare("FailureTimestampUtc", propName, StringComparison.Ordinal) == 0)
                {
                    failureTimestampUtc = reader.ReadValueAsString();
                }
                else if (string.Compare("FailureReason", propName, StringComparison.Ordinal) == 0)
                {
                    failureReason = FailureReasonConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDomainProgressAtFailure", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDomainProgressAtFailure = FailureUpgradeDomainProgressInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeStatusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeStatusDetails = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ApplicationUpgradeProgressInfo(
                       name: name,
                       typeName: typeName,
                       targetApplicationTypeVersion: targetApplicationTypeVersion,
                       upgradeDomains: upgradeDomains,
                       upgradeState: upgradeState,
                       nextUpgradeDomain: nextUpgradeDomain,
                       rollingUpgradeMode: rollingUpgradeMode,
                       upgradeDescription: upgradeDescription,
                       upgradeDurationInMilliseconds: upgradeDurationInMilliseconds,
                       upgradeDomainDurationInMilliseconds: upgradeDomainDurationInMilliseconds,
                       unhealthyEvaluations: unhealthyEvaluations,
                       currentUpgradeDomainProgress: currentUpgradeDomainProgress,
                       startTimestampUtc: startTimestampUtc,
                       failureTimestampUtc: failureTimestampUtc,
                       failureReason: failureReason,
                       upgradeDomainProgressAtFailure: upgradeDomainProgressAtFailure,
                       upgradeStatusDetails: upgradeStatusDetails));
        }
예제 #3
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ClusterUpgradeProgressObject GetFromJsonProperties(JsonReader reader)
        {
            var codeVersion                         = default(string);
            var configVersion                       = default(string);
            var upgradeDomains                      = default(IEnumerable <UpgradeDomainInfo>);
            var upgradeUnits                        = default(IEnumerable <UpgradeUnitInfo>);
            var upgradeState                        = default(UpgradeState?);
            var nextUpgradeDomain                   = default(string);
            var rollingUpgradeMode                  = default(UpgradeMode?);
            var upgradeDescription                  = default(ClusterUpgradeDescriptionObject);
            var upgradeDurationInMilliseconds       = default(string);
            var upgradeDomainDurationInMilliseconds = default(string);
            var unhealthyEvaluations                = default(IEnumerable <HealthEvaluationWrapper>);
            var currentUpgradeDomainProgress        = default(CurrentUpgradeDomainProgressInfo);
            var currentUpgradeUnitsProgress         = default(CurrentUpgradeUnitsProgressInfo);
            var startTimestampUtc                   = default(string);
            var failureTimestampUtc                 = default(string);
            var failureReason                       = default(FailureReason?);
            var upgradeDomainProgressAtFailure      = default(FailedUpgradeDomainProgressObject);
            var isNodeByNode                        = default(bool?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("CodeVersion", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    codeVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("ConfigVersion", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    configVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeDomains", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeDomains = reader.ReadList(UpgradeDomainInfoConverter.Deserialize);
                }
                else if (string.Compare("UpgradeUnits", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeUnits = reader.ReadList(UpgradeUnitInfoConverter.Deserialize);
                }
                else if (string.Compare("UpgradeState", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeState = UpgradeStateConverter.Deserialize(reader);
                }
                else if (string.Compare("NextUpgradeDomain", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    nextUpgradeDomain = reader.ReadValueAsString();
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeDescription = ClusterUpgradeDescriptionObjectConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDurationInMilliseconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeDurationInMilliseconds = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeDomainDurationInMilliseconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeDomainDurationInMilliseconds = reader.ReadValueAsString();
                }
                else if (string.Compare("UnhealthyEvaluations", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    unhealthyEvaluations = reader.ReadList(HealthEvaluationWrapperConverter.Deserialize);
                }
                else if (string.Compare("CurrentUpgradeDomainProgress", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    currentUpgradeDomainProgress = CurrentUpgradeDomainProgressInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("CurrentUpgradeUnitsProgress", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    currentUpgradeUnitsProgress = CurrentUpgradeUnitsProgressInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("StartTimestampUtc", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    startTimestampUtc = reader.ReadValueAsString();
                }
                else if (string.Compare("FailureTimestampUtc", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    failureTimestampUtc = reader.ReadValueAsString();
                }
                else if (string.Compare("FailureReason", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    failureReason = FailureReasonConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeDomainProgressAtFailure", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeDomainProgressAtFailure = FailedUpgradeDomainProgressObjectConverter.Deserialize(reader);
                }
                else if (string.Compare("IsNodeByNode", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    isNodeByNode = reader.ReadValueAsBool();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ClusterUpgradeProgressObject(
                       codeVersion: codeVersion,
                       configVersion: configVersion,
                       upgradeDomains: upgradeDomains,
                       upgradeUnits: upgradeUnits,
                       upgradeState: upgradeState,
                       nextUpgradeDomain: nextUpgradeDomain,
                       rollingUpgradeMode: rollingUpgradeMode,
                       upgradeDescription: upgradeDescription,
                       upgradeDurationInMilliseconds: upgradeDurationInMilliseconds,
                       upgradeDomainDurationInMilliseconds: upgradeDomainDurationInMilliseconds,
                       unhealthyEvaluations: unhealthyEvaluations,
                       currentUpgradeDomainProgress: currentUpgradeDomainProgress,
                       currentUpgradeUnitsProgress: currentUpgradeUnitsProgress,
                       startTimestampUtc: startTimestampUtc,
                       failureTimestampUtc: failureTimestampUtc,
                       failureReason: failureReason,
                       upgradeDomainProgressAtFailure: upgradeDomainProgressAtFailure,
                       isNodeByNode: isNodeByNode));
        }