ListTrafficPoliciesCommand

Gets information about the latest version for every traffic policy that is associated with the current Amazon Web Services account. Policies are listed in the order that they were created in.

For information about how of deleting a traffic policy affects the response from ListTrafficPolicies, see DeleteTrafficPolicy .

Example Syntax

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

import { Route53Client, ListTrafficPoliciesCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, ListTrafficPoliciesCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // ListTrafficPoliciesRequest
  TrafficPolicyIdMarker: "STRING_VALUE",
  MaxItems: Number("int"),
};
const command = new ListTrafficPoliciesCommand(input);
const response = await client.send(command);
// { // ListTrafficPoliciesResponse
//   TrafficPolicySummaries: [ // TrafficPolicySummaries // required
//     { // TrafficPolicySummary
//       Id: "STRING_VALUE", // required
//       Name: "STRING_VALUE", // required
//       Type: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS", // required
//       LatestVersion: Number("int"), // required
//       TrafficPolicyCount: Number("int"), // required
//     },
//   ],
//   IsTruncated: true || false, // required
//   TrafficPolicyIdMarker: "STRING_VALUE", // required
//   MaxItems: Number("int"), // required
// };

ListTrafficPoliciesCommand Input

See ListTrafficPoliciesCommandInput for more details

Parameter
Type
Description
MaxItems
number | undefined

(Optional) The maximum number of traffic policies that you want Amazon Route 53 to return in response to this request. If you have more than MaxItems traffic policies, the value of IsTruncated in the response is true, and the value of TrafficPolicyIdMarker is the ID of the first traffic policy that Route 53 will return if you submit another request.

TrafficPolicyIdMarker
string | undefined

(Conditional) For your first request to ListTrafficPolicies, don't include the TrafficPolicyIdMarker parameter.

If you have more traffic policies than the value of MaxItems, ListTrafficPolicies returns only the first MaxItems traffic policies. To get the next group of policies, submit another request to ListTrafficPolicies. For the value of TrafficPolicyIdMarker, specify the value of TrafficPolicyIdMarker that was returned in the previous response.

ListTrafficPoliciesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
IsTruncated
Required
boolean | undefined

A flag that indicates whether there are more traffic policies to be listed. If the response was truncated, you can get the next group of traffic policies by submitting another ListTrafficPolicies request and specifying the value of TrafficPolicyIdMarker in the TrafficPolicyIdMarker request parameter.

MaxItems
Required
number | undefined

The value that you specified for the MaxItems parameter in the ListTrafficPolicies request that produced the current response.

TrafficPolicyIdMarker
Required
string | undefined

If the value of IsTruncated is true, TrafficPolicyIdMarker is the ID of the first traffic policy in the next group of MaxItems traffic policies.

TrafficPolicySummaries
Required
TrafficPolicySummary[] | undefined

A list that contains one TrafficPolicySummary element for each traffic policy that was created by the current Amazon Web Services account.

Throws

Name
Fault
Details
InvalidInput
client

The input is not valid.

Route53ServiceException
Base exception class for all service exceptions from Route53 service.