Skip to content

get_assessment async

get_assessment(
    environment_arn: EnvironmentArn,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    control_id: ControlID,
    project: ProjectName,
    assessment_id: AssessmentId,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> GetAssessmentOutput

Retrieves a single assessment.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

  • framework (FrameworkName) –

    The name of the compliance framework.

  • framework_version (FrameworkVersion) –

    The version of the compliance framework.

  • control_id (ControlID) –

    The control identifier. Optional. If omitted, the operation applies to the full framework.

  • project (ProjectName) –

    The name of the project.

  • assessment_id (AssessmentId) –

    The identifier of the assessment.

Raises:

Examples:

Get an assessment Retrieves the current status and score of a PCI-DSS assessment in the payments-prod project.

>>> await client.get_assessment(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='AWS:PCI-DSS', framework_version='4', control_id='8.2.1', project='payments-prod', assessment_id='1773480600000')
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def get_assessment(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    framework: "capo_assurance.types.framework_name.FrameworkName",
    framework_version: "capo_assurance.types.framework_version.FrameworkVersion",
    control_id: "capo_assurance.types.control_id.ControlID",
    project: "capo_assurance.types.project_name.ProjectName",
    assessment_id: "capo_assurance.types.assessment_id.AssessmentId",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> "capo_assurance.types.get_assessment_output.GetAssessmentOutput":
    """<p>Retrieves a single assessment.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        framework: <p>The name of the compliance framework.</p>
        framework_version: <p>The version of the compliance framework.</p>
        control_id: <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
        project: <p>The name of the project.</p>
        assessment_id: <p>The identifier of the assessment.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get an assessment
        Retrieves the current status and score of a PCI-DSS assessment in the payments-prod project.

        >>> await client.get_assessment(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='AWS:PCI-DSS', framework_version='4', control_id='8.2.1', project='payments-prod', assessment_id='1773480600000')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.get_assessment_input.GetAssessmentInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.get_assessment_output.GetAssessmentOutput"
    ]:
        import capo_assurance._operations.assurance.get_assessment

        (
            output,
            http_response,
        ) = await capo_assurance._operations.assurance.get_assessment.async_get_assessment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_assurance.types.get_assessment_output.GetAssessmentOutput",
    ) -> dict[str, Any]:
        import capo_assurance.types.get_assessment_output

        return capo_assurance.types.get_assessment_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetAssessment", redact_output=_redact_output),
    )
    input_: capo_assurance.types.get_assessment_input.GetAssessmentInput = {
        "environment_arn": environment_arn,
        "framework": framework,
        "framework_version": framework_version,
        "control_id": control_id,
        "project": project,
        "assessment_id": assessment_id,
    }

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