# Storage

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

## Storage

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

| NO | Method                               | Request Type                                              | Response Type                                                                                                      | Description |
| -- | ------------------------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | [**register**](#register)            | [RegisterStorageRequest](#registerstoragerequest)         | [StorageInfo](#storageinfo)                                                                                        |             |
| 2  | [**update**](#update)                | [UpdateStorageRequest](#updatestoragerequest)             | [StorageInfo](#storageinfo)                                                                                        |             |
| 3  | [**update\_plugin**](#update_plugin) | [UpdateStoragePluginRequest](#updatestoragepluginrequest) | [StorageInfo](#storageinfo)                                                                                        |             |
| 4  | [**verify\_plugin**](#verify_plugin) | [StorageRequest](#storagerequest)                         | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 5  | [**enable**](#enable)                | [StorageRequest](#storagerequest)                         | [StorageInfo](#storageinfo)                                                                                        |             |
| 6  | [**disable**](#disable)              | [StorageRequest](#storagerequest)                         | [StorageInfo](#storageinfo)                                                                                        |             |
| 7  | [**deregister**](#deregister)        | [StorageRequest](#storagerequest)                         | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 8  | [**get**](#get)                      | [GetStorageRequest](#getstoragerequest)                   | [StorageInfo](#storageinfo)                                                                                        |             |
| 9  | [**list**](#list)                    | [StorageQuery](#storagequery)                             | [StoragesInfo](#storagesinfo)                                                                                      |             |
| 10 | [**stat**](#stat)                    | [StorageStatQuery](#storagestatquery)                     | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### register

> **POST** /statistics/v1/storages

| Type     | Message                                           |
| -------- | ------------------------------------------------- |
| Request  | [RegisterStorageRequest](#registerstoragerequest) |
| Response | [StorageInfo](#storageinfo)                       |

### update

> **PUT** /statistics/v1/storage/{storage\_id}

| Type     | Message                                       |
| -------- | --------------------------------------------- |
| Request  | [UpdateStorageRequest](#updatestoragerequest) |
| Response | [StorageInfo](#storageinfo)                   |

### update\_plugin

> **PUT** /spot-automation/v1/storage/{storage\_id}/plugin

| Type     | Message                                                   |
| -------- | --------------------------------------------------------- |
| Request  | [UpdateStoragePluginRequest](#updatestoragepluginrequest) |
| Response | [StorageInfo](#storageinfo)                               |

### verify\_plugin

> **POST** /spot-automation/v1/storage/{storage\_id}/plugin/verify

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

### enable

> **PUT** /statistics/v1/storage/{schedule\_id}/enable

| Type     | Message                           |
| -------- | --------------------------------- |
| Request  | [StorageRequest](#storagerequest) |
| Response | [StorageInfo](#storageinfo)       |

### disable

> **PUT** /statistics/v1/storage/{schedule\_id}/disable

| Type     | Message                           |
| -------- | --------------------------------- |
| Request  | [StorageRequest](#storagerequest) |
| Response | [StorageInfo](#storageinfo)       |

### deregister

> **DELETE** /statistics/v1/storage/{schedule\_id}

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

### get

> **GET** /statistics/v1/storage/{schedule\_id}

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [GetStorageRequest](#getstoragerequest) |
| Response | [StorageInfo](#storageinfo)             |

### list

> **GET** /statistics/v1/storages
>
> **POST** /statistics/v1/storages/search

| Type     | Message                       |
| -------- | ----------------------------- |
| Request  | [StorageQuery](#storagequery) |
| Response | [StoragesInfo](#storagesinfo) |

### stat

> **POST** /statistics/v1/storages/stat

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

## Message

### GetStorageRequest

| No | Field       | Type           | Required | Description |
| -- | ----------- | -------------- | :------: | ----------- |
| 1  | storage\_id | string         |     ✅    |             |
| 2  | domain\_id  | string         |     ✅    |             |
| 3  | only        | list of string |     ❌    |             |

### PluginInfo

| No | Field      | Type                                                                                                               | Description |
| -- | ---------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | plugin\_id | string                                                                                                             |             |
| 2  | version    | string                                                                                                             |             |
| 3  | options    | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 4  | secret\_id | string                                                                                                             |             |
| 5  | metadata   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### PluginRequest

| No | Field        | Type                                                                                                               | Description |
| -- | ------------ | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | plugin\_id   | string                                                                                                             |             |
| 2  | version      | string                                                                                                             |             |
| 3  | options      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 4  | secret\_data | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 5  | schema       | string                                                                                                             |             |

### RegisterStorageRequest

| No | Field        | Type                                                                                                               | Required | Description |
| -- | ------------ | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| 1  | name         | string                                                                                                             |     ✅    |             |
| 2  | plugin\_info | [PluginRequest](#pluginrequest)                                                                                    |     ❌    |             |
| 3  | tags         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |
| 4  | user\_id     | string                                                                                                             |     ✅    |             |
| 5  | domain\_id   | string                                                                                                             |     ✅    |             |

### StorageInfo

| No | Field        | Type                                                                                                               | Description |
| -- | ------------ | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | storage\_id  | string                                                                                                             |             |
| 2  | name         | string                                                                                                             |             |
| 3  | state        | <ul><li>NONE</li><li>ENABLED</li><li>DISABLED</li></ul>                                                            |             |
| 4  | options      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 5  | capability   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 6  | plugin\_info | [PluginInfo](#plugininfo)                                                                                          |             |
| 7  | tags         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 8  | user\_id     | string                                                                                                             |             |
| 9  | domain\_id   | string                                                                                                             |             |
| 10 | created\_at  | string                                                                                                             |             |

### StorageQuery

| No | Field       | Type                                                                                               | Required | Description |
| -- | ----------- | -------------------------------------------------------------------------------------------------- | :------: | ----------- |
| 1  | query       | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) |     ❌    |             |
| 2  | storage\_id | string                                                                                             |     ❌    |             |
| 3  | name        | string                                                                                             |     ❌    |             |
| 4  | state       | string                                                                                             |     ❌    |             |
| 5  | user\_id    | string                                                                                             |     ❌    |             |
| 6  | domain\_id  | string                                                                                             |     ✅    |             |

### StorageRequest

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

### StorageStatQuery

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

### StoragesInfo

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

### UpdateStoragePluginRequest

| No | Field        | Type                                                                                                               | Required | Description |
| -- | ------------ | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| 1  | storage\_id  | string                                                                                                             |     ✅    |             |
| 2  | version      | string                                                                                                             |     ❌    |             |
| 3  | options      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |
| 4  | secret\_data | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |
| 5  | domain\_id   | string                                                                                                             |     ✅    |             |

### UpdateStorageRequest

| No | Field       | Type                                                                                                               | Required | Description |
| -- | ----------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| 1  | storage\_id | string                                                                                                             |     ✅    |             |
| 2  | name        | string                                                                                                             |     ❌    |             |
| 3  | tags        | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |
| 4  | domain\_id  | string                                                                                                             |     ✅    |             |
