Class: OCI::Database::Models::DbNode
- Inherits:
-
Object
- Object
- OCI::Database::Models::DbNode
- Defined in:
- lib/oci/database/models/db_node.rb
Overview
DbNode model.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
rubocop:disable Metrics/LineLength
[ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze, LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_STOPPING = 'STOPPING'.freeze, LIFECYCLE_STATE_STOPPED = 'STOPPED'.freeze, LIFECYCLE_STATE_STARTING = 'STARTING'.freeze, LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze, LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#backup_vnic_id ⇒ String
The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the backup VNIC.
-
#db_system_id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB system.
-
#hostname ⇒ String
The host name for the database node.
-
#id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the database node.
-
#lifecycle_state ⇒ String
[Required] The current state of the database node.
-
#software_storage_size_in_gb ⇒ Integer
The size (in GB) of the block storage volume allocation for the DB system.
-
#time_created ⇒ DateTime
[Required] The date and time that the database node was created.
-
#vnic_id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the VNIC.
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 = {}) ⇒ DbNode
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 = {}) ⇒ DbNode
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 142 143 144 |
# File 'lib/oci/database/models/db_node.rb', line 102 def initialize(attributes = {}) return unless attributes.is_a?(Hash) self.id = attributes[:'id'] if attributes[:'id'] self.db_system_id = attributes[:'dbSystemId'] if attributes[:'dbSystemId'] raise 'You cannot provide both :dbSystemId and :db_system_id' if attributes.key?(:'dbSystemId') && attributes.key?(:'db_system_id') self.db_system_id = attributes[:'db_system_id'] if attributes[:'db_system_id'] self.vnic_id = attributes[:'vnicId'] if attributes[:'vnicId'] raise 'You cannot provide both :vnicId and :vnic_id' if attributes.key?(:'vnicId') && attributes.key?(:'vnic_id') self.vnic_id = attributes[:'vnic_id'] if attributes[:'vnic_id'] self.backup_vnic_id = attributes[:'backupVnicId'] if attributes[:'backupVnicId'] raise 'You cannot provide both :backupVnicId and :backup_vnic_id' if attributes.key?(:'backupVnicId') && attributes.key?(:'backup_vnic_id') self.backup_vnic_id = attributes[:'backup_vnic_id'] if attributes[:'backup_vnic_id'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.hostname = attributes[:'hostname'] if attributes[:'hostname'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.software_storage_size_in_gb = attributes[:'softwareStorageSizeInGB'] if attributes[:'softwareStorageSizeInGB'] raise 'You cannot provide both :softwareStorageSizeInGB and :software_storage_size_in_gb' if attributes.key?(:'softwareStorageSizeInGB') && attributes.key?(:'software_storage_size_in_gb') self.software_storage_size_in_gb = attributes[:'software_storage_size_in_gb'] if attributes[:'software_storage_size_in_gb'] end |
Instance Attribute Details
#backup_vnic_id ⇒ String
The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the backup VNIC.
37 38 39 |
# File 'lib/oci/database/models/db_node.rb', line 37 def backup_vnic_id @backup_vnic_id end |
#db_system_id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB system.
29 30 31 |
# File 'lib/oci/database/models/db_node.rb', line 29 def db_system_id @db_system_id end |
#hostname ⇒ String
The host name for the database node.
45 46 47 |
# File 'lib/oci/database/models/db_node.rb', line 45 def hostname @hostname end |
#id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the database node.
25 26 27 |
# File 'lib/oci/database/models/db_node.rb', line 25 def id @id end |
#lifecycle_state ⇒ String
[Required] The current state of the database node.
41 42 43 |
# File 'lib/oci/database/models/db_node.rb', line 41 def lifecycle_state @lifecycle_state end |
#software_storage_size_in_gb ⇒ Integer
The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems.
54 55 56 |
# File 'lib/oci/database/models/db_node.rb', line 54 def software_storage_size_in_gb @software_storage_size_in_gb end |
#time_created ⇒ DateTime
[Required] The date and time that the database node was created.
49 50 51 |
# File 'lib/oci/database/models/db_node.rb', line 49 def time_created @time_created end |
#vnic_id ⇒ String
[Required] The [OCID](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the VNIC.
33 34 35 |
# File 'lib/oci/database/models/db_node.rb', line 33 def vnic_id @vnic_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/oci/database/models/db_node.rb', line 57 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'db_system_id': :'dbSystemId', 'vnic_id': :'vnicId', 'backup_vnic_id': :'backupVnicId', 'lifecycle_state': :'lifecycleState', 'hostname': :'hostname', 'time_created': :'timeCreated', 'software_storage_size_in_gb': :'softwareStorageSizeInGB' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/database/models/db_node.rb', line 73 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'db_system_id': :'String', 'vnic_id': :'String', 'backup_vnic_id': :'String', 'lifecycle_state': :'String', 'hostname': :'String', 'time_created': :'DateTime', 'software_storage_size_in_gb': :'Integer' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/oci/database/models/db_node.rb', line 168 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && db_system_id == other.db_system_id && vnic_id == other.vnic_id && backup_vnic_id == other.backup_vnic_id && lifecycle_state == other.lifecycle_state && hostname == other.hostname && time_created == other.time_created && software_storage_size_in_gb == other.software_storage_size_in_gb end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/oci/database/models/db_node.rb', line 205 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
185 186 187 |
# File 'lib/oci/database/models/db_node.rb', line 185 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
194 195 196 |
# File 'lib/oci/database/models/db_node.rb', line 194 def hash [id, db_system_id, vnic_id, backup_vnic_id, lifecycle_state, hostname, time_created, software_storage_size_in_gb].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
238 239 240 241 242 243 244 245 246 247 |
# File 'lib/oci/database/models/db_node.rb', line 238 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
232 233 234 |
# File 'lib/oci/database/models/db_node.rb', line 232 def to_s to_hash.to_s end |