Class: OCI::DataFlow::Models::CreateApplicationDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_flow/models/create_application_details.rb

Overview

The create application details.

Constant Summary collapse

LANGUAGE_ENUM =
[
  LANGUAGE_SCALA = 'SCALA'.freeze,
  LANGUAGE_JAVA = 'JAVA'.freeze,
  LANGUAGE_PYTHON = 'PYTHON'.freeze,
  LANGUAGE_SQL = 'SQL'.freeze
].freeze
TYPE_ENUM =
[
  TYPE_BATCH = 'BATCH'.freeze,
  TYPE_STREAMING = 'STREAMING'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateApplicationDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/oci/data_flow/models/create_application_details.rb', line 259

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

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

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

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

  self.class_name = attributes[:'className'] if attributes[:'className']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.driver_shape = attributes[:'driverShape'] if attributes[:'driverShape']

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

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

  self.driver_shape_config = attributes[:'driverShapeConfig'] if attributes[:'driverShapeConfig']

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

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

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

  self.executor_shape = attributes[:'executorShape'] if attributes[:'executorShape']

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

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

  self.executor_shape_config = attributes[:'executorShapeConfig'] if attributes[:'executorShapeConfig']

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

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

  self.file_uri = attributes[:'fileUri'] if attributes[:'fileUri']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

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

  self.logs_bucket_uri = attributes[:'logsBucketUri'] if attributes[:'logsBucketUri']

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

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

  self.metastore_id = attributes[:'metastoreId'] if attributes[:'metastoreId']

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

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

  self.num_executors = attributes[:'numExecutors'] if attributes[:'numExecutors']

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

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

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

  self.private_endpoint_id = attributes[:'privateEndpointId'] if attributes[:'privateEndpointId']

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

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

  self.spark_version = attributes[:'sparkVersion'] if attributes[:'sparkVersion']

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

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

  self.type = attributes[:'type'] if attributes[:'type']
  self.type = "BATCH" if type.nil? && !attributes.key?(:'type') # rubocop:disable Style/StringLiterals

  self.warehouse_bucket_uri = attributes[:'warehouseBucketUri'] if attributes[:'warehouseBucketUri']

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

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

Instance Attribute Details

#archive_uriString

An Oracle Cloud Infrastructure URI of an archive.zip file containing custom dependencies that may be used to support the execution a Python, Java, or Scala application. See docs.cloud.oracle.com/iaas/Content/API/SDKDocs/hdfsconnector.htm#uriformat.

Returns:

  • (String)


27
28
29
# File 'lib/oci/data_flow/models/create_application_details.rb', line 27

def archive_uri
  @archive_uri
end

#argumentsArray<String>

The arguments passed to the running application as command line arguments. An argument is either a plain text or a placeholder. Placeholders are replaced using values from the parameters map. Each placeholder specified must be represented in the parameters map else the request (POST or PUT) will fail with a HTTP 400 status code. Placeholders are specified as `Service Api Spec`, where `name` is the name of the parameter. Example: `[ "–input", "$input_file", "–name", "John Doe" ]` If "input_file" has a value of "mydata.xml", then the value above will be translated to `–input mydata.xml –name "John Doe"`

Returns:

  • (Array<String>)


39
40
41
# File 'lib/oci/data_flow/models/create_application_details.rb', line 39

def arguments
  @arguments
end

#class_nameString

The class for the application.

Returns:

  • (String)


44
45
46
# File 'lib/oci/data_flow/models/create_application_details.rb', line 44

def class_name
  @class_name
end

#compartment_idString

**[Required]** The OCID of a compartment.

Returns:

  • (String)


49
50
51
# File 'lib/oci/data_flow/models/create_application_details.rb', line 49

def compartment_id
  @compartment_id
end

#configurationHash<String, String>

The Spark configuration passed to the running process. See spark.apache.org/docs/latest/configuration.html#available-properties. Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" } Note: Not all Spark properties are permitted to be set. Attempting to set a property that is not allowed to be overwritten will cause a 400 status to be returned.

Returns:

  • (Hash<String, String>)


58
59
60
# File 'lib/oci/data_flow/models/create_application_details.rb', line 58

def configuration
  @configuration
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"CostCenter": "42"}`

Returns:

  • (Hash<String, Hash<String, Object>>)


64
65
66
# File 'lib/oci/data_flow/models/create_application_details.rb', line 64

def defined_tags
  @defined_tags
end

#descriptionString

A user-friendly description. Avoid entering confidential information.

Returns:

  • (String)


69
70
71
# File 'lib/oci/data_flow/models/create_application_details.rb', line 69

def description
  @description
end

#display_nameString

**[Required]** A user-friendly name. It does not have to be unique. Avoid entering confidential information.

Returns:

  • (String)


74
75
76
# File 'lib/oci/data_flow/models/create_application_details.rb', line 74

def display_name
  @display_name
end

#driver_shapeString

**[Required]** The VM shape for the driver. Sets the driver cores and memory.

Returns:

  • (String)


79
80
81
# File 'lib/oci/data_flow/models/create_application_details.rb', line 79

def driver_shape
  @driver_shape
end

#driver_shape_configOCI::DataFlow::Models::ShapeConfig



82
83
84
# File 'lib/oci/data_flow/models/create_application_details.rb', line 82

def driver_shape_config
  @driver_shape_config
end

#executeString

The input used for spark-submit command. For more details see spark.apache.org/docs/latest/submitting-applications.html#launching-applications-with-spark-submit. Supported options include “–class“, “–file“, “–jars“, “–conf“, “–py-files“, and main application file with arguments. Example: “–jars oci://path/to/a.jar,oci://path/to/b.jar –files oci://path/to/a.json,oci://path/to/b.csv –py-files oci://path/to/a.py,oci://path/to/b.py –conf spark.sql.crossJoin.enabled=true –class org.apache.spark.examples.SparkPi oci://path/to/main.jar 10“ Note: If execute is specified together with applicationId, className, configuration, fileUri, language, arguments, parameters during application create/update, or run create/submit, Data Flow service will use derived information from execute input only.

Returns:

  • (String)


91
92
93
# File 'lib/oci/data_flow/models/create_application_details.rb', line 91

def execute
  @execute
end

#executor_shapeString

**[Required]** The VM shape for the executors. Sets the executor cores and memory.

Returns:

  • (String)


96
97
98
# File 'lib/oci/data_flow/models/create_application_details.rb', line 96

def executor_shape
  @executor_shape
end

#executor_shape_configOCI::DataFlow::Models::ShapeConfig



99
100
101
# File 'lib/oci/data_flow/models/create_application_details.rb', line 99

def executor_shape_config
  @executor_shape_config
end

#file_uriString

**[Required]** An Oracle Cloud Infrastructure URI of the file containing the application to execute. See docs.cloud.oracle.com/iaas/Content/API/SDKDocs/hdfsconnector.htm#uriformat.

Returns:

  • (String)


105
106
107
# File 'lib/oci/data_flow/models/create_application_details.rb', line 105

def file_uri
  @file_uri
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `"Finance"`

Returns:

  • (Hash<String, String>)


112
113
114
# File 'lib/oci/data_flow/models/create_application_details.rb', line 112

def freeform_tags
  @freeform_tags
end

#languageString

**[Required]** The Spark language.

Returns:

  • (String)


117
118
119
# File 'lib/oci/data_flow/models/create_application_details.rb', line 117

def language
  @language
end

#logs_bucket_uriString

An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. See docs.cloud.oracle.com/iaas/Content/API/SDKDocs/hdfsconnector.htm#uriformat.

Returns:

  • (String)


123
124
125
# File 'lib/oci/data_flow/models/create_application_details.rb', line 123

def logs_bucket_uri
  @logs_bucket_uri
end

#metastore_idString

The OCID of OCI Hive Metastore.

Returns:

  • (String)


128
129
130
# File 'lib/oci/data_flow/models/create_application_details.rb', line 128

def metastore_id
  @metastore_id
end

#num_executorsInteger

**[Required]** The number of executor VMs requested.

Returns:

  • (Integer)


133
134
135
# File 'lib/oci/data_flow/models/create_application_details.rb', line 133

def num_executors
  @num_executors
end

#parametersArray<OCI::DataFlow::Models::ApplicationParameter>

An array of name/value pairs used to fill placeholders found in properties like `Application.arguments`. The name must be a string of one or more word characters (a-z, A-Z, 0-9, _). The value can be a string of 0 or more characters of any kind. Example: [ { name: "iterations", value: "10"}, { name: "input_file", value: "mydata.xml" }, { name: "variable_x", value: "$x"} ]



141
142
143
# File 'lib/oci/data_flow/models/create_application_details.rb', line 141

def parameters
  @parameters
end

#private_endpoint_idString

The OCID of a private endpoint.

Returns:

  • (String)


146
147
148
# File 'lib/oci/data_flow/models/create_application_details.rb', line 146

def private_endpoint_id
  @private_endpoint_id
end

#spark_versionString

**[Required]** The Spark version utilized to run the application.

Returns:

  • (String)


151
152
153
# File 'lib/oci/data_flow/models/create_application_details.rb', line 151

def spark_version
  @spark_version
end

#typeString

The Spark application processing type.

Returns:

  • (String)


156
157
158
# File 'lib/oci/data_flow/models/create_application_details.rb', line 156

def type
  @type
end

#warehouse_bucket_uriString

An Oracle Cloud Infrastructure URI of the bucket to be used as default warehouse directory for BATCH SQL runs. See docs.cloud.oracle.com/iaas/Content/API/SDKDocs/hdfsconnector.htm#uriformat.

Returns:

  • (String)


163
164
165
# File 'lib/oci/data_flow/models/create_application_details.rb', line 163

def warehouse_bucket_uri
  @warehouse_bucket_uri
end

Class Method Details

.attribute_mapObject

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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/oci/data_flow/models/create_application_details.rb', line 166

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'archive_uri': :'archiveUri',
    'arguments': :'arguments',
    'class_name': :'className',
    'compartment_id': :'compartmentId',
    'configuration': :'configuration',
    'defined_tags': :'definedTags',
    'description': :'description',
    'display_name': :'displayName',
    'driver_shape': :'driverShape',
    'driver_shape_config': :'driverShapeConfig',
    'execute': :'execute',
    'executor_shape': :'executorShape',
    'executor_shape_config': :'executorShapeConfig',
    'file_uri': :'fileUri',
    'freeform_tags': :'freeformTags',
    'language': :'language',
    'logs_bucket_uri': :'logsBucketUri',
    'metastore_id': :'metastoreId',
    'num_executors': :'numExecutors',
    'parameters': :'parameters',
    'private_endpoint_id': :'privateEndpointId',
    'spark_version': :'sparkVersion',
    'type': :'type',
    'warehouse_bucket_uri': :'warehouseBucketUri'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/oci/data_flow/models/create_application_details.rb', line 198

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'archive_uri': :'String',
    'arguments': :'Array<String>',
    'class_name': :'String',
    'compartment_id': :'String',
    'configuration': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'description': :'String',
    'display_name': :'String',
    'driver_shape': :'String',
    'driver_shape_config': :'OCI::DataFlow::Models::ShapeConfig',
    'execute': :'String',
    'executor_shape': :'String',
    'executor_shape_config': :'OCI::DataFlow::Models::ShapeConfig',
    'file_uri': :'String',
    'freeform_tags': :'Hash<String, String>',
    'language': :'String',
    'logs_bucket_uri': :'String',
    'metastore_id': :'String',
    'num_executors': :'Integer',
    'parameters': :'Array<OCI::DataFlow::Models::ApplicationParameter>',
    'private_endpoint_id': :'String',
    'spark_version': :'String',
    'type': :'String',
    'warehouse_bucket_uri': :'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



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/oci/data_flow/models/create_application_details.rb', line 406

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

  self.class == other.class &&
    archive_uri == other.archive_uri &&
    arguments == other.arguments &&
    class_name == other.class_name &&
    compartment_id == other.compartment_id &&
    configuration == other.configuration &&
    defined_tags == other.defined_tags &&
    description == other.description &&
    display_name == other.display_name &&
    driver_shape == other.driver_shape &&
    driver_shape_config == other.driver_shape_config &&
    execute == other.execute &&
    executor_shape == other.executor_shape &&
    executor_shape_config == other.executor_shape_config &&
    file_uri == other.file_uri &&
    freeform_tags == other.freeform_tags &&
    language == other.language &&
    logs_bucket_uri == other.logs_bucket_uri &&
    metastore_id == other.metastore_id &&
    num_executors == other.num_executors &&
    parameters == other.parameters &&
    private_endpoint_id == other.private_endpoint_id &&
    spark_version == other.spark_version &&
    type == other.type &&
    warehouse_bucket_uri == other.warehouse_bucket_uri
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



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/oci/data_flow/models/create_application_details.rb', line 459

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


439
440
441
# File 'lib/oci/data_flow/models/create_application_details.rb', line 439

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



448
449
450
# File 'lib/oci/data_flow/models/create_application_details.rb', line 448

def hash
  [archive_uri, arguments, class_name, compartment_id, configuration, defined_tags, description, display_name, driver_shape, driver_shape_config, execute, executor_shape, executor_shape_config, file_uri, freeform_tags, language, logs_bucket_uri, metastore_id, num_executors, parameters, private_endpoint_id, spark_version, type, warehouse_bucket_uri].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



492
493
494
495
496
497
498
499
500
501
# File 'lib/oci/data_flow/models/create_application_details.rb', line 492

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



486
487
488
# File 'lib/oci/data_flow/models/create_application_details.rb', line 486

def to_s
  to_hash.to_s
end