modzyClient.getJob
Retrieve the job information
modzyClient.getJob(jobId)
Return the Job details, including the status
, total
, completed
, and failed
number of items.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
jobId | string | Job identifier | '14856eb1-0ad8-49e7-9da3-887acb80fea5' |
Returns
A Job
object with the status from the server
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Job",
"definitions": {
"Job": {
"type": "object",
"additionalProperties": false,
"properties": {
"model": {
"$ref": "#/definitions/Model"
},
"status": {
"type": "string"
},
"totalInputs": {
"type": "integer"
},
"jobIdentifier": {
"type": "string",
"format": "uuid"
},
"accessKey": {
"type": "string"
},
"explain": {
"type": "boolean"
},
"jobType": {
"type": "string"
},
"accountIdentifier": {
"type": "string"
},
"team": {
"$ref": "#/definitions/Team"
},
"user": {
"$ref": "#/definitions/User"
},
"jobInputs": {
"$ref": "#/definitions/JobInputs"
},
"submittedAt": {
"type": "string",
"format": "date-time"
},
"imageClassificationModel": {
"type": "boolean"
}
},
"required": [
"accessKey",
"accountIdentifier",
"explain",
"imageClassificationModel",
"jobIdentifier",
"jobInputs",
"jobType",
"model",
"status",
"submittedAt",
"team",
"totalInputs",
"user"
]
},
"JobInputs": {
"type": "object",
"additionalProperties": false,
"properties": {
"identifier": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"identifier"
]
},
"Model": {
"type": "object",
"additionalProperties": false,
"properties": {
"identifier": {
"type": "string"
},
"version": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"identifier",
"name",
"version"
]
},
"Team": {
"type": "object",
"additionalProperties": false,
"properties": {
"identifier": {
"type": "string"
}
},
"required": [
"identifier"
]
},
"User": {
"type": "object",
"additionalProperties": false,
"properties": {
"identifier": {
"type": "string",
"format": "uuid"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
}
},
"required": [
"email",
"firstName",
"identifier",
"lastName"
]
}
}
}
Examples
job = await modzyClient.getJob('14856eb1-0ad8-49e7-9da3-887acb80fea5');
console.log( `Job ${job.identifier} status ${job.status}` );
Using promises
modzyClient.getJob('14856eb1-0ad8-49e7-9da3-887acb80fea5')
.then(
(job)=>{
console.log( `Job ${job.identifier} status ${job.status}` );
}
)
.catch(
(error)=>{
console.error(error);
}
);
Updated about 2 years ago