UNPKG

12.6 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class IoTJobsDataPlane extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: IoTJobsDataPlane.Types.ClientConfiguration)
13 config: Config & IoTJobsDataPlane.Types.ClientConfiguration;
14 /**
15 * Gets details of a job execution.
16 */
17 describeJobExecution(params: IoTJobsDataPlane.Types.DescribeJobExecutionRequest, callback?: (err: AWSError, data: IoTJobsDataPlane.Types.DescribeJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.DescribeJobExecutionResponse, AWSError>;
18 /**
19 * Gets details of a job execution.
20 */
21 describeJobExecution(callback?: (err: AWSError, data: IoTJobsDataPlane.Types.DescribeJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.DescribeJobExecutionResponse, AWSError>;
22 /**
23 * Gets the list of all jobs for a thing that are not in a terminal status.
24 */
25 getPendingJobExecutions(params: IoTJobsDataPlane.Types.GetPendingJobExecutionsRequest, callback?: (err: AWSError, data: IoTJobsDataPlane.Types.GetPendingJobExecutionsResponse) => void): Request<IoTJobsDataPlane.Types.GetPendingJobExecutionsResponse, AWSError>;
26 /**
27 * Gets the list of all jobs for a thing that are not in a terminal status.
28 */
29 getPendingJobExecutions(callback?: (err: AWSError, data: IoTJobsDataPlane.Types.GetPendingJobExecutionsResponse) => void): Request<IoTJobsDataPlane.Types.GetPendingJobExecutionsResponse, AWSError>;
30 /**
31 * Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.
32 */
33 startNextPendingJobExecution(params: IoTJobsDataPlane.Types.StartNextPendingJobExecutionRequest, callback?: (err: AWSError, data: IoTJobsDataPlane.Types.StartNextPendingJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.StartNextPendingJobExecutionResponse, AWSError>;
34 /**
35 * Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.
36 */
37 startNextPendingJobExecution(callback?: (err: AWSError, data: IoTJobsDataPlane.Types.StartNextPendingJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.StartNextPendingJobExecutionResponse, AWSError>;
38 /**
39 * Updates the status of a job execution.
40 */
41 updateJobExecution(params: IoTJobsDataPlane.Types.UpdateJobExecutionRequest, callback?: (err: AWSError, data: IoTJobsDataPlane.Types.UpdateJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.UpdateJobExecutionResponse, AWSError>;
42 /**
43 * Updates the status of a job execution.
44 */
45 updateJobExecution(callback?: (err: AWSError, data: IoTJobsDataPlane.Types.UpdateJobExecutionResponse) => void): Request<IoTJobsDataPlane.Types.UpdateJobExecutionResponse, AWSError>;
46}
47declare namespace IoTJobsDataPlane {
48 export type ApproximateSecondsBeforeTimedOut = number;
49 export type DescribeJobExecutionJobId = string;
50 export interface DescribeJobExecutionRequest {
51 /**
52 * The unique identifier assigned to this job when it was created.
53 */
54 jobId: DescribeJobExecutionJobId;
55 /**
56 * The thing name associated with the device the job execution is running on.
57 */
58 thingName: ThingName;
59 /**
60 * Optional. When set to true, the response contains the job document. The default is false.
61 */
62 includeJobDocument?: IncludeJobDocument;
63 /**
64 * Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.
65 */
66 executionNumber?: ExecutionNumber;
67 }
68 export interface DescribeJobExecutionResponse {
69 /**
70 * Contains data about a job execution.
71 */
72 execution?: JobExecution;
73 }
74 export type DetailsKey = string;
75 export type DetailsMap = {[key: string]: DetailsValue};
76 export type DetailsValue = string;
77 export type ExecutionNumber = number;
78 export type ExpectedVersion = number;
79 export interface GetPendingJobExecutionsRequest {
80 /**
81 * The name of the thing that is executing the job.
82 */
83 thingName: ThingName;
84 }
85 export interface GetPendingJobExecutionsResponse {
86 /**
87 * A list of JobExecutionSummary objects with status IN_PROGRESS.
88 */
89 inProgressJobs?: JobExecutionSummaryList;
90 /**
91 * A list of JobExecutionSummary objects with status QUEUED.
92 */
93 queuedJobs?: JobExecutionSummaryList;
94 }
95 export type IncludeExecutionState = boolean;
96 export type IncludeJobDocument = boolean;
97 export type JobDocument = string;
98 export interface JobExecution {
99 /**
100 * The unique identifier you assigned to this job when it was created.
101 */
102 jobId?: JobId;
103 /**
104 * The name of the thing that is executing the job.
105 */
106 thingName?: ThingName;
107 /**
108 * The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
109 */
110 status?: JobExecutionStatus;
111 /**
112 * A collection of name/value pairs that describe the status of the job execution.
113 */
114 statusDetails?: DetailsMap;
115 /**
116 * The time, in milliseconds since the epoch, when the job execution was enqueued.
117 */
118 queuedAt?: QueuedAt;
119 /**
120 * The time, in milliseconds since the epoch, when the job execution was started.
121 */
122 startedAt?: StartedAt;
123 /**
124 * The time, in milliseconds since the epoch, when the job execution was last updated.
125 */
126 lastUpdatedAt?: LastUpdatedAt;
127 /**
128 * The estimated number of seconds that remain before the job execution status will be changed to TIMED_OUT.
129 */
130 approximateSecondsBeforeTimedOut?: ApproximateSecondsBeforeTimedOut;
131 /**
132 * The version of the job execution. Job execution versions are incremented each time they are updated by a device.
133 */
134 versionNumber?: VersionNumber;
135 /**
136 * A number that identifies a particular job execution on a particular device. It can be used later in commands that return or update job execution information.
137 */
138 executionNumber?: ExecutionNumber;
139 /**
140 * The content of the job document.
141 */
142 jobDocument?: JobDocument;
143 }
144 export interface JobExecutionState {
145 /**
146 * The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
147 */
148 status?: JobExecutionStatus;
149 /**
150 * A collection of name/value pairs that describe the status of the job execution.
151 */
152 statusDetails?: DetailsMap;
153 /**
154 * The version of the job execution. Job execution versions are incremented each time they are updated by a device.
155 */
156 versionNumber?: VersionNumber;
157 }
158 export type JobExecutionStatus = "QUEUED"|"IN_PROGRESS"|"SUCCEEDED"|"FAILED"|"TIMED_OUT"|"REJECTED"|"REMOVED"|"CANCELED"|string;
159 export interface JobExecutionSummary {
160 /**
161 * The unique identifier you assigned to this job when it was created.
162 */
163 jobId?: JobId;
164 /**
165 * The time, in milliseconds since the epoch, when the job execution was enqueued.
166 */
167 queuedAt?: QueuedAt;
168 /**
169 * The time, in milliseconds since the epoch, when the job execution started.
170 */
171 startedAt?: StartedAt;
172 /**
173 * The time, in milliseconds since the epoch, when the job execution was last updated.
174 */
175 lastUpdatedAt?: LastUpdatedAt;
176 /**
177 * The version of the job execution. Job execution versions are incremented each time AWS IoT Jobs receives an update from a device.
178 */
179 versionNumber?: VersionNumber;
180 /**
181 * A number that identifies a particular job execution on a particular device.
182 */
183 executionNumber?: ExecutionNumber;
184 }
185 export type JobExecutionSummaryList = JobExecutionSummary[];
186 export type JobId = string;
187 export type LastUpdatedAt = number;
188 export type QueuedAt = number;
189 export interface StartNextPendingJobExecutionRequest {
190 /**
191 * The name of the thing associated with the device.
192 */
193 thingName: ThingName;
194 /**
195 * A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.
196 */
197 statusDetails?: DetailsMap;
198 /**
199 * Specifies the amount of time this device has to finish execution of this job. If the job execution status is not set to a terminal state before this timer expires, or before the timer is reset (by calling UpdateJobExecution, setting the status to IN_PROGRESS and specifying a new timeout value in field stepTimeoutInMinutes) the job execution status will be automatically set to TIMED_OUT. Note that setting this timeout has no effect on that job execution timeout which may have been specified when the job was created (CreateJob using field timeoutConfig).
200 */
201 stepTimeoutInMinutes?: StepTimeoutInMinutes;
202 }
203 export interface StartNextPendingJobExecutionResponse {
204 /**
205 * A JobExecution object.
206 */
207 execution?: JobExecution;
208 }
209 export type StartedAt = number;
210 export type StepTimeoutInMinutes = number;
211 export type ThingName = string;
212 export interface UpdateJobExecutionRequest {
213 /**
214 * The unique identifier assigned to this job when it was created.
215 */
216 jobId: JobId;
217 /**
218 * The name of the thing associated with the device.
219 */
220 thingName: ThingName;
221 /**
222 * The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.
223 */
224 status: JobExecutionStatus;
225 /**
226 * Optional. A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.
227 */
228 statusDetails?: DetailsMap;
229 /**
230 * Specifies the amount of time this device has to finish execution of this job. If the job execution status is not set to a terminal state before this timer expires, or before the timer is reset (by again calling UpdateJobExecution, setting the status to IN_PROGRESS and specifying a new timeout value in this field) the job execution status will be automatically set to TIMED_OUT. Note that setting or resetting this timeout has no effect on that job execution timeout which may have been specified when the job was created (CreateJob using field timeoutConfig).
231 */
232 stepTimeoutInMinutes?: StepTimeoutInMinutes;
233 /**
234 * Optional. The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)
235 */
236 expectedVersion?: ExpectedVersion;
237 /**
238 * Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.
239 */
240 includeJobExecutionState?: IncludeExecutionState;
241 /**
242 * Optional. When set to true, the response contains the job document. The default is false.
243 */
244 includeJobDocument?: IncludeJobDocument;
245 /**
246 * Optional. A number that identifies a particular job execution on a particular device.
247 */
248 executionNumber?: ExecutionNumber;
249 }
250 export interface UpdateJobExecutionResponse {
251 /**
252 * A JobExecutionState object.
253 */
254 executionState?: JobExecutionState;
255 /**
256 * The contents of the Job Documents.
257 */
258 jobDocument?: JobDocument;
259 }
260 export type VersionNumber = number;
261 /**
262 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
263 */
264 export type apiVersion = "2017-09-29"|"latest"|string;
265 export interface ClientApiVersions {
266 /**
267 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
268 */
269 apiVersion?: apiVersion;
270 }
271 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
272 /**
273 * Contains interfaces for use with the IoTJobsDataPlane client.
274 */
275 export import Types = IoTJobsDataPlane;
276}
277export = IoTJobsDataPlane;