Skip to content

stop_assessment_run

stop_assessment_run(
    assessment_run_arn: Arn,
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    stop_action: Optional[StopAction] = None,
) -> None

Stops the assessment run that is specified by the ARN of the assessment run.

Parameters:

  • assessment_run_arn (Arn) –

    The ARN of the assessment run that you want to stop.

  • stop_action (Optional[StopAction], default: None ) –

    An input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent from collecting data and begins the results evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.

Raises:

Examples:

Stop assessment run Stops the assessment run that is specified by the ARN of the assessment run.

>>> client.stop_assessment_run(assessment_run_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe')
Source code in docs_src/capo_inspector/_services/inspector.py
def stop_assessment_run(
    self,
    assessment_run_arn: "capo_inspector.types.arn.Arn",
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    stop_action: Optional["capo_inspector.types.stop_action.StopAction"] = None,
) -> None:
    """<p>Stops the assessment run that is specified by the ARN of the assessment run.</p>

    Args:
        assessment_run_arn: <p>The ARN of the assessment run that you want to stop.</p>
        stop_action: <p>An input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent from collecting data and begins the results evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.service_temporarily_unavailable_exception.ServiceTemporarilyUnavailableException: <p>The serice is temporary unavailable.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Stop assessment run
        Stops the assessment run that is specified by the ARN of the assessment run.

        >>> client.stop_assessment_run(assessment_run_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe')
    """

    def _handler(
        req: "OperationRequest[capo_inspector.types.stop_assessment_run_request.StopAssessmentRunRequest]",
    ) -> OperationResponse[None]:
        import capo_inspector._operations.inspector_service.stop_assessment_run

        output, http_response = (
            capo_inspector._operations.inspector_service.stop_assessment_run.stop_assessment_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopAssessmentRun")
    )
    input_: capo_inspector.types.stop_assessment_run_request.StopAssessmentRunRequest = {
        "assessment_run_arn": assessment_run_arn
    }
    if stop_action is not None:
        input_["stop_action"] = stop_action

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