Class: OCI::Core::Models::InstanceReservationConfigDetails
- Inherits:
-
Object
- Object
- OCI::Core::Models::InstanceReservationConfigDetails
- Defined in:
- lib/oci/core/models/instance_reservation_config_details.rb
Overview
A template that contains the settings to use when defining the instance reservation configuration.
Instance Attribute Summary collapse
-
#fault_domain ⇒ String
The fault domain to use for instances created using this reservation configuration.
-
#instance_shape ⇒ String
[Required] The shape requested when launching instances using reserved capacity.
- #instance_shape_config ⇒ OCI::Core::Models::InstanceReservationShapeConfigDetails
-
#reserved_count ⇒ Integer
[Required] The amount of capacity to reserve in this reservation configuration.
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 = {}) ⇒ InstanceReservationConfigDetails
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 = {}) ⇒ InstanceReservationConfigDetails
Initializes the object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 74 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.instance_shape = attributes[:'instanceShape'] if attributes[:'instanceShape'] raise 'You cannot provide both :instanceShape and :instance_shape' if attributes.key?(:'instanceShape') && attributes.key?(:'instance_shape') self.instance_shape = attributes[:'instance_shape'] if attributes[:'instance_shape'] self.instance_shape_config = attributes[:'instanceShapeConfig'] if attributes[:'instanceShapeConfig'] raise 'You cannot provide both :instanceShapeConfig and :instance_shape_config' if attributes.key?(:'instanceShapeConfig') && attributes.key?(:'instance_shape_config') self.instance_shape_config = attributes[:'instance_shape_config'] if attributes[:'instance_shape_config'] 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.reserved_count = attributes[:'reservedCount'] if attributes[:'reservedCount'] raise 'You cannot provide both :reservedCount and :reserved_count' if attributes.key?(:'reservedCount') && attributes.key?(:'reserved_count') self.reserved_count = attributes[:'reserved_count'] if attributes[:'reserved_count'] end |
Instance Attribute Details
#fault_domain ⇒ String
The fault domain to use for instances created using this reservation configuration. For more information, see [Fault Domains](docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm#fault). If you do not specify the fault domain, the capacity is available for an instance that does not specify a fault domain. To change the fault domain for a reservation, delete the reservation and create a new one in the preferred fault domain.
To retrieve a list of fault domains, use the ListFaultDomains operation in the [Identity and Access Management Service API](docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/).
Example: FAULT-DOMAIN-1
34 35 36 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 34 def fault_domain @fault_domain end |
#instance_shape ⇒ String
[Required] The shape requested when launching instances using reserved capacity. The shape determines the number of CPUs, amount of memory, and other resources allocated to the instance. You can list all available shapes by calling ListComputeCapacityReservationInstanceShapes.
17 18 19 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 17 def instance_shape @instance_shape end |
#instance_shape_config ⇒ OCI::Core::Models::InstanceReservationShapeConfigDetails
20 21 22 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 20 def instance_shape_config @instance_shape_config end |
#reserved_count ⇒ Integer
[Required] The amount of capacity to reserve in this reservation configuration.
38 39 40 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 38 def reserved_count @reserved_count end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 41 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'instance_shape': :'instanceShape', 'instance_shape_config': :'instanceShapeConfig', 'fault_domain': :'faultDomain', 'reserved_count': :'reservedCount' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 53 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'instance_shape': :'String', 'instance_shape_config': :'OCI::Core::Models::InstanceReservationShapeConfigDetails', 'fault_domain': :'String', 'reserved_count': :'Integer' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
112 113 114 115 116 117 118 119 120 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 112 def ==(other) return true if equal?(other) self.class == other.class && instance_shape == other.instance_shape && instance_shape_config == other.instance_shape_config && fault_domain == other.fault_domain && reserved_count == other.reserved_count end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 145 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
125 126 127 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 125 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
134 135 136 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 134 def hash [instance_shape, instance_shape_config, fault_domain, reserved_count].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 178 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
172 173 174 |
# File 'lib/oci/core/models/instance_reservation_config_details.rb', line 172 def to_s to_hash.to_s end |