# Plugin

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

## Plugin

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

| NO | Method                             | Request Type                                              | Response Type                                                                                                      | Description |
| -- | ---------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | [**register**](#register)          | [CreatePluginRequest](#createpluginrequest)               | [PluginInfo](#plugininfo)                                                                                          |             |
| 2  | [**update**](#update)              | [UpdatePluginRequest](#updatepluginrequest)               | [PluginInfo](#plugininfo)                                                                                          |             |
| 3  | [**deregister**](#deregister)      | [PluginRequest](#pluginrequest)                           | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 4  | [**enable**](#enable)              | [PluginRequest](#pluginrequest)                           | [PluginInfo](#plugininfo)                                                                                          |             |
| 5  | [**disable**](#disable)            | [PluginRequest](#pluginrequest)                           | [PluginInfo](#plugininfo)                                                                                          |             |
| 6  | [**get\_versions**](#get_versions) | [RepositoryPluginRequest](#repositorypluginrequest)       | [VersionsInfo](#versionsinfo)                                                                                      |             |
| 7  | [**get**](#get)                    | [GetRepositoryPluginRequest](#getrepositorypluginrequest) | [PluginInfo](#plugininfo)                                                                                          |             |
| 8  | [**list**](#list)                  | [PluginQuery](#pluginquery)                               | [PluginsInfo](#pluginsinfo)                                                                                        |             |
| 9  | [**stat**](#stat)                  | [PluginStatQuery](#pluginstatquery)                       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### register

> **POST** /repository/v1/plugins

| Type     | Message                                     |
| -------- | ------------------------------------------- |
| Request  | [CreatePluginRequest](#createpluginrequest) |
| Response | [PluginInfo](#plugininfo)                   |

### update

> **PUT** /repository/v1/plugin/{plugin\_id}

| Type     | Message                                     |
| -------- | ------------------------------------------- |
| Request  | [UpdatePluginRequest](#updatepluginrequest) |
| Response | [PluginInfo](#plugininfo)                   |

### deregister

> **DELETE** /repository/v1/plugin/{plugin\_id}

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

### enable

> **PUT** /repository/v1/plugin/{plugin\_id}/enable

| Type     | Message                         |
| -------- | ------------------------------- |
| Request  | [PluginRequest](#pluginrequest) |
| Response | [PluginInfo](#plugininfo)       |

### disable

> **PUT** /repository/v1/plugin/{plugin\_id}/disable

| Type     | Message                         |
| -------- | ------------------------------- |
| Request  | [PluginRequest](#pluginrequest) |
| Response | [PluginInfo](#plugininfo)       |

### get\_versions

> **GET** /repository/v1/plugins/{plugin\_id}/versions

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [RepositoryPluginRequest](#repositorypluginrequest) |
| Response | [VersionsInfo](#versionsinfo)                       |

### get

> **GET** /repository/v1/plugins/{plugin\_id}

| Type     | Message                                                   |
| -------- | --------------------------------------------------------- |
| Request  | [GetRepositoryPluginRequest](#getrepositorypluginrequest) |
| Response | [PluginInfo](#plugininfo)                                 |

### list

> **GET** /repository/v1/plugins
>
> **POST** /repository/v1/plugins/search

| Type     | Message                     |
| -------- | --------------------------- |
| Request  | [PluginQuery](#pluginquery) |
| Response | [PluginsInfo](#pluginsinfo) |

### stat

> **POST** /repository/v1/plugins/stat

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

## Message

### CreatePluginRequest

| No | Field         | Type                                                                                                               | Required | Description |
| -- | ------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| 1  | name          | string                                                                                                             | ✅        |             |
| 2  | service\_type | string                                                                                                             | ✅        |             |
| 3  | image         | string                                                                                                             | ✅        |             |
| 4  | provider      | string                                                                                                             | ❌        |             |
| 5  | capability    | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 6  | template      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 7  | labels        | [google.protobuf.ListValue](https://developers.google.com/protocol-buffers/docs/reference/overview)                | ❌        |             |
| 8  | tags          | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 9  | project\_id   | string                                                                                                             | ❌        |             |
| 10 | domain\_id    | string                                                                                                             | ✅        |             |

### GetRepositoryPluginRequest

| No | Field          | Type           | Required | Description |
| -- | -------------- | -------------- | -------- | ----------- |
| 1  | plugin\_id     | string         | ✅        |             |
| 2  | domain\_id     | string         | ✅        |             |
| 3  | repository\_id | string         | ❌        |             |
| 4  | only           | list of string | ❌        |             |

### PluginInfo

| No | Field            | Type                                                                                                               | Description |
| -- | ---------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | plugin\_id       | string                                                                                                             |             |
| 2  | name             | string                                                                                                             |             |
| 3  | image            | string                                                                                                             |             |
| 4  | registry\_url    | string                                                                                                             |             |
| 5  | state            | <ul><li>NONE</li><li>ENABLED</li><li>DISABLED</li></ul>                                                            |             |
| 6  | service\_type    | string                                                                                                             |             |
| 7  | provider         | string                                                                                                             |             |
| 8  | capability       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 9  | template         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 10 | labels           | [google.protobuf.ListValue](https://developers.google.com/protocol-buffers/docs/reference/overview)                |             |
| 11 | tags             | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 12 | repository\_info | [RepositoryInfo](#repositoryinfo)                                                                                  |             |
| 13 | project\_id      | string                                                                                                             |             |
| 14 | domain\_id       | string                                                                                                             |             |
| 15 | created\_at      | string                                                                                                             |             |
| 16 | updated\_at      | string                                                                                                             |             |

### PluginQuery

| No | Field          | Type                                                                                               | Required | Description |
| -- | -------------- | -------------------------------------------------------------------------------------------------- | -------- | ----------- |
| 1  | query          | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) | ❌        |             |
| 2  | plugin\_id     | string                                                                                             | ❌        |             |
| 3  | name           | string                                                                                             | ❌        |             |
| 4  | state          | <ul><li>NONE</li><li>ENABLED</li><li>DISABLED</li></ul>                                            | ❌        |             |
| 5  | service\_type  | string                                                                                             | ❌        |             |
| 6  | provider       | string                                                                                             | ❌        |             |
| 7  | repository\_id | string                                                                                             | ✅        |             |
| 8  | domain\_id     | string                                                                                             | ✅        |             |

### PluginRequest

| No | Field      | Type   | Required | Description |
| -- | ---------- | ------ | -------- | ----------- |
| 1  | plugin\_id | string | ✅        |             |
| 2  | domain\_id | string | ✅        |             |

### PluginStatQuery

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

### PluginsInfo

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

### RepositoryPluginRequest

| No | Field          | Type   | Required | Description |
| -- | -------------- | ------ | -------- | ----------- |
| 1  | plugin\_id     | string | ✅        |             |
| 2  | domain\_id     | string | ✅        |             |
| 3  | repository\_id | string | ❌        |             |

### UpdatePluginRequest

| No | Field      | Type                                                                                                               | Required | Description |
| -- | ---------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| 1  | plugin\_id | string                                                                                                             | ✅        |             |
| 2  | name       | string                                                                                                             | ❌        |             |
| 3  | capability | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 4  | template   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 5  | labels     | [google.protobuf.ListValue](https://developers.google.com/protocol-buffers/docs/reference/overview)                | ❌        |             |
| 6  | tags       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 7  | domain\_id | string                                                                                                             | ✅        |             |

### VersionsInfo

| No | Field        | Type                                                                                            | Description      |
| -- | ------------ | ----------------------------------------------------------------------------------------------- | ---------------- |
| 1  | version      | list of string                                                                                  | deprecated field |
| 2  | total\_count | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |                  |
| 3  | results      | list of string                                                                                  |                  |
