# Escalation Policy

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

## EscalationPolicy

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

| Method                           | Request                                                         | Response                                                                                                           |
| -------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create)            | [CreateEscalationPolicyRequest](#createescalationpolicyrequest) | [EscalationPolicyInfo](#escalationpolicyinfo)                                                                      |
| [**update**](#update)            | [UpdateEscalationPolicyRequest](#updateescalationpolicyrequest) | [EscalationPolicyInfo](#escalationpolicyinfo)                                                                      |
| [**set\_default**](#set_default) | [EscalationPolicyRequest](#escalationpolicyrequest)             | [EscalationPolicyInfo](#escalationpolicyinfo)                                                                      |
| [**delete**](#delete)            | [EscalationPolicyRequest](#escalationpolicyrequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)                  | [GetEscalationPolicyRequest](#getescalationpolicyrequest)       | [EscalationPolicyInfo](#escalationpolicyinfo)                                                                      |
| [**list**](#list)                | [EscalationPolicyQuery](#escalationpolicyquery)                 | [EscalationPoliciesInfo](#escalationpoliciesinfo)                                                                  |
| [**stat**](#stat)                | [EscalationPolicyStatQuery](#escalationpolicystatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /monitoring/v1/escalation-policies

> Creates a new EscalationPolicy. When creating an EscalationPolicy, if the project\_id is assigned, the EscalationPolicy is applied to the Project with the same project\_id. If an EscalationPolicy is set as a global policy, all Projects in the same domain can apply the policy.

| Type     | Message                                                         |
| -------- | --------------------------------------------------------------- |
| Request  | [CreateEscalationPolicyRequest](#createescalationpolicyrequest) |
| Response | [EscalationPolicyInfo](#escalationpolicyinfo)                   |

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

```
{
    "name": "es-test",
    "rules": [
        {
            "notification_level": "LV1",
            "escalate_minutes": 30
        },
        {
            "notification_level": "LV2",
            "escalate_minutes": 30
        }
    ],
    "repeat_count": 2,
    "finish_condition": "ACKNOWLEDGED",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "escalation_policy_id": "ep-526e536fdca9",
    "name": "es-test",
    "rules": [
        {
            "notification_level": "LV1",
            "escalate_minutes": 30
        },
        {
            "notification_level": "LV2",
            "escalate_minutes": 30
        }
    ],
    "repeat_count": 2,
    "finish_condition": "ACKNOWLEDGED",
    "scope": "GLOBAL",
    "tags": {},
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-21T09:22:45.340Z"
}
```

{% endtab %}
{% endtabs %}

### update

> **PUT** /monitoring/v1/escalation-policy/{escalation\_policy\_id}

> Updates a specific EscalationPolicy. You can make changes in EscalationPolicy settings, including the name, the escalation process, and the number of iterations.

| Type     | Message                                                         |
| -------- | --------------------------------------------------------------- |
| Request  | [UpdateEscalationPolicyRequest](#updateescalationpolicyrequest) |
| Response | [EscalationPolicyInfo](#escalationpolicyinfo)                   |

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

```
{
    "escalation_policy_id": "ep-526e536fdca9",
    "name": "es-test2",
    "rules": [
        {
            "notification_level": "LV1",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV2",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV3",
            "escalate_minutes": 15
        }
    ],
    "repeat_count": 1,
    "finish_condition": "RESOLVED",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "escalation_policy_id": "ep-526e536fdca9",
    "name": "es-test2",
    "rules": [
        {
            "notification_level": "LV1",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV2",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV3",
            "escalate_minutes": 15
        }
    ],
    "repeat_count": 1,
    "finish_condition": "RESOLVED",
    "scope": "GLOBAL",
    "tags": {},
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-21T09:22:45.340Z"
}
```

{% endtab %}
{% endtabs %}

### set\_default

> **PUT** /monitoring/v1/escalation-policy/{escalation\_policy\_id}/set-default

> Sets a specific EscalationPolicy as default. Only policies configured as global can be set as default. When a Project is created, even if you did not configure any policy to the Project, the default policy set by this api method is applied.

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [EscalationPolicyRequest](#escalationpolicyrequest) |
| Response | [EscalationPolicyInfo](#escalationpolicyinfo)       |

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

```
{
    "escalation_policy_id": "ep-526e536fdca9",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "escalation_policy_id": "ep-526e536fdca9",
    "name": "es-test2",
    "is_default": true,
    "rules": [
        {
            "notification_level": "LV1",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV2",
            "escalate_minutes": 15
        },
        {
            "notification_level": "LV3",
            "escalate_minutes": 15
        }
    ],
    "repeat_count": 1,
    "finish_condition": "RESOLVED",
    "scope": "GLOBAL",
    "tags": {},
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-21T09:22:45.340Z"
}
```

{% endtab %}
{% endtabs %}

### delete

> **DELETE** /monitoring/v1/escalation-policy/{escalation\_policy\_id}

> Deletes a specific EscalationPolicy. Deletes the EscalationPolicy with the escalation\_policy\_id from the deletion request.

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

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

```
{
    "escalation_policy_id": "ep-d75670166af4",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}
{% endtabs %}

### get

> **GET** /monitoring/v1/escalation-policy/{escalation\_policy\_id}

> Gets a specific EscalationPolicy. Prints detailed information about the EscalationPolicy, including the name, rules, and termination conditions.

| Type     | Message                                                   |
| -------- | --------------------------------------------------------- |
| Request  | [GetEscalationPolicyRequest](#getescalationpolicyrequest) |
| Response | [EscalationPolicyInfo](#escalationpolicyinfo)             |

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

```
{
    "escalation_policy_id": "ep-d75670166af4",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "escalation_policy_id": "ep-d75670166af4",
    "name": "0525-ms-test-2",
    "rules": [
        {
            "notification_level": "LV2",
            "escalate_minutes": 30
        },
        {
            "notification_level": "LV2"
        }
    ],
    "finish_condition": "ACKNOWLEDGED",
    "scope": "GLOBAL",
    "tags": {},
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-05-25T09:31:38.573Z"
}
```

{% endtab %}
{% endtabs %}

### list

> **GET** /monitoring/v1/escalation-policies
>
> **POST** /monitoring/v1/escalation-policies/search

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

| Type     | Message                                           |
| -------- | ------------------------------------------------- |
| Request  | [EscalationPolicyQuery](#escalationpolicyquery)   |
| Response | [EscalationPoliciesInfo](#escalationpoliciesinfo) |

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

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

{% endtab %}

{% tab title="Response Example" %}

```
{
    "results": [
        {
            "escalation_policy_id": "ep-7c9745003372",
            "name": "0525-ms-test-1",
            "rules": [
                {
                    "notification_level": "LV1"
                }
            ],
            "finish_condition": "ACKNOWLEDGED",
            "scope": "GLOBAL",
            "tags": {},
            "domain_id": "domain-58010aa2e451",
            "created_at": "2022-05-25T09:31:15.150Z"
        },
        {
            "escalation_policy_id": "ep-d75670166af4",
            "name": "0525-ms-test-2",
            "rules": [
                {
                    "notification_level": "LV2",
                    "escalate_minutes": 30
                },
                {
                    "notification_level": "LV2"
                }
            ],
            "finish_condition": "ACKNOWLEDGED",
            "scope": "GLOBAL",
            "tags": {},
            "domain_id": "domain-58010aa2e451",
            "created_at": "2022-05-25T09:31:38.573Z"
        }
    ],
    "total_count": 2
}
```

{% endtab %}
{% endtabs %}

### stat

> **POST** /monitoring/v1/escalation-policies/stat

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

##

## Message

### CreateEscalationPolicyRequest

| Field             | Type                                                                                                               | Required | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| name              | string                                                                                                             | ✔        |             |
| rules             | [list of EscalationPolicyRule](#escalationpolicyrule)                                                              | ✔        |             |
| repeat\_count     | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    | ✘        |             |
| finish\_condition | <ul><li>NONE</li><li>ACKNOWLEDGED</li><li>RESOLVED</li></ul>                                                       | ✘        |             |
| project\_id       | string                                                                                                             | ✘        |             |
| tags              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| domain\_id        | string                                                                                                             | ✔        |             |

### EscalationPoliciesInfo

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

### EscalationPolicyInfo

| Field                  | Type                                                                                                               | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| escalation\_policy\_id | string                                                                                                             |             |
| name                   | string                                                                                                             |             |
| is\_default            | bool                                                                                                               |             |
| rules                  | [list of EscalationPolicyRule](#escalationpolicyrule)                                                              |             |
| repeat\_count          | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |             |
| finish\_condition      | <ul><li>NONE</li><li>ACKNOWLEDGED</li><li>RESOLVED</li></ul>                                                       |             |
| scope                  | <ul><li>SCOPE\_NONE</li><li>GLOBAL</li><li>PROJECT</li></ul>                                                       |             |
| project\_id            | string                                                                                                             |             |
| tags                   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| domain\_id             | string                                                                                                             |             |
| created\_at            | string                                                                                                             |             |

### EscalationPolicyQuery

| Field                  | Type                                                                                               | Required | Description |
| ---------------------- | -------------------------------------------------------------------------------------------------- | -------- | ----------- |
| query                  | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) | ✘        |             |
| escalation\_policy\_id | string                                                                                             | ✘        |             |
| name                   | string                                                                                             | ✘        |             |
| is\_default            | bool                                                                                               | ✘        |             |
| finish\_condition      | <ul><li>NONE</li><li>ACKNOWLEDGED</li><li>RESOLVED</li></ul>                                       | ✘        |             |
| scope                  | <ul><li>SCOPE\_NONE</li><li>GLOBAL</li><li>PROJECT</li></ul>                                       | ✘        |             |
| project\_id            | string                                                                                             | ✘        |             |
| domain\_id             | string                                                                                             | ✔        |             |

### EscalationPolicyRequest

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

### EscalationPolicyRule

| Field               | Type                                                                                            | Description |
| ------------------- | ----------------------------------------------------------------------------------------------- | ----------- |
| notification\_level | <ul><li>NONE</li><li>ALL</li><li>LV1</li><li>LV2</li><li>LV3</li><li>LV4</li><li>LV5</li></ul>  |             |
| escalate\_minutes   | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |             |

### EscalationPolicyStatQuery

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

### GetEscalationPolicyRequest

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

### UpdateEscalationPolicyRequest

| Field                  | Type                                                                                                               | Required | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| escalation\_policy\_id | string                                                                                                             | ✔        |             |
| name                   | string                                                                                                             | ✘        |             |
| rules                  | [list of EscalationPolicyRule](#escalationpolicyrule)                                                              | ✘        |             |
| repeat\_count          | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    | ✘        |             |
| finish\_condition      | <ul><li>NONE</li><li>ACKNOWLEDGED</li><li>RESOLVED</li></ul>                                                       | ✘        |             |
| tags                   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| domain\_id             | string                                                                                                             | ✔        |             |
