> 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/runbookssdk.md).

# Runbooks

## Overview

### Available Operations

* [attach](#attach) - Attach Runbooks
* [get\_all\_by\_team](#get_all_by_team) - Get All Runbooks By Team
* [create](#create) - Create Runbook
* [delete](#delete) - Remove Runbook
* [get\_by\_id](#get_by_id) - Get Runbook By ID
* [update](#update) - Update Runbook

## attach

Attach Runbooks

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.runbooks.attach(incident_id="<id>", runbooks=[
        "<value 1>",
        "<value 2>",
    ])

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `incident_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `runbooks`    | List\[*str*]                                                                                                                   | :heavy\_check\_mark: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RunbooksAttachRunbooksResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/runbooksattachrunbooksresponse.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\_all\_by\_team

Returns all the runbooks of the team. 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.runbooks.get_all_by_team()

    # Handle response
    print(res)

```

### Parameters

| Parameter | Type                                                                                                                           | Required             | Description                                                         |
| --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `retries` | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RunbooksGetAllRunbooksByTeamResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/runbooksgetallrunbooksbyteamresponse.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

Add runbook to the team. Returns the runbook object in response. 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.runbooks.create(name="<value>", steps=[
        {
            "content": "<value>",
        },
    ], owner_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter      | Type                                                                                                                                      | Required             | Description                                                         |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `name`         | *str*                                                                                                                                     | :heavy\_check\_mark: | The name of the runbook.                                            |
| `steps`        | List\[[models.V3RunbooksStep](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3runbooksstep.md)]                | :heavy\_check\_mark: | The steps that make up the runbook.                                 |
| `owner_id`     | *str*                                                                                                                                     | :heavy\_check\_mark: | The ID of the team that owns this runbook.                          |
| `entity_owner` | [Optional\[models.CommonV3EntityOwner\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/commonv3entityowner.md) | :heavy\_minus\_sign: | The owner of the entity.                                            |
| `retries`      | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md)            | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RunbooksCreateRunbookResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/runbookscreaterunbookresponse.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    | \*/\*            |

## delete

Remove runbook from team. 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.runbooks.delete(runbook_id="<id>")

    # Handle response
    print(res)

```

### Parameters

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

### Response

[**bytes**](https://github.com/solarwinds/squadcast-sdk-python/tree/main/squadcastv1/docs/models/.md/README.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\_by\_id

Returns a runbook details of the given `runbookID` 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.runbooks.get_by_id(runbook_id="<id>")

    # Handle response
    print(res)

```

### Parameters

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

### Response

[**models.RunbooksGetRunbookByIDResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/runbooksgetrunbookbyidresponse.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

Update runbook details. 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.runbooks.update(runbook_id="<id>", name="<value>", steps=[
        {
            "content": "<value>",
        },
    ])

    # Handle response
    print(res)

```

### Parameters

| Parameter      | Type                                                                                                                                      | Required             | Description                                                         |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `runbook_id`   | *str*                                                                                                                                     | :heavy\_check\_mark: | N/A                                                                 |
| `name`         | *str*                                                                                                                                     | :heavy\_check\_mark: | The name of the runbook.                                            |
| `steps`        | List\[[models.V3RunbooksStep](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3runbooksstep.md)]                | :heavy\_check\_mark: | The steps that make up the runbook.                                 |
| `entity_owner` | [Optional\[models.CommonV3EntityOwner\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/commonv3entityowner.md) | :heavy\_minus\_sign: | The owner of the entity.                                            |
| `retries`      | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md)            | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.RunbooksUpdateRunbookResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/runbooksupdaterunbookresponse.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    | \*/\*            |
