CancelResourceRequestCommand

Cancels the specified resource operation request. For more information, see Canceling resource operation requests  in the Amazon Web Services Cloud Control API User Guide.

Only resource operations requests with a status of PENDING or IN_PROGRESS can be canceled.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CloudControlClient, CancelResourceRequestCommand } from "@aws-sdk/client-cloudcontrol"; // ES Modules import
// const { CloudControlClient, CancelResourceRequestCommand } = require("@aws-sdk/client-cloudcontrol"); // CommonJS import
const client = new CloudControlClient(config);
const input = { // CancelResourceRequestInput
  RequestToken: "STRING_VALUE", // required
};
const command = new CancelResourceRequestCommand(input);
const response = await client.send(command);
// { // CancelResourceRequestOutput
//   ProgressEvent: { // ProgressEvent
//     TypeName: "STRING_VALUE",
//     Identifier: "STRING_VALUE",
//     RequestToken: "STRING_VALUE",
//     HooksRequestToken: "STRING_VALUE",
//     Operation: "STRING_VALUE",
//     OperationStatus: "STRING_VALUE",
//     EventTime: new Date("TIMESTAMP"),
//     ResourceModel: "STRING_VALUE",
//     StatusMessage: "STRING_VALUE",
//     ErrorCode: "STRING_VALUE",
//     RetryAfter: new Date("TIMESTAMP"),
//   },
// };

CancelResourceRequestCommand Input

Parameter
Type
Description
RequestToken
Required
string | undefined

The RequestToken of the ProgressEvent object returned by the resource operation request.

CancelResourceRequestCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ProgressEvent
ProgressEvent | undefined

Represents the current status of a resource operation request. For more information, see Managing resource operation requests  in the Amazon Web Services Cloud Control API User Guide.

Throws

Name
Fault
Details
ConcurrentModificationException
server

The resource is currently being modified by another operation.

RequestTokenNotFoundException
client

A resource operation with the specified request token can't be found.

CloudControlServiceException
Base exception class for all service exceptions from CloudControl service.