Skip to content

get_curation_policy async

get_curation_policy(
    curation_policy_id: CurationPolicyId,
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    version: Optional[CurationPolicyVersion] = None,
) -> GetCurationPolicyResponse

Returns a curation policy's configuration, status, and policy document.

Parameters:

  • curation_policy_id (CurationPolicyId) –

    The ID of the curation policy to return.

  • version (Optional[CurationPolicyVersion], default: None ) –

    The version to return: DRAFT for the working copy, or a published version number. If you omit it, AWS Context returns the working copy.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Get a published version of a curation policy The following example returns version 1 of a curation policy, including the Cedar policy document that the associated agent contexts enforce.

>>> await client.get_curation_policy(curation_policy_id='pol-3e7a9c1b5d2f4a6e8b0c2d4f6a8b1c3e', version='1')
Source code in docs_src/capo_context/_services/async_context.py
async def get_curation_policy(
    self,
    curation_policy_id: "capo_context.types.curation_policy_id.CurationPolicyId",
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    version: Optional[
        "capo_context.types.curation_policy_version.CurationPolicyVersion"
    ] = None,
) -> "capo_context.types.get_curation_policy_response.GetCurationPolicyResponse":
    """<p>Returns a curation policy's configuration, status, and policy document.</p>

    Args:
        curation_policy_id: <p>The ID of the curation policy to return.</p>
        version: <p>The version to return: <code>DRAFT</code> for the working copy, or a published version number. If you omit it, AWS Context returns the working copy.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get a published version of a curation policy
        The following example returns version 1 of a curation policy, including the Cedar policy document that the associated agent contexts enforce.

        >>> await client.get_curation_policy(curation_policy_id='pol-3e7a9c1b5d2f4a6e8b0c2d4f6a8b1c3e', version='1')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_context.types.get_curation_policy_request.GetCurationPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_context.types.get_curation_policy_response.GetCurationPolicyResponse"
    ]:
        import capo_context._operations.context.get_curation_policy

        (
            output,
            http_response,
        ) = await capo_context._operations.context.get_curation_policy.async_get_curation_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCurationPolicy")
    )
    input_: capo_context.types.get_curation_policy_request.GetCurationPolicyRequest = {
        "curation_policy_id": curation_policy_id
    }
    if version is not None:
        input_["version"] = version

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