> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Alerts

> SDK methods to query and manage alerts for applications and clusters in TrueFoundry.

## Methods

<Accordion title="list">
  Get alerts for a given application or cluster filtered by start and end timestamp

  #### Parameters

  <ParamField body="start_ts" type="typing.Optional[str]">
    Start timestamp (ISO format) for querying events
  </ParamField>

  <ParamField body="end_ts" type="typing.Optional[str]">
    End timestamp (ISO format) for querying events
  </ParamField>

  <ParamField body="cluster_id" type="typing.Optional[str]">
    Cluster id
  </ParamField>

  <ParamField body="application_id" type="typing.Optional[str]">
    Application id
  </ParamField>

  <ParamField body="alert_status" type="typing.Optional[AlertStatus]">
    [🔗 AlertStatus](/docs/truefoundry_sdk/enums#alertstatus)

    Alert status
  </ParamField>

  #### Returns

  <ResponseField name="GetAlertsResponse" type="GetAlertsResponse">
    [🔗 GetAlertsResponse](/docs/truefoundry_sdk/types#getalertsresponse)

    Returns an object with alert name as key and list of alerts as value
  </ResponseField>

  #### Usage

  ```python lines theme={"dark"}
  from truefoundry import TrueFoundry

  client = TrueFoundry(
      api_key="YOUR_API_KEY",
      base_url="https://yourhost.com/path/to/api",
  )

  client.alerts.list(
      start_ts="value",
      end_ts="value",
      cluster_id="cluster_id_value",
      application_id="application_id_value",
      alert_status="value",
  )

  # Iterate through results
  for item in response:
      print(item.name)

  # Or paginate page by page
  for page in response.iter_pages():
      for item in page:
          print(item.name)
  ```
</Accordion>
