# CostQuerySet

A CostQuerySet is a set of saved queries a User frequently uses as a setting.

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

\
\


## CostQuerySet

**CostQuerySet Methods:**

| Method                                                                                                                       | Request                                                                                                                                                        | Response                                                                                                                                       |
| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#create) | [CreateCostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#createcostquerysetrequest) | [CostQuerySetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#update) | [UpdateCostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#updatecostquerysetrequest) | [CostQuerySetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetinfo)   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#delete) | [CostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetrequest)             | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#empty)                         |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#get)       | [CostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetrequest)             | [CostQuerySetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#list)     | [CostQuerySetQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetquery)                 | [CostQuerySetsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetsinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#stat)     | [CostQuerySetStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetstatquery)         | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#struct)                       |

\


### create

Creates a new CostQuerySet. You can make your own custom query that meets your needs, and input it as an `option` parameter of the resource. Queries such as `group_by` and `granularity` are provided by default.

> **POST** /cost-analysis/v1/cost-query-set/create

\{{< tabs " create " >\}}

\{{< tab "Request Example" >\}}

[CreateCostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#createcostquerysetrequest)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
* **tags** (Struct)

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "project\_provider\_region", "options": {} } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[CostQuerySetInfo](#COSTQUERYSETINFO)

* **cost\_query\_set\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **user\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-76a58ea5d02c", "name": "project\_provider\_region", "options": {}, "tags": {}, "user\_id": "test@cloudforet.io", "data\_source\_id": "ds-085d1e872789", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T06:11:03.701Z", "updated\_at": "2022-07-19T06:11:03.701Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update

Updates a specific CostQuerySet. You can make changes in the details of queries.

> **POST** /cost-analysis/v1/cost-query-set/update

\{{< tabs " update " >\}}

\{{< tab "Request Example" >\}}

[UpdateCostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#updatecostquerysetrequest)

* **cost\_query\_set\_id** (string) `Required`
* **name** (string)
* **options** (Struct)
* **tags** (Struct)

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-76a58ea5d02c", "name": "project\_provider\_region", "options": {}, "tags": {}, "user\_id": "test@cloudforet.io", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T06:11:03.701Z", "updated\_at": "2022-07-19T06:11:03.701Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[CostQuerySetInfo](#COSTQUERYSETINFO)

* **cost\_query\_set\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **user\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-76a58ea5d02c", "name": "project\_provider\_region", "options": {}, "tags": {}, "user\_id": "test@cloudforet.io", "data\_source\_id": "ds-085d1e872789", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T06:11:03.701Z", "updated\_at": "2022-07-19T06:11:03.701Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### delete

Deletes a specific CostQuerySet. You must specify the `cost_query_set_id` of the CostQuerySet to delete.

> **POST** /cost-analysis/v1/cost-query-set/delete

\{{< tabs " delete " >\}}

\{{< tab "Request Example" >\}}

[CostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetrequest)

* **cost\_query\_set\_id** (string) `Required`

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-16ae671dc8fb", "domain\_id": "domain-58010aa2e451" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### get

Gets a specific CostQuerySet. Prints detailed information about the CostQuerySet, including the details of queries.

> **POST** /cost-analysis/v1/cost-query-set/get

\{{< tabs " get " >\}}

\{{< tab "Request Example" >\}}

[CostQuerySetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetrequest)

* **cost\_query\_set\_id** (string) `Required`

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-16ae671dc8fb", "domain\_id": "domain-58010aa2e451" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[CostQuerySetInfo](#COSTQUERYSETINFO)

* **cost\_query\_set\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **user\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

\{{< highlight json >\}} { "cost\_query\_set\_id": "query-76a58ea5d02c", "name": "project\_provider\_region", "options": {}, "tags": {}, "user\_id": "test@cloudforet.io", "data\_source\_id": "ds-085d1e872789", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T06:11:03.701Z", "updated\_at": "2022-07-19T06:11:03.701Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### list

Gets a list of all CostQuerySets. You can use a query to get a filtered list of CostQuerySets.

> **POST** /cost-analysis/v1/cost-query-set/list

\{{< tabs " list " >\}}

\{{< tab "Request Example" >\}}

[CostQuerySetQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/CostQuerySet/README.md#costquerysetquery)

* **data\_source\_id** (string) `Required`
* **query** (Query)
* **name** (string)

\{{< highlight json >\}} { "query": {} } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[CostQuerySetsInfo](#COSTQUERYSETSINFO)

* **results** (CostQuerySetInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

\{{< highlight json >\}} { "results": \[ { "cost\_query\_set\_id": "query-16ae671dc8fb", "name": "3 month product pie chart", "options": {}, "tags": {}, "user\_id": "yuda@mz.co.kr", "data\_source\_id": "ds-085d1e872789", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-03-08T03:37:31.404Z", "updated\_at": "2022-03-08T03:37:31.404Z" }, { "cost\_query\_set\_id": "query-d90addf25e4b", "name": "6 month project group", "options": {}, "tags": {}, "user\_id": "yuda@mz.co.kr", "data\_source\_id": "ds-085d1e872789", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-03-14T09:29:54.306Z", "updated\_at": "2022-03-14T09:29:54.306Z" } ], "total\_count": 34 } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### stat

> **POST** /cost-analysis/v1/cost-query-set/stat

\
\


## Message

### CostQuerySetInfo

* **cost\_query\_set\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
* **tags** (Struct) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **user\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
*   **updated\_at** (string) `Required`

    \


### CostQuerySetQuery

* **data\_source\_id** (string) `Required`
* **query** (Query)
*   **name** (string)

    \


### CostQuerySetRequest

*   **cost\_query\_set\_id** (string) `Required`

    \


### CostQuerySetStatQuery

* **query** (StatisticsQuery) `Required`
*   **data\_source\_id** (string) `Required`

    \


### CostQuerySetsInfo

* **results** (CostQuerySetInfo) `Repeated` `Required`
*   **total\_count** (int32) `Required`

    \


### CreateCostQuerySetRequest

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **options** (Struct) `Required`
*   **tags** (Struct)

    \


### UpdateCostQuerySetRequest

* **cost\_query\_set\_id** (string) `Required`
* **name** (string)
* **options** (Struct)
*   **tags** (Struct)

    \
