Skip to content

stop_experiment_run

stop_experiment_run(
    application_identifier: Identifier,
    experiment_definition_identifier: Identifier,
    run: PositiveInteger,
    *,
    config_overrides: Optional[AppConfigClientConfig] = None,
    result: Optional[ExperimentRunResult] = None,
    deployment_parameters: Optional[DeploymentParameters] = None,
) -> ExperimentRun

Stops a running experiment. Stopping an experiment run ends audience exposure and returns users to the currently deployed feature flag configuration.

Parameters:

  • application_identifier (Identifier) –

    The application ID or name.

  • experiment_definition_identifier (Identifier) –

    The experiment definition ID or name.

  • run (PositiveInteger) –

    The run number to stop.

  • result (Optional[ExperimentRunResult], default: None ) –

    The result of the experiment run, including an executive summary and reasons for or against launching.

  • deployment_parameters (Optional[DeploymentParameters], default: None ) –

    The deployment parameters for the stop operation.

Raises:

Examples:

To stop an experiment run The following StopExperimentRun example stops a running experiment and records the result.

>>> client.stop_experiment_run(application_identifier='339ohji', experiment_definition_identifier='bsxyd7k', run=1, result={'ExecutiveSummary': 't1 wins with 16% lift in conversion', 'ReasonsToLaunch': 'Significant improvement in key metric'})
Source code in docs_src/capo_appconfig/_services/app_config.py
def stop_experiment_run(
    self,
    application_identifier: "capo_appconfig.types.identifier.Identifier",
    experiment_definition_identifier: "capo_appconfig.types.identifier.Identifier",
    run: "capo_appconfig.types.positive_integer.PositiveInteger",
    *,
    config_overrides: Optional[AppConfigClientConfig] = None,
    result: Optional[
        "capo_appconfig.types.experiment_run_result.ExperimentRunResult"
    ] = None,
    deployment_parameters: Optional[
        "capo_appconfig.types.deployment_parameters.DeploymentParameters"
    ] = None,
) -> "capo_appconfig.types.experiment_run.ExperimentRun":
    """<p>Stops a running experiment. Stopping an experiment run ends audience exposure and returns users to the currently deployed feature flag configuration.</p>

    Args:
        application_identifier: <p>The application ID or name.</p>
        experiment_definition_identifier: <p>The experiment definition ID or name.</p>
        run: <p>The run number to stop.</p>
        result: <p>The result of the experiment run, including an executive summary and reasons for or against launching.</p>
        deployment_parameters: <p>The deployment parameters for the stop operation.</p>

    Raises:
        capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_appconfig.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
        capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
        capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To stop an experiment run
        The following StopExperimentRun example stops a running experiment and records the result.

        >>> client.stop_experiment_run(application_identifier='339ohji', experiment_definition_identifier='bsxyd7k', run=1, result={'ExecutiveSummary': 't1 wins with 16% lift in conversion', 'ReasonsToLaunch': 'Significant improvement in key metric'})
    """

    def _handler(
        req: "OperationRequest[capo_appconfig.types.stop_experiment_run_request.StopExperimentRunRequest]",
    ) -> OperationResponse["capo_appconfig.types.experiment_run.ExperimentRun"]:
        import capo_appconfig._operations.amazon_app_config.stop_experiment_run

        output, http_response = (
            capo_appconfig._operations.amazon_app_config.stop_experiment_run.stop_experiment_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appconfig.types.stop_experiment_run_request.StopExperimentRunRequest",
    ) -> dict[str, Any]:
        import capo_appconfig.types.stop_experiment_run_request

        return capo_appconfig.types.stop_experiment_run_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StopExperimentRun", redact_input=_redact_input),
    )
    input_: capo_appconfig.types.stop_experiment_run_request.StopExperimentRunRequest = {
        "application_identifier": application_identifier,
        "experiment_definition_identifier": experiment_definition_identifier,
        "run": run,
    }
    if result is not None:
        input_["result"] = result
    if deployment_parameters is not None:
        input_["deployment_parameters"] = deployment_parameters

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