Class: OCI::CloudBridge::Models::OlvmPowerManagement

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/models/olvm_power_management.rb

Overview

OLVM Power management definitions

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_OFF = 'OFF'.freeze,
  STATUS_ON = 'ON'.freeze,
  STATUS_UNKNOWN = 'UNKNOWN'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OlvmPowerManagement

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 102

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

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

  self.address = attributes[:'address'] if attributes[:'address']

  self.agents = attributes[:'agents'] if attributes[:'agents']

  self.is_automatic_pm_enabled = attributes[:'isAutomaticPmEnabled'] unless attributes[:'isAutomaticPmEnabled'].nil?

  raise 'You cannot provide both :isAutomaticPmEnabled and :is_automatic_pm_enabled' if attributes.key?(:'isAutomaticPmEnabled') && attributes.key?(:'is_automatic_pm_enabled')

  self.is_automatic_pm_enabled = attributes[:'is_automatic_pm_enabled'] unless attributes[:'is_automatic_pm_enabled'].nil?

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

  raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

  self.is_k_dump_detection = attributes[:'isKDumpDetection'] unless attributes[:'isKDumpDetection'].nil?

  raise 'You cannot provide both :isKDumpDetection and :is_k_dump_detection' if attributes.key?(:'isKDumpDetection') && attributes.key?(:'is_k_dump_detection')

  self.is_k_dump_detection = attributes[:'is_k_dump_detection'] unless attributes[:'is_k_dump_detection'].nil?

  self.pm_proxies = attributes[:'pmProxies'] if attributes[:'pmProxies']

  raise 'You cannot provide both :pmProxies and :pm_proxies' if attributes.key?(:'pmProxies') && attributes.key?(:'pm_proxies')

  self.pm_proxies = attributes[:'pm_proxies'] if attributes[:'pm_proxies']

  self.status = attributes[:'status'] if attributes[:'status']

  self.type = attributes[:'type'] if attributes[:'type']

  self.username = attributes[:'username'] if attributes[:'username']
end

Instance Attribute Details

#addressString

Address of power management

Returns:

  • (String)


19
20
21
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 19

def address
  @address
end

#agentsArray<OCI::CloudBridge::Models::OlvmAgent>

Supported sources of random number generator.



23
24
25
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 23

def agents
  @agents
end

#is_automatic_pm_enabledBOOLEAN

Toggles the automated power control of the host in order to save energy.

Returns:

  • (BOOLEAN)


27
28
29
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 27

def is_automatic_pm_enabled
  @is_automatic_pm_enabled
end

#is_enabledBOOLEAN

Indicates whether power management configuration is enabled or disabled.

Returns:

  • (BOOLEAN)


31
32
33
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 31

def is_enabled
  @is_enabled
end

#is_k_dump_detectionBOOLEAN

Toggles whether to determine if kdump is running on the host before it is shut down.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 35

def is_k_dump_detection
  @is_k_dump_detection
end

#pm_proxiesArray<OCI::CloudBridge::Models::OlvmPmProxy>

Determines the power management proxy.



39
40
41
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 39

def pm_proxies
  @pm_proxies
end

#statusString

Determines the power status of the host.

Returns:

  • (String)


43
44
45
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 43

def status
  @status
end

#typeString

Fencing device code.

Returns:

  • (String)


47
48
49
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 47

def type
  @type
end

#usernameString

A valid user name for power management.

Returns:

  • (String)


51
52
53
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 51

def username
  @username
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 54

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'address',
    'agents': :'agents',
    'is_automatic_pm_enabled': :'isAutomaticPmEnabled',
    'is_enabled': :'isEnabled',
    'is_k_dump_detection': :'isKDumpDetection',
    'pm_proxies': :'pmProxies',
    'status': :'status',
    'type': :'type',
    'username': :'username'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 71

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'String',
    'agents': :'Array<OCI::CloudBridge::Models::OlvmAgent>',
    'is_automatic_pm_enabled': :'BOOLEAN',
    'is_enabled': :'BOOLEAN',
    'is_k_dump_detection': :'BOOLEAN',
    'pm_proxies': :'Array<OCI::CloudBridge::Models::OlvmPmProxy>',
    'status': :'String',
    'type': :'String',
    'username': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 158

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    address == other.address &&
    agents == other.agents &&
    is_automatic_pm_enabled == other.is_automatic_pm_enabled &&
    is_enabled == other.is_enabled &&
    is_k_dump_detection == other.is_k_dump_detection &&
    pm_proxies == other.pm_proxies &&
    status == other.status &&
    type == other.type &&
    username == other.username
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 196

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


176
177
178
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 176

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



185
186
187
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 185

def hash
  [address, agents, is_automatic_pm_enabled, is_enabled, is_k_dump_detection, pm_proxies, status, type, username].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 229

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



223
224
225
# File 'lib/oci/cloud_bridge/models/olvm_power_management.rb', line 223

def to_s
  to_hash.to_s
end