# Project Alert Config

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

## ProjectAlertConfig

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

| Method                | Request                                                             | Response                                                                                                           |
| --------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create) | [CreateProjectAlertConfigRequest](#createprojectalertconfigrequest) | [ProjectAlertConfigInfo](#projectalertconfiginfo)                                                                  |
| [**update**](#update) | [UpdateProjectAlertConfigRequest](#updateprojectalertconfigrequest) | [ProjectAlertConfigInfo](#projectalertconfiginfo)                                                                  |
| [**delete**](#delete) | [ProjectAlertConfigRequest](#projectalertconfigrequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)       | [GetProjectAlertConfigRequest](#getprojectalertconfigrequest)       | [ProjectAlertConfigInfo](#projectalertconfiginfo)                                                                  |
| [**list**](#list)     | [ProjectAlertConfigQuery](#projectalertconfigquery)                 | [ProjectAlertConfigsInfo](#projectalertconfigsinfo)                                                                |
| [**stat**](#stat)     | [ProjectAlertConfigStatQuery](#projectalertconfigstatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /monitoring/v1/project-alert-configs

> Creates a new ProjectAlertConfig in a specific Project. When creating a ProjectAlertConfig, validation of the Project is preceded. After the validation is done, ProjectAlertConfig enables EscalationPolicy to be set in the Project, or enables `enum` type `recovery_mode` and `notification_urgency` to be set through the `options` parameter. The parameter `recovery_mode` is for changing the state of the Alert to `resolved` if the external monitoring solution sends the resolved Alert. The parameter `notification_urgency` is used to choose whether you will get all Alerts or only urgent ones.

| Type     | Message                                                             |
| -------- | ------------------------------------------------------------------- |
| Request  | [CreateProjectAlertConfigRequest](#createprojectalertconfigrequest) |
| Response | [ProjectAlertConfigInfo](#projectalertconfiginfo)                   |

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

```
{
    "project_id": "project-dee2a81d4859",
    "escalation_policy_id": "ep-b441abe04ca9",
    "options": {
        "notification_urgency": "ALL",
        "recovery_mode": "AUTO"
    },
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "project_id": "project-dee2a81d4859",
    "options": {
        "notification_urgency": "ALL",
        "recovery_mode": "AUTO"
    },
    "escalation_policy_info": {
        "escalation_policy_id": "ep-b441abe04ca9",
        "name": "Global New Policy"
    },
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-27T05:12:22.998Z"
}
```

{% endtab %}
{% endtabs %}

### update

> **PUT** /monitoring/v1/project-alert-config/{project\_alert\_config\_id}

> Updates a specific ProjectAlertConfig. You can make changes in ProjectAlertConfig settings, including the EscalationPolicy to apply. You can also change `notification_urgency` and `recovery_mode` by modifying the `options` parameter.

| Type     | Message                                                             |
| -------- | ------------------------------------------------------------------- |
| Request  | [UpdateProjectAlertConfigRequest](#updateprojectalertconfigrequest) |
| Response | [ProjectAlertConfigInfo](#projectalertconfiginfo)                   |

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

```
{
    "project_id": "project-dee2a81d4859",
    "escalation_policy_id": "ep-4ee42a9b2d96",
    "options": {
        "notification_urgency": "ALL",
        "recovery_mode": "MANUAL"
    },
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "project_id": "project-dee2a81d4859",
    "options": {
        "notification_urgency": "ALL",
        "recovery_mode": "MANUAL"
    },
    "escalation_policy_info": {
        "escalation_policy_id": "ep-4ee42a9b2d96",
        "name": "HAHA",
        "is_default": true
    },
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-27T05:15:02.697Z"
}
```

{% endtab %}
{% endtabs %}

### delete

> **DELETE** /monitoring/v1/project-alert-config/{project\_alert\_config\_id}

> Deletes a specific ProjectAlertConfig. Deletes alert configuration data in a Project.

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

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

```
{
    "project_id": "project-dee2a81d4859",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}
{% endtabs %}

### get

> **GET** /monitoring/v1/project-alert-config/{project\_alert\_config\_id}

> Gets a specific ProjectAlertConfig. Prints detailed information about the ProjectAlertConfig, including EscalationPolicy, recovery mode, and notification urgency.

| Type     | Message                                                       |
| -------- | ------------------------------------------------------------- |
| Request  | [GetProjectAlertConfigRequest](#getprojectalertconfigrequest) |
| Response | [ProjectAlertConfigInfo](#projectalertconfiginfo)             |

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

```
{
    "project_id": "project-430bf6ab1e6d",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "project_id": "project-430bf6ab1e6d",
    "options": {
        "notification_urgency": "ALL",
        "recovery_mode": "AUTO"
    },
    "escalation_policy_info": {
        "escalation_policy_id": "ep-4ee42a9b2d96",
        "name": "HAHA",
        "is_default": true
    },
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-05-03T08:17:11.715Z"
}
```

{% endtab %}
{% endtabs %}

### list

> **GET** /monitoring/v1/project-alert-configs
>
> **POST** /monitoring/v1/project-alert-configs/search

> Gets a list of all ProjectAlertConfigs from all projects configured in the same domain. You can use a query to get a filtered list of ProjectAlertConfigs.

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [ProjectAlertConfigQuery](#projectalertconfigquery) |
| Response | [ProjectAlertConfigsInfo](#projectalertconfigsinfo) |

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

```
{
    "query": {},
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "results": [
        {
            "project_id": "project-18655561c535",
            "options": {
                "notification_urgency": "ALL",
                "recovery_mode": "MANUAL"
            },
            "escalation_policy_info": {
                "escalation_policy_id": "ep-4ee42a9b2d96",
                "name": "HAHA",
                "is_default": true
            },
            "domain_id": "domain-58010aa2e451",
            "created_at": "2022-05-17T02:09:19.839Z"
        },
        {
            "project_id": "project-9074eea97d7e",
            "options": {
                "notification_urgency": "ALL",
                "recovery_mode": "MANUAL"
            },
            "escalation_policy_info": {
                "escalation_policy_id": "ep-b441abe04ca9",
                "name": "Global New Policy"
            },
            "domain_id": "domain-58010aa2e451",
            "created_at": "2021-06-24T02:50:50.535Z"
        }
    ],
    "total_count": 2
}
```

{% endtab %}
{% endtabs %}

### stat

> **POST** /monitoring/v1/project-alert-configs/stat

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

##

## Message

### AlertOptions

| Field                 | Type                                                           | Description |
| --------------------- | -------------------------------------------------------------- | ----------- |
| notification\_urgency | <ul><li>URGENCY\_NONE</li><li>ALL</li><li>HIGH\_ONLY</li></ul> |             |
| recovery\_mode        | <ul><li>RECOVERY\_NONE</li><li>AUTO</li><li>MANUAL</li></ul>   |             |

### CreateProjectAlertConfigRequest

| Field                  | Type                          | Required | Description |
| ---------------------- | ----------------------------- | :------: | ----------- |
| project\_id            | string                        |     ✔    |             |
| escalation\_policy\_id | string                        |     ✘    |             |
| options                | [AlertOptions](#alertoptions) |     ✘    |             |
| domain\_id             | string                        |     ✔    |             |

### GetProjectAlertConfigRequest

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

### ProjectAlertConfigInfo

| Field                    | Type                                          | Description |
| ------------------------ | --------------------------------------------- | ----------- |
| project\_id              | string                                        |             |
| options                  | [AlertOptions](#alertoptions)                 |             |
| escalation\_policy\_info | [EscalationPolicyInfo](#escalationpolicyinfo) |             |
| domain\_id               | string                                        |             |
| created\_at              | string                                        |             |

### ProjectAlertConfigQuery

| Field                  | Type                                                                                               | Required | Description |
| ---------------------- | -------------------------------------------------------------------------------------------------- | :------: | ----------- |
| query                  | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) |     ✘    |             |
| project\_id            | string                                                                                             |     ✘    |             |
| escalation\_policy\_id | string                                                                                             |     ✘    |             |
| domain\_id             | string                                                                                             |     ✔    |             |

### ProjectAlertConfigRequest

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

### ProjectAlertConfigStatQuery

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

### ProjectAlertConfigsInfo

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

### UpdateProjectAlertConfigRequest

| Field                  | Type                          | Required | Description |
| ---------------------- | ----------------------------- | :------: | ----------- |
| project\_id            | string                        |     ✔    |             |
| escalation\_policy\_id | string                        |     ✘    |             |
| options                | [AlertOptions](#alertoptions) |     ✘    |             |
| domain\_id             | string                        |     ✔    |             |
