add(crm): api spec for workflow jobs

This commit is contained in:
Tit Petric
2018-12-05 16:51:40 +01:00
parent 101c322299
commit 73728bcf61
13 changed files with 1042 additions and 4 deletions
+103 -1
View File
@@ -32,6 +32,108 @@ CRM input field definitions
# Jobs
Workflow Jobs
## List jobs
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/` | HTTP/S | GET | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| status | string | GET | Job status (`ok`, `error`, `running`, `cancelled` or `queued`) | N/A | NO |
| page | int | GET | Page number (0 based) | N/A | NO |
| perPage | int | GET | Returned items per page (default 50) | N/A | NO |
## Create a new job
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/` | HTTP/S | POST | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| workflowID | string | POST | Workflow ID | N/A | YES |
| startAt | string | POST | Start datetime for a delayed job | N/A | NO |
| parameters | types.JobParameterSet | POST | Extra job parameters (map[string]string) | N/A | NO |
## Get job details
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/{jobID}` | HTTP/S | GET | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| jobID | string | PATH | Job ID | N/A | YES |
## Get job logs
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/{jobID}/logs` | HTTP/S | GET | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| jobID | string | PATH | Job ID | N/A | YES |
| page | int | PATH | Page number (0 based) | N/A | NO |
| perPage | int | PATH | Returned items per page (default 50) | N/A | NO |
## Update job details
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/{jobID}` | HTTP/S | POST | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| jobID | string | PATH | Job ID | N/A | YES |
| status | string | POST | Job status (`ok`, `error`, `running`, `cancelled` or `queued`) | N/A | NO |
| log | sqlxTypes.JSONText | POST | Job log item (append-only) | N/A | NO |
| workflowID | string | POST | Workflow ID | N/A | NO |
| startAt | string | POST | Start datetime for a delayed job | N/A | NO |
| parameters | types.JobParameterSet | POST | Extra job parameters (map[string]string) | N/A | NO |
## Cancel job
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/job/{jobID}` | HTTP/S | DELETE | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| jobID | string | PATH | Job ID | N/A | YES |
# Modules
CRM module definitions
@@ -550,7 +652,7 @@ CRM workflow definitions
| onError | types.WorkflowTaskSet | POST | Type ID | N/A | NO |
| timeout | int | POST | Timeout in seconds | N/A | NO |
## Get existing workflow details
## Get workflow details
#### Method