# 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::V2018_02_01
  module Models
    #
    # Describes the delta health policies for the cluster upgrade.
    #
    class ClusterUpgradeDeltaHealthPolicy

      include MsRestAzure

      # @return [Integer] The maximum allowed percentage of nodes health
      # degradation allowed during cluster upgrades.
      # The delta is measured between the state of the nodes at the beginning
      # of upgrade and the state of the nodes at the time of the health
      # evaluation.
      # The check is performed after every upgrade domain upgrade completion to
      # make sure the global state of the cluster is within tolerated limits.
      #
      attr_accessor :max_percent_delta_unhealthy_nodes

      # @return [Integer] The maximum allowed percentage of upgrade domain
      # nodes health degradation allowed during cluster upgrades.
      # The delta is measured between the state of the upgrade domain nodes at
      # the beginning of upgrade and the state of the upgrade domain nodes at
      # the time of the health evaluation.
      # The check is performed after every upgrade domain upgrade completion
      # for all completed upgrade domains to make sure the state of the upgrade
      # domains is within tolerated limits.
      #
      attr_accessor :max_percent_upgrade_domain_delta_unhealthy_nodes

      # @return [Integer] The maximum allowed percentage of applications health
      # degradation allowed during cluster upgrades.
      # The delta is measured between the state of the applications at the
      # beginning of upgrade and the state of the applications at the time of
      # the health evaluation.
      # The check is performed after every upgrade domain upgrade completion to
      # make sure the global state of the cluster is within tolerated limits.
      # System services are not included in this.
      #
      attr_accessor :max_percent_delta_unhealthy_applications

      # @return [Hash{String => ApplicationDeltaHealthPolicy}] Defines the
      # application delta health policy map used to evaluate the health of an
      # application or one of its child entities when upgrading the cluster.
      attr_accessor :application_delta_health_policies


      #
      # Mapper for ClusterUpgradeDeltaHealthPolicy class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ClusterUpgradeDeltaHealthPolicy',
          type: {
            name: 'Composite',
            class_name: 'ClusterUpgradeDeltaHealthPolicy',
            model_properties: {
              max_percent_delta_unhealthy_nodes: {
                client_side_validation: true,
                required: true,
                serialized_name: 'maxPercentDeltaUnhealthyNodes',
                constraints: {
                  InclusiveMaximum: 100,
                  InclusiveMinimum: 0
                },
                type: {
                  name: 'Number'
                }
              },
              max_percent_upgrade_domain_delta_unhealthy_nodes: {
                client_side_validation: true,
                required: true,
                serialized_name: 'maxPercentUpgradeDomainDeltaUnhealthyNodes',
                constraints: {
                  InclusiveMaximum: 100,
                  InclusiveMinimum: 0
                },
                type: {
                  name: 'Number'
                }
              },
              max_percent_delta_unhealthy_applications: {
                client_side_validation: true,
                required: true,
                serialized_name: 'maxPercentDeltaUnhealthyApplications',
                constraints: {
                  InclusiveMaximum: 100,
                  InclusiveMinimum: 0
                },
                type: {
                  name: 'Number'
                }
              },
              application_delta_health_policies: {
                client_side_validation: true,
                required: false,
                serialized_name: 'applicationDeltaHealthPolicies',
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ApplicationDeltaHealthPolicyElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ApplicationDeltaHealthPolicy'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
