# 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::Mgmt::V2017_07_01_preview
  module Models
    #
    # Describes the policy used when upgrading the cluster.
    #
    class ClusterUpgradePolicy

      include MsRestAzure

      # @return [Boolean] If true, then processes are forcefully restarted
      # during upgrade even when the code version has not changed (the upgrade
      # only changes configuration or data).
      attr_accessor :force_restart

      # @return [String] The maximum amount of time to block processing of an
      # upgrade domain and revent loss of availability when there are
      # unexpected issues. When this timeout expires, processing of the upgrade
      # domain will proceed regardless of availability loss issues. The timeout
      # is reset at the start of each upgrade domain. The timeout can be in
      # either hh:mm:ss or in d.hh:mm:ss.ms format.
      attr_accessor :upgrade_replica_set_check_timeout

      # @return [String] The length of time to wait after completing an upgrade
      # domain before performing health checks. The duration can be in either
      # hh:mm:ss or in d.hh:mm:ss.ms format.
      attr_accessor :health_check_wait_duration

      # @return [String] The amount of time that the application or cluster
      # must remain healthy before the upgrade proceeds to the next upgrade
      # domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms
      # format.
      attr_accessor :health_check_stable_duration

      # @return [String] The amount of time to retry health evaluation when the
      # application or cluster is unhealthy before the upgrade rolls back. The
      # timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format.
      attr_accessor :health_check_retry_timeout

      # @return [String] The amount of time the overall upgrade has to complete
      # before the upgrade rolls back. The timeout can be in either hh:mm:ss or
      # in d.hh:mm:ss.ms format.
      attr_accessor :upgrade_timeout

      # @return [String] The amount of time each upgrade domain has to complete
      # before the upgrade rolls back. The timeout can be in either hh:mm:ss or
      # in d.hh:mm:ss.ms format.
      attr_accessor :upgrade_domain_timeout

      # @return [ClusterHealthPolicy] The cluster health policy used when
      # upgrading the cluster.
      attr_accessor :health_policy

      # @return [ClusterUpgradeDeltaHealthPolicy] The delta health policy used
      # when upgrading the cluster.
      attr_accessor :delta_health_policy


      #
      # Mapper for ClusterUpgradePolicy class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ClusterUpgradePolicy',
          type: {
            name: 'Composite',
            class_name: 'ClusterUpgradePolicy',
            model_properties: {
              force_restart: {
                client_side_validation: true,
                required: false,
                serialized_name: 'forceRestart',
                type: {
                  name: 'Boolean'
                }
              },
              upgrade_replica_set_check_timeout: {
                client_side_validation: true,
                required: true,
                serialized_name: 'upgradeReplicaSetCheckTimeout',
                type: {
                  name: 'String'
                }
              },
              health_check_wait_duration: {
                client_side_validation: true,
                required: true,
                serialized_name: 'healthCheckWaitDuration',
                type: {
                  name: 'String'
                }
              },
              health_check_stable_duration: {
                client_side_validation: true,
                required: true,
                serialized_name: 'healthCheckStableDuration',
                type: {
                  name: 'String'
                }
              },
              health_check_retry_timeout: {
                client_side_validation: true,
                required: true,
                serialized_name: 'healthCheckRetryTimeout',
                type: {
                  name: 'String'
                }
              },
              upgrade_timeout: {
                client_side_validation: true,
                required: true,
                serialized_name: 'upgradeTimeout',
                type: {
                  name: 'String'
                }
              },
              upgrade_domain_timeout: {
                client_side_validation: true,
                required: true,
                serialized_name: 'upgradeDomainTimeout',
                type: {
                  name: 'String'
                }
              },
              health_policy: {
                client_side_validation: true,
                required: true,
                serialized_name: 'healthPolicy',
                type: {
                  name: 'Composite',
                  class_name: 'ClusterHealthPolicy'
                }
              },
              delta_health_policy: {
                client_side_validation: true,
                required: false,
                serialized_name: 'deltaHealthPolicy',
                type: {
                  name: 'Composite',
                  class_name: 'ClusterUpgradeDeltaHealthPolicy'
                }
              }
            }
          }
        }
      end
    end
  end
end
