class OCI::ContainerEngine::Models::Node
The properties that define a node.
Constants
- LIFECYCLE_STATE_ENUM
Attributes
The name of the availability domain in which this node is placed. @return [String]
The fault domain of this node. @return [String]
The OCID of the compute instance backing this node. @return [String]
The version of Kubernetes this node is running. @return [String]
Details about the state of the node. @return [String]
The state of the node. @return [String]
The name of the node. @return [String]
An error that may be associated with the node. @return [OCI::ContainerEngine::Models::NodeError]
The OCID of the node pool to which this node belongs. @return [String]
The private IP address of this node. @return [String]
The public IP address of this node. @return [String]
The OCID of the subnet in which this node is placed. @return [String]
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/oci/container_engine/models/node.rb, line 71 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'name': :'name', 'kubernetes_version': :'kubernetesVersion', 'availability_domain': :'availabilityDomain', 'subnet_id': :'subnetId', 'node_pool_id': :'nodePoolId', 'fault_domain': :'faultDomain', 'private_ip': :'privateIp', 'public_ip': :'publicIp', 'node_error': :'nodeError', 'lifecycle_state': :'lifecycleState', 'lifecycle_details': :'lifecycleDetails' # rubocop:enable Style/SymbolLiteral } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :id The value to assign to the {#id} property @option attributes [String] :name The value to assign to the {#name} property @option attributes [String] :kubernetes_version The value to assign to the {#kubernetes_version} property @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property @option attributes [String] :subnet_id The value to assign to the {#subnet_id} property @option attributes [String] :node_pool_id The value to assign to the {#node_pool_id} property @option attributes [String] :fault_domain The value to assign to the {#fault_domain} property @option attributes [String] :private_ip The value to assign to the {#private_ip} property @option attributes [String] :public_ip The value to assign to the {#public_ip} property @option attributes [OCI::ContainerEngine::Models::NodeError] :node_error The value to assign to the {#node_error} property @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
# File lib/oci/container_engine/models/node.rb, line 128 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.id = attributes[:'id'] if attributes[:'id'] self.name = attributes[:'name'] if attributes[:'name'] self.kubernetes_version = attributes[:'kubernetesVersion'] if attributes[:'kubernetesVersion'] raise 'You cannot provide both :kubernetesVersion and :kubernetes_version' if attributes.key?(:'kubernetesVersion') && attributes.key?(:'kubernetes_version') self.kubernetes_version = attributes[:'kubernetes_version'] if attributes[:'kubernetes_version'] self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain'] raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain') self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain'] self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId'] raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id') self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id'] self.node_pool_id = attributes[:'nodePoolId'] if attributes[:'nodePoolId'] raise 'You cannot provide both :nodePoolId and :node_pool_id' if attributes.key?(:'nodePoolId') && attributes.key?(:'node_pool_id') self.node_pool_id = attributes[:'node_pool_id'] if attributes[:'node_pool_id'] self.fault_domain = attributes[:'faultDomain'] if attributes[:'faultDomain'] raise 'You cannot provide both :faultDomain and :fault_domain' if attributes.key?(:'faultDomain') && attributes.key?(:'fault_domain') self.fault_domain = attributes[:'fault_domain'] if attributes[:'fault_domain'] self.private_ip = attributes[:'privateIp'] if attributes[:'privateIp'] raise 'You cannot provide both :privateIp and :private_ip' if attributes.key?(:'privateIp') && attributes.key?(:'private_ip') self.private_ip = attributes[:'private_ip'] if attributes[:'private_ip'] self.public_ip = attributes[:'publicIp'] if attributes[:'publicIp'] raise 'You cannot provide both :publicIp and :public_ip' if attributes.key?(:'publicIp') && attributes.key?(:'public_ip') self.public_ip = attributes[:'public_ip'] if attributes[:'public_ip'] self.node_error = attributes[:'nodeError'] if attributes[:'nodeError'] raise 'You cannot provide both :nodeError and :node_error' if attributes.key?(:'nodeError') && attributes.key?(:'node_error') self.node_error = attributes[:'node_error'] if attributes[:'node_error'] 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.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails'] raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details') self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details'] end
Attribute type mapping.
# File lib/oci/container_engine/models/node.rb, line 91 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'name': :'String', 'kubernetes_version': :'String', 'availability_domain': :'String', 'subnet_id': :'String', 'node_pool_id': :'String', 'fault_domain': :'String', 'private_ip': :'String', 'public_ip': :'String', 'node_error': :'OCI::ContainerEngine::Models::NodeError', 'lifecycle_state': :'String', 'lifecycle_details': :'String' # rubocop:enable Style/SymbolLiteral } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] other the other object to be compared
# File lib/oci/container_engine/models/node.rb, line 219 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && name == other.name && kubernetes_version == other.kubernetes_version && availability_domain == other.availability_domain && subnet_id == other.subnet_id && node_pool_id == other.node_pool_id && fault_domain == other.fault_domain && private_ip == other.private_ip && public_ip == other.public_ip && node_error == other.node_error && lifecycle_state == other.lifecycle_state && lifecycle_details == other.lifecycle_details end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/oci/container_engine/models/node.rb, line 260 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
@see the `==` method @param [Object] other the other object to be compared
# File lib/oci/container_engine/models/node.rb, line 240 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/oci/container_engine/models/node.rb, line 249 def hash [id, name, kubernetes_version, availability_domain, subnet_id, node_pool_id, fault_domain, private_ip, public_ip, node_error, lifecycle_state, lifecycle_details].hash end
Custom attribute writer method checking allowed values (enum). @param [Object] lifecycle_state
Object
to be assigned
# File lib/oci/container_engine/models/node.rb, line 203 def lifecycle_state=(lifecycle_state) # rubocop:disable Style/ConditionalAssignment if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state) OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE else @lifecycle_state = lifecycle_state end # rubocop:enable Style/ConditionalAssignment end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/oci/container_engine/models/node.rb, line 293 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/oci/container_engine/models/node.rb, line 287 def to_s to_hash.to_s end
Private Instance Methods
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/oci/container_engine/models/node.rb, line 310 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end