-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
emc_canceljob.js
33 lines (28 loc) · 1.06 KB
/
emc_canceljob.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// ABOUT THIS NODE.JS SAMPLE: This sample is part of the SDK for JavaScript Developer Guide topic at
// https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/emc-examples-jobs.html
// snippet-start:[mediaconvert.JavaScript.jobs.cancelJob]
// Load the AWS SDK for Node.js
var AWS = require("aws-sdk");
// Set the Region
AWS.config.update({ region: "us-west-2" });
// Set MediaConvert to customer endpoint
AWS.config.mediaconvert = { endpoint: "ACCOUNT_ENDPOINT" };
var params = {
Id: "JOB_ID" /* required */,
};
// Create a promise on a MediaConvert object
var endpointPromise = new AWS.MediaConvert({ apiVersion: "2017-08-29" })
.cancelJob(params)
.promise();
// Handle promise's fulfilled/rejected status
endpointPromise.then(
function (data) {
console.log("Job " + params.Id + " is canceled");
},
function (err) {
console.log("Error", err);
}
);
// snippet-end:[mediaconvert.JavaScript.jobs.cancelJob]