Class: Apcera::JobHealth

Inherits:
BaseObject show all
Defined in:
lib/apcera/models/job_health.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ JobHealth

Returns a new instance of JobHealth.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/apcera/models/job_health.rb', line 35

def initialize(attributes = {})
  return if !attributes.is_a?(Hash) || attributes.empty?

  # convert string to symbol for hash key
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}

  
  if attributes[:'flapping']
    self.flapping = attributes[:'flapping']
  end
  
  if attributes[:'instance_state_count']
    if (value = attributes[:'instance_state_count']).is_a?(Array)
      self.instance_state_count = value
    end
  end
  
  if attributes[:'score']
    self.score = attributes[:'score']
  end
  
  if attributes[:'uuid']
    self.uuid = attributes[:'uuid']
  end
  
end

Instance Attribute Details

#flappingObject

Returns the value of attribute flapping.



4
5
6
# File 'lib/apcera/models/job_health.rb', line 4

def flapping
  @flapping
end

#instance_state_countObject

Returns the value of attribute instance_state_count.



4
5
6
# File 'lib/apcera/models/job_health.rb', line 4

def instance_state_count
  @instance_state_count
end

#scoreObject

Returns the value of attribute score.



4
5
6
# File 'lib/apcera/models/job_health.rb', line 4

def score
  @score
end

#uuidObject

Returns the value of attribute uuid.



4
5
6
# File 'lib/apcera/models/job_health.rb', line 4

def uuid
  @uuid
end

Class Method Details

.attribute_mapObject

attribute mapping from ruby-style variable name to JSON key



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/apcera/models/job_health.rb', line 6

def self.attribute_map
  {
    
    # Indicates if job is in a flapping state (true) or not (false).
    :'flapping' => :'flapping',
    
    # Map of instance states to the number of instances in that state, as reported by the health manager.
    :'instance_state_count' => :'instance_state_count',
    
    # Score is the ratio of running instances to configured instances, capped between 0 and 1.
    :'score' => :'score',
    
    # UUID of the job.
    :'uuid' => :'uuid'
    
  }
end

.swagger_typesObject

attribute type



25
26
27
28
29
30
31
32
33
# File 'lib/apcera/models/job_health.rb', line 25

def self.swagger_types
  {
    :'flapping' => :'BOOLEAN',
    :'instance_state_count' => :'Hash<String, InstanceState>',
    :'score' => :'Integer',
    :'uuid' => :'BOOLEAN'
    
  }
end