Step-by-step procedure

  1. Authenticate to the cloud platform via the Python shell.

    The following variables should be available now:

    >>> base_url  # the base URL
    >>> auth  # the 'Authorization' header value with the access token
    {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImMwMD...'}
  2. Define a variable named params, and then assign an object with the id parameter to dismiss one or more alerts by IDs to this variable:

    >>> params = {
    ...     # ID of the alert(s) to remove
    ...     "id": "54f3318a-6e72-49d7-b94f-b9909df96d16"
    ... }
  3. Send a DELETE request to the /api/alert_manager/v1/alerts endpoint:

    >>> response = requests.delete(f'{base_url}/api/alert_manager/v1/alerts', headers=auth, params=params)
  4. Check the status code of the response:

    >>> response.status_code

    Status code 204 means that the alerts were dismissed successfully.