Generic Resource
PEPPERI NOTIFICATION SERVICE
Actions Queue
CPI Node
TODO training

Execute Job Using Published Code

post
Execute a single Code Job - Asynchronous

https://api.pepperi.com/v1.0/code_jobs/async/{Code Job UUID}/execute
Request
Response
Request
Path Parameters
Code Job UUID
required
string
Response
200: OK
{
"ExecutionUUID": "881951ad-c2bd-4df1-8c88-80c5dabc0a37",
"URI": "/audit_log/881951ad-c2bd-4df1-8c88-80c5dabc0a37"
}

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:

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

post
Execute a single Code Job - Synchronous

https://api.pepperi.com/v1.0/code_jobs/{Code Job UUID}/execute
Request
Response
Request
Path Parameters
Code Job UUID
required
string
Response
200: OK

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