# Secret Group

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

## SecretGroup

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

| NO | Method                               | Request Type                                          | Response Type                                                                                                      | Description |
| -- | ------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | [**create**](#create)                | [CreateSecretGroupRequest](#createsecretgrouprequest) | [SecretGroupInfo](#secretgroupinfo)                                                                                |             |
| 2  | [**update**](#update)                | [UpdateSecretGroupRequest](#updatesecretgrouprequest) | [SecretGroupInfo](#secretgroupinfo)                                                                                |             |
| 3  | [**add\_secret**](#add_secret)       | [SecretGroupSecretRequest](#secretgroupsecretrequest) | [SecretGroupSecretInfo](#secretgroupsecretinfo)                                                                    |             |
| 4  | [**remove\_secret**](#remove_secret) | [SecretGroupSecretRequest](#secretgroupsecretrequest) | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 5  | [**delete**](#delete)                | [SecretGroupRequest](#secretgrouprequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 6  | [**get**](#get)                      | [GetSecretGroupRequest](#getsecretgrouprequest)       | [SecretGroupInfo](#secretgroupinfo)                                                                                |             |
| 7  | [**list**](#list)                    | [SecretGroupQuery](#secretgroupquery)                 | [SecretGroupsInfo](#secretgroupsinfo)                                                                              |             |
| 8  | [**stat**](#stat)                    | [SecretGroupStatQuery](#secretgroupstatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### create

> **POST** /secret/v1/secret-groups

| Type     | Message                                               |
| -------- | ----------------------------------------------------- |
| Request  | [CreateSecretGroupRequest](#createsecretgrouprequest) |
| Response | [SecretGroupInfo](#secretgroupinfo)                   |

### update

> **PUT** /secret/v1/secret-group/{secret\_group\_id}

| Type     | Message                                               |
| -------- | ----------------------------------------------------- |
| Request  | [UpdateSecretGroupRequest](#updatesecretgrouprequest) |
| Response | [SecretGroupInfo](#secretgroupinfo)                   |

### add\_secret

> **POST** /secret/v1/secret-group/{secret\_group\_id}/secrets

| Type     | Message                                               |
| -------- | ----------------------------------------------------- |
| Request  | [SecretGroupSecretRequest](#secretgroupsecretrequest) |
| Response | [SecretGroupSecretInfo](#secretgroupsecretinfo)       |

### remove\_secret

> **DELETE** /secret/v1/secret-group/{secret\_group\_id}/secret/{secret\_id}

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

### delete

> **DELETE** /secret/v1/secret-group/{secret\_group\_id}

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

### get

> **GET** /secret/v1/secret-group/{secret\_group\_id}

| Type     | Message                                         |
| -------- | ----------------------------------------------- |
| Request  | [GetSecretGroupRequest](#getsecretgrouprequest) |
| Response | [SecretGroupInfo](#secretgroupinfo)             |

### list

> **GET** /secret/v1/secret-groups
>
> **POST** /secret/v1/secret-groups/search

| Type     | Message                               |
| -------- | ------------------------------------- |
| Request  | [SecretGroupQuery](#secretgroupquery) |
| Response | [SecretGroupsInfo](#secretgroupsinfo) |

### stat

> **POST** /secret/v1/secret-groups/stat

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

## Message

### CreateSecretGroupRequest

| No | Field      | Type                             | Required | Description |
| -- | ---------- | -------------------------------- | -------- | ----------- |
| 1  | name       | string                           | ✅        |             |
| 2  | tags       | list of spaceone.api.core.v1.Tag | ❌        |             |
| 3  | domain\_id | string                           | ✅        |             |

### GetSecretGroupRequest

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

### SecretGroupInfo

| No | Field             | Type                                                                                                                     | Description |
| -- | ----------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | secret\_group\_id | string                                                                                                                   |             |
| 2  | name              | string                                                                                                                   |             |
| 3  | tags              | list of spaceone.api.core.v1.Tag                                                                                         |             |
| 4  | domain\_id        | string                                                                                                                   |             |
| 5  | created\_at       | [google.protobuf.Timestamp](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto) |             |

### SecretGroupQuery

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

### SecretGroupRequest

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

### SecretGroupSecretInfo

| No | Field               | Type                                | Description |
| -- | ------------------- | ----------------------------------- | ----------- |
| 1  | secret\_group\_info | [SecretGroupInfo](#secretgroupinfo) |             |
| 2  | secret\_info        | [SecretInfo](#secretinfo)           |             |
| 3  | domain\_id          | string                              |             |

### SecretGroupSecretRequest

| No | Field             | Type   | Required | Description |
| -- | ----------------- | ------ | -------- | ----------- |
| 1  | secret\_group\_id | string | ✅        |             |
| 2  | secret\_id        | string | ✅        |             |
| 3  | domain\_id        | string | ✅        |             |

### SecretGroupStatQuery

| 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                                                                                                           | ✅        |             |

### SecretGroupsInfo

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

### UpdateSecretGroupRequest

| No | Field             | Type                             | Required | Description |
| -- | ----------------- | -------------------------------- | -------- | ----------- |
| 1  | secret\_group\_id | string                           | ✅        |             |
| 2  | name              | string                           | ❌        |             |
| 3  | tags              | list of spaceone.api.core.v1.Tag | ❌        |             |
| 4  | domain\_id        | string                           | ✅        |             |
