# Resource Group

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

## ResourceGroup

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

| NO | Method                | Request Type                                              | Response Type                                                                                                      | Description |
| -- | --------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | [**create**](#create) | [CreateResourceGroupRequest](#createresourcegrouprequest) | [ResourceGroupInfo](#resourcegroupinfo)                                                                            |             |
| 2  | [**update**](#update) | [UpdateResourceGroupRequest](#updateresourcegrouprequest) | [ResourceGroupInfo](#resourcegroupinfo)                                                                            |             |
| 3  | [**delete**](#delete) | [ResourceGroupRequest](#resourcegrouprequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 4  | [**get**](#get)       | [GetResourceGroupRequest](#getresourcegrouprequest)       | [ResourceGroupInfo](#resourcegroupinfo)                                                                            |             |
| 5  | [**list**](#list)     | [ResourceGroupQuery](#resourcegroupquery)                 | [ResourceGroupsInfo](#resourcegroupsinfo)                                                                          |             |
| 6  | [**stat**](#stat)     | [ResourceGroupStatQuery](#resourcegroupstatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### create

> **POST** /inventory/v1/resource-groups

| Type     | Message                                                   |
| -------- | --------------------------------------------------------- |
| Request  | [CreateResourceGroupRequest](#createresourcegrouprequest) |
| Response | [ResourceGroupInfo](#resourcegroupinfo)                   |

### update

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

| Type     | Message                                                   |
| -------- | --------------------------------------------------------- |
| Request  | [UpdateResourceGroupRequest](#updateresourcegrouprequest) |
| Response | [ResourceGroupInfo](#resourcegroupinfo)                   |

### delete

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

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

### get

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

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [GetResourceGroupRequest](#getresourcegrouprequest) |
| Response | [ResourceGroupInfo](#resourcegroupinfo)             |

### list

> **GET** /inventory/v1/resource-groups
>
> **POST** /inventory/v1/resource-groups/search

| Type     | Message                                   |
| -------- | ----------------------------------------- |
| Request  | [ResourceGroupQuery](#resourcegroupquery) |
| Response | [ResourceGroupsInfo](#resourcegroupsinfo) |

### stat

> **POST** /inventory/v1/resource-groups/stat

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

## Message

### CreateResourceGroupRequest

| No | Field       | Type                                                                                                               | Required | Description |
| -- | ----------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| 1  | name        | string                                                                                                             | ✅        |             |
| 2  | resources   | [list of Resource](#resource)                                                                                      | ✅        |             |
| 3  | options     | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 4  | tags        | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 5  | project\_id | string                                                                                                             | ✅        |             |
| 6  | domain\_id  | string                                                                                                             | ✅        |             |

### GetResourceGroupRequest

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

### Resource

| No | Field          | Type                                                                                                | Required | Description |
| -- | -------------- | --------------------------------------------------------------------------------------------------- | -------- | ----------- |
| 1  | resource\_type | string                                                                                              | ✅        |             |
| 2  | filter         | [google.protobuf.ListValue](https://developers.google.com/protocol-buffers/docs/reference/overview) | ❌        |             |
| 3  | keyword        | string                                                                                              | ❌        |             |

### ResourceGroupInfo

| No | Field               | Type                                                                                                                     | Description |
| -- | ------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | resource\_group\_id | string                                                                                                                   |             |
| 2  | name                | string                                                                                                                   |             |
| 3  | resources           | [list of Resource](#resource)                                                                                            |             |
| 4  | options             | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto)       |             |
| 5  | tags                | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto)       |             |
| 6  | project\_id         | string                                                                                                                   |             |
| 7  | domain\_id          | string                                                                                                                   |             |
| 8  | created\_at         | [google.protobuf.Timestamp](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto) |             |

### ResourceGroupQuery

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

### ResourceGroupRequest

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

### ResourceGroupStatQuery

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

### ResourceGroupsInfo

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

### UpdateResourceGroupRequest

| No | Field               | Type                                                                                                               | Required | Description |
| -- | ------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| 1  | resource\_group\_id | string                                                                                                             | ✅        |             |
| 2  | name                | string                                                                                                             | ❌        |             |
| 3  | resources           | [list of Resource](#resource)                                                                                      | ❌        |             |
| 4  | options             | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 5  | tags                | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 6  | release\_project    | bool                                                                                                               | ❌        |             |
| 7  | project\_id         | string                                                                                                             | ❌        |             |
| 8  | domain\_id          | string                                                                                                             | ✅        |             |
