ExecuteActionCommand

Executes an action on a target resource.

Example Syntax

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

import { IoTSiteWiseClient, ExecuteActionCommand } from "@aws-sdk/client-iotsitewise"; // ES Modules import
// const { IoTSiteWiseClient, ExecuteActionCommand } = require("@aws-sdk/client-iotsitewise"); // CommonJS import
const client = new IoTSiteWiseClient(config);
const input = { // ExecuteActionRequest
  targetResource: { // TargetResource
    assetId: "STRING_VALUE", // required
  },
  actionDefinitionId: "STRING_VALUE", // required
  actionPayload: { // ActionPayload
    stringValue: "STRING_VALUE", // required
  },
  clientToken: "STRING_VALUE",
};
const command = new ExecuteActionCommand(input);
const response = await client.send(command);
// { // ExecuteActionResponse
//   actionId: "STRING_VALUE", // required
// };

ExecuteActionCommand Input

See ExecuteActionCommandInput for more details

Parameter
Type
Description
actionDefinitionId
Required
string | undefined

The ID of the action definition.

actionPayload
Required
ActionPayload | undefined

The JSON payload of the action.

targetResource
Required
TargetResource | undefined

The resource the action will be taken on.

clientToken
string | undefined

A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

ExecuteActionCommand Output

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

The ID of the action.

Throws

Name
Fault
Details
ConflictingOperationException
client

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

InternalFailureException
server

IoT SiteWise can't process your request right now. Try again later.

InvalidRequestException
client

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

LimitExceededException
client

You've reached the limit for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.

For more information, see Quotas  in the IoT SiteWise User Guide.

ResourceNotFoundException
client

The requested resource can't be found.

ThrottlingException
client

Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

For more information, see Quotas  in the IoT SiteWise User Guide.

IoTSiteWiseServiceException
Base exception class for all service exceptions from IoTSiteWise service.