API

API

Main class for managing a session with the Voxel51 Vision Services API.

Constructor

new API()

Creates a new API instance.

Source:

Methods

(async) listAlgorithms() → {Array}

Returns a list of all available algorithms.

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) getAlgorithmDoc(algoId) → {object}

Gets documentation about the algorithm with the given ID.

Parameters:
Name Type Description
algoId string

the algorithm ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) listData() → {Array}

Returns a list of all user data uploaded to cloud storage.

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) uploadData(path) → {object}

Uploads data to cloud storage.

Parameters:
Name Type Description
path string

the path to the data file

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) getDataDetails(dataId) → {object}

Gets details about the data with the given ID.

Parameters:
Name Type Description
dataId string

the data ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) downloadData(dataId, outputPathopt)

Downloads the data with the given ID.

Parameters:
Name Type Attributes Description
dataId string

the data ID

outputPath string <optional>

the output path to write to

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) deleteData(dataId)

Deletes the data with the given ID from the cloud.

Parameters:
Name Type Description
dataId string

the data ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) listDatasets() → {array}

Returns a list of all datasets in cloud storage.

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) createDataset(datasetName) → {object}

Creates a new dataset in the cloud with the given name.

Parameters:
Name Type Description
datasetName string

a name for the dataset

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) addDataToDataset(dataId, datasetId) → {Response}

Adds the data with the given ID to the dataset with the given ID.

Parameters:
Name Type Description
dataId string

the ID of the data to add to the dataset

datasetId string

the dataset ID

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) removeDataFromDataset(dataId, datasetId, deleteFilesopt)

Removes the data with the given ID from the dataset with the given ID.

Parameters:
Name Type Attributes Default Description
dataId string

the ID of the data to remove from the dataset

datasetId string

the dataset ID

deleteFiles boolean <optional>
false

whether to delete the underlying data file from cloud storage

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) getDatasetDetails(datasetId) → {object}

Gets details about the dataset with the given ID.

Parameters:
Name Type Description
datasetId string

the dataset ID

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) downloadDataset(datasetId)

Downloads the dataset with the given ID.

Parameters:
Name Type Description
datasetId string

the dataset ID

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) deleteDataset(datasetId, deleteFilesopt)

Deletes the dataset with the given ID.

Parameters:
Name Type Attributes Default Description
datasetId string

the dataset ID

deleteFiles boolean <optional>
false

whether to delete the underlying data files from cloud storage

Source:
To Do:
  • implement this method
Throws:

if the request was unsuccessful

Type
Error

(async) listJobs() → {Array}

Returns a list of all jobs in the cloud.

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) uploadJobRequest(jobJSONPath, jobName, autoStartopt) → {object}

Uploads a job request to the cloud.

Parameters:
Name Type Attributes Default Description
jobJSONPath string

the path to a job JSON request file

jobName string

a name for the job

autoStart boolean <optional>
false

whether to automatically start the job upon creation

Source:
To Do:
  • allow jobJSONPath to accept a job JSON object directly
Throws:

if the request was unsuccessful

Type
Error

(async) getJobDetails(jobId) → {object}

Gets details about the job with the given ID.

Parameters:
Name Type Description
jobId string

the job ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) getJobRequest(jobId) → {object}

Gets the job request for the job with the given ID.

Parameters:
Name Type Description
jobId string

the job ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) startJob(jobId)

Starts the job with the given ID.

Parameters:
Name Type Description
jobId string

the job ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) getJobStatus(jobId) → {object}

Gets the status of the job with the given ID.

Parameters:
Name Type Description
jobId string

the job ID

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) downloadJobOutput(jobId, outputPathopt)

Downloads the output of the job with the given ID.

Parameters:
Name Type Attributes Default Description
jobId string

the job ID

outputPath string <optional>
'output.zip'

the output path to write to

Source:
Throws:

if the request was unsuccessful

Type
Error

(async) getTypesDoc() → {object}

Gets documentation about the types supported by the system.

Source:
Throws:

if the request was unsuccessful

Type
Error