StorageService

StorageService

StorageService describes any remote service (s3, ftp, etc.) to which we can upload data. This object contains the information required to connect to the remote service (hostname, login name, password, etc.).

Constructor

new StorageService(opts)

Creates a new StorageService.

Parameters:
Name Type Description
opts object

Object containing properties to set.

Properties
Name Type Description
id string

A UUID in hex-string format. This is the object's unique identifier.

userCanDelete boolean

Indicates whether user is allowed to delete this record.

name string

The name of the remote storage service. This can be anything that's meaningful to the user (e.g. 'My S3 Bucket', 'Library SFTP Server', etc.). Names should be unique to prevent confusion.

description string

A user-friendly description of the storage service.

protocol string

The protocol to use when connecting to the remote repo ('s3', 'sftp', etc.).

host string

The name or IP address of the remote host.

port string

The port to connect to on the remote host. A value of zero means use the default port.

bucket string

The bucket or root folder into which to upload material.

login string

The user name or AWS Access Key ID to use when authenticating with the remote service. To avoid storing sensitive info in DART's data files, you can specify an environment variable here by using "env:VAR_NAME". When performing upload operations, DART will substitute the value of the environment variable "VAR_NAME".

password string

The password or AWS Secret Access Key to use when authenticating with the remote service. You can specify an environment variable here by using "env:VAR_NAME". When performing upload operations, DART will substitute the value of the environment variable "VAR_NAME".

loginExtra string

Optional additional information to pass to the remote service during the authentication process. You can specify an environment variable here by using "env:VAR_NAME". When performing upload operations, DART will substitute the value of the environment variable "VAR_NAME".

Source:

Members

allowsDownload :boolean

This describes whether the storage service allows users to read data/files from it.

Default Value:
  • true
Source:

allowsUpload :boolean

This describes whether the storage service allows users to write data/files into it.

Default Value:
  • true
Source:

bucket :string

Bucket is the name of the s3 bucket to connect to, or the directory to cd into on the remote server.

Source:

description :string

A description of this storage service. It should be meaningful to the user.

Source:

host :string

The hostname or IP address of the remote server.

Source:

login :string

login is the name to use when logging in to the remote server. For s3 connections, it's the Access Key Id. You can use an environment variable in this field by specifying "env:VAR_NAME". DART will look up the environment variable at runtime, and its value will not be stored with DART's data.

Source:

loginExtra :string

loginExtra is any additional information required by plugins to connect to remote services. What the plugin does with this bit of info is its own business. For example, a plugin that requires the path to a local private key file can ask the user to enter the path to that file here. You can use an environment variable in this field by specifying a value like "env:VAR_NAME". DART will look up the environment variable at runtime, and its value will not be stored with DART's data.

Source:

name :string

name is the name of this storage service. It should be meaningful to the user.

Source:

password :string

password is the password required to connect to the remote server. For S3, it's the secret key (aka AWS Secret Access Key). You can use an environment variable in this field by specifying "env:VAR_NAME". DART will look up the environment variable at runtime, and its value will not be stored with DART's data.

Source:

port :number

The port number to connect to on the remote server. This should be a whole number. You can leave this blank if you're connecting to the service's default port.

Source:

protocol :string

The protocol to use when connecting to the remote service. For example, 's3', 'sftp', etc. There should be a valid plugin capable of communicating via that protocol.

Source:

Methods

(static) inflateFrom(data) → {StorageService}

This converts a generic object into an StorageService object. this is useful when loading objects from JSON.

Parameters:
Name Type Description
data object

An object you want to convert to a StorageService.

Source:

hasPlaintextLogin() → {boolean}

Returns true if this storage service setting contains a plaintext login. When exporting workflows, storage service should use "env:VAR_NAME" to read passwords from the environment.

Source:

hasPlaintextPassword() → {boolean}

Returns true if this storage service setting contains a plaintext password. When exporting workflows, storage service should use "env:VAR_NAME" to read passwords from the environment.

Source:

url() → {string}

Returns the url to which files will be uploaded.

Source:

validate() → {boolean}

validate returns true or false, indicating whether this object contains complete and valid data. If it returns false, check the errors property for specific errors.

Source: