# Secret Group

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

## SecretGroup

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

| Method                               | Request                                               | Response                                                                                                           |
| ------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create)                | [CreateSecretGroupRequest](#createsecretgrouprequest) | [SecretGroupInfo](#secretgroupinfo)                                                                                |
| [**update**](#update)                | [UpdateSecretGroupRequest](#updatesecretgrouprequest) | [SecretGroupInfo](#secretgroupinfo)                                                                                |
| [**add\_secret**](#add_secret)       | [SecretGroupSecretRequest](#secretgroupsecretrequest) | [SecretGroupSecretInfo](#secretgroupsecretinfo)                                                                    |
| [**remove\_secret**](#remove_secret) | [SecretGroupSecretRequest](#secretgroupsecretrequest) | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**delete**](#delete)                | [SecretGroupRequest](#secretgrouprequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)                      | [GetSecretGroupRequest](#getsecretgrouprequest)       | [SecretGroupInfo](#secretgroupinfo)                                                                                |
| [**list**](#list)                    | [SecretGroupQuery](#secretgroupquery)                 | [SecretGroupsInfo](#secretgroupsinfo)                                                                              |
| [**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

| Field      | Type                                                                                                               | Required | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| name       | string                                                                                                             |     ✔    |             |
| tags       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ✘    |             |
| domain\_id | string                                                                                                             |     ✔    |             |

### GetSecretGroupRequest

| Field             | Type           | Required | Description |
| ----------------- | -------------- | :------: | ----------- |
| secret\_group\_id | string         |     ✔    |             |
| domain\_id        | string         |     ✔    |             |
| only              | list of string |     ✘    |             |

### SecretGroupInfo

| Field             | Type                                                                                                               | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| secret\_group\_id | string                                                                                                             |             |
| name              | string                                                                                                             |             |
| tags              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| domain\_id        | string                                                                                                             |             |
| created\_at       | string                                                                                                             |             |

### SecretGroupQuery

| Field             | Type                                                                                               | Required | Description |
| ----------------- | -------------------------------------------------------------------------------------------------- | :------: | ----------- |
| query             | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) |     ✘    |             |
| secret\_group\_id | string                                                                                             |     ✘    |             |
| name              | string                                                                                             |     ✘    |             |
| secret\_id        | string                                                                                             |     ✘    |             |
| domain\_id        | string                                                                                             |     ✔    |             |

### SecretGroupRequest

| Field             | Type   | Required | Description |
| ----------------- | ------ | :------: | ----------- |
| secret\_group\_id | string |     ✔    |             |
| domain\_id        | string |     ✔    |             |

### SecretGroupSecretInfo

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

### SecretGroupSecretRequest

| Field             | Type   | Required | Description |
| ----------------- | ------ | :------: | ----------- |
| secret\_group\_id | string |     ✔    |             |
| secret\_id        | string |     ✔    |             |
| domain\_id        | string |     ✔    |             |

### SecretGroupStatQuery

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

### SecretGroupsInfo

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

### UpdateSecretGroupRequest

| Field             | Type                                                                                                               | Required | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| secret\_group\_id | string                                                                                                             |     ✔    |             |
| name              | string                                                                                                             |     ✘    |             |
| tags              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ✘    |             |
| domain\_id        | string                                                                                                             |     ✔    |             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spaceone-dev.gitbook.io/spaceone-apis/secret/v1/secret-group.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
