Class: OCI::DataScience::Models::OcirContainerJobEnvironmentConfigurationDetails

Inherits:
JobEnvironmentConfigurationDetails show all
Defined in:
lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb

Overview

Environment configuration based on container image stored in OCI Container Registry.

Constant Summary

Constants inherited from JobEnvironmentConfigurationDetails

JobEnvironmentConfigurationDetails::JOB_ENVIRONMENT_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from JobEnvironmentConfigurationDetails

#job_environment_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JobEnvironmentConfigurationDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ OcirContainerJobEnvironmentConfigurationDetails

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



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
109
110
111
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 84

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

  attributes['jobEnvironmentType'] = '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>)


25
26
27
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 25

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>)


33
34
35
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 33

def entrypoint
  @entrypoint
end

#imageString

[Required] The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. Acceptable format: <region>.ocir.io/<registry>/<image>:<tag> <region>.ocir.io/<registry>/<image>:<tag>@digest

Returns:

  • (String)


18
19
20
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 18

def image
  @image
end

#image_digestString

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

Returns:

  • (String)


39
40
41
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 39

def image_digest
  @image_digest
end

#image_signature_idString

OCID of the container image signature

Returns:

  • (String)


43
44
45
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 43

def image_signature_id
  @image_signature_id
end

Class Method Details

.attribute_mapObject

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



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 46

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

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'job_environment_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



120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 120

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

  self.class == other.class &&
    job_environment_type == other.job_environment_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



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

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


135
136
137
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 135

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



144
145
146
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 144

def hash
  [job_environment_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



188
189
190
191
192
193
194
195
196
197
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 188

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



182
183
184
# File 'lib/oci/data_science/models/ocir_container_job_environment_configuration_details.rb', line 182

def to_s
  to_hash.to_s
end