# Custom Widget

> **Package : spaceone.api.cost\_analysis.v1**

## CustomWidget

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

| Method                | Request                                                 | Response                                                                                                           |
| --------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create) | [CreateCustomWidgetRequest](#createcustomwidgetrequest) | [CustomWidgetInfo](#customwidgetinfo)                                                                              |
| [**update**](#update) | [UpdateCustomWidgetRequest](#updatecustomwidgetrequest) | [CustomWidgetInfo](#customwidgetinfo)                                                                              |
| [**delete**](#delete) | [CustomWidgetRequest](#customwidgetrequest)             | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)       | [GetCustomWidgetRequest](#getcustomwidgetrequest)       | [CustomWidgetInfo](#customwidgetinfo)                                                                              |
| [**list**](#list)     | [CustomWidgetQuery](#customwidgetquery)                 | [CustomWidgetsInfo](#customwidgetsinfo)                                                                            |
| [**stat**](#stat)     | [CustomWidgetStatQuery](#customwidgetstatquery)         | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /cost-analysis/v1/custom-widgets

| Type     | Message                                                 |
| -------- | ------------------------------------------------------- |
| Request  | [CreateCustomWidgetRequest](#createcustomwidgetrequest) |
| Response | [CustomWidgetInfo](#customwidgetinfo)                   |

### update

> **PUT** /cost-analysis/v1/custom-widget/{widget\_id}

| Type     | Message                                                 |
| -------- | ------------------------------------------------------- |
| Request  | [UpdateCustomWidgetRequest](#updatecustomwidgetrequest) |
| Response | [CustomWidgetInfo](#customwidgetinfo)                   |

### delete

> **DELETE** /cost-analysis/v1/custom-widget/{widget\_id}

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

### get

> **GET** /cost-analysis/v1/custom-widget/{widget\_id}

| Type     | Message                                           |
| -------- | ------------------------------------------------- |
| Request  | [GetCustomWidgetRequest](#getcustomwidgetrequest) |
| Response | [CustomWidgetInfo](#customwidgetinfo)             |

### list

> **GET** /cost-analysis/v1/custom-widgets
>
> **POST** /cost-analysis/v1/custom-widgets/search

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [CustomWidgetQuery](#customwidgetquery) |
| Response | [CustomWidgetsInfo](#customwidgetsinfo) |

### stat

> **POST** /cost-analysis/v1/custom-widgets/stat

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

##

## Message

### CreateCustomWidgetRequest

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

### CustomWidgetInfo

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

### CustomWidgetQuery

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

### CustomWidgetRequest

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

### CustomWidgetStatQuery

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

### CustomWidgetsInfo

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

### GetCustomWidgetRequest

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

### UpdateCustomWidgetRequest

| Field      | Type                                                                                                               | Required | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| widget\_id | string                                                                                                             |     ✔    |             |
| name       | string                                                                                                             |     ✘    |             |
| options    | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ✘    |             |
| 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/cost_analysis/v1/custom-widget.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.
