- 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.
ListDeploymentInstancesCommand
- This operation is deprecated, use ListDeploymentTargets instead.
The newer BatchGetDeploymentTargets
should be used instead because it works with all compute types. ListDeploymentInstances
throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.
Lists the instance for a deployment associated with the user or Amazon Web Services account.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeDeployClient, ListDeploymentInstancesCommand } from "@aws-sdk/client-codedeploy"; // ES Modules import
// const { CodeDeployClient, ListDeploymentInstancesCommand } = require("@aws-sdk/client-codedeploy"); // CommonJS import
const client = new CodeDeployClient(config);
const input = { // ListDeploymentInstancesInput
deploymentId: "STRING_VALUE", // required
nextToken: "STRING_VALUE",
instanceStatusFilter: [ // InstanceStatusList
"Pending" || "InProgress" || "Succeeded" || "Failed" || "Skipped" || "Unknown" || "Ready",
],
instanceTypeFilter: [ // InstanceTypeList
"Blue" || "Green",
],
};
const command = new ListDeploymentInstancesCommand(input);
const response = await client.send(command);
// { // ListDeploymentInstancesOutput
// instancesList: [ // InstancesList
// "STRING_VALUE",
// ],
// nextToken: "STRING_VALUE",
// };
ListDeploymentInstancesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
deploymentId Required | string | undefined | The unique ID of a deployment. |
instanceStatusFilter | InstanceStatus[] | undefined | A subset of instances to list by status:
|
instanceTypeFilter | _InstanceType[] | undefined | The set of instances in a blue/green deployment, either those in the original environment ("BLUE") or those in the replacement environment ("GREEN"), for which you want to view instance information. |
nextToken | string | undefined | An identifier returned from the previous list deployment instances call. It can be used to return the next set of deployment instances in the list. |
ListDeploymentInstancesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
instancesList | string[] | undefined | A list of instance IDs. |
nextToken | string | undefined | If a large amount of information is returned, an identifier is also returned. It can be used in a subsequent list deployment instances call to return the next set of deployment instances in the list. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DeploymentDoesNotExistException | client | The deployment with the user or Amazon Web Services account does not exist. |
DeploymentIdRequiredException | client | At least one deployment ID must be specified. |
DeploymentNotStartedException | client | The specified deployment has not started. |
InvalidComputePlatformException | client | The computePlatform is invalid. The computePlatform should be |
InvalidDeploymentIdException | client | At least one of the deployment IDs was specified in an invalid format. |
InvalidDeploymentInstanceTypeException | client | An instance type was specified for an in-place deployment. Instance types are supported for blue/green deployments only. |
InvalidInstanceStatusException | client | The specified instance status does not exist. |
InvalidInstanceTypeException | client | An invalid instance type was specified for instances in a blue/green deployment. Valid values include "Blue" for an original environment and "Green" for a replacement environment. |
InvalidNextTokenException | client | The next token was specified in an invalid format. |
InvalidTargetFilterNameException | client | The target filter name is invalid. |
CodeDeployServiceException | Base exception class for all service exceptions from CodeDeploy service. |