Skip to content
Get started

List all violations for an SLA

slas.list_violations(strsla_urn, SlaListViolationsParams**kwargs) -> SlaListViolationsResponse
GET/v1/slas/{sla_urn}/violations

List all violations for an SLA

ParametersExpand Collapse
sla_urn: str
data_source_urn: Optional[str]

An SLA data source's unique identifier

timeframe_end: Optional[str]

Year and month landing within the last SLA evaluation period to include in the result, in the format YYYY-MM

timeframe_start: Optional[str]

Year and month landing within the first SLA evaluation period to include in the result, in the format YYYY-MM

ReturnsExpand Collapse
List[SlaListViolationsResponseItem]
allowable_downtime_hours: float

The total number of allowable downtime hours during the evaluation period, as defined by the SLA's terms

data_source_type: Literal["STATUS_PAGE", "MONITOR"]

The type of data source used to determine the violation.

Accepts one of the following:
"STATUS_PAGE"
"MONITOR"
downtime_hours: float

The total number of downtime hours during the evaluation period

evaluation_period: SlaListViolationsResponseItemEvaluationPeriod

The evaluation period during which the SLA violation occurred. The length of the period is determined by the SLA's configured evaluation window (for example: monthly or quarterly).

end_month: SlaListViolationsResponseItemEvaluationPeriodEndMonth

The month in which the SLA violation ended. Null if the violation is ongoing.

month: int

The month number (1-12)

year: int

The year of the month

start_month: SlaListViolationsResponseItemEvaluationPeriodStartMonth

The month in which the SLA violation started

month: int

The month number (1-12)

year: int

The year of the month

uptime_percentage: float

The percentage of uptime during the evaluation period

urn: str

A unique identifier composed of the SLA URN and the evaluation period

List all violations for an SLA

import os
from clarative import Clarative

client = Clarative(
    api_key=os.environ.get("CLARATIVE_API_KEY"),  # This is the default and can be omitted
)
response = client.slas.list_violations(
    sla_urn="sla_urn",
)
print(response)
[
  {
    "allowable_downtime_hours": 0,
    "data_source_type": "STATUS_PAGE",
    "downtime_hours": 0,
    "evaluation_period": {
      "end_month": {
        "month": 0,
        "year": 0
      },
      "start_month": {
        "month": 0,
        "year": 0
      }
    },
    "uptime_percentage": 0,
    "urn": "urn"
  }
]
Returns Examples
[
  {
    "allowable_downtime_hours": 0,
    "data_source_type": "STATUS_PAGE",
    "downtime_hours": 0,
    "evaluation_period": {
      "end_month": {
        "month": 0,
        "year": 0
      },
      "start_month": {
        "month": 0,
        "year": 0
      }
    },
    "uptime_percentage": 0,
    "urn": "urn"
  }
]