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

# GlobalEventRules.Rulesets.Rules

## Overview

### Available Operations

* [list](#list) - List Ruleset Rules
* [create](#create) - Create Rule
* [get\_by\_id](#get_by_id) - Get Rule by ID
* [update\_by\_id](#update_by_id) - Update Rule by ID
* [reorder](#reorder) - Reorder Ruleset By Index

## list

Get all rules of a GER Ruleset.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.global_event_rules.rulesets.rules.list(ger_id=894010, alert_source_version="<value>", alert_source_shortname="<value>")

    while res is not None:
        # Handle items

        res = res.next()

```

### Parameters

| Parameter                | Type                                                                                                                           | Required             | Description                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `ger_id`                 | *int*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_version`   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_shortname` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `page_size`              | *Optional\[int]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `page_number`            | *Optional\[int]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `filters_search`         | *Optional\[str]*                                                                                                               | :heavy\_minus\_sign: | 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.GlobalEventRulesListRulesetRulesResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/globaleventruleslistrulesetrulesresponse.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

Create a GER Ruleset Rule.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.global_event_rules.rulesets.rules.create(ger_id=934313, alert_source_version="<value>", alert_source_shortname="<value>", description="ha newsprint within beside scientific", expression="<value>", action={
        "route_to": "<value>",
    })

    # Handle response
    print(res)

```

### Parameters

| Parameter                | Type                                                                                                                                            | Required             | Description                                                         |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `ger_id`                 | *int*                                                                                                                                           | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_version`   | *str*                                                                                                                                           | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_shortname` | *str*                                                                                                                                           | :heavy\_check\_mark: | N/A                                                                 |
| `description`            | *str*                                                                                                                                           | :heavy\_check\_mark: | N/A                                                                 |
| `expression`             | *str*                                                                                                                                           | :heavy\_check\_mark: | N/A                                                                 |
| `action`                 | [models.V3GlobalEventRulesRuleAction](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3globaleventrulesruleaction.md) | :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.GlobalEventRulesCreateRuleResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/globaleventrulescreateruleresponse.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

Get a GER Ruleset Rule by its ID.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.global_event_rules.rulesets.rules.get_by_id(ger_id=518804, alert_source_version="<value>", alert_source_shortname="<value>", rule_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter                | Type                                                                                                                           | Required             | Description                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `ger_id`                 | *int*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_version`   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_shortname` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rule_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.GlobalEventRulesGetRuleByIDResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/globaleventrulesgetrulebyidresponse.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\_by\_id

Update a GER Ruleset Rule by its ID.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.global_event_rules.rulesets.rules.update_by_id(ger_id=140241, alert_source_version="<value>", alert_source_shortname="<value>", rule_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter                | Type                                                                                                                                                                    | Required             | Description                                                         |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `ger_id`                 | *int*                                                                                                                                                                   | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_version`   | *str*                                                                                                                                                                   | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_shortname` | *str*                                                                                                                                                                   | :heavy\_check\_mark: | N/A                                                                 |
| `rule_id`                | *str*                                                                                                                                                                   | :heavy\_check\_mark: | N/A                                                                 |
| `description`            | *Optional\[str]*                                                                                                                                                        | :heavy\_minus\_sign: | N/A                                                                 |
| `expression`             | *Optional\[str]*                                                                                                                                                        | :heavy\_minus\_sign: | N/A                                                                 |
| `action`                 | [Optional\[models.V3GlobalEventRulesRuleActionUpdate\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3globaleventrulesruleactionupdate.md) | :heavy\_minus\_sign: | 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.GlobalEventRulesUpdateRuleByIDResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/globaleventrulesupdaterulebyidresponse.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    | \*/\*            |

## reorder

Reorder a GER Ruleset Rule by its index in the ruleset.

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.global_event_rules.rulesets.rules.reorder(ger_id=281260, alert_source_version="<value>", alert_source_shortname="<value>", rule_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter                | Type                                                                                                                           | Required             | Description                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `ger_id`                 | *int*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_version`   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `alert_source_shortname` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rule_id`                | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `shift_to`               | *Optional\[str]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `shift_index_by`         | *Optional\[int]*                                                                                                               | :heavy\_minus\_sign: | 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.GlobalEventRulesReorderRulesetByIndexResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/globaleventrulesreorderrulesetbyindexresponse.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    | \*/\*            |
