-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Scheduled jobs management
bugzmanov edited this page Mar 20, 2013
·
9 revisions
Path:/rest/jobs-stat
Type: GET
Example results:
{"links":[],
"items": [
{
"projectId":1,
"scheduledJobs":2,
"failedJobs":1,
"links":
[{"href":"http://localhost:8080/rest/projects/1/jobs",
"rel":"self",
"type":"application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods":["get"]}]
}
]
}
Path:/rest/projects/(projectId)/jobs
Type: GET
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
Example results:
{
"failed": [{
"item": {
"id": "1",
"projectId": 1,
"envId": 1,
"date": 1363763640000,
"workflow": "another",
"variables": {
"count": "1"
},
"scheduledBy": "Scheduler / genesis",
"failureDescription": "Workflow execution failed",
"workflowId": 2
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/failedJobs/1",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["delete"]
}
]
}
],
"requested": [{
"item": {
"id": "execution-destroy-env-1",
"projectId": 1,
"envId": 1,
"date": 1364368327497,
"workflow": "destroy",
"variables": {},
"scheduledBy": "genesis"
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/jobs/execution-destroy-env-1",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["put", "delete"]
}
]
}, {
"item": {
"id": "execution-destroy-env-2",
"projectId": 1,
"envId": 2,
"date": 1364373126772,
"workflow": "destroy",
"variables": {},
"scheduledBy": "genesis"
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/2/jobs/execution-destroy-env-2",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["put", "delete"]
}
]
}
]
}Path:/rest/projects/(projectId)/envs/(envId)/jobs
Type: GET
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
| envId | Number | id of the environment |
Example results:
{
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/2/jobs",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["get", "post"]
}
],
"items": [{
"id": "execution-destroy-env-2",
"projectId": 1,
"envId": 2,
"date": 1364373126772,
"workflow": "destroy",
"variables": {},
"scheduledBy": "genesis",
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/2/jobs/execution-destroy-env-2",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["put", "delete"]
}
]
}
]
}Path:/rest/projects/(projectId)/jobs
Type: GET
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
Example results:
{
"failed": [{
"item": {
"id": "1",
"projectId": 1,
"envId": 1,
"date": 1363763640000,
"workflow": "another",
"variables": {
"count": "1"
},
"scheduledBy": "Scheduler / genesis",
"failureDescription": "Workflow execution failed",
"workflowId": 2
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/failedJobs/1",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["delete"]
}
]
}
],
"requested": [{
"item": {
"id": "execution-destroy-env-1",
"projectId": 1,
"envId": 1,
"date": 1364368327497,
"workflow": "destroy",
"variables": {},
"scheduledBy": "genesis"
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/jobs/execution-destroy-env-1",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["put", "delete"]
}
]
}, {
"item": {
"id": "execution-destroy-env-2",
"projectId": 1,
"envId": 2,
"date": 1364373126772,
"workflow": "destroy",
"variables": {},
"scheduledBy": "genesis"
},
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/2/jobs/execution-destroy-env-2",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["put", "delete"]
}
]
}
]
}Path:/rest/projects/(projectId)/envs/(envId)/failedJobs
Type: GET
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
| envId | Number | id of the environment |
Example results:
{
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/failedJobs",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["get"]
}
],
"items": [{
"id": "1",
"projectId": 1,
"envId": 1,
"date": 1363763640000,
"workflow": "another",
"variables": {
"count": "1"
},
"scheduledBy": "Scheduler / genesis",
"failureDescription": "Workflow execution failed",
"workflowId": 2,
"links": [{
"href": "http://localhost:8080/rest/projects/1/envs/1/failedJobs/1",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.ScheduledJobDetails+json",
"methods": ["delete"]
}
]
}
]
}Path:/rest/projects/(projectId)/envs/(envId)/jobs
Type: POST
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
| envId | Number | id of the environment |
**Request body structure**
Request body consists form a single JSON map contains the following entries:
| Entry name | Entry predefined value | Type | Description |
|---|---|---|---|
| parameters | В | JSON object | parameters used by execution action |
Parameters JSON object structure:
| Entry name | Type | Description |
|---|---|---|
| variables | Map of String pairs | Workflow variable values customized by user |
Request example
{
"workflow":"another",
"executionDate":1364642100000,
"parameters":{"count":"1"}}Response example
{"result":"2013-03-30T11:15:00Z","isSuccess":true}