Home Reference Source
import Client from '@fnndsc/chrisapi'
public class | source

Client

API client object.

Static Method Summary

Static Public Methods
public static

createUser(usersUrl: string, username: string, password: string, email: string, timeout: number): Promise<User>

Create a new user account.

public static

getAuthToken(authUrl: string, username: string, password: string, timeout: number): Promise<string>

Fetch a user's login authorization token from the REST API.

public static

runAsyncTask(taskGenerator: function*())

Helper method to run an asynchronous task defined by a task generator function.

Constructor Summary

Public Constructor
public

constructor(url: string, auth: Object)

Constructor

Member Summary

Public Members
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public

Method Summary

Public Methods
public

Create a new group resource through the REST API.

public

adminUploadPlugin(data: Object, pluginFileObj: Object, timeout: number): Promise<PluginAdmin>

Upload a plugin representation file and create a new plugin admin resource through the REST API.

public

computeWorkflowNodesInfo(pipelineDefaultParameters: Object[], includeAllDefaults: boolean): Object[]

Helper method to create the nodes_info field required by createWorkflow method's data argument to create a workflow from a pipeline's default parameters data array tipically returned by Pipeline.getDefaultParameters().data.

public

Create a new file download token resource through the REST API.

public

Create a new file browser folder resource through the REST API.

public

Create a new pipeline resource through the REST API.

public

Create a new plugin instance resource through the REST API.

public

createPluginInstanceSplit(pluginInstanceId: number, filter: string, cr_name: string, timeout: number): Promise<PluginInstanceSplit>

Create a new plugin instance split resource through the REST API.

public

createTag(data: Object, timeout: number): Promise<Tag>

Create a new tag resource through the REST API.

public

createWorkflow(pipelineId: number, data: Object, timeout: number): Promise<Workflow>

Create a new workflow resource through the REST API.

public

Get the ChRIS instance resource object.

public

Get a compute resource object given its id.

public

Get a paginated list of compute resources from the REST API given query search parameters.

public

Get a download token resource object given its id.

public

Get a paginated list of file download tokens for the authenticated user from the REST API given query search parameters.

public

getFeed(id: number, timeout: number): Promise<Feed|null>

Get a feed resource object given its id.

public

getFeeds(searchParams: Object, timeout: number): Promise<FeedList>

Get a paginated list of currently authenticated user's feeds from the REST API given query search parameters. If no search parameters then get the default first page.

public

Get a file browser folder resource object given its id.

public

Get a file browser folder resource object given its path.

public

Get a list with the matching file browser folder (the returned list only has at most one element) from the REST API given query search parameters.

public

getGroup(id: number, timeout: number): Promise<Group|null>

Get a group resource object given its id.

public

getGroups(searchParams: Object, timeout: number): Promise<GroupList>

Get a paginated list of groups from the REST API given query search parameters.

public

Get a PACS file resource object given its id.

public

getPACSFiles(searchParams: Object, timeout: number): Promise<PACSFileList>

Get a paginated list of PACS files from the REST API given query search parameters.

public

Get a PACS series resource object given its id.

public

Get a paginated list of PACS series from the REST API given query search parameters.

public

Get a pipeline resource object given its id.

public

Get a pipeline source file resource object given its id.

public

Get a paginated list of pipeline source files from the REST API given query search parameters.

public

getPipelines(searchParams: Object, timeout: number): Promise<PipelineList>

Get a paginated list of pipelines from the REST API given query search parameters.

public

Get a plugin resource object given its id.

public

Get a plugin instance resource object given its id.

public

Get a paginated list of plugin instances from the REST API given query search parameters.

public

Get a plugin meta resource object given its id.

public

getPluginMetas(searchParams: Object, timeout: number): Promise<PluginMetaList>

Get a paginated list of plugin metas from the REST API given query search parameters.

public

getPlugins(searchParams: Object, timeout: number): Promise<PluginList>

Get a paginated list of plugins from the REST API given query search parameters.

public

getPublicFeeds(searchParams: Object, timeout: number): Promise<PublicFeedList>

Get a paginated list of public feeds from the REST API given query search parameters.

public

getTag(id: number, timeout: number): Promise<Tag|null>

Get a tag resource object given its id.

public

getTags(searchParams: Object, timeout: number): Promise<TagList>

Get a paginated list of tags from the REST API given query search parameters.

public

getUser(timeout: number): Promise<User>

Get a user resource object for the currently authenticated user.

public

Get a user file resource object given its id.

public

getUserFiles(searchParams: Object, timeout: number): Promise<UserFileList>

Get a paginated list of user files from the REST API given query search parameters.

public

Get a workflow resource object given its id.

public

getWorkflows(searchParams: Object, timeout: number): Promise<AllWorkflowList>

Get a paginated list of workflows from the REST API given query search parameters.

public

setUrls(timeout: number): Promise

Set the urls of the high level API resources.

public

uploadFile(data: Object, uploadFileObj: Object, timeout: number): Promise<UserFile>

Upload a file and create a new user file resource through the REST API.

public

Upload a pipeline source file and create a new pipeline source file resource through the REST API.

Private Methods
private

_fetchRes(resUrlProp: string, ResClass: string, searchParams: Object, timeout: number): Promise

Internal method to fetch a high level resource through the REST API.

Static Public Methods

public static createUser(usersUrl: string, username: string, password: string, email: string, timeout: number): Promise<User> source

Create a new user account.

Params:

NameTypeAttributeDescription
usersUrl string

url of the user accounts service

username string

username

password string

password

email string

user email

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<User>

JS Promise, resolves to a User object

public static getAuthToken(authUrl: string, username: string, password: string, timeout: number): Promise<string> source

Fetch a user's login authorization token from the REST API.

Params:

NameTypeAttributeDescription
authUrl string

url of the authorization service

username string

username

password string

password

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<string>

JS Promise, resolves to a string value

public static runAsyncTask(taskGenerator: function*()) source

Helper method to run an asynchronous task defined by a task generator function.

Params:

NameTypeAttributeDescription
taskGenerator function*()

generator function

Public Constructors

public constructor(url: string, auth: Object) source

Constructor

Params:

NameTypeAttributeDescription
url string

url of the ChRIS service

auth Object
  • optional
  • default: null

authentication object

auth.token string
  • optional

authentication token

Public Members

public adminUrl: string source

public auth: Object source

public chrisInstanceUrl: string source

public computeResourcesUrl: string source

public downloadTokensUrl: string source

public feedsUrl: * source

public fileBrowserUrl: string source

public groupsUrl: string source

public pacsFilesUrl: string source

public pacsSeriesUrl: string source

public pipelineSourceFilesUrl: string source

public pipelinesUrl: string source

public pluginInstancesUrl: string source

public pluginMetasUrl: string source

public pluginsUrl: string source

public publicFeedsUrl: string source

public tagsUrl: string source

public url: string source

public userFilesUrl: string source

public userUrl: string source

public workflowsUrl: string source

Public Methods

public adminCreateGroup(data: Object, timeout: number): Promise<Group> source

Create a new group resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request data object

data.name string

group name

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Group>

JS Promise, resolves to a Group object

public adminUploadPlugin(data: Object, pluginFileObj: Object, timeout: number): Promise<PluginAdmin> source

Upload a plugin representation file and create a new plugin admin resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request JSON data object

data.compute_names string

string representing a comma-separated list of names of already registered compute resources

pluginFileObj Object

custom file object

pluginFileObj.fname Object

plugin's file blob

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginAdmin>

JS Promise, resolves to a PluginAdmin object

public computeWorkflowNodesInfo(pipelineDefaultParameters: Object[], includeAllDefaults: boolean): Object[] source

Helper method to create the nodes_info field required by createWorkflow method's data argument to create a workflow from a pipeline's default parameters data array tipically returned by Pipeline.getDefaultParameters().data.

Params:

NameTypeAttributeDescription
pipelineDefaultParameters Object[]

array of objects with the default parameters as returned by Pipeline.getDefaultParameters().data

includeAllDefaults boolean
  • optional
  • default: false

if set to true` then non-null parameters are also included in the result

Return:

Object[]

array of workflow node objects

public createDownloadToken(timeout: number): Promise<DownloadToken> source

Create a new file download token resource through the REST API.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<DownloadToken>

JS Promise, resolves to a DownloadToken object

public createFileBrowserFolder(data: Object, timeout: number): Promise<FileBrowserFolder> source

Create a new file browser folder resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request data object

data.path string

folder path

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FileBrowserFolder>

JS Promise, resolves to a FileBrowserFolder object

public createPipeline(data: Object, timeout: number): Promise<Pipeline> source

Create a new pipeline resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request data object

data.name string

pipeline name

data.authors string
  • optional

pipeline authors

data.category string
  • optional

pipeline category

data.description string
  • optional

pipeline description

data.locked boolean
  • optional
  • default: true

pipeline status

data.plugin_tree string
  • optional

JSON string containing a plugin tree list

data.plugin_inst_id number
  • optional

plugin instance id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Pipeline>

JS Promise, resolves to a Pipeline object

public createPluginInstance(pluginId: number, data: Object, timeout: number): Promise<PluginInstance> source

Create a new plugin instance resource through the REST API.

Params:

NameTypeAttributeDescription
pluginId number

plugin id

data Object

request data object which is plugin-specific

data.previous_id number
  • default: null

id of the previous plugin instance

data.title string
  • optional

title

data.compute_resource_name string
  • optional

remote compute resource name

data.cpu_limit string
  • optional

cpu limit

data.memory_limit string
  • optional

memory limit

data.number_of_workers string
  • optional

number of workers

data.gpu_limit string
  • optional

gpu limit

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginInstance>

JS Promise, resolves to a PluginInstance object

public createPluginInstanceSplit(pluginInstanceId: number, filter: string, cr_name: string, timeout: number): Promise<PluginInstanceSplit> source

Create a new plugin instance split resource through the REST API.

Params:

NameTypeAttributeDescription
pluginInstanceId number

plugin instance id

filter string
  • optional
  • default: ''

comma-separated list of regular expressions

cr_name string
  • optional
  • default: ''

remote compute resource name

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginInstanceSplit>

JS Promise, resolves to a PluginInstanceSplit object

public createTag(data: Object, timeout: number): Promise<Tag> source

Create a new tag resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request data object

data.color string

tag color

data.name string
  • optional
  • default: ''

tag name

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Tag>

JS Promise, resolves to a Tag object

public createWorkflow(pipelineId: number, data: Object, timeout: number): Promise<Workflow> source

Create a new workflow resource through the REST API.

Params:

NameTypeAttributeDescription
pipelineId number

pipeline id

data Object

request data object

data.previous_plugin_inst_id number

previous plugin instance id

data.nodes_info string

pipeline-specific JSON string encoding a list of objects. Each object is a workflow node containing a piping_id, compute_resource_name, title and a list of objects called plugin_parameter_defaults. Each object in this list has name and default properties.

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Workflow>

JS Promise, resolves to a Workflow object

public getChrisInstance(timeout: number): Promise<ChrisInstance> source

Get the ChRIS instance resource object.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<ChrisInstance>

JS Promise, resolves to a ChrisInstance object

public getComputeResource(id: number, timeout: number): Promise<ComputeResource|null> source

Get a compute resource object given its id.

Params:

NameTypeAttributeDescription
id number

compute resource id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<ComputeResource|null>

JS Promise, resolves to a ComputeResource object or null

public getComputeResources(searchParams: Object, timeout: number): Promise<ComputeResourceList> source

Get a paginated list of compute resources from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file id exactly with this number

searchParams.name string
  • optional

match compute resource's name containing this string

searchParams.name_exact string
  • optional

match compute resource's name exactly with this string

searchParams.description string
  • optional

match compute resource's description containing this string

searchParams.plugin_id string
  • optional

match plugin id exactly with this string for all the compute resources associated with the plugin

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<ComputeResourceList>

JS Promise, resolves to a ComputeResourceList object

public getDownloadToken(id: number, timeout: number): Promise<DownloadToken|null> source

Get a download token resource object given its id.

Params:

NameTypeAttributeDescription
id number

file download token id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<DownloadToken|null>

JS Promise, resolves to a DownloadToken object or null

public getDownloadTokens(searchParams: Object, timeout: number): Promise<DownloadTokenList> source

Get a paginated list of file download tokens for the authenticated user from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file download token id exactly with this number

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<DownloadTokenList>

JS Promise, resolves to a DownloadTokenList object

public getFeed(id: number, timeout: number): Promise<Feed|null> source

Get a feed resource object given its id.

Params:

NameTypeAttributeDescription
id number

feed id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Feed|null>

JS Promise, resolves to a Feed object or null

public getFeeds(searchParams: Object, timeout: number): Promise<FeedList> source

Get a paginated list of currently authenticated user's feeds from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match feed id exactly with this number

searchParams.min_id number
  • optional

match feed id gte this number

searchParams.max_id number
  • optional

match feed id lte this number

searchParams.name string
  • optional

match feed name containing this string

searchParams.name_exact string
  • optional

match feed name exactly with this string

searchParams.name_startswith string
  • optional

match feed name starting with this string

searchParams.files_fname_icontains string
  • optional

match the feeds that have files containing all the substrings from the queried string (which in turn represents a white-space-separated list of query strings) case insensitive anywhere in their fname.

searchParams.min_creation_date number
  • optional

match feed creation date gte this date

searchParams.max_creation_date number
  • optional

match feed creation date lte this date

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FeedList>

JS Promise, resolves to a FeedList object

public getFileBrowserFolder(id: number, timeout: number): Promise<FileBrowserFolder|null> source

Get a file browser folder resource object given its id.

Params:

NameTypeAttributeDescription
id number

file browser folder id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FileBrowserFolder|null>

JS Promise, resolves to a FileBrowserFolder object or null

public getFileBrowserFolderByPath(path: string, timeout: number): Promise<FileBrowserFolder|null> source

Get a file browser folder resource object given its path.

Params:

NameTypeAttributeDescription
path string
  • optional
  • default: ''

file browser folder path

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FileBrowserFolder|null>

JS Promise, resolves to a FileBrowserFolder object or null

public getFileBrowserFolders(searchParams: Object, timeout: number): Promise<FileBrowserFolderList> source

Get a list with the matching file browser folder (the returned list only has at most one element) from the REST API given query search parameters. If no search parameters then get a list with the default root folder.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match folder id exactly with this number

searchParams.path string
  • optional

match folder's path exactly with this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FileBrowserFolderList>

JS Promise, resolves to a FileBrowserFolderList object

public getGroup(id: number, timeout: number): Promise<Group|null> source

Get a group resource object given its id.

Params:

NameTypeAttributeDescription
id number

group id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Group|null>

JS Promise, resolves to a Group object or null

public getGroups(searchParams: Object, timeout: number): Promise<GroupList> source

Get a paginated list of groups from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match group id exactly with this number

searchParams.name string
  • optional

match group name exactly with this string

searchParams.name_icontains string
  • optional

match group name containing this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<GroupList>

JS Promise, resolves to a GroupList object

public getPACSFile(id: number, timeout: number): Promise<PACSFile|null> source

Get a PACS file resource object given its id.

Params:

NameTypeAttributeDescription
id number

PACS file id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PACSFile|null>

JS Promise, resolves to a PACSFile object or null`

public getPACSFiles(searchParams: Object, timeout: number): Promise<PACSFileList> source

Get a paginated list of PACS files from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file id exactly with this number

searchParams.fname string
  • optional

match file's path starting with this string

searchParams.fname_exact string
  • optional

match file's path exactly with this string

searchParams.fname_icontains string
  • optional

match file's path containing this string

searchParams.fname_icontains_topdir_unique string
  • optional

match file's path containing all the substrings from the queried string (which in turn represents a white-space-separated list of query strings) case insensitive anywhere in their fname. But only one file is returned per toplevel directory under SERVICES/PACS/pacs_name. This is useful to efficiently determine the top level directories containing a file that matches the query.

searchParams.min_creation_date string
  • optional

match file's creation_date greater than this date string

searchParams.max_creation_date string
  • optional

match file's creation_date lesser than this date string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PACSFileList>

JS Promise, resolves to a PACSFileList object

public getPACSSeries(id: number, timeout: number): Promise<PACSSeries|null> source

Get a PACS series resource object given its id.

Params:

NameTypeAttributeDescription
id number

PACS series id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PACSSeries|null>

JS Promise, resolves to a PACSSeries object or null

public getPACSSeriesList(searchParams: Object, timeout: number): Promise<PACSSeriesList> source

Get a paginated list of PACS series from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file id exactly with this number

searchParams.PatientID string
  • optional

match file's PatientID exactly with this string

searchParams.PatientName string
  • optional

match file's PatientName containing this string

searchParams.PatientSex string
  • optional

match file's PatientSex exactly with this string

searchParams.PatientAge number
  • optional

match file's PatientAge exactly with this number

searchParams.min_PatientAge number
  • optional

match file's PatientAge greater than this number

searchParams.max_PatientAge number
  • optional

match file's PatientAge lesser than this number

searchParams.PatientBirthDate string
  • optional

match file's PatientBirthDate exactly with this date string

searchParams.StudyDate string
  • optional

match file's StudyDate exactly with this date string

searchParams.AccessionNumber string
  • optional

match file's AccessionNumber exactly with this string

searchParams.ProtocolName string
  • optional

match file's ProtocolName exactly with this string

searchParams.StudyInstanceUID string
  • optional

match file's StudyInstanceUID exactly with this string

searchParams.StudyDescription string
  • optional

match file's StudyDescription containing this string

searchParams.SeriesInstanceUID string
  • optional

match file's SeriesInstanceUID exactly with this string

searchParams.SeriesDescription string
  • optional

match file's SeriesDescription containing this string

searchParams.min_creation_date string
  • optional

match file's creation_date greater than this date string

searchParams.max_creation_date string
  • optional

match file's creation_date lesser than this date string

searchParams.pacs_identifier string
  • optional

match file's PACS exactly with this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PACSSeriesList>

JS Promise, resolves to a PACSSeriesList object

public getPipeline(id: number, timeout: number): Promise<Pipeline|null> source

Get a pipeline resource object given its id.

Params:

NameTypeAttributeDescription
id number

pipeline id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Pipeline|null>

JS Promise, resolves to a Pipeline object or null

public getPipelineSourceFile(id: number, timeout: number): Promise<PipelineSourceFile|null> source

Get a pipeline source file resource object given its id.

Params:

NameTypeAttributeDescription
id number

pipeline source file id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PipelineSourceFile|null>

JS Promise, resolves to a PipelineSourceFile object or null`

public getPipelineSourceFiles(searchParams: Object, timeout: number): Promise<PipelineSourceFileList> source

Get a paginated list of pipeline source files from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file id exactly with this number

searchParams.fname string
  • optional

match file's path starting with this string

searchParams.fname_exact string
  • optional

match file's path exactly with this string

searchParams.fname_icontains string
  • optional

match file's path containing this string

searchParams.uploader_username string
  • optional

match file's uploader username exactly with this string

searchParams.min_creation_date string
  • optional

match file's creation_date greater than this date string

searchParams.max_creation_date string
  • optional

match file's creation_date lesser than this date string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PipelineSourceFileList>

JS Promise, resolves to a PipelineSourceFileList object

public getPipelines(searchParams: Object, timeout: number): Promise<PipelineList> source

Get a paginated list of pipelines from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match plugin id exactly with this number

searchParams.name string
  • optional

match plugin name containing this string

searchParams.owner_username string
  • optional

match pipeline's owner username exactly with this string

searchParams.category string
  • optional

match plugin category containing this string

searchParams.description string
  • optional

match plugin description containing this string

searchParams.authors string
  • optional

match plugin authors containing this string

searchParams.min_creation_date string
  • optional

match plugin creation date gte this date

searchParams.max_creation_date string
  • optional

match plugin creation date lte this date

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PipelineList>

JS Promise, resolves to a PipelineList object

public getPlugin(id: number, timeout: number): Promise<Plugin|null> source

Get a plugin resource object given its id.

Params:

NameTypeAttributeDescription
id number

plugin id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Plugin|null>

JS Promise, resolves to a Plugin object or null

public getPluginInstance(id: number, timeout: number): Promise<PluginInstance|null> source

Get a plugin instance resource object given its id.

Params:

NameTypeAttributeDescription
id number

plugin instance id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginInstance|null>

JS Promise, resolves to a PluginInstance object or null

public getPluginInstances(searchParams: Object, timeout: number): Promise<AllPluginInstanceList> source

Get a paginated list of plugin instances from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match plugin instance id exactly with this number

searchParams.root_id number
  • optional

match root plugin instance's id exactly with this number

searchParams.previous_id number
  • optional

match previous plugin instance's id exactly with this number

searchParams.title string
  • optional

match plugin instance title containing this string

searchParams.status string
  • optional

match plugin instance execution status exactly with this string

searchParams.owner_username string
  • optional

match plugin instances's owner username exactly with this string

searchParams.feed_id number
  • optional

match associated feed's id exactly with this number

searchParams.workflow_id number
  • optional

match associated workflows's id exactly with this number

searchParams.plugin_id number
  • optional

match associated plugin's id exactly with this number

searchParams.plugin_name number
  • optional

match associated plugin's name containing this string

searchParams.plugin_name_exact number
  • optional

match associated plugin's name exact with this string

searchParams.plugin_version number
  • optional

match associated plugin's verion exactly with this string

searchParams.min_start_date string
  • optional

match plugin instance's start date gte this date

searchParams.max_start_date string
  • optional

match plugin instance's start date lte this date

searchParams.min_end_date string
  • optional

match plugin instance's end date gte this date

searchParams.max_end_date string
  • optional

match plugin instance's end date lte this date

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<AllPluginInstanceList>

JS Promise, resolves to AllPluginInstanceList object

public getPluginMeta(id: number, timeout: number): Promise<PluginMeta|null> source

Get a plugin meta resource object given its id.

Params:

NameTypeAttributeDescription
id number

plugin meta id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginMeta|null>

JS Promise, resolves to a PluginMeta object or null

public getPluginMetas(searchParams: Object, timeout: number): Promise<PluginMetaList> source

Get a paginated list of plugin metas from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match plugin meta id exactly with this number

searchParams.name string
  • optional

match plugin meta name containing this string

searchParams.name_exact string
  • optional

match plugin meta name exactly with this string

searchParams.title string
  • optional

match plugin meta title containing this string

searchParams.category string
  • optional

match plugin meta category exactly with this string

searchParams.type string
  • optional

match plugin meta type exactly with this string

searchParams.authors string
  • optional

match plugin meta authors containing this string

searchParams.min_creation_date number
  • optional

match plugin meta creation date gte this date

searchParams.max_creation_date number
  • optional

match plugin meta creation date lte this date

searchParams.name_title_category string
  • optional

match plugin meta name, title or category containing this string

searchParams.name_authors_category string
  • optional

match plugin meta name, authors or category containing this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginMetaList>

JS Promise, resolves to a PluginMetaList object

public getPlugins(searchParams: Object, timeout: number): Promise<PluginList> source

Get a paginated list of plugins from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match plugin id exactly with this number

searchParams.name string
  • optional

match plugin name containing this string

searchParams.name_exact string
  • optional

match plugin name exactly with this string

searchParams.version string
  • optional

match plugin version exactly with this string

searchParams.dock_image string
  • optional

match plugin docker image exactly with this string

searchParams.type string
  • optional

match plugin type exactly with this string

searchParams.category string
  • optional

match plugin category containing this string

searchParams.title string
  • optional

match plugin title containing this string

searchParams.description string
  • optional

match plugin description containing this string

searchParams.min_creation_date string
  • optional

match plugin creation date gte this date

searchParams.max_creation_date string
  • optional

match plugin creation date lte this date

searchParams.name_title_category string
  • optional

match plugin name, title or category containing this string

searchParams.compute_resource_id number
  • optional

match plugin's compute resource id exactly with this number

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PluginList>

JS Promise, resolves to a PluginList object

public getPublicFeeds(searchParams: Object, timeout: number): Promise<PublicFeedList> source

Get a paginated list of public feeds from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match feed id exactly with this number

searchParams.min_id number
  • optional

match feed id gte this number

searchParams.max_id number
  • optional

match feed id lte this number

searchParams.name string
  • optional

match feed name containing this string

searchParams.name_exact string
  • optional

match feed name exactly with this string

searchParams.name_startswith string
  • optional

match feed name starting with this string

searchParams.files_fname_icontains string
  • optional

match the feeds that have files containing all the substrings from the queried string (which in turn represents a white-space-separated list of query strings) case insensitive anywhere in their fname.

searchParams.min_creation_date number
  • optional

match feed creation date gte this date

searchParams.max_creation_date number
  • optional

match feed creation date lte this date

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PublicFeedList>

JS Promise, resolves to a PublicFeedList object

public getTag(id: number, timeout: number): Promise<Tag|null> source

Get a tag resource object given its id.

Params:

NameTypeAttributeDescription
id number

tag id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Tag|null>

JS Promise, resolves to a Tag object or null

public getTags(searchParams: Object, timeout: number): Promise<TagList> source

Get a paginated list of tags from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match tag id exactly with this number

searchParams.name string
  • optional

match tag name containing this string

searchParams.owner_username string
  • optional

match tag's owner username exactly with this string

searchParams.color string
  • optional

match plugin color containing this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<TagList>

JS Promise, resolves to a TagList object

public getUser(timeout: number): Promise<User> source

Get a user resource object for the currently authenticated user.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<User>

JS Promise, resolves to a User object

public getUserFile(id: number, timeout: number): Promise<UserFile|null> source

Get a user file resource object given its id.

Params:

NameTypeAttributeDescription
id number

user file id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<UserFile|null>

JS Promise, resolves to a UserFile object or null

public getUserFiles(searchParams: Object, timeout: number): Promise<UserFileList> source

Get a paginated list of user files from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match file id exactly with this number

searchParams.fname string
  • optional

match file's path starting with this string

searchParams.fname_exact string
  • optional

match file's path exactly with this string

searchParams.fname_icontains string
  • optional

match file's path containing this string

searchParams.fname_nslashes string | number
  • optional

match file's path containing this number of slashes

searchParams.owner_username string
  • optional

match file's owner username exactly with this string

searchParams.min_creation_date string
  • optional

match file's creation_date greater than this date string

searchParams.max_creation_date string
  • optional

match file's creation_date lesser than this date string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<UserFileList>

JS Promise, resolves to a UserFileList object

public getWorkflow(id: number, timeout: number): Promise<Workflow> | null source

Get a workflow resource object given its id.

Params:

NameTypeAttributeDescription
id number

workflow id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Workflow> | null

JS Promise, resolves to a Workflow object or null

public getWorkflows(searchParams: Object, timeout: number): Promise<AllWorkflowList> source

Get a paginated list of workflows from the REST API given query search parameters. If no search parameters then get the default first page.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match workflow id exactly with this number

searchParams.title string
  • optional

match workflow title containing this string

searchParams.owner_username string
  • optional

match workflow's owner username exactly with this string

searchParams.pipeline_name string
  • optional

match associated pipeline name containing this string

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<AllWorkflowList>

JS Promise, resolves to AllWorkflowList object

public setUrls(timeout: number): Promise source

Set the urls of the high level API resources.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise

JS Promise

public uploadFile(data: Object, uploadFileObj: Object, timeout: number): Promise<UserFile> source

Upload a file and create a new user file resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request data object

data.upload_path string

absolute path including file name where the file will be uploaded on the storage service

uploadFileObj Object

custom file object

uploadFileObj.fname Object

file blob

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<UserFile>

JS Promise, resolves to a UserFile object

public uploadPipelineSourceFile(data: Object, uploadFileObj: Object, timeout: number): Promise<PipelineSourceFile> source

Upload a pipeline source file and create a new pipeline source file resource through the REST API. In addition, this creates a new pipeline resource based on the source of the uploaded file.

Params:

NameTypeAttributeDescription
data Object

request data object

data.type string

pipeline source file type

uploadFileObj Object

custom file object

uploadFileObj.fname Object

file blob

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<PipelineSourceFile>

JS Promise, resolves to a PipelineSourceFile object

Private Methods

private _fetchRes(resUrlProp: string, ResClass: string, searchParams: Object, timeout: number): Promise source

Internal method to fetch a high level resource through the REST API.

Params:

NameTypeAttributeDescription
resUrlProp string

property of the this object containing the url of the resource

ResClass string

resource class

searchParams Object
  • optional
  • default: null

search parameters object

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise

JS Promise