Class: OCI::CloudBridge::Models::Placement
- Inherits:
-
Object
- Object
- OCI::CloudBridge::Models::Placement
- Defined in:
- lib/oci/cloud_bridge/models/placement.rb
Overview
Describes the placement of an instance.
Instance Attribute Summary collapse
-
#affinity ⇒ String
The affinity setting for the instance on the Dedicated Host.
-
#availability_zone ⇒ String
The Availability Zone of the instance.
-
#group_name ⇒ String
The name of the placement group the instance is in.
-
#host_key ⇒ String
The ID of the Dedicated Host on which the instance resides.
-
#host_resource_group_arn ⇒ String
The ARN of the host resource group in which to launch the instances.
-
#partition_number ⇒ Integer
The number of the partition that the instance is in.
-
#spread_domain ⇒ String
Reserved for future use.
-
#tenancy ⇒ String
The tenancy of the instance (if the instance is running in a VPC).
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 = {}) ⇒ Placement
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 = {}) ⇒ Placement
Initializes the object
89 90 91 92 93 94 95 96 97 98 99 100 101 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 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 89 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.affinity = attributes[:'affinity'] if attributes[:'affinity'] self.availability_zone = attributes[:'availabilityZone'] if attributes[:'availabilityZone'] raise 'You cannot provide both :availabilityZone and :availability_zone' if attributes.key?(:'availabilityZone') && attributes.key?(:'availability_zone') self.availability_zone = attributes[:'availability_zone'] if attributes[:'availability_zone'] self.group_name = attributes[:'groupName'] if attributes[:'groupName'] raise 'You cannot provide both :groupName and :group_name' if attributes.key?(:'groupName') && attributes.key?(:'group_name') self.group_name = attributes[:'group_name'] if attributes[:'group_name'] self.host_key = attributes[:'hostKey'] if attributes[:'hostKey'] raise 'You cannot provide both :hostKey and :host_key' if attributes.key?(:'hostKey') && attributes.key?(:'host_key') self.host_key = attributes[:'host_key'] if attributes[:'host_key'] self.host_resource_group_arn = attributes[:'hostResourceGroupArn'] if attributes[:'hostResourceGroupArn'] raise 'You cannot provide both :hostResourceGroupArn and :host_resource_group_arn' if attributes.key?(:'hostResourceGroupArn') && attributes.key?(:'host_resource_group_arn') self.host_resource_group_arn = attributes[:'host_resource_group_arn'] if attributes[:'host_resource_group_arn'] self.partition_number = attributes[:'partitionNumber'] if attributes[:'partitionNumber'] raise 'You cannot provide both :partitionNumber and :partition_number' if attributes.key?(:'partitionNumber') && attributes.key?(:'partition_number') self.partition_number = attributes[:'partition_number'] if attributes[:'partition_number'] self.spread_domain = attributes[:'spreadDomain'] if attributes[:'spreadDomain'] raise 'You cannot provide both :spreadDomain and :spread_domain' if attributes.key?(:'spreadDomain') && attributes.key?(:'spread_domain') self.spread_domain = attributes[:'spread_domain'] if attributes[:'spread_domain'] self.tenancy = attributes[:'tenancy'] if attributes[:'tenancy'] end |
Instance Attribute Details
#affinity ⇒ String
The affinity setting for the instance on the Dedicated Host.
13 14 15 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 13 def affinity @affinity end |
#availability_zone ⇒ String
The Availability Zone of the instance.
17 18 19 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 17 def availability_zone @availability_zone end |
#group_name ⇒ String
The name of the placement group the instance is in.
21 22 23 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 21 def group_name @group_name end |
#host_key ⇒ String
The ID of the Dedicated Host on which the instance resides.
25 26 27 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 25 def host_key @host_key end |
#host_resource_group_arn ⇒ String
The ARN of the host resource group in which to launch the instances.
29 30 31 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 29 def host_resource_group_arn @host_resource_group_arn end |
#partition_number ⇒ Integer
The number of the partition that the instance is in.
33 34 35 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 33 def partition_number @partition_number end |
#spread_domain ⇒ String
Reserved for future use.
37 38 39 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 37 def spread_domain @spread_domain end |
#tenancy ⇒ String
The tenancy of the instance (if the instance is running in a VPC).
41 42 43 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 41 def tenancy @tenancy end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 44 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'affinity': :'affinity', 'availability_zone': :'availabilityZone', 'group_name': :'groupName', 'host_key': :'hostKey', 'host_resource_group_arn': :'hostResourceGroupArn', 'partition_number': :'partitionNumber', 'spread_domain': :'spreadDomain', 'tenancy': :'tenancy' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 60 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'affinity': :'String', 'availability_zone': :'String', 'group_name': :'String', 'host_key': :'String', 'host_resource_group_arn': :'String', 'partition_number': :'Integer', 'spread_domain': :'String', 'tenancy': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 143 def ==(other) return true if equal?(other) self.class == other.class && affinity == other.affinity && availability_zone == other.availability_zone && group_name == other.group_name && host_key == other.host_key && host_resource_group_arn == other.host_resource_group_arn && partition_number == other.partition_number && spread_domain == other.spread_domain && tenancy == other.tenancy end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 180 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
160 161 162 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 160 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
169 170 171 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 169 def hash [affinity, availability_zone, group_name, host_key, host_resource_group_arn, partition_number, spread_domain, tenancy].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
213 214 215 216 217 218 219 220 221 222 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 213 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
207 208 209 |
# File 'lib/oci/cloud_bridge/models/placement.rb', line 207 def to_s to_hash.to_s end |