Client
Extends:
The Client class is used to connect to the server and retrieve information about available services and jobs.
Example:
// Obtain Client object from GSF.
const Client = GSF.client({address:'MyServer',port:9191});
Constructor Summary
Public Constructor | ||
public |
constructor(clientOptions: ClientOptions) |
Member Summary
Public Members | ||
public |
The API root endpoint. |
|
public |
The server url. |
|
public |
The server address/name. |
|
public |
The headers to use in requests |
|
public |
The server port. |
|
public |
The protocol to use. |
|
public |
The API root url. |
Private Members | ||
private |
_events: * |
Method Summary
Public Methods | ||
public |
job(jobId: string, progressCallback: function(info: JobProgressInfo), startedCallback: function(info: JobStartedInfo)): Job Retrieves job object based on the job ID. |
|
public |
jobInfoList(jobListOptions: JobListOptions): Promise<JobInfoList, error> Retrieves an array of job info objects. |
|
public |
jobs(jobListOptions: JobListOptions): Promise<Job[], error> Retrieves an array of jobs on the server. |
|
public |
Returns the Service object based on service name. |
|
public |
Retrieves an array of available services from the server. |
Public Constructors
public constructor(clientOptions: ClientOptions) source
Params:
Name | Type | Attribute | Description |
clientOptions | ClientOptions | The object containing server information. |
Public Methods
public job(jobId: string, progressCallback: function(info: JobProgressInfo), startedCallback: function(info: JobStartedInfo)): Job source
Retrieves job object based on the job ID.
Params:
Name | Type | Attribute | Description |
jobId | string | The id of the job from which to retrieve the job object. |
|
progressCallback | function(info: JobProgressInfo) |
|
The callback to handle job progress. |
startedCallback | function(info: JobStartedInfo) |
|
The callback that is called when the job starts. For more reliable job started information, listen to the GSF JobStarted events as this callback may not always get called. In some cases the job can start before the callback is registered. |
public jobInfoList(jobListOptions: JobListOptions): Promise<JobInfoList, error> source
Retrieves an array of job info objects.
Params:
Name | Type | Attribute | Description |
jobListOptions | JobListOptions | Object containing options for filtering job list. |
public jobs(jobListOptions: JobListOptions): Promise<Job[], error> source
Retrieves an array of jobs on the server.
Params:
Name | Type | Attribute | Description |
jobListOptions | JobListOptions | Object containing options for filtering job list. |