Class: OCI::Core::Models::ComputeClusterPlacementConstraintDetails

Inherits:
PlacementConstraintDetails show all
Defined in:
lib/oci/core/models/compute_cluster_placement_constraint_details.rb

Overview

The details for providing placement constraints for a compute cluster.

Constant Summary collapse

LOGICAL_PLACEMENT_CONSTRAINT_ENUM =
[
  LOGICAL_PLACEMENT_CONSTRAINT_SINGLE_TIER = 'SINGLE_TIER'.freeze,
  LOGICAL_PLACEMENT_CONSTRAINT_SINGLE_BLOCK = 'SINGLE_BLOCK'.freeze,
  LOGICAL_PLACEMENT_CONSTRAINT_PACKED_DISTRIBUTION_MULTI_BLOCK = 'PACKED_DISTRIBUTION_MULTI_BLOCK'.freeze,
  LOGICAL_PLACEMENT_CONSTRAINT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Attributes inherited from PlacementConstraintDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PlacementConstraintDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ComputeClusterPlacementConstraintDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 90

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'COMPUTE_CLUSTER'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.hpc_island_id = attributes[:'hpcIslandId'] if attributes[:'hpcIslandId']

  raise 'You cannot provide both :hpcIslandId and :hpc_island_id' if attributes.key?(:'hpcIslandId') && attributes.key?(:'hpc_island_id')

  self.hpc_island_id = attributes[:'hpc_island_id'] if attributes[:'hpc_island_id']

  self.target_network_block_ids = attributes[:'targetNetworkBlockIds'] if attributes[:'targetNetworkBlockIds']

  raise 'You cannot provide both :targetNetworkBlockIds and :target_network_block_ids' if attributes.key?(:'targetNetworkBlockIds') && attributes.key?(:'target_network_block_ids')

  self.target_network_block_ids = attributes[:'target_network_block_ids'] if attributes[:'target_network_block_ids']

  self.target_memory_fabric_ids = attributes[:'targetMemoryFabricIds'] if attributes[:'targetMemoryFabricIds']

  raise 'You cannot provide both :targetMemoryFabricIds and :target_memory_fabric_ids' if attributes.key?(:'targetMemoryFabricIds') && attributes.key?(:'target_memory_fabric_ids')

  self.target_memory_fabric_ids = attributes[:'target_memory_fabric_ids'] if attributes[:'target_memory_fabric_ids']

  self.logical_placement_constraint = attributes[:'logicalPlacementConstraint'] if attributes[:'logicalPlacementConstraint']

  raise 'You cannot provide both :logicalPlacementConstraint and :logical_placement_constraint' if attributes.key?(:'logicalPlacementConstraint') && attributes.key?(:'logical_placement_constraint')

  self.logical_placement_constraint = attributes[:'logical_placement_constraint'] if attributes[:'logical_placement_constraint']
end

Instance Attribute Details

#hpc_island_idString

The OCID of the HPC island for the compute cluster.

This field cannot be updated after creation of the compute cluster.

Returns:

  • (String)


26
27
28
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 26

def hpc_island_id
  @hpc_island_id
end

#logical_placement_constraintString

The logical placement strategy to apply. Allowed values are SINGLE_TIER, SINGLE_BLOCK, and PACKED_DISTRIBUTION_MULTI_BLOCK.

Returns:

  • (String)


52
53
54
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 52

def logical_placement_constraint
  @logical_placement_constraint
end

#target_memory_fabric_idsArray<String>

The list of target GPU memory fabric OCIDs to constrain placement.

If GMFs are passed in, the hpcIslandId must be set on the compute cluster, and the provided GMFs must belong to that same HPC island.

The ordering of the array will be preserved. Ensure that all items in the array are unique.

Returns:

  • (Array<String>)


46
47
48
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 46

def target_memory_fabric_ids
  @target_memory_fabric_ids
end

#target_network_block_idsArray<String>

The list of target network block OCIDs to constrain placement.

If targetNetworkBlockIds is provided, the hpcIslandId must be set on the compute cluster, and the provided network blocks must belong to that same HPC island.

The ordering of the array will be preserved. Ensure that all items in the array are unique.

Returns:

  • (Array<String>)


36
37
38
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 36

def target_network_block_ids
  @target_network_block_ids
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 55

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'hpc_island_id': :'hpcIslandId',
    'target_network_block_ids': :'targetNetworkBlockIds',
    'target_memory_fabric_ids': :'targetMemoryFabricIds',
    'logical_placement_constraint': :'logicalPlacementConstraint'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'hpc_island_id': :'String',
    'target_network_block_ids': :'Array<String>',
    'target_memory_fabric_ids': :'Array<String>',
    'logical_placement_constraint': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



145
146
147
148
149
150
151
152
153
154
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 145

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    type == other.type &&
    hpc_island_id == other.hpc_island_id &&
    target_network_block_ids == other.target_network_block_ids &&
    target_memory_fabric_ids == other.target_memory_fabric_ids &&
    logical_placement_constraint == other.logical_placement_constraint
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 179

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


159
160
161
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 159

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



168
169
170
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 168

def hash
  [type, hpc_island_id, target_network_block_ids, target_memory_fabric_ids, logical_placement_constraint].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 212

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



206
207
208
# File 'lib/oci/core/models/compute_cluster_placement_constraint_details.rb', line 206

def to_s
  to_hash.to_s
end