# Supervisor

A Supervisor is a resource managing the lifecycle of the plugin instances to deploy. A Supervisor manages the deployment of plugin instances by deploying or deleting the `pod` of the plugin instances.

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

\ <br>

## Supervisor

**Supervisor Methods:**

| Method                                                                                                                               | Request                                                                                                                                               | Response                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [**publish**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#publish)                | [PublishSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#publishsupervisorrequest)   | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**register**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#register)              | [RegisterSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#registersupervisorrequest) | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#update)                  | [RegisterSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#registersupervisorrequest) | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**deregister**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#deregister)          | [SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)                 | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#empty)                     |
| [**enable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#enable)                  | [SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)                 | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**disable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#disable)                | [SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)                 | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**recover\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#recover_plugin) | [RecoverPluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#recoverpluginrequest)           | [PluginInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#plugininfo)           |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#get)                        | [SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)                 | [SupervisorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#list)                      | [SupervisorQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorquery)                     | [SupervisorsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorsinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#stat)                      | [SupervisorStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorstatquery)             | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#struct)                   |
| [**list\_plugins**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#list_plugins)     | [PluginQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#pluginquery)                             | [PluginsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#pluginsinfo)         |

<br>

### publish

Creates a new Supervisor. Only Users with the `MANAGED` permission can set the Supervisor `public`. The Supervisor manages the lifecycle of plugin instances by the Supervisor's state. When a Supervisor is created, the state of the resource is `PENDING`. If the state remains the same for 5 minutes, the state is changed to `DISCONNECTED`.

{{< tabs " publish " >}}

{{< tab "Request Example" >}}

[PublishSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#publishsupervisorrequest)

* **name** (string) `Required`
* **hostname** (string) `Required`
* **domain\_id** (string) `Required`
* **secret\_key** (string)
* **plugin\_info** (PluginInfo) `Repeated`
* **is\_public** (bool)
* **labels** (ListValue)
* **tags** (Struct)

{{< highlight json >}} { "name": "test", "hostname": "dev-test2", "secret\_key": "xxxxx", "tags": { "a": "b" } } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### register

Registers a specific Supervisor. You must specify the `supervisor_id` of the Supervisor to register. The `state` of the Supervisor changes from `PENDING` to `ENABLED`.

{{< tabs " register " >}}

{{< tab "Request Example" >}}

[RegisterSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#registersupervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **name** (string)
* **is\_public** (bool)
* **priority** (int32)
* **labels** (Struct)
* **tags** (Struct)

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "is\_public": true, "priority": 10, "labels": { "a": "b" }, "tags": { "c": "d" }, "domain\_id": "domain-1c5a6b8181ad" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update

Updates a specific Supervisor. You can make changes in Supervisor settings, including `labels`, `tags`, and the `bool` type parameter `is_public`.

{{< tabs " update " >}}

{{< tab "Request Example" >}}

[RegisterSupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#registersupervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **name** (string)
* **is\_public** (bool)
* **priority** (int32)
* **labels** (Struct)
* **tags** (Struct)

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "is\_public": true, "priority": 10, "labels": { "a": "b" }, "tags": { "c": "d" }, "domain\_id": "domain-1c5a6b8181ad" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### deregister

Deregisters and deletes a specific Supervisor. You must specify the `supervisor_id` of the Supervisor to deregister.

{{< tabs " deregister " >}}

{{< tab "Request Example" >}}

[SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-d73011256d55" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### enable

Enables a specific Supervisor. By changing the `state` parameter to `ENABLED`, the Supervisor can deploy or delete the `pod` of the plugin instance.

{{< tabs " enable " >}}

{{< tab "Request Example" >}}

[SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-d73011256d55" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### disable

Disables a specific Supervisor. By changing the `state` parameter to `DISABLED`, the Supervisor cannot deploy or delete the `pod` of the plugin instance.

{{< tabs " disable " >}}

{{< tab "Request Example" >}}

[SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-d73011256d55" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### recover\_plugin

Recovers a specific plugin instance in a specific Supervisor. Changes the `state` of the Supervisor to `RE-PROVISIONING`.

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

{{< tab "Request Example" >}}

[RecoverPluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#recoverpluginrequest)

* **supervisor\_id** (string) `Required`
* **version** (string) `Required`
* **domain\_id** (string) `Required`
* **plugin\_id** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-a4c287cba676", "plugin\_id": "plugin-api-direct-mon-webhook", "version": "1.1.0" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### get

{{< tabs " get " >}}

{{< tab "Request Example" >}}

[SupervisorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorrequest)

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-d73011256d55" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorInfo](#SUPERVISORINFO)

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "supervisor\_id": "supervisor-525982f2ae9a", "name": "test", "hostname": "dev-test2", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-01-15T05:42:02.999Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### list

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

{{< tabs " list " >}}

{{< tab "Request Example" >}}

[SupervisorQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#supervisorquery)

* **domain\_id** (string) `Required`
* **query** (Query)
* **supervisor\_id** (string)
* **name** (string)
* **is\_public** (bool)

{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SupervisorsInfo](#SUPERVISORSINFO)

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

{{< highlight json >}} { "results": \[ { "supervisor\_id": "supervisor-3a091f899539", "name": "root", "hostname": "dev-supervisor.svc.cluster.local", "state": "ENABLED", "is\_public": true, "domain\_id": "domain-1c5a6b8181ad", "labels": {}, "created\_at": "2020-05-12T00:24:48.250Z" }, { "supervisor\_id": "supervisor-a4c287cba676", "name": "test", "hostname": "dev-test", "state": "ENABLED", "domain\_id": "domain-1c5a6b8181ad", "tags": { "a": "b" }, "labels": {}, "created\_at": "2022-06-15T05:39:15.886Z" } ], "total\_count": 2 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### stat

<br>

### list\_plugins

Gets a list of all plugin instances regardless of Supervisors. Prints detailed information about the plugin instances, including `version`, `state`, and the relevant Supervisor.

{{< tabs " list\_plugins " >}}

{{< tab "Request Example" >}}

[PluginQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/plugin/v1/Supervisor/README.md#pluginquery)

* **domain\_id** (string) `Required`
* **query** (Query)
* **supervisor\_id** (string)
* **hostname** (string)
* **plugin\_id** (string)
* **version** (string)
* **state** (State)
* **endpoint** (string)

{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[PluginsInfo](#PLUGINSINFO)

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

{{< highlight json >}} { "results": \[ { "plugin\_id": "plugin-openstack-inven-collector", "version": "0.4.1.20220609.122832", "state": "ACTIVE", "endpoint": "grpc://plugin-openstack-inven-collector-vbnnsoszfjsneiqz.dev-supervisor.svc.cluster.local:50051", "supervisor\_id": "supervisor-3a091f899539", "supervisor\_name": "root", "managed": true, "endpoints": \[ "grpc://172.16.16.234:50051" ] }, { "plugin\_id": "plugin-zabbix-mon-webhook", "version": "1.0", "state": "ACTIVE", "endpoint": "grpc://plugin-zabbix-mon-webhook-dgqqfqsqidieeuk.dev-supervisor.svc.cluster.local:50051", "supervisor\_id": "supervisor-3a091f899539", "supervisor\_name": "root", "managed": true, "endpoints": \[ "grpc://172.16.16.130:50051" ] } ], "total\_count": 2 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

\ <br>

## Message

### PluginInfo

* **plugin\_id** (string) `Required`
* **version** (string) `Required`
* **state** (State) `Required`
* **endpoint** (string) `Required`
* **managed** (bool) `Required`
* **endpoints** (string) `Repeated` `Required`
* **domain\_id** (string) `Required`
* **supervisor\_id** (string) `Required`
* **supervisor\_name** (string) `Required`

  <br>

### PluginQuery

* **domain\_id** (string) `Required`
* **query** (Query)
* **supervisor\_id** (string)
* **hostname** (string)
* **plugin\_id** (string)
* **version** (string)
* **state** (State)
* **endpoint** (string)

  <br>

### PluginsInfo

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

  <br>

### PublishSupervisorRequest

* **name** (string) `Required`
* **hostname** (string) `Required`
* **domain\_id** (string) `Required`
* **secret\_key** (string)
* **plugin\_info** (PluginInfo) `Repeated`
* **is\_public** (bool)
* **labels** (ListValue)
* **tags** (Struct)

  <br>

### RecoverPluginRequest

* **supervisor\_id** (string) `Required`
* **version** (string) `Required`
* **domain\_id** (string) `Required`
* **plugin\_id** (string) `Required`

  <br>

### RegisterSupervisorRequest

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **name** (string)
* **is\_public** (bool)
* **priority** (int32)
* **labels** (Struct)
* **tags** (Struct)

  <br>

### SupervisorInfo

* **supervisor\_id** (string) `Required`
* **name** (string) `Required`
* **hostname** (string) `Required`
* **state** (State) `Required`
* **is\_public** (bool) `Required`
* **labels** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

  <br>

### SupervisorQuery

* **domain\_id** (string) `Required`
* **query** (Query)
* **supervisor\_id** (string)
* **name** (string)
* **is\_public** (bool)

  <br>

### SupervisorRequest

* **supervisor\_id** (string) `Required`
* **domain\_id** (string) `Required`

  <br>

### SupervisorStatQuery

* **query** (StatisticsQuery) `Required`
* **domain\_id** (string) `Required`

  <br>

### SupervisorsInfo

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

  <br>
