Class: VectorAmp::FileUploadSource

Inherits:
Source
  • Object
show all
Defined in:
lib/vector_amp/source.rb

Overview

File-upload ingestion source used by direct local file uploads.

Constant Summary

Constants inherited from Source

Source::SUPPORTED_SOURCE_TYPES

Instance Attribute Summary

Attributes inherited from Source

#config, #description, #id, #metadata, #name, #source_type

Instance Method Summary collapse

Methods inherited from Source

#[], from_api, #inspect, normalize_hash, #to_create_body, #to_h

Constructor Details

#initialize(name: nil, description: nil, metadata: nil, id: nil, storage_provider: "s3", sync_mode: "full", **config) ⇒ FileUploadSource

Parameters:

  • name (String, nil) (defaults to: nil)

    defaults to timestamped ruby-sdk-file-upload-YYYYmmddHHMMSS.

  • description (String, nil) (defaults to: nil)

    optional description.

  • metadata (Hash, nil) (defaults to: nil)

    optional metadata.

  • id (String, nil) (defaults to: nil)

    optional API source id.

  • storage_provider (String) (defaults to: "s3")

    storage backend; defaults to s3.

  • sync_mode (String) (defaults to: "full")

    sync strategy; defaults to full.

  • config (Hash)

    additional file-upload config forwarded to the API.



290
291
292
293
294
295
296
297
298
299
# File 'lib/vector_amp/source.rb', line 290

def initialize(name: nil, description: nil, metadata: nil, id: nil, storage_provider: "s3", sync_mode: "full", **config)
  super(
    id: id,
    source_type: "file_upload",
    name: name || SourceNames.file_upload,
    description: description,
    metadata: ,
    config: Utils.compact_hash(config.merge(storage_provider: storage_provider, sync_mode: sync_mode))
  )
end