Get Link's Job History
Get the operations history for the link with the specified ID.
Request
HTTP Request
Permissions
Path parameters
Parameter | Type | Description |
---|---|---|
id | Stringrequired |
The ID of a link for whose job history is retrieved. |
Request body
The request body is empty.
Response
Returns an array of jobs performed on a link.
Example
Request
let login = <...>
let password = <...>
let saymonHostname = <...>
let linkId = <...>
let path = "/node/api/objects/" + linkId + "/jobs"
let auth = "Basic " + btoa(login + ":" + password);
let headers = new Headers();
headers.append("Authorization", auth);
let requestOptions = {
method: "GET",
headers: headers
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
const http = require("http");
let login = <...>
let password = <...>
let saymonHostname = <...>
let linkId = <...>
let path = "/node/api/objects/" + linkId + "/jobs"
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "GET",
"hostname": saymonHostname,
"headers": {
"Authorization": auth
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Response
[
{
"description": {
"stdout": "Operation 1",
"exitCode": 0
},
"results": [],
"operation_id": "62e7d648ebe90b0c87903fcb",
"owner_id": "62d7e5da56d203149a08002f",
"user_id": "62c2f3ce80c8654892764d56",
"timestamp": 1659362048187,
"process_meta": null,
"operation": {
"name": "Operation 1"
},
"id": "62e7db0081358e0de357a173"
},
{
"description": {
"stdout": "Hello World",
"exitCode": 0
},
...
"operation": {
"name": "Operation1"
},
"id": "62e7db0581358e0de357a178"
},
{
"description": {
"stdout": "Operation 2",
"exitCode": 0
},
...
"operation": {
"name": "Operation 2"
},
"id": "62e7db0681358e0de357a17a"
}
]