> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/slossdk.md).

# Slos

## Overview

### Available Operations

* [list\_all](#list_all) - Get All SLOs
* [create](#create) - Create SLO
* [update](#update) - Update SLO
* [remove](#remove) - Remove SLO
* [get](#get) - Get SLO By ID
* [mark\_affected](#mark_affected) - Mark SLO Affected

## list\_all

Returns all the SLOs of the passed owner\_id in the params. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.list_all(owner_id="<id>", offset="<value>", limit="<value>")

    # Handle response
    print(res)

```

### Parameters

| Parameter  | Type                                                                          | Required             | Description                                                         |
| ---------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `owner_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `offset`   | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `limit`    | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`  | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLOGetAllSLOsResponse**](/python-sdk/docs/models/slogetallslosresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## create

* This API will create SLO. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK
from squadcast.utils import parse_datetime


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.create(name="<value>", time_interval_type="rolling", service_ids=[
        "<value 1>",
    ], slis=[], target_slo=6924.37, start_time=parse_datetime("2023-06-03T10:41:05.981Z"), end_time=parse_datetime("2023-11-20T07:09:22.422Z"), duration_in_days=574042, owner_type="<value>", owner_id="<id>", slo_owner_id="<id>", slo_owner_type="squad")

    # Handle response
    print(res)

```

### Parameters

| Parameter               | Type                                                                                                 | Required             | Description                                                         |
| ----------------------- | ---------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `name`                  | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `time_interval_type`    | [models.V3SLOTimeIntervalType](/python-sdk/docs/models/v3slotimeintervaltype.md)                     | :heavy\_check\_mark: | N/A                                                                 |
| `service_ids`           | List\[*str*]                                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `slis`                  | List\[*str*]                                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `target_slo`            | *float*                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `start_time`            | [date](https://docs.python.org/3/library/datetime.html#date-objects)                                 | :heavy\_check\_mark: | N/A                                                                 |
| `end_time`              | [date](https://docs.python.org/3/library/datetime.html#date-objects)                                 | :heavy\_check\_mark: | N/A                                                                 |
| `duration_in_days`      | *int*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `owner_type`            | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`              | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `slo_owner_id`          | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `slo_owner_type`        | [models.V3SLOSLOOwnerType](/python-sdk/docs/models/v3slosloownertype.md)                             | :heavy\_check\_mark: | N/A                                                                 |
| `description`           | *Optional\[str]*                                                                                     | :heavy\_minus\_sign: | N/A                                                                 |
| `tags`                  | [Optional\[models.V3SLOCreateSLORequestTags\]](/python-sdk/docs/models/v3slocreateslorequesttags.md) | :heavy\_minus\_sign: | N/A                                                                 |
| `slo_monitoring_checks` | List\[[models.V3SLOSLOMonitoringCheck](/python-sdk/docs/models/v3sloslomonitoringcheck.md)]          | :heavy\_minus\_sign: | N/A                                                                 |
| `slo_actions`           | List\[[models.V3SLOSLOAction](/python-sdk/docs/models/v3slosloaction.md)]                            | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`               | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)                        | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLOCreateSLOResponse**](/python-sdk/docs/models/slocreatesloresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## update

* This API will update SLO. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK
from squadcast.utils import parse_datetime


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.update(slo_id=16112, owner_id_param="<value>", name="<value>", time_interval_type="rolling", service_ids=[
        "<value 1>",
        "<value 2>",
        "<value 3>",
    ], slis=[
        "<value 1>",
    ], target_slo=2464.03, start_time=parse_datetime("2025-10-31T03:29:37.701Z"), end_time=parse_datetime("2024-03-30T19:04:36.297Z"), duration_in_days=271064, owner_type="<value>", owner_id="<id>", slo_owner_id="<id>", slo_owner_type="user")

    # Handle response
    print(res)

```

### Parameters

| Parameter               | Type                                                                                                 | Required             | Description                                                         |
| ----------------------- | ---------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `slo_id`                | *int*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id_param`        | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `name`                  | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `time_interval_type`    | [models.V3SLOTimeIntervalType](/python-sdk/docs/models/v3slotimeintervaltype.md)                     | :heavy\_check\_mark: | N/A                                                                 |
| `service_ids`           | List\[*str*]                                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `slis`                  | List\[*str*]                                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `target_slo`            | *float*                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `start_time`            | [date](https://docs.python.org/3/library/datetime.html#date-objects)                                 | :heavy\_check\_mark: | N/A                                                                 |
| `end_time`              | [date](https://docs.python.org/3/library/datetime.html#date-objects)                                 | :heavy\_check\_mark: | N/A                                                                 |
| `duration_in_days`      | *int*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `owner_type`            | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`              | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `slo_owner_id`          | *str*                                                                                                | :heavy\_check\_mark: | N/A                                                                 |
| `slo_owner_type`        | [models.V3SLOSLOOwnerType](/python-sdk/docs/models/v3slosloownertype.md)                             | :heavy\_check\_mark: | N/A                                                                 |
| `description`           | *Optional\[str]*                                                                                     | :heavy\_minus\_sign: | N/A                                                                 |
| `tags`                  | [Optional\[models.V3SLOCreateSLORequestTags\]](/python-sdk/docs/models/v3slocreateslorequesttags.md) | :heavy\_minus\_sign: | N/A                                                                 |
| `slo_monitoring_checks` | List\[[models.V3SLOSLOMonitoringCheck](/python-sdk/docs/models/v3sloslomonitoringcheck.md)]          | :heavy\_minus\_sign: | N/A                                                                 |
| `slo_actions`           | List\[[models.V3SLOSLOAction](/python-sdk/docs/models/v3slosloaction.md)]                            | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`               | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)                        | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLOUpdateSLOResponse**](/python-sdk/docs/models/sloupdatesloresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## remove

Remove SLO from passed owner\_id (team\_id) in the params . Upon sccess the slo will be removed. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.remove(slo_id=938544, owner_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter  | Type                                                                          | Required             | Description                                                         |
| ---------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `slo_id`   | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`  | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLORemoveSLOResponse**](/python-sdk/docs/models/sloremovesloresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## get

Returns a SLO details of the given `sloID` in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.get(slo_id=586718, owner_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter  | Type                                                                          | Required             | Description                                                         |
| ---------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `slo_id`   | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id` | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`  | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLOGetSLOByIDResponse**](/python-sdk/docs/models/slogetslobyidresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## mark\_affected

This endpoint is used for mark slo affected.

Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.slos.mark_affected(slo_id=294670, owner_id_param="<value>", incident_id="<id>", slis=[
        "<value 1>",
        "<value 2>",
    ], error_budget_spent=3480.26, owner_type="<value>", owner_id="<id>", org_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter            | Type                                                                          | Required             | Description                                                         |
| -------------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `slo_id`             | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id_param`     | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `incident_id`        | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `slis`               | List\[*str*]                                                                  | :heavy\_check\_mark: | N/A                                                                 |
| `error_budget_spent` | *float*                                                                       | :heavy\_check\_mark: | N/A                                                                 |
| `owner_type`         | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`           | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `org_id`             | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`            | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.SLOMarkSLOAffectedResponse**](/python-sdk/docs/models/slomarksloaffectedresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/slossdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
