class Apcera::RestartConfig
Attributes
maximum_attempts[RW]
restart_mode[RW]
Public Class Methods
attribute_map()
click to toggle source
attribute mapping from ruby-style variable name to JSON key
# File lib/apcera/models/restart_config.rb, line 6 def self.attribute_map { # The maximum number of restart attempts per instance, applies to `always` and `failure` restart modes. If set to 0 restarts are not limited. :'maximum_attempts' => :'maximum_attempts', # The restart mode to use. Valid values are `always` (always restart), `no` (never restart), and `failure` (only restart on application failure). :'restart_mode' => :'restart_mode' } end
new(attributes = {})
click to toggle source
# File lib/apcera/models/restart_config.rb, line 27 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[:'maximum_attempts'] self.maximum_attempts = attributes[:'maximum_attempts'] end if attributes[:'restart_mode'] self.restart_mode = attributes[:'restart_mode'] end end
swagger_types()
click to toggle source
attribute type
# File lib/apcera/models/restart_config.rb, line 19 def self.swagger_types { :'maximum_attempts' => :'Integer', :'restart_mode' => :'String' } end
Public Instance Methods
restart_mode=(restart_mode)
click to toggle source
# File lib/apcera/models/restart_config.rb, line 44 def restart_mode=(restart_mode) allowed_values = ["always", "no", "failure"] if restart_mode && !allowed_values.include?(restart_mode) fail "invalid value for 'restart_mode', must be one of #{allowed_values}" end @restart_mode = restart_mode end