# GlobalEventRules

## Overview

### Available Operations

* [list](#list) - List Global Event Rules
* [create\_rule](#create_rule) - Create Global Event Rule
* [delete\_by\_id](#delete_by_id) - Delete Global Event Rule by ID
* [get\_by\_id](#get_by_id) - Get Global Event Rule by ID
* [update\_by\_id](#update_by_id) - Update Global Event Rule by ID

## list

Get a list of all GERs

### 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.list(owner_id="<id>")

    while res is not None:
        # Handle items

        res = res.next()

```

### Parameters

| Parameter          | Type                                                                          | Required             | Description                                                         |
| ------------------ | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `owner_id`         | *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_owner_id` | List\[*str*]                                                                  | :heavy\_minus\_sign: | N/A                                                                 |
| `filters_search`   | *Optional\[str]*                                                              | :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.GlobalEventRulesListGlobalEventRulesResponse**](/python-sdk/docs/models/globaleventruleslistglobaleventrulesresponse.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\_rule

Create a GER

### 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.create_rule(name="<value>", description="majestically effector headline dampen eek middle like shrill", owner_id="<id>", entity_owner={
        "id": "<id>",
        "type": "user",
    })

    # Handle response
    print(res)

```

### Parameters

| Parameter      | Type                                                                                             | Required             | Description                                                         |
| -------------- | ------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `name`         | *str*                                                                                            | :heavy\_check\_mark: | N/A                                                                 |
| `description`  | *str*                                                                                            | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`     | *str*                                                                                            | :heavy\_check\_mark: | N/A                                                                 |
| `entity_owner` | [models.V3GlobalEventRulesEntityOwner](/python-sdk/docs/models/v3globaleventrulesentityowner.md) | :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.GlobalEventRulesCreateGlobalEventRuleResponse**](/python-sdk/docs/models/globaleventrulescreateglobaleventruleresponse.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\_by\_id

Delete a GER 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.delete_by_id(ger_id=491102)

    # Handle response
    print(res)

```

### Parameters

| Parameter | Type                                                                          | Required             | Description                                                         |
| --------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `ger_id`  | *int*                                                                         | :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

[**bytes**](https://github.com/solarwinds/squadcast-sdk-python/blob/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

Get a GER 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.get_by_id(ger_id=292040)

    # Handle response
    print(res)

```

### Parameters

| Parameter | Type                                                                          | Required             | Description                                                         |
| --------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `ger_id`  | *int*                                                                         | :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.GlobalEventRulesGetGlobalEventRuleByIDResponse**](/python-sdk/docs/models/globaleventrulesgetglobaleventrulebyidresponse.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 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.update_by_id(ger_id=885894)

    # Handle response
    print(res)

```

### Parameters

| Parameter      | Type                                                                                                                     | Required             | Description                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `ger_id`       | *int*                                                                                                                    | :heavy\_check\_mark: | N/A                                                                 |
| `name`         | *Optional\[str]*                                                                                                         | :heavy\_minus\_sign: | N/A                                                                 |
| `description`  | *Optional\[str]*                                                                                                         | :heavy\_minus\_sign: | N/A                                                                 |
| `entity_owner` | [Optional\[models.V3GlobalEventRulesEntityOwnerUpdate\]](/python-sdk/docs/models/v3globaleventrulesentityownerupdate.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.GlobalEventRulesUpdateGlobalEventRuleByIDResponse**](/python-sdk/docs/models/globaleventrulesupdateglobaleventrulebyidresponse.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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
