# Note

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

## Note

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

| Method                | Request                                 | Response                                                                                                           |
| --------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create) | [CreateNoteRequest](#createnoterequest) | [NoteInfo](#noteinfo)                                                                                              |
| [**update**](#update) | [UpdateNoteRequest](#updatenoterequest) | [NoteInfo](#noteinfo)                                                                                              |
| [**delete**](#delete) | [NoteRequest](#noterequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)       | [GetNoteRequest](#getnoterequest)       | [NoteInfo](#noteinfo)                                                                                              |
| [**list**](#list)     | [NoteQuery](#notequery)                 | [NotesInfo](#notesinfo)                                                                                            |
| [**stat**](#stat)     | [NoteStatQuery](#notestatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /monitoring/v1/notes

> Creates a new Note. You can create Notes for each Alert to record the information needed to manage the Alerts.

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [CreateNoteRequest](#createnoterequest) |
| Response | [NoteInfo](#noteinfo)                   |

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

```
{
    "alert_id": "alert-160ce04f6908",
    "note": "This is a description",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "note_id": "note-df107d31bf20",
    "alert_id": "alert-160ce04f6908",
    "note": "This is a description",
    "created_by": "seolmin@mz.co.kr",
    "project_id": "project-52a423012d5e",
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-29T08:26:14.418Z"
}
```

{% endtab %}
{% endtabs %}

### update

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

> Updates a specific Note. You must specify the `note_id` for Note validation check. If the Note exists, it is updated.

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [UpdateNoteRequest](#updatenoterequest) |
| Response | [NoteInfo](#noteinfo)                   |

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

```
{
    "note_id": "note-df107d31bf20",
    "note": "This is a test",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "note_id": "note-df107d31bf20",
    "alert_id": "alert-160ce04f6908",
    "note": "This is a test",
    "created_by": "seolmin@mz.co.kr",
    "project_id": "project-52a423012d5e",
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-29T08:26:14.418Z"
}
```

{% endtab %}
{% endtabs %}

### delete

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

> Deletes a specific Note. You must specify the `note_id` of the Note to delete.

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

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

```
{
    "note_id": "note-0bfac585bf5a",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}
{% endtabs %}

### get

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

> Gets a specific Note. You must specify the `note_id` and `domain_id`.

| Type     | Message                           |
| -------- | --------------------------------- |
| Request  | [GetNoteRequest](#getnoterequest) |
| Response | [NoteInfo](#noteinfo)             |

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

```
{
    "note_id": "note-0bfac585bf5a",
    "domain_id": "domain-58010aa2e451"
}
```

{% endtab %}

{% tab title="Response Example" %}

```
{
    "note_id": "note-0bfac585bf5a",
    "alert_id": "alert-fbfd78e43df8",
    "note": "test",
    "created_by": "hykang@mz.co.kr",
    "project_id": "project-52a423012d5e",
    "domain_id": "domain-58010aa2e451",
    "created_at": "2022-06-23T09:52:42.251Z"
}
```

{% endtab %}
{% endtabs %}

### list

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

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

| Type     | Message                 |
| -------- | ----------------------- |
| Request  | [NoteQuery](#notequery) |
| Response | [NotesInfo](#notesinfo) |

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

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

{% endtab %}

{% tab title="Response Example" %}

```
{
    "results": [
        {
            "note_id": "note-0597bd748be0",
            "alert_id": "alert-fbfd78e43df8",
            "note": "http://spaceone.org",
            "created_by": "hykang@mz.co.kr",
            "project_id": "project-52a423012d5e",
            "domain_id": "domain-58010aa2e451",
            "created_at": "2022-06-23T09:58:23.838Z"
        },
        {
            "note_id": "note-0bfac585bf5a",
            "alert_id": "alert-fbfd78e43df8",
            "note": "test",
            "created_by": "hykang@mz.co.kr",
            "project_id": "project-52a423012d5e",
            "domain_id": "domain-58010aa2e451",
            "created_at": "2022-06-23T09:52:42.251Z"
        }
    ],
    "total_count": 2
}
```

{% endtab %}
{% endtabs %}

### stat

> **POST** /monitoring/v1/notes/stat

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

##

## Message

### CreateNoteRequest

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

### GetNoteRequest

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

### NoteInfo

| Field       | Type   | Description |
| ----------- | ------ | ----------- |
| note\_id    | string |             |
| alert\_id   | string |             |
| note        | string |             |
| created\_by | string |             |
| project\_id | string |             |
| domain\_id  | string |             |
| created\_at | string |             |

### NoteQuery

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

### NoteRequest

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

### NoteStatQuery

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

### NotesInfo

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

### UpdateNoteRequest

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