# Alert

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

## Alert

{% hint style="info" %}
**Alert Methods:**
{% endhint %}

| Method                                                        | Request                                                         | Response                                                                                                           |
| ------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create)                                         | [CreateAlertRequest](#createalertrequest)                       | [AlertInfo](#alertinfo)                                                                                            |
| [**update**](#update)                                         | [UpdateAlertRequest](#updatealertrequest)                       | [AlertInfo](#alertinfo)                                                                                            |
| [**update\_state**](#update_state)                            | [UpdateAlertStateRequest](#updatealertstaterequest)             | [AlertInfo](#alertinfo)                                                                                            |
| [**merge**](#merge)                                           | [MergeAlertRequest](#mergealertrequest)                         | [AlertInfo](#alertinfo)                                                                                            |
| [**snooze**](#snooze)                                         | [SnoozeAlertRequest](#snoozealertrequest)                       | [AlertInfo](#alertinfo)                                                                                            |
| [**add\_responder**](#add_responder)                          | [AlertResponderRequest](#alertresponderrequest)                 | [AlertInfo](#alertinfo)                                                                                            |
| [**remove\_responder**](#remove_responder)                    | [AlertResponderRequest](#alertresponderrequest)                 | [AlertInfo](#alertinfo)                                                                                            |
| [**add\_project\_dependency**](#add_project_dependency)       | [AlertProjectDependencyRequest](#alertprojectdependencyrequest) | [AlertInfo](#alertinfo)                                                                                            |
| [**remove\_project\_dependency**](#remove_project_dependency) | [AlertProjectDependencyRequest](#alertprojectdependencyrequest) | [AlertInfo](#alertinfo)                                                                                            |
| [**delete**](#delete)                                         | [AlertRequest](#alertrequest)                                   | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)                                               | [GetAlertRequest](#getalertrequest)                             | [AlertInfo](#alertinfo)                                                                                            |
| [**list**](#list)                                             | [AlertQuery](#alertquery)                                       | [AlertsInfo](#alertsinfo)                                                                                          |
| [**stat**](#stat)                                             | [AlertStatQuery](#alertstatquery)                               | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /monitoring/v1/alerts

> Creates a new Alert. Alerts generated with `create` method are made in a manual way. Manually made Alerts can be used for Notifications.

| Type     | Message                                   |
| -------- | ----------------------------------------- |
| Request  | [CreateAlertRequest](#createalertrequest) |
| Response | [AlertInfo](#alertinfo)                   |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "title": "sample test",
    "description": "This is a description of sample.",
    "urgency": "HIGH",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "alert_number": 104053,
    "alert_id": "alert-123456789012",
    "title": "sample test",
    "state": "TRIGGERED",
    "description": "This is a description of sample.",
    "urgency": "HIGH",
    "severity": "NONE",
    "escalation_step": 1,
    "additional_info": {},
    "triggered_by": "user1@email.com",
    "escalation_policy_id": "ep-123456789012",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012",
    "created_at": "2022-01-01T01:43:08.566Z",
    "updated_at": "2022-01-01T01:43:08.566Z",
    "escalated_at": "2022-01-01T01:43:54.464Z"
}
```

{% endtab %}
{% endtabs %}

### update

> **PUT** /monitoring/v1/alert/{alert\_id}

> Updates a specific Alert. You can make changes in Alert settings, including the `title`, `description`, `responder`, `state`, and `urgency`. The `responder` of the Alert is a User who is assigned to respond to the Alert.

| Type     | Message                                   |
| -------- | ----------------------------------------- |
| Request  | [UpdateAlertRequest](#updatealertrequest) |
| Response | [AlertInfo](#alertinfo)                   |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "alert_id": "alert-123456789012",
    "state": "ACKNOWLEDGED",
    "urgency": "LOW",
    "description": "[updating]This is a description of sample.",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "alert_number": 104053,
    "alert_id": "alert-123456789012",
    "title": "sample test",
    "state": "ACKNOWLEDGED",
    "description": "[updating]This is a description of sample. ",
    "urgency": "LOW",
    "severity": "NONE",
    "escalation_step": 1,
    "additional_info": {},
    "triggered_by": "user1@email.com",
    "escalation_policy_id": "ep-123456789012",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012",
    "created_at": "2022-01-01T01:43:08.566Z",
    "updated_at": "2022-01-01T01:43:08.566Z",
    "acknowledged_at": "2022-01-01T01:48:52.799Z",
    "escalated_at": "2022-01-01T01:43:54.464Z"
}
```

{% endtab %}
{% endtabs %}

### update\_state

> **POST** /monitoring/v1/alert/{alert\_id}/{access\_key}/{state}

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [UpdateAlertStateRequest](#updatealertstaterequest) |
| Response | [AlertInfo](#alertinfo)                             |

### merge

> **POST** /monitoring/v1/alerts/merge

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [MergeAlertRequest](#mergealertrequest) |
| Response | [AlertInfo](#alertinfo)                 |

### snooze

> **POST** /monitoring/v1/alert/{alert\_id}/snooze

| Type     | Message                                   |
| -------- | ----------------------------------------- |
| Request  | [SnoozeAlertRequest](#snoozealertrequest) |
| Response | [AlertInfo](#alertinfo)                   |

### add\_responder

> **POST** /monitoring/v1/alert/{alert\_id}/responders

> Adds a responder who receives a Notification about an Alert.

| Type     | Message                                         |
| -------- | ----------------------------------------------- |
| Request  | [AlertResponderRequest](#alertresponderrequest) |
| Response | [AlertInfo](#alertinfo)                         |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "alert_id": "alert-123456789012",
    "resource_type": "identity.User",
    "resource_id": "user2@email.com",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "alert_number": 104053,
    "alert_id": "alert-123456789012",
    "title": "sample test",
    "state": "ACKNOWLEDGED",
    "description": "[updating]This is a description of sample. ",
    "urgency": "LOW",
    "severity": "NONE",
    "escalation_step": 1,
    "responders": [
        {
            "resource_type": "identity.User",
            "resource_id": "user2@email.com"
        }
    ],
    "additional_info": {},
    "triggered_by": "user1@email.com",
    "escalation_policy_id": "ep-123456789012",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012",
    "created_at": "2022-01-01T01:43:08.566Z",
    "updated_at": "2022-01-01T01:43:08.566Z",
    "acknowledged_at": "2022-01-01T02:24:12.051Z",
    "escalated_at": "2022-01-01T01:43:54.464Z"
}
```

{% endtab %}
{% endtabs %}

### remove\_responder

> **DELETE** /monitoring/v1/alert/{alert\_id}/responders

> Deletes a responder who receives a Notification about an Alert.

| Type     | Message                                         |
| -------- | ----------------------------------------------- |
| Request  | [AlertResponderRequest](#alertresponderrequest) |
| Response | [AlertInfo](#alertinfo)                         |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "alert_id": "alert-123456789012",
    "resource_type": "identity.User",
    "resource_id": "user2@email.com",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "alert_number": 104053,
    "alert_id": "alert-123456789012",
    "title": "sample test",
    "state": "ACKNOWLEDGED",
    "description": "[updating]This is a description of sample. ",
    "urgency": "LOW",
    "severity": "NONE",
    "escalation_step": 1,
    "additional_info": {},
    "triggered_by": "user1@email.com",
    "escalation_policy_id": "ep-123456789012",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012",
    "created_at": "2022-01-01T01:43:08.566Z",
    "updated_at": "2022-01-01T01:43:08.566Z",
    "acknowledged_at": "2022-01-01T01:48:52.799Z",
    "escalated_at": "2022-01-01T01:43:54.464Z"
}
```

{% endtab %}
{% endtabs %}

### add\_project\_dependency

> **POST** /monitoring/v1/alert/{alert\_id}/project-dependencies

| Type     | Message                                                         |
| -------- | --------------------------------------------------------------- |
| Request  | [AlertProjectDependencyRequest](#alertprojectdependencyrequest) |
| Response | [AlertInfo](#alertinfo)                                         |

### remove\_project\_dependency

> **DELETE** /monitoring/v1/alert/{alert\_id}/project-dependency/{project\_id}

| Type     | Message                                                         |
| -------- | --------------------------------------------------------------- |
| Request  | [AlertProjectDependencyRequest](#alertprojectdependencyrequest) |
| Response | [AlertInfo](#alertinfo)                                         |

### delete

> **DELETE** /monitoring/v1/alert/{alert\_id}

> Deletes a specific Alert and remove it from the list of Alerts. You must specify the `alert_id` of the Alert to delete.

| Type     | Message                                                                                                          |
| -------- | ---------------------------------------------------------------------------------------------------------------- |
| Request  | [AlertRequest](#alertrequest)                                                                                    |
| Response | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto) |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "alert_id": "alert-123456789012",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}
{% endtabs %}

### get

> **GET** /monitoring/v1/alert/{alert\_id}

> Gets a specific Alert. Prints detailed information about the Alert.

| Type     | Message                             |
| -------- | ----------------------------------- |
| Request  | [GetAlertRequest](#getalertrequest) |
| Response | [AlertInfo](#alertinfo)             |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "alert_id": "alert-123456789012",
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "alert_number": 104053,
    "alert_id": "alert-123456789012",
    "title": "sample test",
    "state": "ACKNOWLEDGED",
    "description": "[updating]This is a description of sample. ",
    "urgency": "LOW",
    "severity": "NONE",
    "escalation_step": 1,
    "additional_info": {},
    "triggered_by": "user1@email.com",
    "escalation_policy_id": "ep-123456789012",
    "project_id": "project-123456789012",
    "domain_id": "domain-123456789012",
    "created_at": "2022-01-01T01:43:08.566Z",
    "updated_at": "2022-01-01T01:43:08.566Z",
    "acknowledged_at": "2022-01-01T01:48:52.799Z",
    "escalated_at": "2022-01-01T01:43:54.464Z"
}
```

{% endtab %}
{% endtabs %}

### list

> **GET** /monitoring/v1/alerts
>
> **POST** /monitoring/v1/alerts/search

> Gets a list of all Alerts. You can use a query to get a filtered list of Alerts.

| Type     | Message                   |
| -------- | ------------------------- |
| Request  | [AlertQuery](#alertquery) |
| Response | [AlertsInfo](#alertsinfo) |

{% tabs %}
{% tab title="Request Example" %}

```
{
    "query": {},
    "domain_id": "domain-123456789012"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "results": [
        {
            "alert_number": 104057,
            "alert_id": "alert-987654321098",
            "title": "Notification of access to the bastion Host",
            "state": "TRIGGERED",
            "description": "SSH Access to stargate-dev from adm",
            "urgency": "LOW",
            "severity": "INFO",
            "resource": {
                "resource_id": "server-123456789012",
                "resource_type": "inventory.Server",
                "name": "stargate-dev"
            },
            "escalation_step": 1,
            "escalation_ttl": 1,
            "additional_info": {
                "host": "[]",
                "user": "user1"
            },
            "triggered_by": "webhook-123456789012",
            "webhook_id": "webhook-123456789012",
            "escalation_policy_id": "ep-123456789012",
            "project_id": "project-123456789012",
            "domain_id": "domain-123456789012",
            "created_at": "2022-01-01T02:46:35.934Z",
            "updated_at": "2022-01-01T02:46:35.934Z",
            "escalated_at": "2022-01-01T02:46:35.979Z"
        },
        {
            "alert_number": 104056,
            "alert_id": "alert-123456789999",
            "title": "Notification of access to the bastion Host",
            "state": "TRIGGERED",
            "description": "SSH Access to stargate-dev from user3@email.com",
            "urgency": "LOW",
            "severity": "INFO",
            "resource": {
                "resource_id": "server-123456789012",
                "resource_type": "inventory.Server",
                "name": "stargate-dev"
            },
            "escalation_step": 1,
            "escalation_ttl": 1,
            "additional_info": {
                "user": "user3@email.com",
                "host": "['111.111.111.11']"
            },
            "triggered_by": "webhook-123456789012",
            "webhook_id": "webhook-123456789012",
            "escalation_policy_id": "ep-123456789012",
            "project_id": "project-123456789012",
            "domain_id": "domain-123456789012",
            "created_at": "2022-01-01T02:46:31.391Z",
            "updated_at": "2022-01-01T02:46:31.391Z",
            "escalated_at": "2022-01-01T02:46:31.553Z"
        }
    ],
    "total_count": 21283
}
```

{% endtab %}
{% endtabs %}

### stat

> **POST** /monitoring/v1/alerts/stat

| Type     | Message                                                                                                            |
| -------- | ------------------------------------------------------------------------------------------------------------------ |
| Request  | [AlertStatQuery](#alertstatquery)                                                                                  |
| Response | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

##

## Message

### AlertInfo

| Field                  | Type                                                                                                               | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| alert\_number          | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |             |
| alert\_id              | string                                                                                                             |             |
| title                  | string                                                                                                             |             |
| state                  | <ul><li>ALERT\_STATE\_NONE</li><li>TRIGGERED</li><li>ACKNOWLEDGED</li><li>RESOLVED</li><li>ERROR</li></ul>         |             |
| status\_message        | string                                                                                                             |             |
| description            | string                                                                                                             |             |
| assignee               | string                                                                                                             |             |
| urgency                | <ul><li>ALERT\_URGENCY\_NONE</li><li>HIGH</li><li>LOW</li></ul>                                                    |             |
| severity               | string                                                                                                             |             |
| rule                   | string                                                                                                             |             |
| resource               | [AlertResource](#alertresource)                                                                                    |             |
| provider               | string                                                                                                             |             |
| account                | string                                                                                                             |             |
| is\_snoozed            | bool                                                                                                               |             |
| snoozed\_end\_time     | string                                                                                                             |             |
| escalation\_step       | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |             |
| escalation\_ttl        | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |             |
| responders             | [list of AlertResponder](#alertresponder)                                                                          |             |
| project\_dependencies  | list of string                                                                                                     |             |
| image\_url             | string                                                                                                             |             |
| additional\_info       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| triggered\_by          | string                                                                                                             |             |
| webhook\_id            | string                                                                                                             |             |
| escalation\_policy\_id | string                                                                                                             |             |
| project\_id            | string                                                                                                             |             |
| domain\_id             | string                                                                                                             |             |
| created\_at            | string                                                                                                             |             |
| updated\_at            | string                                                                                                             |             |
| acknowledged\_at       | string                                                                                                             |             |
| resolved\_at           | string                                                                                                             |             |
| escalated\_at          | string                                                                                                             |             |

### AlertProjectDependencyRequest

| Field       | Type   | Required | Description |
| ----------- | ------ | :------: | ----------- |
| alert\_id   | string |     ✔    |             |
| project\_id | string |     ✔    |             |
| domain\_id  | string |     ✔    |             |

### AlertQuery

| Field                  | Type                                                                                                       | Required | Description |
| ---------------------- | ---------------------------------------------------------------------------------------------------------- | -------- | ----------- |
| query                  | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query)         | ✘        |             |
| alert\_number          | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)            | ✘        |             |
| alert\_id              | string                                                                                                     | ✘        |             |
| title                  | string                                                                                                     | ✘        |             |
| state                  | <ul><li>ALERT\_STATE\_NONE</li><li>TRIGGERED</li><li>ACKNOWLEDGED</li><li>RESOLVED</li><li>ERROR</li></ul> | ✘        |             |
| assignee               | string                                                                                                     | ✘        |             |
| urgency                | <ul><li>ALERT\_URGENCY\_NONE</li><li>HIGH</li><li>LOW</li></ul>                                            | ✘        |             |
| severity               | string                                                                                                     | ✘        |             |
| is\_snoozed            | string                                                                                                     | ✘        |             |
| resource\_id           | string                                                                                                     | ✘        |             |
| provider               | string                                                                                                     | ✘        |             |
| account                | string                                                                                                     | ✘        |             |
| triggered\_by          | string                                                                                                     | ✘        |             |
| webhook\_id            | string                                                                                                     | ✘        |             |
| escalation\_policy\_id | string                                                                                                     | ✘        |             |
| project\_id            | string                                                                                                     | ✘        |             |
| domain\_id             | string                                                                                                     | ✔        |             |

### AlertRequest

| Field      | Type   | Required | Description |
| ---------- | ------ | :------: | ----------- |
| alert\_id  | string |     ✔    |             |
| domain\_id | string |     ✔    |             |

### AlertResource

| Field          | Type   | Description |
| -------------- | ------ | ----------- |
| resource\_id   | string |             |
| resource\_type | string |             |
| name           | string |             |

### AlertResponder

| Field          | Type   | Description |
| -------------- | ------ | ----------- |
| resource\_type | string |             |
| resource\_id   | string |             |

### AlertResponderRequest

| Field          | Type   | Required | Description |
| -------------- | ------ | :------: | ----------- |
| alert\_id      | string |     ✔    |             |
| resource\_type | string |     ✔    |             |
| resource\_id   | string |     ✔    |             |
| domain\_id     | string |     ✔    |             |

### AlertStatQuery

| Field      | Type                                                                                                             | Required | Description |
| ---------- | ---------------------------------------------------------------------------------------------------------------- | :------: | ----------- |
| query      | [spaceone.api.core.v1.StatisticsQuery](https://spaceone-dev.gitbook.io/api-reference/common-v1/statistics-query) |     ✔    |             |
| domain\_id | string                                                                                                           |     ✔    |             |

### AlertsInfo

| Field        | Type                                                                                            | Description |
| ------------ | ----------------------------------------------------------------------------------------------- | ----------- |
| results      | [list of AlertInfo](#alertinfo)                                                                 |             |
| total\_count | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |             |

### CreateAlertRequest

| Field       | Type                                                            | Required | Description |
| ----------- | --------------------------------------------------------------- | -------- | ----------- |
| title       | string                                                          | ✔        |             |
| description | string                                                          | ✘        |             |
| assignee    | string                                                          | ✘        |             |
| urgency     | <ul><li>ALERT\_URGENCY\_NONE</li><li>HIGH</li><li>LOW</li></ul> | ✘        |             |
| project\_id | string                                                          | ✔        |             |
| domain\_id  | string                                                          | ✔        |             |

### GetAlertRequest

| Field      | Type           | Required | Description |
| ---------- | -------------- | :------: | ----------- |
| alert\_id  | string         |     ✔    |             |
| domain\_id | string         |     ✔    |             |
| only       | list of string |     ✘    |             |

### MergeAlertRequest

| Field      | Type           | Required | Description |
| ---------- | -------------- | :------: | ----------- |
| alerts     | list of string |     ✔    |             |
| merge\_to  | string         |     ✔    |             |
| domain\_id | string         |     ✔    |             |

### SnoozeAlertRequest

| Field      | Type   | Required | Description |
| ---------- | ------ | :------: | ----------- |
| alert\_id  | string |     ✔    |             |
| end\_time  | string |     ✔    |             |
| domain\_id | string |     ✔    |             |

### UpdateAlertRequest

| Field                  | Type                                                            | Required | Description |
| ---------------------- | --------------------------------------------------------------- | -------- | ----------- |
| alert\_id              | string                                                          | ✔        |             |
| title                  | string                                                          | ✘        |             |
| state                  | string                                                          | ✘        |             |
| status\_message        | string                                                          | ✘        |             |
| description            | string                                                          | ✘        |             |
| assignee               | string                                                          | ✘        |             |
| urgency                | <ul><li>ALERT\_URGENCY\_NONE</li><li>HIGH</li><li>LOW</li></ul> | ✘        |             |
| project\_id            | string                                                          | ✘        |             |
| reset\_status\_message | bool                                                            | ✘        |             |
| reset\_description     | bool                                                            | ✘        |             |
| reset\_assignee        | bool                                                            | ✘        |             |
| domain\_id             | string                                                          | ✔        |             |

### UpdateAlertStateRequest

| Field       | Type   | Required | Description |
| ----------- | ------ | :------: | ----------- |
| alert\_id   | string |     ✔    |             |
| access\_key | string |     ✔    |             |
| state       | string |     ✘    |             |
