PgBeam Docs
Anomalies

ListAnomalyAlerts

List anomaly alerts

Lists anomaly alerts for the project, newest first, optionally filtered by status.

Usage

result, err := client.Anomalies.ListAnomalyAlerts(ctx, "prj_xxx", nil)

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
params*pgbeam.ListAnomalyAlertsParamsNoQuery parameters
params.StatusstringNoFilter to a single status.
params.PageSizeintNoMaximum number of items to return (1-100, default 20).
params.PageTokenstringNoOpaque token for cursor-based pagination.

Response

(*pgbeam.ListAnomalyAlertsResponse, error) — page of anomaly alerts.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Anomalies.ListAnomalyAlerts(ctx, "prj_xxx", &pgbeam.ListAnomalyAlertsParams{
    Status: "open",
    PageSize: 20,
    PageToken: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page