Class: OCI::DataFlow::Models::CreateRunDetails

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

Overview

The create run details. The following properties are optional and override the default values set in the associated application: - arguments - configuration - definedTags - driverShape - executorShape - freeformTags - logsBucketUri - numExecutors - parameters - warehouseBucketUri If the optional properties are not specified, they are copied over from the parent application. Once a run is created, its properties (except for definedTags and freeformTags) cannot be changed. If the parent application's properties (including definedTags and freeformTags) are updated, the corresponding properties of the run will not update.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateRunDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :application_id (String)

    The value to assign to the #application_id property

  • :arguments (Array<String>)

    The value to assign to the #arguments property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :configuration (Hash<String, String>)

    The value to assign to the #configuration property

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

    The value to assign to the #defined_tags property

  • :display_name (String)

    The value to assign to the #display_name property

  • :driver_shape (String)

    The value to assign to the #driver_shape property

  • :executor_shape (String)

    The value to assign to the #executor_shape property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :logs_bucket_uri (String)

    The value to assign to the #logs_bucket_uri property

  • :num_executors (Integer)

    The value to assign to the #num_executors property

  • :parameters (Array<OCI::DataFlow::Models::ApplicationParameter>)

    The value to assign to the #parameters property

  • :warehouse_bucket_uri (String)

    The value to assign to the #warehouse_bucket_uri property



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/data_flow/models/create_run_details.rb', line 172

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

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

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

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

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

#application_idString

[Required] The application ID.

Returns:

  • (String)


29
30
31
# File 'lib/oci/data_flow/models/create_run_details.rb', line 29

def application_id
  @application_id
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>)


41
42
43
# File 'lib/oci/data_flow/models/create_run_details.rb', line 41

def arguments
  @arguments
end

#compartment_idString

[Required] The OCID of a compartment.

Returns:

  • (String)


46
47
48
# File 'lib/oci/data_flow/models/create_run_details.rb', line 46

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


55
56
57
# File 'lib/oci/data_flow/models/create_run_details.rb', line 55

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. Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

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


61
62
63
# File 'lib/oci/data_flow/models/create_run_details.rb', line 61

def defined_tags
  @defined_tags
end

#display_nameString

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

Returns:

  • (String)


66
67
68
# File 'lib/oci/data_flow/models/create_run_details.rb', line 66

def display_name
  @display_name
end

#driver_shapeString

The VM shape for the driver. Sets the driver cores and memory.

Returns:

  • (String)


71
72
73
# File 'lib/oci/data_flow/models/create_run_details.rb', line 71

def driver_shape
  @driver_shape
end

#executor_shapeString

The VM shape for the executors. Sets the executor cores and memory.

Returns:

  • (String)


76
77
78
# File 'lib/oci/data_flow/models/create_run_details.rb', line 76

def executor_shape
  @executor_shape
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. Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


83
84
85
# File 'lib/oci/data_flow/models/create_run_details.rb', line 83

def freeform_tags
  @freeform_tags
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)


89
90
91
# File 'lib/oci/data_flow/models/create_run_details.rb', line 89

def logs_bucket_uri
  @logs_bucket_uri
end

#num_executorsInteger

The number of executor VMs requested.

Returns:

  • (Integer)


94
95
96
# File 'lib/oci/data_flow/models/create_run_details.rb', line 94

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"} ]



102
103
104
# File 'lib/oci/data_flow/models/create_run_details.rb', line 102

def parameters
  @parameters
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)


109
110
111
# File 'lib/oci/data_flow/models/create_run_details.rb', line 109

def warehouse_bucket_uri
  @warehouse_bucket_uri
end

Class Method Details

.attribute_mapObject

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



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/data_flow/models/create_run_details.rb', line 112

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'application_id': :'applicationId',
    'arguments': :'arguments',
    'compartment_id': :'compartmentId',
    'configuration': :'configuration',
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'driver_shape': :'driverShape',
    'executor_shape': :'executorShape',
    'freeform_tags': :'freeformTags',
    'logs_bucket_uri': :'logsBucketUri',
    'num_executors': :'numExecutors',
    'parameters': :'parameters',
    'warehouse_bucket_uri': :'warehouseBucketUri'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/oci/data_flow/models/create_run_details.rb', line 133

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'application_id': :'String',
    'arguments': :'Array<String>',
    'compartment_id': :'String',
    'configuration': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'driver_shape': :'String',
    'executor_shape': :'String',
    'freeform_tags': :'Hash<String, String>',
    'logs_bucket_uri': :'String',
    'num_executors': :'Integer',
    'parameters': :'Array<OCI::DataFlow::Models::ApplicationParameter>',
    '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



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/data_flow/models/create_run_details.rb', line 252

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

  self.class == other.class &&
    application_id == other.application_id &&
    arguments == other.arguments &&
    compartment_id == other.compartment_id &&
    configuration == other.configuration &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    driver_shape == other.driver_shape &&
    executor_shape == other.executor_shape &&
    freeform_tags == other.freeform_tags &&
    logs_bucket_uri == other.logs_bucket_uri &&
    num_executors == other.num_executors &&
    parameters == other.parameters &&
    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



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/oci/data_flow/models/create_run_details.rb', line 294

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


274
275
276
# File 'lib/oci/data_flow/models/create_run_details.rb', line 274

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



283
284
285
# File 'lib/oci/data_flow/models/create_run_details.rb', line 283

def hash
  [application_id, arguments, compartment_id, configuration, defined_tags, display_name, driver_shape, executor_shape, freeform_tags, logs_bucket_uri, num_executors, parameters, 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



327
328
329
330
331
332
333
334
335
336
# File 'lib/oci/data_flow/models/create_run_details.rb', line 327

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



321
322
323
# File 'lib/oci/data_flow/models/create_run_details.rb', line 321

def to_s
  to_hash.to_s
end