# EventRule

An EventRule is a rule to transform the request data when an Event is generated.

> **Package : spaceone.api.monitoring.v1**

\
\


## EventRule

**EventRule Methods:**

| Method                                                                                                                              | Request                                                                                                                                                      | Response                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#create)              | [CreateEventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#createeventrulerequest)           | [EventRuleInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventruleinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#update)              | [UpdateEventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#updateeventrulerequest)           | [EventRuleInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventruleinfo)   |
| [**change\_order**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#change_order) | [ChangeEventRuleOrderRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#changeeventruleorderrequest) | [EventRuleInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventruleinfo)   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#delete)              | [EventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulerequest)                       | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#empty)                   |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#get)                    | [EventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulerequest)                       | [EventRuleInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventruleinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#list)                  | [EventRuleQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulequery)                           | [EventRulesInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulesinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#stat)                  | [EventRuleStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulestatquery)                   | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#struct)                 |

\


### create

Creates a new EventRule. You can filter the Events to apply the EventRule by setting the input parameter `Conditions`. The method can change the Events' assignee or Project.

> **POST** /monitoring/v1/event-rule/create

\{{< tabs " create " >\}}

\{{< tab "Request Example" >\}}

[CreateEventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#createeventrulerequest)

* **name** (string) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **options** (EventRuleOptions)
* **tags** (Struct)
* **project\_id** (string)

\{{< highlight json >\}} { "conditions": \[{"key": "description", "value": "API", "operator": "contain"}], "conditions\_policy": "ALL", "actions": {"change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": {"type": "personal rule"}, "no\_notification": true}, "options": {}, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[EventRuleInfo](#EVENTRULEINFO)

* **event\_rule\_id** (string) `Required`
* **name** (string) `Required`
* **order** (int32) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **options** (EventRuleOptions) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 1, "conditions": \[ { "key": "description", "value": "API", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": { "type": "personal rule" }, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-02T06:02:31.517Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update

Changes a priority order between EventRules to apply. EventRules are filtered by the order configured.

> **POST** /monitoring/v1/event-rule/update

\{{< tabs " update " >\}}

\{{< tab "Request Example" >\}}

[UpdateEventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#updateeventrulerequest)

* **event\_rule\_id** (string) `Required`
* **name** (string)
* **conditions** (EventRuleCondition) `Repeated`
* **conditions\_policy** (ConditionsPolicy)
* **actions** (EventRuleActions)
* **options** (EventRuleOptions)
* **tags** (Struct)

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "conditions": \[{"key": "description", "value": "ELB", "operator": "contain"}], "conditions\_policy": "ALL", "actions": {"change\_assignee": "user2@email.com", "change\_urgency": "HIGH", "change\_project": "project-123456789012", "add\_additional\_info": {"type": "personal rule"}, "no\_notification": true}, "options": {}, "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[EventRuleInfo](#EVENTRULEINFO)

* **event\_rule\_id** (string) `Required`
* **name** (string) `Required`
* **order** (int32) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **options** (EventRuleOptions) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 1, "conditions": \[ { "key": "description", "value": "API", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": { "type": "personal rule" }, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-02T06:02:31.517Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### change\_order

Updates a specific EventRule. You can make changes in EventRule settings.

> **POST** /monitoring/v1/event-rule/change-order

\{{< tabs " change\_order " >\}}

\{{< tab "Request Example" >\}}

[ChangeEventRuleOrderRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#changeeventruleorderrequest)

* **event\_rule\_id** (string) `Required`
* **order** (int32) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 2, "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[EventRuleInfo](#EVENTRULEINFO)

* **event\_rule\_id** (string) `Required`
* **name** (string) `Required`
* **order** (int32) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **options** (EventRuleOptions) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 1, "conditions": \[ { "key": "description", "value": "API", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": { "type": "personal rule" }, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-02T06:02:31.517Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### delete

Deletes a specific EventRule. You must assign an EventRule resource to delete by specifying `event_rule_id`.

> **POST** /monitoring/v1/event-rule/delete

\{{< tabs " delete " >\}}

\{{< tab "Request Example" >\}}

[EventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulerequest)

* **event\_rule\_id** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 2, "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### get

Gets a specific EventRule. Prints detailed information about the EventRule.

> **POST** /monitoring/v1/event-rule/get

\{{< tabs " get " >\}}

\{{< tab "Request Example" >\}}

[EventRuleRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulerequest)

* **event\_rule\_id** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 2, "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[EventRuleInfo](#EVENTRULEINFO)

* **event\_rule\_id** (string) `Required`
* **name** (string) `Required`
* **order** (int32) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **options** (EventRuleOptions) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

\{{< highlight json >\}} { "event\_rule\_id": "er-123456789012", "order": 1, "conditions": \[ { "key": "description", "value": "API", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": { "type": "personal rule" }, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-02T06:02:31.517Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### list

Gets a list of all EventRules. You can use a query to get a filtered list of EventRules. For example, you can adjust the scope of the list to a certain Project or Domain.

> **POST** /monitoring/v1/event-rule/list

\{{< tabs " list " >\}}

\{{< tab "Request Example" >\}}

[EventRuleQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/EventRule/README.md#eventrulequery)

* **query** (Query)
* **event\_rule\_id** (string)
* **name** (string)
* **workspace\_id** (string)
* **project\_id** (string)

\{{< highlight json >\}} { "project\_id": "project-123456789012", "domain\_id": "domain-123456789012" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[EventRulesInfo](#EVENTRULESINFO)

* **results** (EventRuleInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

\{{< highlight json >\}} { "results": \[ { "event\_rule\_id": "er-123456789012", "order": 1, "conditions": \[ { "key": "title", "value": "AWS", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user2@email.com", "change\_urgency": "HIGH", "add\_additional\_info": {}, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T06:33:58.388Z" }, { "event\_rule\_id": "er-123456789012", "order": 2, "conditions": \[ { "key": "title", "value": "ELB", "operator": "contain" } ], "conditions\_policy": "ALL", "actions": { "change\_assignee": "user1@email.com", "change\_urgency": "LOW", "change\_project": "project-123456789012", "add\_additional\_info": {}, "no\_notification": true }, "options": {}, "scope": "PROJECT", "project\_id": "project-123456789012", "tags": {}, "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T06:12:30.226Z" } ], "total\_count": 2 } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### stat

> **POST** /monitoring/v1/event-rule/stat

\
\


## Message

### ChangeEventRuleOrderRequest

* **event\_rule\_id** (string) `Required`
*   **order** (int32) `Required`

    \


### CreateEventRuleRequest

* **name** (string) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **options** (EventRuleOptions)
* **tags** (Struct)
*   **project\_id** (string)

    \


### EventRuleActionResponder

* **resource\_type** (string) `Required`
*   **resource\_id** (string) `Required`

    \


### EventRuleActions

* **change\_assignee** (string) `Required`
* **change\_urgency** (string) `Required`
* **change\_project** (string) `Required`
* **change\_escalation\_policy** (string) `Required`
* **match\_service\_account** (MatchRule) `Required`
* **add\_additional\_info** (Struct) `Required`
*   **no\_notification** (bool) `Required`

    \


### EventRuleCondition

* **key** (string) `Required`
* **value** (string) `Required`
*   **operator** (string) `Required`

    \


### EventRuleInfo

* **event\_rule\_id** (string) `Required`
* **name** (string) `Required`
* **order** (int32) `Required`
* **conditions** (EventRuleCondition) `Repeated` `Required`
* **conditions\_policy** (ConditionsPolicy) `Required`
* **actions** (EventRuleActions) `Required`
* **options** (EventRuleOptions) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
*   **created\_at** (string) `Required`

    \


### EventRuleOptions

*   **stop\_processing** (bool) `Required`

    \


### EventRuleQuery

* **query** (Query)
* **event\_rule\_id** (string)
* **name** (string)
* **workspace\_id** (string)
*   **project\_id** (string)

    \


### EventRuleRequest

*   **event\_rule\_id** (string) `Required`

    \


### EventRuleStatQuery

*   **query** (StatisticsQuery) `Required`

    \


### EventRulesInfo

* **results** (EventRuleInfo) `Repeated` `Required`
*   **total\_count** (int32) `Required`

    \


### MatchRule

* **source** (string) `Required`
*   **target** (string) `Required`

    \


### UpdateEventRuleRequest

* **event\_rule\_id** (string) `Required`
* **name** (string)
* **conditions** (EventRuleCondition) `Repeated`
* **conditions\_policy** (ConditionsPolicy)
* **actions** (EventRuleActions)
* **options** (EventRuleOptions)
*   **tags** (Struct)

    \
