ListDeploymentsCommand

Lists the deployments in a deployment group for an application registered 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, ListDeploymentsCommand } from "@aws-sdk/client-codedeploy"; // ES Modules import
// const { CodeDeployClient, ListDeploymentsCommand } = require("@aws-sdk/client-codedeploy"); // CommonJS import
const client = new CodeDeployClient(config);
const input = { // ListDeploymentsInput
  applicationName: "STRING_VALUE",
  deploymentGroupName: "STRING_VALUE",
  externalId: "STRING_VALUE",
  includeOnlyStatuses: [ // DeploymentStatusList
    "Created" || "Queued" || "InProgress" || "Baking" || "Succeeded" || "Failed" || "Stopped" || "Ready",
  ],
  createTimeRange: { // TimeRange
    start: new Date("TIMESTAMP"),
    end: new Date("TIMESTAMP"),
  },
  nextToken: "STRING_VALUE",
};
const command = new ListDeploymentsCommand(input);
const response = await client.send(command);
// { // ListDeploymentsOutput
//   deployments: [ // DeploymentsList
//     "STRING_VALUE",
//   ],
//   nextToken: "STRING_VALUE",
// };

ListDeploymentsCommand Input

See ListDeploymentsCommandInput for more details

Parameter
Type
Description
applicationName
string | undefined

The name of an CodeDeploy application associated with the user or Amazon Web Services account.

If applicationName is specified, then deploymentGroupName must be specified. If it is not specified, then deploymentGroupName must not be specified.

createTimeRange
TimeRange | undefined

A time range (start and end) for returning a subset of the list of deployments.

deploymentGroupName
string | undefined

The name of a deployment group for the specified application.

If deploymentGroupName is specified, then applicationName must be specified. If it is not specified, then applicationName must not be specified.

externalId
string | undefined

The unique ID of an external resource for returning deployments linked to the external resource.

includeOnlyStatuses
DeploymentStatus[] | undefined

A subset of deployments to list by status:

  • Created: Include created deployments in the resulting list.

  • Queued: Include queued deployments in the resulting list.

  • In Progress: Include in-progress deployments in the resulting list.

  • Succeeded: Include successful deployments in the resulting list.

  • Failed: Include failed deployments in the resulting list.

  • Stopped: Include stopped deployments in the resulting list.

nextToken
string | undefined

An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.

ListDeploymentsCommand Output

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

A list of deployment 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 deployments call to return the next set of deployments in the list.

Throws

Name
Fault
Details
ApplicationDoesNotExistException
client

The application does not exist with the user or Amazon Web Services account.

ApplicationNameRequiredException
client

The minimum number of required application names was not specified.

DeploymentGroupDoesNotExistException
client

The named deployment group with the user or Amazon Web Services account does not exist.

DeploymentGroupNameRequiredException
client

The deployment group name was not specified.

InvalidApplicationNameException
client

The application name was specified in an invalid format.

InvalidDeploymentGroupNameException
client

The deployment group name was specified in an invalid format.

InvalidDeploymentStatusException
client

The specified deployment status doesn't exist or cannot be determined.

InvalidExternalIdException
client

The external ID was specified in an invalid format.

InvalidInputException
client

The input was specified in an invalid format.

InvalidNextTokenException
client

The next token was specified in an invalid format.

InvalidTimeRangeException
client

The specified time range was specified in an invalid format.

CodeDeployServiceException
Base exception class for all service exceptions from CodeDeploy service.