Skip to content

update_service_level_objective async

update_service_level_objective(
    id: ServiceLevelObjectiveId,
    *,
    config_overrides: Optional[AsyncApplicationSignalsClientConfig] = None,
    description: Optional[ServiceLevelObjectiveDescription] = None,
    sli_config: Optional[ServiceLevelIndicatorConfig] = None,
    request_based_sli_config: Optional[RequestBasedServiceLevelIndicatorConfig] = None,
    goal: Optional[Goal] = None,
    burn_rate_configurations: Optional[BurnRateConfigurations] = None,
    auto_investigation_enabled: Optional[bool] = None,
) -> UpdateServiceLevelObjectiveOutput

Updates an existing service level objective (SLO). If you omit parameters, the previous values of those parameters are retained.

You cannot change from a period-based SLO to a request-based SLO, or change from a request-based SLO to a period-based SLO.

Parameters:

  • id (ServiceLevelObjectiveId) –

    The Amazon Resource Name (ARN) or name of the service level objective that you want to update.

  • description (Optional[ServiceLevelObjectiveDescription], default: None ) –

    An optional description for the SLO.

  • sli_config (Optional[ServiceLevelIndicatorConfig], default: None ) –

    If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.

  • request_based_sli_config (Optional[RequestBasedServiceLevelIndicatorConfig], default: None ) –

    If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.

    You can't specify both SliConfig and RequestBasedSliConfig in the same operation.

  • goal (Optional[Goal], default: None ) –

    A structure that contains the attributes that determine the goal of the SLO. This includes the time period for evaluation and the attainment threshold.

  • burn_rate_configurations (Optional[BurnRateConfigurations], default: None ) –

    Use this array to create burn rates for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.

  • auto_investigation_enabled (Optional[bool], default: None ) –

    Indicates whether DevOps Agent will automatically investigate this SLO when it is breached

Raises:

Source code in docs_src/capo_application_signals/_services/async_application_signals.py
async def update_service_level_objective(
    self,
    id: "capo_application_signals.types.service_level_objective_id.ServiceLevelObjectiveId",
    *,
    config_overrides: Optional[AsyncApplicationSignalsClientConfig] = None,
    description: Optional[
        "capo_application_signals.types.service_level_objective_description.ServiceLevelObjectiveDescription"
    ] = None,
    sli_config: Optional[
        "capo_application_signals.types.service_level_indicator_config.ServiceLevelIndicatorConfig"
    ] = None,
    request_based_sli_config: Optional[
        "capo_application_signals.types.request_based_service_level_indicator_config.RequestBasedServiceLevelIndicatorConfig"
    ] = None,
    goal: Optional["capo_application_signals.types.goal.Goal"] = None,
    burn_rate_configurations: Optional[
        "capo_application_signals.types.burn_rate_configurations.BurnRateConfigurations"
    ] = None,
    auto_investigation_enabled: Optional[bool] = None,
) -> "capo_application_signals.types.update_service_level_objective_output.UpdateServiceLevelObjectiveOutput":
    """<p>Updates an existing service level objective (SLO). If you omit parameters, the previous values of those parameters are retained. </p> <p>You cannot change from a period-based SLO to a request-based SLO, or change from a request-based SLO to a period-based SLO.</p>

    Args:
        id: <p>The Amazon Resource Name (ARN) or name of the service level objective that you want to update.</p>
        description: <p>An optional description for the SLO.</p>
        sli_config: <p>If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
        request_based_sli_config: <p>If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p> <p>You can't specify both <code>SliConfig</code> and <code>RequestBasedSliConfig</code> in the same operation.</p>
        goal: <p>A structure that contains the attributes that determine the goal of the SLO. This includes the time period for evaluation and the attainment threshold.</p>
        burn_rate_configurations: <p>Use this array to create <i>burn rates</i> for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.</p>
        auto_investigation_enabled: Indicates whether DevOps Agent will automatically investigate this SLO when it is breached

    Raises:
        capo_application_signals.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_application_signals.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_application_signals.errors.validation_exception.ValidationException: <p>The resource is not valid.</p>
        capo_application_signals.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_signals.types.update_service_level_objective_input.UpdateServiceLevelObjectiveInput]",
    ) -> AsyncOperationResponse[
        "capo_application_signals.types.update_service_level_objective_output.UpdateServiceLevelObjectiveOutput"
    ]:
        import capo_application_signals._operations.application_signals.update_service_level_objective

        (
            output,
            http_response,
        ) = await capo_application_signals._operations.application_signals.update_service_level_objective.async_update_service_level_objective(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateServiceLevelObjective")
    )
    input_: capo_application_signals.types.update_service_level_objective_input.UpdateServiceLevelObjectiveInput = {
        "id": id
    }
    if description is not None:
        input_["description"] = description
    if sli_config is not None:
        input_["sli_config"] = sli_config
    if request_based_sli_config is not None:
        input_["request_based_sli_config"] = request_based_sli_config
    if goal is not None:
        input_["goal"] = goal
    if burn_rate_configurations is not None:
        input_["burn_rate_configurations"] = burn_rate_configurations
    if auto_investigation_enabled is not None:
        input_["auto_investigation_enabled"] = auto_investigation_enabled

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