- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetCommandCommand
Gets information about the specified command.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTClient, GetCommandCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, GetCommandCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // GetCommandRequest
commandId: "STRING_VALUE", // required
};
const command = new GetCommandCommand(input);
const response = await client.send(command);
// { // GetCommandResponse
// commandId: "STRING_VALUE",
// commandArn: "STRING_VALUE",
// namespace: "AWS-IoT" || "AWS-IoT-FleetWise",
// displayName: "STRING_VALUE",
// description: "STRING_VALUE",
// mandatoryParameters: [ // CommandParameterList
// { // CommandParameter
// name: "STRING_VALUE", // required
// value: { // CommandParameterValue
// S: "STRING_VALUE",
// B: true || false,
// I: Number("int"),
// L: Number("long"),
// D: Number("double"),
// BIN: new Uint8Array(),
// UL: "STRING_VALUE",
// },
// defaultValue: {
// S: "STRING_VALUE",
// B: true || false,
// I: Number("int"),
// L: Number("long"),
// D: Number("double"),
// BIN: new Uint8Array(),
// UL: "STRING_VALUE",
// },
// description: "STRING_VALUE",
// },
// ],
// payload: { // CommandPayload
// content: new Uint8Array(),
// contentType: "STRING_VALUE",
// },
// roleArn: "STRING_VALUE",
// createdAt: new Date("TIMESTAMP"),
// lastUpdatedAt: new Date("TIMESTAMP"),
// deprecated: true || false,
// pendingDeletion: true || false,
// };
GetCommandCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
commandId Required | string | undefined | The unique identifier of the command for which you want to retrieve information. |
GetCommandCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
commandArn | string | undefined | The Amazon Resource Number (ARN) of the command. For example, |
commandId | string | undefined | The unique identifier of the command. |
createdAt | Date | undefined | The timestamp, when the command was created. |
deprecated | boolean | undefined | Indicates whether the command has been deprecated. |
description | string | undefined | A short text description of the command. |
displayName | string | undefined | The user-friendly name in the console for the command. |
lastUpdatedAt | Date | undefined | The timestamp, when the command was last updated. |
mandatoryParameters | CommandParameter[] | undefined | A list of parameters for the command created. |
namespace | CommandNamespace | undefined | The namespace of the command. |
payload | CommandPayload | undefined | The payload object that you provided for the command. |
pendingDeletion | boolean | undefined | Indicates whether the command is being deleted. |
roleArn | string | undefined | The IAM role that you provided when creating the command with |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerException | server | Internal error from the service that indicates an unexpected error or that the service is unavailable. |
ResourceNotFoundException | client | The specified resource does not exist. |
ThrottlingException | client | The rate exceeds the limit. |
ValidationException | client | The request is not valid. |
IoTServiceException | Base exception class for all service exceptions from IoT service. |