UNPKG

1.66 kBTypeScriptView Raw
1import Modem = require('docker-modem');
2/**
3 * Class representing a task
4 */
5export declare class Task {
6 modem: Modem;
7 id: String;
8 data: Object;
9 /**
10 * Create a task
11 * @param {Modem} modem Modem to connect to the remote service
12 * @param {string} id Id of the task (optional)
13 */
14 constructor(modem: Modem, id: String);
15 /**
16 * Get low-level information on a task
17 * https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/inspect-a-task
18 * The reason why this module isn't called inspect is because that interferes with the inspect utility of task.
19 * @param {Object} opts Query params in the request (optional)
20 * @param {String} id ID of the task to inspect, if it's not set, use the id of the object (optional)
21 * @return {Promise} Promise return the task
22 */
23 status(opts?: Object): Promise<{}>;
24}
25export default class {
26 modem: Modem;
27 /**
28 * Create a task
29 * @param {Modem} modem Modem to connect to the remote service
30 * @param {string} id Id of the task (optional)
31 */
32 constructor(modem: Modem);
33 /**
34 * Get a Task object
35 * @param {id} string ID of the secret
36 * @return {Task}
37 */
38 get(id: String): Task;
39 /**
40 * Get the list of tasks
41 * https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/list-tasks
42 * @param {Object} opts Query params in the request (optional)
43 * @return {Promise} Promise returning the result as a list of tasks
44 */
45 list(opts?: Object): Promise<Array<Task>>;
46}