Class: OCI::DataScience::Models::PipelineOcirContainerConfigurationDetails

Inherits:
PipelineContainerConfigurationDetails show all
Defined in:
lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb

Overview

Container configuration based on image stored in OCI Container Registry.

Constant Summary

Constants inherited from PipelineContainerConfigurationDetails

OCI::DataScience::Models::PipelineContainerConfigurationDetails::CONTAINER_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from PipelineContainerConfigurationDetails

#container_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PipelineContainerConfigurationDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ PipelineOcirContainerConfigurationDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :image (String)

    The value to assign to the #image property

  • :cmd (Array<String>)

    The value to assign to the #cmd property

  • :entrypoint (Array<String>)

    The value to assign to the #entrypoint property

  • :image_digest (String)

    The value to assign to the #image_digest property

  • :image_signature_id (String)

    The value to assign to the #image_signature_id property



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 81

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

  attributes['containerType'] = 'OCIR_CONTAINER'

  super(attributes)

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

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

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

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

  self.image_digest = attributes[:'imageDigest'] if attributes[:'imageDigest']

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

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

  self.image_signature_id = attributes[:'imageSignatureId'] if attributes[:'imageSignatureId']

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

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

Instance Attribute Details

#cmdArray<String>

The container image run CMD as a list of strings. Use CMD as arguments to the ENTRYPOINT or the only command to run in the absence of an ENTRYPOINT. The combined size of CMD and ENTRYPOINT must be less than 2048 bytes.

Returns:

  • (Array<String>)


22
23
24
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 22

def cmd
  @cmd
end

#entrypointArray<String>

The container image run ENTRYPOINT as a list of strings. Accept the CMD as extra arguments. The combined size of CMD and ENTRYPOINT must be less than 2048 bytes. More information on how CMD and ENTRYPOINT interact are here.

Returns:

  • (Array<String>)


30
31
32
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 30

def entrypoint
  @entrypoint
end

#imageString

[Required] The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format.

Returns:

  • (String)


15
16
17
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 15

def image
  @image
end

#image_digestString

The digest of the container image. For example, sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 36

def image_digest
  @image_digest
end

#image_signature_idString

OCID of the container image signature

Returns:

  • (String)


40
41
42
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 40

def image_signature_id
  @image_signature_id
end

Class Method Details

.attribute_mapObject

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



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 43

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'container_type': :'containerType',
    'image': :'image',
    'cmd': :'cmd',
    'entrypoint': :'entrypoint',
    'image_digest': :'imageDigest',
    'image_signature_id': :'imageSignatureId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 57

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'container_type': :'String',
    'image': :'String',
    'cmd': :'Array<String>',
    'entrypoint': :'Array<String>',
    'image_digest': :'String',
    'image_signature_id': :'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



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 117

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

  self.class == other.class &&
    container_type == other.container_type &&
    image == other.image &&
    cmd == other.cmd &&
    entrypoint == other.entrypoint &&
    image_digest == other.image_digest &&
    image_signature_id == other.image_signature_id
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



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 152

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


132
133
134
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 132

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



141
142
143
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 141

def hash
  [container_type, image, cmd, entrypoint, image_digest, image_signature_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 185

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



179
180
181
# File 'lib/oci/data_science/models/pipeline_ocir_container_configuration_details.rb', line 179

def to_s
  to_hash.to_s
end