Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Returns a list of the notification rule targets for an Amazon Web Services account.

Example

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

import { CodestarNotificationsClient, ListTargetsCommand } from "@aws-sdk/client-codestar-notifications"; // ES Modules import
// const { CodestarNotificationsClient, ListTargetsCommand } = require("@aws-sdk/client-codestar-notifications"); // CommonJS import
const client = new CodestarNotificationsClient(config);
const input = { // ListTargetsRequest
Filters: [ // ListTargetsFilters
{ // ListTargetsFilter
Name: "TARGET_TYPE" || "TARGET_ADDRESS" || "TARGET_STATUS", // required
Value: "STRING_VALUE", // required
},
],
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListTargetsCommand(input);
const response = await client.send(command);
// { // ListTargetsResult
// Targets: [ // TargetsBatch
// { // TargetSummary
// TargetAddress: "STRING_VALUE",
// TargetType: "STRING_VALUE",
// TargetStatus: "PENDING" || "ACTIVE" || "UNREACHABLE" || "INACTIVE" || "DEACTIVATED",
// },
// ],
// NextToken: "STRING_VALUE",
// };

Param

ListTargetsCommandInput

Returns

ListTargetsCommandOutput

See

Throws

InvalidNextTokenException (client fault)

The value for the enumeration token used in the request to return the next batch of the results is not valid.

Throws

ValidationException (client fault)

One or more parameter values are not valid.

Throws

CodestarNotificationsServiceException

Base exception class for all service exceptions from CodestarNotifications service.

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<ListTargetsCommandInput, ListTargetsCommandOutput>

Methods