BatchAssociateClientDeviceWithCoreDeviceCommand

Associates a list of client devices with a core device. Use this API operation to specify which client devices can discover a core device through cloud discovery. With cloud discovery, client devices connect to IoT Greengrass to retrieve associated core devices' connectivity information and certificates. For more information, see Configure cloud discovery  in the IoT Greengrass V2 Developer Guide.

Client devices are local IoT devices that connect to and communicate with an IoT Greengrass core device over MQTT. You can connect client devices to a core device to sync MQTT messages and data to Amazon Web Services IoT Core and interact with client devices in Greengrass components. For more information, see Interact with local IoT devices  in the IoT Greengrass V2 Developer Guide.

Example Syntax

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

import { GreengrassV2Client, BatchAssociateClientDeviceWithCoreDeviceCommand } from "@aws-sdk/client-greengrassv2"; // ES Modules import
// const { GreengrassV2Client, BatchAssociateClientDeviceWithCoreDeviceCommand } = require("@aws-sdk/client-greengrassv2"); // CommonJS import
const client = new GreengrassV2Client(config);
const input = { // BatchAssociateClientDeviceWithCoreDeviceRequest
  entries: [ // AssociateClientDeviceWithCoreDeviceEntryList
    { // AssociateClientDeviceWithCoreDeviceEntry
      thingName: "STRING_VALUE", // required
    },
  ],
  coreDeviceThingName: "STRING_VALUE", // required
};
const command = new BatchAssociateClientDeviceWithCoreDeviceCommand(input);
const response = await client.send(command);
// { // BatchAssociateClientDeviceWithCoreDeviceResponse
//   errorEntries: [ // AssociateClientDeviceWithCoreDeviceErrorList
//     { // AssociateClientDeviceWithCoreDeviceErrorEntry
//       thingName: "STRING_VALUE",
//       code: "STRING_VALUE",
//       message: "STRING_VALUE",
//     },
//   ],
// };

BatchAssociateClientDeviceWithCoreDeviceCommand Input

Parameter
Type
Description
coreDeviceThingName
Required
string | undefined

The name of the core device. This is also the name of the IoT thing.

entries
AssociateClientDeviceWithCoreDeviceEntry[] | undefined

The list of client devices to associate.

BatchAssociateClientDeviceWithCoreDeviceCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
errorEntries
AssociateClientDeviceWithCoreDeviceErrorEntry[] | undefined

The list of any errors for the entries in the request. Each error entry contains the name of the IoT thing that failed to associate.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have permission to perform the action.

InternalServerException
server

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

ResourceNotFoundException
client

The requested resource can't be found.

ThrottlingException
client

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

ValidationException
client

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

GreengrassV2ServiceException
Base exception class for all service exceptions from GreengrassV2 service.