Generic Resource
PEPPERI NOTIFICATION SERVICE
Actions Queue
CPI Node
TODO training
Powered By GitBook
Execute Job Using Published Code
post
https://api.pepperi.com/v1.0
/code_jobs/async/{Code Job UUID}/execute
Execute a single Code Job - Asynchronous
Throwing Error (e.g : throw new Error('error occurred'); will cause Async job to end , and go into Retry Status , based on the NumberOfTries defined for the code job, while the interval is currently defined 5 Minutes between each of Retry operation.

The Async Job Can be in the following optional statuses :

    0 - Failure
    1 - Success
    2 - In Progress (updates upon Code Job Execution Start)
    3 - Skipped
    4 - In Retry (Updates Upon Code Exit caused by Exception/Error )

Example of full Audit Info Object including the Status field for Async Job Execution:

1
{
2
"UUID" : "",
3
"CreationDateTime" : "", //of the audit log ! not the data object
4
"ModificationDateTime" : "",
5
"AuditType" : "action",
6
"Event" : { "Type": "code_job_execution" ,"User" : {"InternalID" :12, "Name" :"", "Email" : ""}}, // future : Type :"User" and UserAction : "Submit"
7
"SourceAuditLog" : {"UUID" : "", "AuditType": "action", "EventType" : "sync" }, //e.g: Event such as Sync or Code Job
8
"Status" : { "ID": 1, "Name": "Success" },
9
"CodeJob" : { "UUID" : "7daf16c1-c4b3-4096-b06a-6e03051f750f", "Name": "CodeJobName", "Description": "CodeJobDescription" } ,
10
"StartDateTime" : "2019-07-07T12:58:13Z",
11
"EndDateTime" : "2019-07-07T12:58:13Z",
12
"ExecutionMemoryLevel" : 2,
13
"ResultObject" : {}, Should include Success , 3 Error, and SummaryMessage
14
"IsPublished" : false, // if its "draft test run"
15
"IsScheduled" : false, // is the log created from scheduler or manual
16
"CodeRevisionURL" : "CodeJobFiles/8513b815-4487-4f16-97ef-2062d8dbde34/Draft/7daf16c1-c4b3-4096-b06a-6e03051f750f"
17
}
18
}
Copied!
post
https://api.pepperi.com/v1.0
/code_jobs/{Code Job UUID}/execute
Execute a single Code Job - Synchronous

Error Codes :

Scenario
Error Code
Fault String
HTTP Status Code
Execute with no Published Code
InvalidParameterCJ008
Invalid field value. Field:ExecutedCode: Value cannot be null or empty.
400
Execute with no Addon Path for AddonJob type
InvalidParameterCJ008
Invalid field value. Field:AddonPath: Value cannot be null or empty.
400
Cannot find Code Job
InvalidParameterCJ004
{ jobUUID } does not exist.
404
Last modified 1yr ago