api/databases/{dbid}/jobs/{jid}
Argument | Type | Description |
---|---|---|
dbid | GUID | The ID of the database |
jid | GUID | The ID of the job |
Name | Type | Options | Description |
---|---|---|---|
Exception | Exception | Job error info | |
JobId | GUID | Job id | |
Progress | JobProgressData | Job progress data | |
Request | JobRequestData | Job request data | |
Status | Integer | Job current status |
- POST api/databases/ec5a34c2-7062-4be7-ade9-c15acefcdbb8/jobs/duplicateentities
- Accept: text/json
- Accept-Encoding: deflate
- Host: localhost:6496
- Cookie: sid=bc6ef8bc-1de7-49ec-a929-7644fcf51911
- Connection: Keep-Alive
- {
- "DuplicatedFields": [
- "name",
- "estimate"
- ],
- "EntityMetaName": "task",
- "InitialIds": [
- "277b190f-bf83-434e-ad31-09010e9ca072",
- "96611d6e-53f4-4f4b-b41a-82093f9fda9c",
- "98345828-304d-4b78-a8b4-3da1e6a306a2",
- "e1597548-cc5d-4d51-99fc-819a62cdaa9a",
- "70abbc97-5f08-463e-8b81-d4b8a3bbf4a4",
- "3db8781c-bf45-4473-b16b-c4f0df8d64b5",
- "747b8168-16b4-4595-85f6-9eea59b0fc87",
- "a45adb38-6db4-46da-ab79-01ee2df689f8",
- "d2489831-b04d-4b1c-bf70-e20e0713572f",
- "0ca18e4a-1264-44f4-93b2-d9e3ce0fbcac",
- "42ec2115-1147-4712-8f97-7c1b9460337a",
- "12ecdc03-d1de-454e-b88d-e38b6936d091",
- "d56ce629-53dc-42cc-b951-1f064a50d69a",
- "5a699d21-bd60-47b1-8abb-0dfaa7c6b5a6",
- "d41ec2ef-dde9-4648-8b1f-bb5b68db26e1",
- "d4e3c403-28f8-46e9-9aa9-f4ccb99fd3a5",
- "3ee3a1cd-a133-47de-ad04-b68d72e3e24a",
- "ca3dd8d5-8443-4e1a-994a-eb92e0430a8e",
- "5629504c-9fe7-4b35-8a6c-5d57f634906c",
- "d45e464a-b209-4d77-a989-ebec33ef0ddd"
- ],
- "Comment": "Duplicated task"
- }
- Cache-Control: no-store
- Date: Mon, 24 Dec 2012 16:47:29 GMT
- Server: Microsoft-HTTPAPI/2.0
- {
- "JobId": "767ede8a-593f-4527-b08e-9b066fdb027e",
- "Status": 0 //Pending start
- }
This request can be send periodically to check the status and progress of job, until it returns the status Closed (3).
GET api/databases/ec5a34c2-7062-4be7-ade9-c15acefcdbb8/jobs/767ede8a-593f-4527-b08e-9b066fdb027e Accept: text/json Accept-Encoding: deflate Host: localhost:6496 Cookie: sid=bc6ef8bc-1de7-49ec-a929-7644fcf51911 Connection: Keep-Alive
Cache-Control: no-store Date: Mon, 24 Dec 2012 16:47:29 GMT Server: Microsoft-HTTPAPI/2.0 { "JobId": "767ede8a-593f-4527-b08e-9b066fdb027e", "Progress": { "Message": "", "Percent": 25.0 }, "Request": { "", }, "Status": 1 //Running }
If job is in state 'WaitingResponse' (2), you will get the message and a set of buttons in the field "Request". You need to display the message (or solve this situation on program level) and send request with selected button (buttons index is Zero based, i.e. first button has 0 value). For example, if you get message: "Can not duplicate the problem 'Task1'. Continue?", with buttons: "Yes", "Yes to All", "None.", you can select button "Yes to All" and send the request: { "Response": { "ButtonIndex": 1 }, }
PUT api/databases/ec5a34c2-7062-4be7-ade9-c15acefcdbb8/jobs/767ede8a-593f-4527-b08e-9b066fdb027e Accept: text/json Accept-Encoding: deflate Host: localhost:6496 Cookie: sid=bc6ef8bc-1de7-49ec-a929-7644fcf51911 Connection: Keep-Alive { "Response": { "ButtonIndex": 1 }, }
Cache-Control: no-store Date: Mon, 24 Dec 2012 16:47:29 GMT Server: Microsoft-HTTPAPI/2.0 { "JobId": "767ede8a-593f-4527-b08e-9b066fdb027e", "Progress": { "Message": "", "Percent": 50.0 }, "Status": 1 //Running }
This request is only for the premature termination of Job
DELETE api/databases/ec5a34c2-7062-4be7-ade9-c15acefcdbb8/jobs/767ede8a-593f-4527-b08e-9b066fdb027e Accept: text/json Accept-Encoding: deflate Host: localhost:6496 Cookie: sid=bc6ef8bc-1de7-49ec-a929-7644fcf51911 Connection: Keep-Alive
Cache-Control: no-store Date: Mon, 24 Dec 2012 16:47:29 GMT Server: Microsoft-HTTPAPI/2.0