- Job ⇐
EventEmitter
Job class
- RemoteConnector ⇐
Connector
Remote connector class for connecting Vulpes APIs to clients
- GetLatestJobTreeOptions :
Object
- ServerStatus :
Object
- VulpesJob :
Object
A remote job payload (may not be complete)
- VulpesClient
- .Worker ⇐
EventEmitter
- .Worker ⇐
Client worker
Kind: static class of VulpesClient
Extends: EventEmitter
Constructor for the worker
Param | Type | Description |
---|---|---|
connector | Connector |
A connector instance |
Job class
Kind: global class
Extends: EventEmitter
- Job ⇐
EventEmitter
- new Job(jobData)
- instance
- .data :
Object
- .id :
String
- .jobData :
Object
- .status :
String
- .type :
String
- .getTimeLeft() ⇒
Promise.<(Number|Infinity)>
- .stop(resultType, [resultData]) ⇒
Promise
- .updateProgress(current, max) ⇒
Promise
- .data :
- static
- .ResultType :
Object
- .ResultType :
Constructor for the Job class
Param | Type | Description |
---|---|---|
jobData | Object |
The job data, containing the entire job payload |
The job's data
Kind: instance property of Job
Read only: true
The job ID
Kind: instance property of Job
Read only: true
The full job payload reference
Kind: instance property of Job
Read only: true
The current job status
Kind: instance property of Job
Read only: true
The job type
Kind: instance property of Job
Read only: true
Get the time left to complete the job
Kind: instance method of Job
Returns: Promise.<(Number|Infinity)>
- Returns the time left in milliseconds or Infinity if
no limit is imposed
Stop the job, setting a result
Kind: instance method of Job
Param | Type | Description |
---|---|---|
resultType | String |
The type of result |
[resultData] | Object |
Optional result payload |
Update the job's progress
Kind: instance method of Job
Param | Type | Description |
---|---|---|
current | Number |
The current progress value (must be 0 or greater and less than or equal to max) |
max | Number |
The max progress value (must be greater than or equal to current) |
Job result type
Kind: static property of Job
Remote connector class for connecting Vulpes APIs to clients
Kind: global class
Extends: Connector
- RemoteConnector ⇐
Connector
- new RemoteConnector(apiURL)
- .apiURL :
String
- .getJob(jobID) ⇒
Promise.<VulpesJob>
- .getJobTree(jobID) ⇒
Promise.<Array.<VulpesJob>>
- .getServiceTime() ⇒
Promise.<Number>
- .queryJobs(query, [options]) ⇒
Promise.<Array.<VulpesJob>>
- .registerWorker(workerID) ⇒
Promise
- .resetJob(jobID) ⇒
Promise
- .startJob() ⇒
Promise.<VulpesJob>
- .stopJob(jobID, resultType, [resultData])
- .updateProgress(jobID, currentValue, maxValue)
- ._getStatus() ⇒
Promise.<ServerStatus>
- .getLatestJobTree(dataQuery, [options]) ⇒
Promise.<Array.<VulpesJob>>
Constructor for a RemoteConnector
Param | Type | Description |
---|---|---|
apiURL | String |
The URL root to the Vulpes API (eg: "http://localhost/api/v1") |
The API URL base
Kind: instance property of RemoteConnector
Read only: true
remoteConnector.getJob(jobID) ⇒ Promise.<VulpesJob>
Get a job for an ID
Kind: instance method of RemoteConnector
Returns: Promise.<VulpesJob>
- The job matching the ID
Param | Type | Description |
---|---|---|
jobID | String |
The ID of the job |
Get a job tree by a member's ID
Kind: instance method of RemoteConnector
Returns: Promise.<Array.<VulpesJob>>
- A promise that resolves with an array
of vulpes jobs
Param | Type | Description |
---|---|---|
jobID | String |
The job ID to fetch the tree for |
Get the time at the point where the Service is running
Kind: instance method of RemoteConnector
Returns: Promise.<Number>
- A promise that resolves with the timestamp of the server
Query the remote service for jobs
Kind: instance method of RemoteConnector
Returns: Promise.<Array.<VulpesJob>>
- A promise that resolves with an array
of jobs
Param | Type | Description |
---|---|---|
query | Object |
The jobs query (refer to Vulpes documentation) |
[options] | Object |
Query options |
Register the worker on the remote service
Kind: instance method of RemoteConnector
Returns: Promise
- A promise that resolves once registration
is complete
Param | Type | Description |
---|---|---|
workerID | String |
The worker's ID (UUID) |
Reset a job with an ID
Kind: instance method of RemoteConnector
Returns: Promise
- A promise that resolves once the reset has been
completed
Param | Type | Description |
---|---|---|
jobID | String |
The job ID |
remoteConnector.startJob() ⇒ Promise.<VulpesJob>
Start a job - fetches a job from the server
Kind: instance method of RemoteConnector
Returns: Promise.<VulpesJob>
- A promise that resolves with a
job to undertake
Stop/Complete a job
Kind: instance method of RemoteConnector
Param | Type | Description |
---|---|---|
jobID | String |
The job ID |
resultType | String |
The result type: ResultType |
[resultData] | Object |
The result data |
Update job progress
Kind: instance method of RemoteConnector
Param | Type | Description |
---|---|---|
jobID | String |
The ID of the job to update progress for |
currentValue | Number |
The current progress value |
maxValue | Number |
The maximum progress value |
remoteConnector._getStatus() ⇒ Promise.<ServerStatus>
Fetch the current system status
Kind: instance method of RemoteConnector
Returns: Promise.<ServerStatus>
- A promise that resolves with the server state
Get the latest job tree for some criteria
Kind: instance method of RemoteConnector
Returns: Promise.<Array.<VulpesJob>>
- A promise that resolves with an array
of vulpes jobs
Param | Type | Description |
---|---|---|
dataQuery | Object |
Query item for quering job data (from 'data' onwards) |
[options] | GetLatestJobTreeOptions |
Fetch options |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[useResult] | Boolean |
Whether to use result data or initialisation data. Default is false (initialisation data). |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
status | String |
The status of the server (ok/offline/init) |
api | String |
The server version |
started | Number |
UTC timestamp of when the server was started |
A remote job payload (may not be complete)
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
id | String |
The job ID |
type | String |
The job type |
status | String |
The job status (pending etc.): Status |
priority | String |
The priority of the job: Priority |
created | Number |
The creation timestamp (UTC) |
parents | Array.<String> |
Array of parent IDs |
data | Object |
The job data (initialisation) |
result | Object |
The results of the job's previous execution |
result.type | String |
The type of result: ResultType |
result.data | Object |
The result data |