Skip to content

list_traffic_policy_versions async

list_traffic_policy_versions(
    id: TrafficPolicyId,
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    traffic_policy_version_marker: Optional[TrafficPolicyVersionMarker] = None,
    max_items: Optional[int] = None,
) -> ListTrafficPolicyVersionsResponse

Gets information about all of the versions for a specified traffic policy.

Traffic policy versions are listed in numerical order by VersionNumber.

Parameters:

  • id (TrafficPolicyId) –

    Specify the value of Id of the traffic policy for which you want to list all versions.

  • traffic_policy_version_marker (Optional[TrafficPolicyVersionMarker], default: None ) –

    For your first request to ListTrafficPolicyVersions, don't include the TrafficPolicyVersionMarker parameter.

    If you have more traffic policy versions than the value of MaxItems, ListTrafficPolicyVersions returns only the first group of MaxItems versions. To get more traffic policy versions, submit another ListTrafficPolicyVersions request. For the value of TrafficPolicyVersionMarker, specify the value of TrafficPolicyVersionMarker in the previous response.

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

    The maximum number of traffic policy versions that you want Amazon Route 53 to include in the response body for this request. If the specified traffic policy has more than MaxItems versions, the value of IsTruncated in the response is true, and the value of the TrafficPolicyVersionMarker element is the ID of the first version that Route 53 will return if you submit another request.

Raises:

Source code in docs_src/capo_route_53/_services/async_route53.py
async def list_traffic_policy_versions(
    self,
    id: "capo_route_53.types.traffic_policy_id.TrafficPolicyId",
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    traffic_policy_version_marker: Optional[
        "capo_route_53.types.traffic_policy_version_marker.TrafficPolicyVersionMarker"
    ] = None,
    max_items: Optional[int] = None,
) -> "capo_route_53.types.list_traffic_policy_versions_response.ListTrafficPolicyVersionsResponse":
    """<p>Gets information about all of the versions for a specified traffic policy.</p> <p>Traffic policy versions are listed in numerical order by <code>VersionNumber</code>.</p>

    Args:
        id: <p>Specify the value of <code>Id</code> of the traffic policy for which you want to list all versions.</p>
        traffic_policy_version_marker: <p>For your first request to <code>ListTrafficPolicyVersions</code>, don't include the <code>TrafficPolicyVersionMarker</code> parameter.</p> <p>If you have more traffic policy versions than the value of <code>MaxItems</code>, <code>ListTrafficPolicyVersions</code> returns only the first group of <code>MaxItems</code> versions. To get more traffic policy versions, submit another <code>ListTrafficPolicyVersions</code> request. For the value of <code>TrafficPolicyVersionMarker</code>, specify the value of <code>TrafficPolicyVersionMarker</code> in the previous response.</p>
        max_items: <p>The maximum number of traffic policy versions that you want Amazon Route 53 to include in the response body for this request. If the specified traffic policy has more than <code>MaxItems</code> versions, the value of <code>IsTruncated</code> in the response is <code>true</code>, and the value of the <code>TrafficPolicyVersionMarker</code> element is the ID of the first version that 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_traffic_policy.NoSuchTrafficPolicy: <p>No traffic policy exists with the specified ID.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route_53.types.list_traffic_policy_versions_request.ListTrafficPolicyVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_route_53.types.list_traffic_policy_versions_response.ListTrafficPolicyVersionsResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.list_traffic_policy_versions

        (
            output,
            http_response,
        ) = await capo_route_53._operations.aws_dns_v20130401.list_traffic_policy_versions.async_list_traffic_policy_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTrafficPolicyVersions")
    )
    input_: capo_route_53.types.list_traffic_policy_versions_request.ListTrafficPolicyVersionsRequest = {
        "id": id
    }
    if traffic_policy_version_marker is not None:
        input_["traffic_policy_version_marker"] = traffic_policy_version_marker
    if max_items is not None:
        input_["max_items"] = max_items

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output