Class: OCI::CloudMigrations::Models::OlvmPowerManagement
- Inherits:
-
Object
- Object
- OCI::CloudMigrations::Models::OlvmPowerManagement
- Defined in:
- lib/oci/cloud_migrations/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
-
#address ⇒ String
Address of power management.
-
#agents ⇒ Array<OCI::CloudMigrations::Models::OlvmAgent>
Supported sources of random number generator.
-
#is_automatic_pm_enabled ⇒ BOOLEAN
Toggles the automated power control of the host in order to save energy.
-
#is_enabled ⇒ BOOLEAN
Indicates whether power management configuration is enabled or disabled.
-
#is_k_dump_detection ⇒ BOOLEAN
Toggles whether to determine if kdump is running on the host before it is shut down.
-
#pm_proxies ⇒ Array<OCI::CloudMigrations::Models::OlvmPmProxy>
Determines the power management proxy.
-
#status ⇒ String
Determines the power status of the host.
-
#type ⇒ String
Fencing device code.
-
#username ⇒ String
A valid user name for power management.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OlvmPowerManagement
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ OlvmPowerManagement
Initializes the object
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_migrations/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
#address ⇒ String
Address of power management
19 20 21 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 19 def address @address end |
#agents ⇒ Array<OCI::CloudMigrations::Models::OlvmAgent>
Supported sources of random number generator.
23 24 25 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 23 def agents @agents end |
#is_automatic_pm_enabled ⇒ BOOLEAN
Toggles the automated power control of the host in order to save energy.
27 28 29 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 27 def is_automatic_pm_enabled @is_automatic_pm_enabled end |
#is_enabled ⇒ BOOLEAN
Indicates whether power management configuration is enabled or disabled.
31 32 33 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 31 def is_enabled @is_enabled end |
#is_k_dump_detection ⇒ BOOLEAN
Toggles whether to determine if kdump is running on the host before it is shut down.
35 36 37 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 35 def is_k_dump_detection @is_k_dump_detection end |
#pm_proxies ⇒ Array<OCI::CloudMigrations::Models::OlvmPmProxy>
Determines the power management proxy.
39 40 41 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 39 def pm_proxies @pm_proxies end |
#status ⇒ String
Determines the power status of the host.
43 44 45 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 43 def status @status end |
#type ⇒ String
Fencing device code.
47 48 49 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 47 def type @type end |
#username ⇒ String
A valid user name for power management.
51 52 53 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 51 def username @username end |
Class Method Details
.attribute_map ⇒ Object
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_migrations/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_types ⇒ Object
Attribute type mapping.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 71 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'address': :'String', 'agents': :'Array<OCI::CloudMigrations::Models::OlvmAgent>', 'is_automatic_pm_enabled': :'BOOLEAN', 'is_enabled': :'BOOLEAN', 'is_k_dump_detection': :'BOOLEAN', 'pm_proxies': :'Array<OCI::CloudMigrations::Models::OlvmPmProxy>', 'status': :'String', 'type': :'String', 'username': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/oci/cloud_migrations/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
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_migrations/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
176 177 178 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 176 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
185 186 187 |
# File 'lib/oci/cloud_migrations/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_hash ⇒ Hash
Returns the object in the form of hash
229 230 231 232 233 234 235 236 237 238 |
# File 'lib/oci/cloud_migrations/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_s ⇒ String
Returns the string representation of the object
223 224 225 |
# File 'lib/oci/cloud_migrations/models/olvm_power_management.rb', line 223 def to_s to_hash.to_s end |