|
| 1 | +import { IoTJobsDataPlaneClient } from "./IoTJobsDataPlaneClient"; |
| 2 | +import { |
| 3 | + DescribeJobExecutionCommand, |
| 4 | + DescribeJobExecutionCommandInput, |
| 5 | + DescribeJobExecutionCommandOutput |
| 6 | +} from "./commands/DescribeJobExecutionCommand"; |
| 7 | +import { |
| 8 | + GetPendingJobExecutionsCommand, |
| 9 | + GetPendingJobExecutionsCommandInput, |
| 10 | + GetPendingJobExecutionsCommandOutput |
| 11 | +} from "./commands/GetPendingJobExecutionsCommand"; |
| 12 | +import { |
| 13 | + StartNextPendingJobExecutionCommand, |
| 14 | + StartNextPendingJobExecutionCommandInput, |
| 15 | + StartNextPendingJobExecutionCommandOutput |
| 16 | +} from "./commands/StartNextPendingJobExecutionCommand"; |
| 17 | +import { |
| 18 | + UpdateJobExecutionCommand, |
| 19 | + UpdateJobExecutionCommandInput, |
| 20 | + UpdateJobExecutionCommandOutput |
| 21 | +} from "./commands/UpdateJobExecutionCommand"; |
| 22 | +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; |
| 23 | + |
| 24 | +/** |
| 25 | + * |
| 26 | + * <p>AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to |
| 27 | + * and executed on one or more devices connected to AWS IoT. For example, you can define a job that instructs a |
| 28 | + * set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform |
| 29 | + * remote troubleshooting operations.</p> |
| 30 | + * <p> To create a job, you make a job document which is a description of the remote operations to be |
| 31 | + * performed, and you specify a list of targets that should perform the operations. The targets can be individual |
| 32 | + * things, thing groups or both.</p> |
| 33 | + * <p> AWS IoT Jobs sends a message to inform the targets that a job is available. The target starts the |
| 34 | + * execution of the job by downloading the job document, performing the operations it specifies, and reporting its |
| 35 | + * progress to AWS IoT. The Jobs service provides commands to track the progress of a job on a specific target and |
| 36 | + * for all the targets of the job</p> |
| 37 | + * |
| 38 | + */ |
| 39 | +export class IoTJobsDataPlane extends IoTJobsDataPlaneClient { |
| 40 | + /** |
| 41 | + * |
| 42 | + * <p>Gets details of a job execution.</p> |
| 43 | + * |
| 44 | + */ |
| 45 | + public describeJobExecution( |
| 46 | + args: DescribeJobExecutionCommandInput, |
| 47 | + options?: __HttpHandlerOptions |
| 48 | + ): Promise<DescribeJobExecutionCommandOutput>; |
| 49 | + public describeJobExecution( |
| 50 | + args: DescribeJobExecutionCommandInput, |
| 51 | + cb: (err: any, data?: DescribeJobExecutionCommandOutput) => void |
| 52 | + ): void; |
| 53 | + public describeJobExecution( |
| 54 | + args: DescribeJobExecutionCommandInput, |
| 55 | + options: __HttpHandlerOptions, |
| 56 | + cb: (err: any, data?: DescribeJobExecutionCommandOutput) => void |
| 57 | + ): void; |
| 58 | + public describeJobExecution( |
| 59 | + args: DescribeJobExecutionCommandInput, |
| 60 | + optionsOrCb?: |
| 61 | + | __HttpHandlerOptions |
| 62 | + | ((err: any, data?: DescribeJobExecutionCommandOutput) => void), |
| 63 | + cb?: (err: any, data?: DescribeJobExecutionCommandOutput) => void |
| 64 | + ): Promise<DescribeJobExecutionCommandOutput> | void { |
| 65 | + const command = new DescribeJobExecutionCommand(args); |
| 66 | + if (typeof optionsOrCb === "function") { |
| 67 | + this.send(command, optionsOrCb); |
| 68 | + } else if (typeof cb === "function") { |
| 69 | + if (typeof optionsOrCb !== "object") |
| 70 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 71 | + this.send(command, optionsOrCb || {}, cb); |
| 72 | + } else { |
| 73 | + return this.send(command, optionsOrCb); |
| 74 | + } |
| 75 | + } |
| 76 | + |
| 77 | + /** |
| 78 | + * |
| 79 | + * <p>Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.</p> |
| 80 | + * |
| 81 | + */ |
| 82 | + public startNextPendingJobExecution( |
| 83 | + args: StartNextPendingJobExecutionCommandInput, |
| 84 | + options?: __HttpHandlerOptions |
| 85 | + ): Promise<StartNextPendingJobExecutionCommandOutput>; |
| 86 | + public startNextPendingJobExecution( |
| 87 | + args: StartNextPendingJobExecutionCommandInput, |
| 88 | + cb: (err: any, data?: StartNextPendingJobExecutionCommandOutput) => void |
| 89 | + ): void; |
| 90 | + public startNextPendingJobExecution( |
| 91 | + args: StartNextPendingJobExecutionCommandInput, |
| 92 | + options: __HttpHandlerOptions, |
| 93 | + cb: (err: any, data?: StartNextPendingJobExecutionCommandOutput) => void |
| 94 | + ): void; |
| 95 | + public startNextPendingJobExecution( |
| 96 | + args: StartNextPendingJobExecutionCommandInput, |
| 97 | + optionsOrCb?: |
| 98 | + | __HttpHandlerOptions |
| 99 | + | ((err: any, data?: StartNextPendingJobExecutionCommandOutput) => void), |
| 100 | + cb?: (err: any, data?: StartNextPendingJobExecutionCommandOutput) => void |
| 101 | + ): Promise<StartNextPendingJobExecutionCommandOutput> | void { |
| 102 | + const command = new StartNextPendingJobExecutionCommand(args); |
| 103 | + if (typeof optionsOrCb === "function") { |
| 104 | + this.send(command, optionsOrCb); |
| 105 | + } else if (typeof cb === "function") { |
| 106 | + if (typeof optionsOrCb !== "object") |
| 107 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 108 | + this.send(command, optionsOrCb || {}, cb); |
| 109 | + } else { |
| 110 | + return this.send(command, optionsOrCb); |
| 111 | + } |
| 112 | + } |
| 113 | + |
| 114 | + /** |
| 115 | + * |
| 116 | + * <p>Gets the list of all jobs for a thing that are not in a terminal status.</p> |
| 117 | + * |
| 118 | + */ |
| 119 | + public getPendingJobExecutions( |
| 120 | + args: GetPendingJobExecutionsCommandInput, |
| 121 | + options?: __HttpHandlerOptions |
| 122 | + ): Promise<GetPendingJobExecutionsCommandOutput>; |
| 123 | + public getPendingJobExecutions( |
| 124 | + args: GetPendingJobExecutionsCommandInput, |
| 125 | + cb: (err: any, data?: GetPendingJobExecutionsCommandOutput) => void |
| 126 | + ): void; |
| 127 | + public getPendingJobExecutions( |
| 128 | + args: GetPendingJobExecutionsCommandInput, |
| 129 | + options: __HttpHandlerOptions, |
| 130 | + cb: (err: any, data?: GetPendingJobExecutionsCommandOutput) => void |
| 131 | + ): void; |
| 132 | + public getPendingJobExecutions( |
| 133 | + args: GetPendingJobExecutionsCommandInput, |
| 134 | + optionsOrCb?: |
| 135 | + | __HttpHandlerOptions |
| 136 | + | ((err: any, data?: GetPendingJobExecutionsCommandOutput) => void), |
| 137 | + cb?: (err: any, data?: GetPendingJobExecutionsCommandOutput) => void |
| 138 | + ): Promise<GetPendingJobExecutionsCommandOutput> | void { |
| 139 | + const command = new GetPendingJobExecutionsCommand(args); |
| 140 | + if (typeof optionsOrCb === "function") { |
| 141 | + this.send(command, optionsOrCb); |
| 142 | + } else if (typeof cb === "function") { |
| 143 | + if (typeof optionsOrCb !== "object") |
| 144 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 145 | + this.send(command, optionsOrCb || {}, cb); |
| 146 | + } else { |
| 147 | + return this.send(command, optionsOrCb); |
| 148 | + } |
| 149 | + } |
| 150 | + |
| 151 | + /** |
| 152 | + * |
| 153 | + * <p>Updates the status of a job execution.</p> |
| 154 | + * |
| 155 | + */ |
| 156 | + public updateJobExecution( |
| 157 | + args: UpdateJobExecutionCommandInput, |
| 158 | + options?: __HttpHandlerOptions |
| 159 | + ): Promise<UpdateJobExecutionCommandOutput>; |
| 160 | + public updateJobExecution( |
| 161 | + args: UpdateJobExecutionCommandInput, |
| 162 | + cb: (err: any, data?: UpdateJobExecutionCommandOutput) => void |
| 163 | + ): void; |
| 164 | + public updateJobExecution( |
| 165 | + args: UpdateJobExecutionCommandInput, |
| 166 | + options: __HttpHandlerOptions, |
| 167 | + cb: (err: any, data?: UpdateJobExecutionCommandOutput) => void |
| 168 | + ): void; |
| 169 | + public updateJobExecution( |
| 170 | + args: UpdateJobExecutionCommandInput, |
| 171 | + optionsOrCb?: |
| 172 | + | __HttpHandlerOptions |
| 173 | + | ((err: any, data?: UpdateJobExecutionCommandOutput) => void), |
| 174 | + cb?: (err: any, data?: UpdateJobExecutionCommandOutput) => void |
| 175 | + ): Promise<UpdateJobExecutionCommandOutput> | void { |
| 176 | + const command = new UpdateJobExecutionCommand(args); |
| 177 | + if (typeof optionsOrCb === "function") { |
| 178 | + this.send(command, optionsOrCb); |
| 179 | + } else if (typeof cb === "function") { |
| 180 | + if (typeof optionsOrCb !== "object") |
| 181 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 182 | + this.send(command, optionsOrCb || {}, cb); |
| 183 | + } else { |
| 184 | + return this.send(command, optionsOrCb); |
| 185 | + } |
| 186 | + } |
| 187 | +} |
0 commit comments