Skip to content

update_problem async

update_problem(
    problem_id: ProblemId,
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
    update_status: Optional[UpdateStatus] = None,
    visibility: Optional[Visibility] = None,
) -> UpdateProblemResponse

Updates the visibility of the problem or specifies the problem as RESOLVED.

Parameters:

  • problem_id (ProblemId) –

    The ID of the problem.

  • update_status (Optional[UpdateStatus], default: None ) –

    The status of the problem. Arguments can be passed for only problems that show a status of RECOVERING.

  • visibility (Optional[Visibility], default: None ) –

    The visibility of a problem. When you pass a value of IGNORED, the problem is removed from the default view, and all notifications for the problem are suspended. When VISIBLE is passed, the IGNORED action is reversed.

Raises:

Source code in docs_src/capo_application_insights/_services/async_application_insights.py
async def update_problem(
    self,
    problem_id: "capo_application_insights.types.problem_id.ProblemId",
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
    update_status: Optional[
        "capo_application_insights.types.update_status.UpdateStatus"
    ] = None,
    visibility: Optional[
        "capo_application_insights.types.visibility.Visibility"
    ] = None,
) -> (
    "capo_application_insights.types.update_problem_response.UpdateProblemResponse"
):
    """<p>Updates the visibility of the problem or specifies the problem as <code>RESOLVED</code>.</p>

    Args:
        problem_id: <p>The ID of the problem.</p>
        update_status: <p>The status of the problem. Arguments can be passed for only problems that show a status of <code>RECOVERING</code>.</p>
        visibility: <p>The visibility of a problem. When you pass a value of <code>IGNORED</code>, the problem is removed from the default view, and all notifications for the problem are suspended. When <code>VISIBLE</code> is passed, the <code>IGNORED</code> action is reversed.</p>

    Raises:
        capo_application_insights.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_application_insights.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist in the customer account.</p>
        capo_application_insights.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_application_insights.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_insights.types.update_problem_request.UpdateProblemRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_insights.types.update_problem_response.UpdateProblemResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.update_problem

        (
            output,
            http_response,
        ) = await capo_application_insights._operations.ec2_windows_barley_service.update_problem.async_update_problem(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateProblem")
    )
    input_: capo_application_insights.types.update_problem_request.UpdateProblemRequest = {
        "problem_id": problem_id
    }
    if update_status is not None:
        input_["update_status"] = update_status
    if visibility is not None:
        input_["visibility"] = visibility

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