- 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.
ListInstancesCommand
This API is in preview release for Amazon Connect and is subject to change.
Return a list of instances which are in active state, creation-in-progress state, and failed state. Instances that aren't successfully created (they are in a failed state) are returned only for 24 hours after the CreateInstance API was invoked.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ConnectClient, ListInstancesCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, ListInstancesCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // ListInstancesRequest
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListInstancesCommand(input);
const response = await client.send(command);
// { // ListInstancesResponse
// InstanceSummaryList: [ // InstanceSummaryList
// { // InstanceSummary
// Id: "STRING_VALUE",
// Arn: "STRING_VALUE",
// IdentityManagementType: "SAML" || "CONNECT_MANAGED" || "EXISTING_DIRECTORY",
// InstanceAlias: "STRING_VALUE",
// CreatedTime: new Date("TIMESTAMP"),
// ServiceRole: "STRING_VALUE",
// InstanceStatus: "CREATION_IN_PROGRESS" || "ACTIVE" || "CREATION_FAILED",
// InboundCallsEnabled: true || false,
// OutboundCallsEnabled: true || false,
// InstanceAccessUrl: "STRING_VALUE",
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListInstancesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
MaxResults | number | undefined | The maximum number of results to return per page. |
NextToken | string | undefined | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
ListInstancesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
InstanceSummaryList | InstanceSummary[] | undefined | Information about the instances. |
NextToken | string | undefined | If there are additional results, this is the token for the next set of results. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServiceException | server | Request processing failed because of an error or failure with the service. |
InvalidRequestException | client | The request is not valid. |
ConnectServiceException | Base exception class for all service exceptions from Connect service. |