- 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.
ListTrafficPolicyInstancesByHostedZoneCommand
Gets information about the traffic policy instances that you created in a specified hosted zone.
After you submit a CreateTrafficPolicyInstance
or an UpdateTrafficPolicyInstance
request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State
response element.
Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the MaxItems
parameter to list them in groups of up to 100.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { Route53Client, ListTrafficPolicyInstancesByHostedZoneCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, ListTrafficPolicyInstancesByHostedZoneCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // ListTrafficPolicyInstancesByHostedZoneRequest
HostedZoneId: "STRING_VALUE", // required
TrafficPolicyInstanceNameMarker: "STRING_VALUE",
TrafficPolicyInstanceTypeMarker: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS",
MaxItems: Number("int"),
};
const command = new ListTrafficPolicyInstancesByHostedZoneCommand(input);
const response = await client.send(command);
// { // ListTrafficPolicyInstancesByHostedZoneResponse
// TrafficPolicyInstances: [ // TrafficPolicyInstances // required
// { // TrafficPolicyInstance
// Id: "STRING_VALUE", // required
// HostedZoneId: "STRING_VALUE", // required
// Name: "STRING_VALUE", // required
// TTL: Number("long"), // required
// State: "STRING_VALUE", // required
// Message: "STRING_VALUE", // required
// TrafficPolicyId: "STRING_VALUE", // required
// TrafficPolicyVersion: Number("int"), // required
// TrafficPolicyType: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS", // required
// },
// ],
// TrafficPolicyInstanceNameMarker: "STRING_VALUE",
// TrafficPolicyInstanceTypeMarker: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS",
// IsTruncated: true || false, // required
// MaxItems: Number("int"), // required
// };
ListTrafficPolicyInstancesByHostedZoneCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
HostedZoneId Required | string | undefined | The ID of the hosted zone that you want to list traffic policy instances for. |
MaxItems | number | undefined | The maximum number of traffic policy instances to be included in the response body for this request. If you have more than |
TrafficPolicyInstanceNameMarker | string | undefined | If the value of If the value of |
TrafficPolicyInstanceTypeMarker | RRType | undefined | If the value of If the value of |
ListTrafficPolicyInstancesByHostedZoneCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
IsTruncated Required | boolean | undefined | A flag that indicates whether there are more traffic policy instances to be listed. If the response was truncated, you can get the next group of traffic policy instances by submitting another |
MaxItems Required | number | undefined | The value that you specified for the |
TrafficPolicyInstances Required | TrafficPolicyInstance[] | undefined | A list that contains one |
TrafficPolicyInstanceNameMarker | string | undefined | If |
TrafficPolicyInstanceTypeMarker | RRType | undefined | If |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInput | client | The input is not valid. |
NoSuchHostedZone | client | No hosted zone exists with the ID that you specified. |
NoSuchTrafficPolicyInstance | client | No traffic policy instance exists with the specified ID. |
Route53ServiceException | Base exception class for all service exceptions from Route53 service. |