Class: OCI::DataScience::Models::UpdateOcirModelDeploymentEnvironmentConfigurationDetails

Inherits:
UpdateModelDeploymentEnvironmentConfigurationDetails show all
Defined in:
lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb

Overview

The update environment configuration details object for OCI Registry

Constant Summary

Constants inherited from UpdateModelDeploymentEnvironmentConfigurationDetails

OCI::DataScience::Models::UpdateModelDeploymentEnvironmentConfigurationDetails::ENVIRONMENT_CONFIGURATION_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from UpdateModelDeploymentEnvironmentConfigurationDetails

#environment_configuration_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UpdateModelDeploymentEnvironmentConfigurationDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ UpdateOcirModelDeploymentEnvironmentConfigurationDetails

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

  • :image_digest (String)

    The value to assign to the #image_digest property

  • :cmd (Array<String>)

    The value to assign to the #cmd property

  • :entrypoint (Array<String>)

    The value to assign to the #entrypoint property

  • :server_port (Integer)

    The value to assign to the #server_port property

  • :health_check_port (Integer)

    The value to assign to the #health_check_port property

  • :environment_variables (Hash<String, String>)

    The value to assign to the #environment_variables property



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 112

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

  attributes['environmentConfigurationType'] = '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.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.cmd = attributes[:'cmd'] if attributes[:'cmd']

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

  self.server_port = attributes[:'serverPort'] if attributes[:'serverPort']

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

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

  self.health_check_port = attributes[:'healthCheckPort'] if attributes[:'healthCheckPort']

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

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

  self.environment_variables = attributes[:'environmentVariables'] if attributes[:'environmentVariables']

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

  self.environment_variables = attributes[:'environment_variables'] if attributes[:'environment_variables']
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>)


31
32
33
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 31

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


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

def entrypoint
  @entrypoint
end

#environment_variablesHash<String, String>

Environment variables to set for the web server container. The size of envVars must be less than 2048 bytes. Key should be under 32 characters. Key should contain only letters, digits and underscore (_) Key should start with a letter. Key should have at least 2 characters. Key should not end with underscore eg. TEST_ Key if added cannot be empty. Value can be empty. No specific size limits on individual Values. But overall environment variables is limited to 2048 bytes. Key can't be reserved Model Deployment environment variables.

Returns:

  • (Hash<String, String>)


65
66
67
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 65

def environment_variables
  @environment_variables
end

#health_check_portInteger

The port on which the container HEALTHCHECK would listen. The port can be anything between 1024 and 65535. The following ports cannot be used 24224, 8446, 8447.

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 51

def health_check_port
  @health_check_port
end

#imageString

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/update_ocir_model_deployment_environment_configuration_details.rb', line 18

def image
  @image
end

#image_digestString

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

Returns:

  • (String)


24
25
26
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 24

def image_digest
  @image_digest
end

#server_portInteger

The port on which the web server serving the inference is running. The port can be anything between 1024 and 65535. The following ports cannot be used 24224, 8446, 8447.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 45

def server_port
  @server_port
end

Class Method Details

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 68

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'environment_configuration_type': :'environmentConfigurationType',
    'image': :'image',
    'image_digest': :'imageDigest',
    'cmd': :'cmd',
    'entrypoint': :'entrypoint',
    'server_port': :'serverPort',
    'health_check_port': :'healthCheckPort',
    'environment_variables': :'environmentVariables'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'environment_configuration_type': :'String',
    'image': :'String',
    'image_digest': :'String',
    'cmd': :'Array<String>',
    'entrypoint': :'Array<String>',
    'server_port': :'Integer',
    'health_check_port': :'Integer',
    'environment_variables': :'Hash<String, 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



160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 160

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

  self.class == other.class &&
    environment_configuration_type == other.environment_configuration_type &&
    image == other.image &&
    image_digest == other.image_digest &&
    cmd == other.cmd &&
    entrypoint == other.entrypoint &&
    server_port == other.server_port &&
    health_check_port == other.health_check_port &&
    environment_variables == other.environment_variables
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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 197

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


177
178
179
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 177

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



186
187
188
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 186

def hash
  [environment_configuration_type, image, image_digest, cmd, entrypoint, server_port, health_check_port, environment_variables].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 230

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



224
225
226
# File 'lib/oci/data_science/models/update_ocir_model_deployment_environment_configuration_details.rb', line 224

def to_s
  to_hash.to_s
end