# Webhook

A Webhook is a plugin instance receiving data from external monitoring systems.

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

\ <br>

## Webhook

**Webhook Methods:**

| Method                                                                                                                              | Request                                                                                                                                                  | Response                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#create)                | [CreateWebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#createwebhookrequest)             | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#update)                | [UpdateWebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#updatewebhookrequest)             | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**update\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#update_plugin) | [UpdateWebhookPluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#updatewebhookpluginrequest) | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**verify\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#verify_plugin) | [WebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookrequest)                         | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#empty)               |
| [**enable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#enable)                | [WebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookrequest)                         | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**disable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#disable)              | [WebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookrequest)                         | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#delete)                | [WebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookrequest)                         | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#empty)               |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#get)                      | [WebhookRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookrequest)                         | [WebhookInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#list)                    | [WebhookQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookquery)                             | [WebhooksInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhooksinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#stat)                    | [WebhookStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#webhookstatquery)                     | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/monitoring/v1/Webhook/README.md#struct)             |

<br>

### create

Creates a new Webhook. A Webhook collects data from an external monitoring system with a webhook URL generated by the resource.

> **POST** /monitoring/v1/webhook/create

{{< tabs " create " >}}

{{< tab "Request Example" >}}

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

* **name** (string) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **project\_id** (string) `Required`
* **tags** (Struct)

{{< highlight json >}} { "name": "aws-sns-webhook-for-phd", "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "options": {} }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update

Updates a specific Webhook. You can make changes in Webhook settings, including the name and tags.

> **POST** /monitoring/v1/webhook/update

{{< tabs " update " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`
* **name** (string)
* **tags** (Struct)

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-cloudwatch", "domain\_id": "domain-123456789012" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update\_plugin

Updates the plugin of a specific DataSource. You can change the `version` of the plugin and select the `upgrade_mode` among `AUTO`, `MANUAL`, and `NONE`.

> **POST** /monitoring/v1/webhook/update-plugin

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

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`
* **version** (string)
* **options** (Struct)
* **upgrade\_mode** (UpgradeMode)

{{< highlight json >}} { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### verify\_plugin

Verifies a specific plugin for a Webhook.

> **POST** /monitoring/v1/webhook/verify-plugin

{{< tabs " verify\_plugin " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`

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

{{< /tabs >}}

<br>

### enable

Enables a specific Webhook. By enabling a Webhook, you can communicate with an external application.

> **POST** /monitoring/v1/webhook/enable

{{< tabs " enable " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`

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

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### disable

Disables a specific Webhook. By disabling a Webhook, you cannot communicate with an external application, as the webhook URL from the Webhook becomes invalid.

> **POST** /monitoring/v1/webhook/disable

{{< tabs " disable " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`

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

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### delete

Deletes a specific Webhook. By deleting a Webhook, you cannot collect data from an external monitoring system, as the `REST URL` is also deleted.

> **POST** /monitoring/v1/webhook/delete

{{< tabs " delete " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`

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

{{< /tabs >}}

<br>

### get

Gets a specific Webhook. Prints detailed information about the Webhook, including the name, the version, and the created datetime.

> **POST** /monitoring/v1/webhook/get

{{< tabs " get " >}}

{{< tab "Request Example" >}}

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

* **webhook\_id** (string) `Required`

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

{{< tab "Response Example" >}}

[WebhookInfo](#WEBHOOKINFO)

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

{{< highlight json >}} { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-phd", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### list

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

> **POST** /monitoring/v1/webhook/list

{{< tabs " list " >}}

{{< tab "Request Example" >}}

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

* **query** (Query)
* **webhook\_id** (string)
* **name** (string)
* **state** (WebhookState)
* **access\_key** (string)
* **workspace\_id** (string)
* **project\_id** (string)

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

{{< tab "Response Example" >}}

[WebhooksInfo](#WEBHOOKSINFO)

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

{{< highlight json >}} { "results": \[ { "webhook\_id": "webhook-123456789012", "name": "aws-sns-webhook-for-cloudwatch", "state": "ENABLED", "access\_key": "1234567890123456789012345678901", "webhook\_url": "<https://monitoring-webhook.dev.spaceone.dev/monitoring/v1/webhook/webhook-123456789012/1234567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-aws-sns-mon-webhook", "version": "1.2.2", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:23:33.875Z" }, { "webhook\_id": "webhook-987654321098", "name": "zabbix-webhook", "state": "ENABLED", "access\_key": "9876567890123456789012345678901", "webhook\_url": "<https://monitoring-webhook.dev.spaceone.dev/monitoring/v1/webhook/webhook-987654321098/9876567890123456789012345678901/events>", "capability": {}, "plugin\_info": { "plugin\_id": "plugin-zabbix-mon-webhook", "version": "1.0", "options": {}, "metadata": {}, "upgrade\_mode": "AUTO" }, "project\_id": "project-123456789012", "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T07:42:31.872Z" } ], "total\_count": 2 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### stat

> **POST** /monitoring/v1/webhook/stat

\ <br>

## Message

### CreateWebhookRequest

* **name** (string) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **project\_id** (string) `Required`
* **tags** (Struct)

  <br>

### UpdateWebhookPluginRequest

* **webhook\_id** (string) `Required`
* **version** (string)
* **options** (Struct)
* **upgrade\_mode** (UpgradeMode)

  <br>

### UpdateWebhookRequest

* **webhook\_id** (string) `Required`
* **name** (string)
* **tags** (Struct)

  <br>

### WebhookInfo

* **webhook\_id** (string) `Required`
* **name** (string) `Required`
* **state** (WebhookState) `Required`
* **access\_key** (string) `Required`
* **webhook\_url** (string) `Required`
* **capability** (Struct) `Required`
* **plugin\_info** (WebhookPluginInfo) `Required`
* **tags** (Struct) `Required`
* **requests** (WebhookRequests) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **created\_at** (string) `Required`

  <br>

### WebhookPluginInfo

* **plugin\_id** (string) `Required`
* **version** (string) `Required`
* **options** (Struct) `Required`
* **metadata** (Struct) `Required`
* **upgrade\_mode** (UpgradeMode) `Required`

  <br>

### WebhookQuery

* **query** (Query)
* **webhook\_id** (string)
* **name** (string)
* **state** (WebhookState)
* **access\_key** (string)
* **workspace\_id** (string)
* **project\_id** (string)

  <br>

### WebhookRequest

* **webhook\_id** (string) `Required`

  <br>

### WebhookRequests

* **total** (int64) `Required`
* **error** (int64) `Required`

  <br>

### WebhookStatQuery

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

  <br>

### WebhooksInfo

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

  <br>
