# Data Source

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

## DataSource

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

| Method                               | Request                                                         | Response                                                                                                           |
| ------------------------------------ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**register**](#register)            | [RegisterDataSourceRequest](#registerdatasourcerequest)         | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**update**](#update)                | [UpdateDataSourceRequest](#updatedatasourcerequest)             | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**update\_plugin**](#update_plugin) | [UpdateDataSourcePluginRequest](#updatedatasourcepluginrequest) | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**verify\_plugin**](#verify_plugin) | [DataSourceRequest](#datasourcerequest)                         | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**enable**](#enable)                | [DataSourceRequest](#datasourcerequest)                         | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**disable**](#disable)              | [DataSourceRequest](#datasourcerequest)                         | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**deregister**](#deregister)        | [DataSourceRequest](#datasourcerequest)                         | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**sync**](#sync)                    | [SyncDataSourceRequest](#syncdatasourcerequest)                 | JobInfo                                                                                                            |
| [**get**](#get)                      | [GetDataSourceRequest](#getdatasourcerequest)                   | [DataSourceInfo](#datasourceinfo)                                                                                  |
| [**list**](#list)                    | [DataSourceQuery](#datasourcequery)                             | [DataSourcesInfo](#datasourcesinfo)                                                                                |
| [**stat**](#stat)                    | [DataSourceStatQuery](#datasourcestatquery)                     | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### register

> **POST** /cost-analysis/v1/data-sources

| Type     | Message                                                 |
| -------- | ------------------------------------------------------- |
| Request  | [RegisterDataSourceRequest](#registerdatasourcerequest) |
| Response | [DataSourceInfo](#datasourceinfo)                       |

### update

> **PUT** /cost-analysis/v1/data-source/{data\_source\_id}

| Type     | Message                                             |
| -------- | --------------------------------------------------- |
| Request  | [UpdateDataSourceRequest](#updatedatasourcerequest) |
| Response | [DataSourceInfo](#datasourceinfo)                   |

### update\_plugin

> **PUT** /cost-analysis/v1/data-source/{data\_source\_id}/plugin

| Type     | Message                                                         |
| -------- | --------------------------------------------------------------- |
| Request  | [UpdateDataSourcePluginRequest](#updatedatasourcepluginrequest) |
| Response | [DataSourceInfo](#datasourceinfo)                               |

### verify\_plugin

> **POST** /cost-analysis/v1/data-source/{data\_source\_id}/plugin/verify

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

### enable

> **PUT** /cost-analysis/v1/data-source/{data\_source\_id}/enable

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [DataSourceRequest](#datasourcerequest) |
| Response | [DataSourceInfo](#datasourceinfo)       |

### disable

> **PUT** /cost-analysis/v1/data-source/{data\_source\_id}/disable

| Type     | Message                                 |
| -------- | --------------------------------------- |
| Request  | [DataSourceRequest](#datasourcerequest) |
| Response | [DataSourceInfo](#datasourceinfo)       |

### deregister

> **DELETE** /cost-analysis/v1/data-source/{data\_source\_id}

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

### sync

> **POST** /cost-analysis/v1/data-source/{data\_source\_id}/sync

| Type     | Message                                         |
| -------- | ----------------------------------------------- |
| Request  | [SyncDataSourceRequest](#syncdatasourcerequest) |
| Response | JobInfo                                         |

### get

> **GET** /cost-analysis/v1/data-source/{data\_source\_id}

| Type     | Message                                       |
| -------- | --------------------------------------------- |
| Request  | [GetDataSourceRequest](#getdatasourcerequest) |
| Response | [DataSourceInfo](#datasourceinfo)             |

### list

> **GET** /cost-analysis/v1/data-sources
>
> **POST** /cost-analysis/v1/data-sources/search

| Type     | Message                             |
| -------- | ----------------------------------- |
| Request  | [DataSourceQuery](#datasourcequery) |
| Response | [DataSourcesInfo](#datasourcesinfo) |

### stat

> **POST** /cost-analysis/v1/data-sources/stat

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

##

## Message

### DataSourceInfo

| Field                  | Type                                                                                                               | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| data\_source\_id       | string                                                                                                             |             |
| name                   | string                                                                                                             |             |
| state                  | <ul><li>STATE\_NONE</li><li>ENABLED</li><li>DISABLED</li></ul>                                                     |             |
| data\_source\_type     | <ul><li>TYPE\_NONE</li><li>LOCAL</li><li>EXTERNAL</li></ul>                                                        |             |
| provider               | string                                                                                                             |             |
| plugin\_info           | [PluginInfo](#plugininfo)                                                                                          |             |
| template               | [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                                                                                                             |             |
| created\_at            | string                                                                                                             |             |
| last\_synchronized\_at | string                                                                                                             |             |

### DataSourceQuery

| Field              | Type                                                                                               | Required | Description |
| ------------------ | -------------------------------------------------------------------------------------------------- | -------- | ----------- |
| query              | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query) | ✘        |             |
| data\_source\_id   | string                                                                                             | ✘        |             |
| name               | string                                                                                             | ✘        |             |
| state              | string                                                                                             | ✘        |             |
| data\_source\_type | <ul><li>NONE</li><li>LOCAL</li><li>EXTERNAL</li></ul>                                              | ✘        |             |
| provider           | string                                                                                             | ✘        |             |
| domain\_id         | string                                                                                             | ✔        |             |

### DataSourceRequest

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

### DataSourceStatQuery

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

### DataSourcesInfo

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

### GetDataSourceRequest

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

### PluginInfo

| Field         | Type                                                                                                               | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| plugin\_id    | string                                                                                                             |             |
| version       | string                                                                                                             |             |
| options       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| metadata      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| secret\_data  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| schema        | string                                                                                                             |             |
| secret\_id    | string                                                                                                             |             |
| upgrade\_mode | <ul><li>NONE</li><li>MANUAL</li><li>AUTO</li></ul>                                                                 |             |

### RegisterDataSourceRequest

| Field              | Type                                                                                                               | Required | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| name               | string                                                                                                             | ✔        |             |
| data\_source\_type | <ul><li>NONE</li><li>LOCAL</li><li>EXTERNAL</li></ul>                                                              | ✔        |             |
| provider           | string                                                                                                             | ✘        |             |
| template           | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| plugin\_info       | [PluginInfo](#plugininfo)                                                                                          | ✘        |             |
| tags               | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| domain\_id         | string                                                                                                             | ✔        |             |

### SyncDataSourceRequest

| Field              | Type   | Required | Description |
| ------------------ | ------ | :------: | ----------- |
| data\_source\_id   | string |     ✔    |             |
| start              | string |     ✘    |             |
| no\_preload\_cache | bool   |     ✘    |             |
| domain\_id         | string |     ✔    |             |

### UpdateDataSourcePluginRequest

| Field            | Type                                                                                                               | Required | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| data\_source\_id | string                                                                                                             | ✔        |             |
| version          | string                                                                                                             | ✘        |             |
| options          | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| upgrade\_mode    | <ul><li>NONE</li><li>MANUAL</li><li>AUTO</li></ul>                                                                 | ✘        |             |
| domain\_id       | string                                                                                                             | ✔        |             |

### UpdateDataSourceRequest

| Field            | Type                                                                                                               | Required | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| data\_source\_id | string                                                                                                             |     ✔    |             |
| name             | string                                                                                                             |     ✘    |             |
| template         | [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/data-source.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.
