Skip to content

list_traffic_policy_instances_by_hosted_zone

list_traffic_policy_instances_by_hosted_zone(
    hosted_zone_id: ResourceId,
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
    traffic_policy_instance_name_marker: Optional[DNSName] = None,
    traffic_policy_instance_type_marker: Optional[RRType] = None,
    max_items: Optional[int] = None,
) -> ListTrafficPolicyInstancesByHostedZoneResponse

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.

Parameters:

  • hosted_zone_id (ResourceId) –

    The ID of the hosted zone that you want to list traffic policy instances for.

  • traffic_policy_instance_name_marker (Optional[DNSName], default: None ) –

    If the value of IsTruncated in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename, specify the value of TrafficPolicyInstanceNameMarker from the previous response, which is the name of the first traffic policy instance in the next group of traffic policy instances.

    If the value of IsTruncated in the previous response was false, there are no more traffic policy instances to get.

  • traffic_policy_instance_type_marker (Optional[RRType], default: None ) –

    If the value of IsTruncated in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype, specify the value of TrafficPolicyInstanceTypeMarker from the previous response, which is the type of the first traffic policy instance in the next group of traffic policy instances.

    If the value of IsTruncated in the previous response was false, there are no more traffic policy instances to get.

  • max_items (Optional[int], default: None ) –

    The maximum number of traffic policy instances to be included in the response body for this request. If you have more than MaxItems traffic policy instances, the value of the IsTruncated element in the response is true, and the values of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker represent the first traffic policy instance that Amazon Route 53 will return if you submit another request.

Raises:

Source code in docs_src/capo_route_53/_services/route53.py
def list_traffic_policy_instances_by_hosted_zone(
    self,
    hosted_zone_id: "capo_route_53.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
    traffic_policy_instance_name_marker: Optional[
        "capo_route_53.types.dns_name.DNSName"
    ] = None,
    traffic_policy_instance_type_marker: Optional[
        "capo_route_53.types.rr_type.RRType"
    ] = None,
    max_items: Optional[int] = None,
) -> "capo_route_53.types.list_traffic_policy_instances_by_hosted_zone_response.ListTrafficPolicyInstancesByHostedZoneResponse":
    """<p>Gets information about the traffic policy instances that you created in a specified hosted zone.</p> <note> <p>After you submit a <code>CreateTrafficPolicyInstance</code> or an <code>UpdateTrafficPolicyInstance</code> 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 <code>State</code> response element.</p> </note> <p>Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the <code>MaxItems</code> parameter to list them in groups of up to 100.</p>

    Args:
        hosted_zone_id: <p>The ID of the hosted zone that you want to list traffic policy instances for.</p>
        traffic_policy_instance_name_marker: <p>If the value of <code>IsTruncated</code> in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another <code>ListTrafficPolicyInstances</code> request. For the value of <code>trafficpolicyinstancename</code>, specify the value of <code>TrafficPolicyInstanceNameMarker</code> from the previous response, which is the name of the first traffic policy instance in the next group of traffic policy instances.</p> <p>If the value of <code>IsTruncated</code> in the previous response was <code>false</code>, there are no more traffic policy instances to get.</p>
        traffic_policy_instance_type_marker: <p>If the value of <code>IsTruncated</code> in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another <code>ListTrafficPolicyInstances</code> request. For the value of <code>trafficpolicyinstancetype</code>, specify the value of <code>TrafficPolicyInstanceTypeMarker</code> from the previous response, which is the type of the first traffic policy instance in the next group of traffic policy instances.</p> <p>If the value of <code>IsTruncated</code> in the previous response was <code>false</code>, there are no more traffic policy instances to get.</p>
        max_items: <p>The maximum number of traffic policy instances to be included in the response body for this request. If you have more than <code>MaxItems</code> traffic policy instances, the value of the <code>IsTruncated</code> element in the response is <code>true</code>, and the values of <code>HostedZoneIdMarker</code>, <code>TrafficPolicyInstanceNameMarker</code>, and <code>TrafficPolicyInstanceTypeMarker</code> represent the first traffic policy instance that Amazon Route 53 will return if you submit another request.</p>

    Raises:
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.no_such_hosted_zone.NoSuchHostedZone: <p>No hosted zone exists with the ID that you specified.</p>
        capo_route_53.errors.no_such_traffic_policy_instance.NoSuchTrafficPolicyInstance: <p>No traffic policy instance exists with the specified ID.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route_53.types.list_traffic_policy_instances_by_hosted_zone_request.ListTrafficPolicyInstancesByHostedZoneRequest]",
    ) -> OperationResponse[
        "capo_route_53.types.list_traffic_policy_instances_by_hosted_zone_response.ListTrafficPolicyInstancesByHostedZoneResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.list_traffic_policy_instances_by_hosted_zone

        output, http_response = (
            capo_route_53._operations.aws_dns_v20130401.list_traffic_policy_instances_by_hosted_zone.list_traffic_policy_instances_by_hosted_zone(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTrafficPolicyInstancesByHostedZone")
    )
    input_: capo_route_53.types.list_traffic_policy_instances_by_hosted_zone_request.ListTrafficPolicyInstancesByHostedZoneRequest = {
        "hosted_zone_id": hosted_zone_id
    }
    if traffic_policy_instance_name_marker is not None:
        input_["traffic_policy_instance_name_marker"] = (
            traffic_policy_instance_name_marker
        )
    if traffic_policy_instance_type_marker is not None:
        input_["traffic_policy_instance_type_marker"] = (
            traffic_policy_instance_type_marker
        )
    if max_items is not None:
        input_["max_items"] = max_items

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output