/// <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 ApplicationUpgradeUpdateDescription GetFromJsonProperties(JsonReader reader)
        {
            var name                    = default(ApplicationName);
            var upgradeKind             = default(UpgradeKind?);
            var applicationHealthPolicy = default(ApplicationHealthPolicy);
            var updateDescription       = default(RollingUpgradeUpdateDescription);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Name", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    name = ApplicationNameConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeKind", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    upgradeKind = UpgradeKindConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationHealthPolicy", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    applicationHealthPolicy = ApplicationHealthPolicyConverter.Deserialize(reader);
                }
                else if (string.Compare("UpdateDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    updateDescription = RollingUpgradeUpdateDescriptionConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ApplicationUpgradeUpdateDescription(
                       name: name,
                       upgradeKind: upgradeKind,
                       applicationHealthPolicy: applicationHealthPolicy,
                       updateDescription: updateDescription));
        }
        /// <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 ComposeDeploymentUpgradeDescription GetFromJsonProperties(JsonReader reader)
        {
            var deploymentName     = default(string);
            var composeFileContent = default(string);
            var registryCredential = default(RegistryCredential);
            var upgradeKind        = default(UpgradeKind?);
            var rollingUpgradeMode = default(UpgradeMode?);
            var upgradeReplicaSetCheckTimeoutInSeconds = default(long?);
            var forceRestart            = default(bool?);
            var monitoringPolicy        = default(MonitoringPolicyDescription);
            var applicationHealthPolicy = default(ApplicationHealthPolicy);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("DeploymentName", propName, StringComparison.Ordinal) == 0)
                {
                    deploymentName = reader.ReadValueAsString();
                }
                else if (string.Compare("ComposeFileContent", propName, StringComparison.Ordinal) == 0)
                {
                    composeFileContent = reader.ReadValueAsString();
                }
                else if (string.Compare("RegistryCredential", propName, StringComparison.Ordinal) == 0)
                {
                    registryCredential = RegistryCredentialConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeKind", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeKind = UpgradeKindConverter.Deserialize(reader);
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.Ordinal) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeReplicaSetCheckTimeoutInSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeReplicaSetCheckTimeoutInSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("ForceRestart", propName, StringComparison.Ordinal) == 0)
                {
                    forceRestart = reader.ReadValueAsBool();
                }
                else if (string.Compare("MonitoringPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    monitoringPolicy = MonitoringPolicyDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationHealthPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    applicationHealthPolicy = ApplicationHealthPolicyConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ComposeDeploymentUpgradeDescription(
                       deploymentName: deploymentName,
                       composeFileContent: composeFileContent,
                       registryCredential: registryCredential,
                       upgradeKind: upgradeKind,
                       rollingUpgradeMode: rollingUpgradeMode,
                       upgradeReplicaSetCheckTimeoutInSeconds: upgradeReplicaSetCheckTimeoutInSeconds,
                       forceRestart: forceRestart,
                       monitoringPolicy: monitoringPolicy,
                       applicationHealthPolicy: applicationHealthPolicy));
        }
        /// <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 StartClusterUpgradeDescription GetFromJsonProperties(JsonReader reader)
        {
            var codeVersion        = default(string);
            var configVersion      = default(string);
            var upgradeKind        = default(UpgradeKind?);
            var rollingUpgradeMode = default(UpgradeMode?);
            var upgradeReplicaSetCheckTimeoutInSeconds = default(long?);
            var forceRestart                = default(bool?);
            var monitoringPolicy            = default(MonitoringPolicyDescription);
            var clusterHealthPolicy         = default(ClusterHealthPolicy);
            var enableDeltaHealthEvaluation = default(bool?);
            var clusterUpgradeHealthPolicy  = default(ClusterUpgradeHealthPolicyObject);
            var applicationHealthPolicyMap  = default(ApplicationHealthPolicies);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("CodeVersion", propName, StringComparison.Ordinal) == 0)
                {
                    codeVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("ConfigVersion", propName, StringComparison.Ordinal) == 0)
                {
                    configVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeKind", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeKind = UpgradeKindConverter.Deserialize(reader);
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.Ordinal) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeReplicaSetCheckTimeoutInSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeReplicaSetCheckTimeoutInSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("ForceRestart", propName, StringComparison.Ordinal) == 0)
                {
                    forceRestart = reader.ReadValueAsBool();
                }
                else if (string.Compare("MonitoringPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    monitoringPolicy = MonitoringPolicyDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("ClusterHealthPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    clusterHealthPolicy = ClusterHealthPolicyConverter.Deserialize(reader);
                }
                else if (string.Compare("EnableDeltaHealthEvaluation", propName, StringComparison.Ordinal) == 0)
                {
                    enableDeltaHealthEvaluation = reader.ReadValueAsBool();
                }
                else if (string.Compare("ClusterUpgradeHealthPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    clusterUpgradeHealthPolicy = ClusterUpgradeHealthPolicyObjectConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationHealthPolicyMap", propName, StringComparison.Ordinal) == 0)
                {
                    applicationHealthPolicyMap = ApplicationHealthPoliciesConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StartClusterUpgradeDescription(
                       codeVersion: codeVersion,
                       configVersion: configVersion,
                       upgradeKind: upgradeKind,
                       rollingUpgradeMode: rollingUpgradeMode,
                       upgradeReplicaSetCheckTimeoutInSeconds: upgradeReplicaSetCheckTimeoutInSeconds,
                       forceRestart: forceRestart,
                       monitoringPolicy: monitoringPolicy,
                       clusterHealthPolicy: clusterHealthPolicy,
                       enableDeltaHealthEvaluation: enableDeltaHealthEvaluation,
                       clusterUpgradeHealthPolicy: clusterUpgradeHealthPolicy,
                       applicationHealthPolicyMap: applicationHealthPolicyMap));
        }
Example #4
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 ApplicationUpgradeDescription GetFromJsonProperties(JsonReader reader)
        {
            var name = default(string);
            var targetApplicationTypeVersion = default(string);
            var parameters         = default(IReadOnlyDictionary <string, string>);
            var upgradeKind        = default(UpgradeKind?);
            var rollingUpgradeMode = default(UpgradeMode?);
            var upgradeReplicaSetCheckTimeoutInSeconds = default(long?);
            var forceRestart            = default(bool?);
            var monitoringPolicy        = default(MonitoringPolicyDescription);
            var applicationHealthPolicy = default(ApplicationHealthPolicy);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Name", propName, StringComparison.Ordinal) == 0)
                {
                    name = reader.ReadValueAsString();
                }
                else if (string.Compare("TargetApplicationTypeVersion", propName, StringComparison.Ordinal) == 0)
                {
                    targetApplicationTypeVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("Parameters", propName, StringComparison.Ordinal) == 0)
                {
                    parameters = ApplicationParametersConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeKind", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeKind = UpgradeKindConverter.Deserialize(reader);
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.Ordinal) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeReplicaSetCheckTimeoutInSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeReplicaSetCheckTimeoutInSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("ForceRestart", propName, StringComparison.Ordinal) == 0)
                {
                    forceRestart = reader.ReadValueAsBool();
                }
                else if (string.Compare("MonitoringPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    monitoringPolicy = MonitoringPolicyDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationHealthPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    applicationHealthPolicy = ApplicationHealthPolicyConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ApplicationUpgradeDescription(
                       name: name,
                       targetApplicationTypeVersion: targetApplicationTypeVersion,
                       parameters: parameters,
                       upgradeKind: upgradeKind,
                       rollingUpgradeMode: rollingUpgradeMode,
                       upgradeReplicaSetCheckTimeoutInSeconds: upgradeReplicaSetCheckTimeoutInSeconds,
                       forceRestart: forceRestart,
                       monitoringPolicy: monitoringPolicy,
                       applicationHealthPolicy: applicationHealthPolicy));
        }
Example #5
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 ComposeDeploymentUpgradeProgressInfo GetFromJsonProperties(JsonReader reader)
        {
            var deploymentName       = default(string);
            var applicationName      = default(string);
            var upgradeState         = default(ComposeDeploymentUpgradeState?);
            var upgradeStatusDetails = default(string);
            var upgradeKind          = default(UpgradeKind?);
            var rollingUpgradeMode   = default(UpgradeMode?);
            var forceRestart         = default(bool?);
            var upgradeReplicaSetCheckTimeoutInSeconds = default(long?);
            var monitoringPolicy             = default(MonitoringPolicyDescription);
            var applicationHealthPolicy      = default(ApplicationHealthPolicy);
            var targetApplicationTypeVersion = default(string);
            var upgradeDuration = default(string);
            var currentUpgradeDomainDuration    = default(string);
            var applicationUnhealthyEvaluations = default(IEnumerable <HealthEvaluationWrapper>);
            var currentUpgradeDomainProgress    = default(CurrentUpgradeDomainProgressInfo);
            var startTimestampUtc               = default(string);
            var failureTimestampUtc             = default(string);
            var failureReason                   = default(FailureReason?);
            var upgradeDomainProgressAtFailure  = default(FailureUpgradeDomainProgressInfo);
            var applicationUpgradeStatusDetails = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("DeploymentName", propName, StringComparison.Ordinal) == 0)
                {
                    deploymentName = reader.ReadValueAsString();
                }
                else if (string.Compare("ApplicationName", propName, StringComparison.Ordinal) == 0)
                {
                    applicationName = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeState", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeState = ComposeDeploymentUpgradeStateConverter.Deserialize(reader);
                }
                else if (string.Compare("UpgradeStatusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeStatusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeKind", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeKind = UpgradeKindConverter.Deserialize(reader);
                }
                else if (string.Compare("RollingUpgradeMode", propName, StringComparison.Ordinal) == 0)
                {
                    rollingUpgradeMode = UpgradeModeConverter.Deserialize(reader);
                }
                else if (string.Compare("ForceRestart", propName, StringComparison.Ordinal) == 0)
                {
                    forceRestart = reader.ReadValueAsBool();
                }
                else if (string.Compare("UpgradeReplicaSetCheckTimeoutInSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeReplicaSetCheckTimeoutInSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("MonitoringPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    monitoringPolicy = MonitoringPolicyDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationHealthPolicy", propName, StringComparison.Ordinal) == 0)
                {
                    applicationHealthPolicy = ApplicationHealthPolicyConverter.Deserialize(reader);
                }
                else if (string.Compare("TargetApplicationTypeVersion", propName, StringComparison.Ordinal) == 0)
                {
                    targetApplicationTypeVersion = reader.ReadValueAsString();
                }
                else if (string.Compare("UpgradeDuration", propName, StringComparison.Ordinal) == 0)
                {
                    upgradeDuration = reader.ReadValueAsString();
                }
                else if (string.Compare("CurrentUpgradeDomainDuration", propName, StringComparison.Ordinal) == 0)
                {
                    currentUpgradeDomainDuration = reader.ReadValueAsString();
                }
                else if (string.Compare("ApplicationUnhealthyEvaluations", propName, StringComparison.Ordinal) == 0)
                {
                    applicationUnhealthyEvaluations = 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("ApplicationUpgradeStatusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    applicationUpgradeStatusDetails = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ComposeDeploymentUpgradeProgressInfo(
                       deploymentName: deploymentName,
                       applicationName: applicationName,
                       upgradeState: upgradeState,
                       upgradeStatusDetails: upgradeStatusDetails,
                       upgradeKind: upgradeKind,
                       rollingUpgradeMode: rollingUpgradeMode,
                       forceRestart: forceRestart,
                       upgradeReplicaSetCheckTimeoutInSeconds: upgradeReplicaSetCheckTimeoutInSeconds,
                       monitoringPolicy: monitoringPolicy,
                       applicationHealthPolicy: applicationHealthPolicy,
                       targetApplicationTypeVersion: targetApplicationTypeVersion,
                       upgradeDuration: upgradeDuration,
                       currentUpgradeDomainDuration: currentUpgradeDomainDuration,
                       applicationUnhealthyEvaluations: applicationUnhealthyEvaluations,
                       currentUpgradeDomainProgress: currentUpgradeDomainProgress,
                       startTimestampUtc: startTimestampUtc,
                       failureTimestampUtc: failureTimestampUtc,
                       failureReason: failureReason,
                       upgradeDomainProgressAtFailure: upgradeDomainProgressAtFailure,
                       applicationUpgradeStatusDetails: applicationUpgradeStatusDetails));
        }