Skip to content

get_response_headers_policy async

get_response_headers_policy(
    id: string, *, config_overrides: Optional[AsyncCloudFrontClientConfig] = None
) -> GetResponseHeadersPolicyResult

Gets a response headers policy, including metadata (the policy's identifier and the date and time when the policy was last modified).

To get a response headers policy, you must provide the policy's identifier. If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the response headers policy is not attached to a cache behavior, you can get the identifier using ListResponseHeadersPolicies.

Parameters:

  • id (string) –

    The identifier for the response headers policy.

    If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the response headers policy is not attached to a cache behavior, you can get the identifier using ListResponseHeadersPolicies.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def get_response_headers_policy(
    self,
    id: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.get_response_headers_policy_result.GetResponseHeadersPolicyResult":
    """<p>Gets a response headers policy, including metadata (the policy's identifier and the date and time when the policy was last modified).</p> <p>To get a response headers policy, you must provide the policy's identifier. If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using <code>ListDistributions</code> or <code>GetDistribution</code>. If the response headers policy is not attached to a cache behavior, you can get the identifier using <code>ListResponseHeadersPolicies</code>.</p>

    Args:
        id: <p>The identifier for the response headers policy.</p> <p>If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using <code>ListDistributions</code> or <code>GetDistribution</code>. If the response headers policy is not attached to a cache behavior, you can get the identifier using <code>ListResponseHeadersPolicies</code>.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.no_such_response_headers_policy.NoSuchResponseHeadersPolicy: <p>The response headers policy does not exist.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.get_response_headers_policy_request.GetResponseHeadersPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.get_response_headers_policy_result.GetResponseHeadersPolicyResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.get_response_headers_policy

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.get_response_headers_policy.async_get_response_headers_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetResponseHeadersPolicy")
    )
    input_: capo_cloudfront.types.get_response_headers_policy_request.GetResponseHeadersPolicyRequest = {
        "id": id
    }

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