# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::ServiceFabric::V6_5_0_36
  module Models
    #
    # Describes the parameters for a standalone cluster configuration upgrade.
    #
    class ClusterConfigurationUpgradeDescription

      include MsRestAzure

      # @return [String] The cluster configuration as a JSON string. For
      # example, [this
      # file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json)
      # contains JSON describing the [nodes and other properties of the
      # cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest).
      attr_accessor :cluster_config

      # @return [Duration] The length of time between attempts to perform
      # health checks if the application or cluster is not healthy. Default
      # value: Date.parse('PT0H0M0S') .
      attr_accessor :health_check_retry_timeout

      # @return [Duration] The length of time to wait after completing an
      # upgrade domain before starting the health checks process. Default
      # value: Date.parse('PT0H0M0S') .
      attr_accessor :health_check_wait_duration_in_seconds

      # @return [Duration] The length of time that the application or cluster
      # must remain healthy before the upgrade proceeds to the next upgrade
      # domain. Default value: Date.parse('PT0H0M0S') .
      attr_accessor :health_check_stable_duration_in_seconds

      # @return [Duration] The timeout for the upgrade domain. Default value:
      # Date.parse('PT0H0M0S') .
      attr_accessor :upgrade_domain_timeout_in_seconds

      # @return [Duration] The upgrade timeout. Default value:
      # Date.parse('PT0H0M0S') .
      attr_accessor :upgrade_timeout_in_seconds

      # @return [Integer] The maximum allowed percentage of unhealthy
      # applications during the upgrade. Allowed values are integer values from
      # zero to 100. Default value: 0 .
      attr_accessor :max_percent_unhealthy_applications

      # @return [Integer] The maximum allowed percentage of unhealthy nodes
      # during the upgrade. Allowed values are integer values from zero to 100.
      # Default value: 0 .
      attr_accessor :max_percent_unhealthy_nodes

      # @return [Integer] The maximum allowed percentage of delta health
      # degradation during the upgrade. Allowed values are integer values from
      # zero to 100. Default value: 0 .
      attr_accessor :max_percent_delta_unhealthy_nodes

      # @return [Integer] The maximum allowed percentage of upgrade domain
      # delta health degradation during the upgrade. Allowed values are integer
      # values from zero to 100. Default value: 0 .
      attr_accessor :max_percent_upgrade_domain_delta_unhealthy_nodes

      # @return [ApplicationHealthPolicies] Defines the application health
      # policy map used to evaluate the health of an application or one of its
      # children entities.
      attr_accessor :application_health_policies


      #
      # Mapper for ClusterConfigurationUpgradeDescription class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ClusterConfigurationUpgradeDescription',
          type: {
            name: 'Composite',
            class_name: 'ClusterConfigurationUpgradeDescription',
            model_properties: {
              cluster_config: {
                client_side_validation: true,
                required: true,
                serialized_name: 'ClusterConfig',
                type: {
                  name: 'String'
                }
              },
              health_check_retry_timeout: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HealthCheckRetryTimeout',
                default_value: Date.parse('PT0H0M0S'),
                type: {
                  name: 'TimeSpan'
                }
              },
              health_check_wait_duration_in_seconds: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HealthCheckWaitDurationInSeconds',
                default_value: Date.parse('PT0H0M0S'),
                type: {
                  name: 'TimeSpan'
                }
              },
              health_check_stable_duration_in_seconds: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HealthCheckStableDurationInSeconds',
                default_value: Date.parse('PT0H0M0S'),
                type: {
                  name: 'TimeSpan'
                }
              },
              upgrade_domain_timeout_in_seconds: {
                client_side_validation: true,
                required: false,
                serialized_name: 'UpgradeDomainTimeoutInSeconds',
                default_value: Date.parse('PT0H0M0S'),
                type: {
                  name: 'TimeSpan'
                }
              },
              upgrade_timeout_in_seconds: {
                client_side_validation: true,
                required: false,
                serialized_name: 'UpgradeTimeoutInSeconds',
                default_value: Date.parse('PT0H0M0S'),
                type: {
                  name: 'TimeSpan'
                }
              },
              max_percent_unhealthy_applications: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MaxPercentUnhealthyApplications',
                default_value: 0,
                type: {
                  name: 'Number'
                }
              },
              max_percent_unhealthy_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MaxPercentUnhealthyNodes',
                default_value: 0,
                type: {
                  name: 'Number'
                }
              },
              max_percent_delta_unhealthy_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MaxPercentDeltaUnhealthyNodes',
                default_value: 0,
                type: {
                  name: 'Number'
                }
              },
              max_percent_upgrade_domain_delta_unhealthy_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MaxPercentUpgradeDomainDeltaUnhealthyNodes',
                default_value: 0,
                type: {
                  name: 'Number'
                }
              },
              application_health_policies: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ApplicationHealthPolicies',
                type: {
                  name: 'Composite',
                  class_name: 'ApplicationHealthPolicies'
                }
              }
            }
          }
        }
      end
    end
  end
end
