# DataSource

A DataSource is a plugin instance collecting external cost data. External cost data consists of `raw data` and the plugin information used for collection.

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

\
\


## DataSource

**DataSource Methods:**

| Method                                                                                                                                               | Request                                                                                                                                                                        | Response                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [**register**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#register)                       | [RegisterDataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#registerdatasourcerequest)                   | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#update)                           | [UpdateDataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#updatedatasourcerequest)                       | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**update\_permissions**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#update_permissions)  | [UpdateDataSourcePermissionsRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#updatedatasourcepermissionsrequest) | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**update\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#update_plugin)            | [UpdateDataSourcePluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#updatedatasourcepluginrequest)           | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**update\_secret\_data**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#update_secret_data) | [UpdateSecretDataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#updatesecretdatasourcerequest)           | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**verify\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#verify_plugin)            | [DataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcerequest)                                   | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#empty)                     |
| [**enable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#enable)                           | [DataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcerequest)                                   | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**disable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#disable)                         | [DataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcerequest)                                   | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**deregister**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#deregister)                   | [DeregisterDataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#deregisterdatasourcerequest)               | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#empty)                     |
| [**sync**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#sync)                               | [SyncDataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#syncdatasourcerequest)                           | [JobInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#jobinfo)                 |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#get)                                 | [DataSourceRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcerequest)                                   | [DataSourceInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourceinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#list)                               | [DataSourceQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcequery)                                       | [DataSourcesInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcesinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#stat)                               | [DataSourceStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#datasourcestatquery)                               | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/DataSource/README.md#struct)                   |

\


### register

Registers a DataSource with information of the plugin to use. Information of the plugin includes `version`, `provider`, and `upgrade_mode`.

> **POST** /cost-analysis/v1/data-source/register

\{{< tabs " register " >\}}

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

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

* **name** (string) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **provider** (string)
* **secret\_type** (SecretType)
* **secret\_filter** (SecretFilter)
* **template** (Struct)
* **plugin\_info** (PluginInfo)
* **tags** (Struct)
* **workspace\_id** (string)

\{{< highlight json >\}} { "name": "AWS HyperBilling Data Source test", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "conditions\_policy": "ALWAYS", "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "conditions": \[], "tags": {}, "name": "match\_service\_account" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "tags": {"a": "b"} } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update

Updates a specific DataSource. You can make changes in DataSource settings, including `name` and `tags`.

> **POST** /cost-analysis/v1/data-source/update

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

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

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

* **data\_source\_id** (string) `Required`
* **name** (string)
* **secret\_filter** (SecretFilter)
* **template** (Struct)
* **tags** (Struct)

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test2", "tags": { "type": "test" } } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update\_permissions

> **POST** /cost-analysis/v1/data-source/update-permissions

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

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

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

* **data\_source\_id** (string) `Required`
* **permissions** (Struct) `Required`

\{{< highlight json >\}} { "data\_source\_id" : "ds-12331222", "permissions" : {"deny": \["data.PayAsYouGo", "data.ActualCost"]} } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update\_plugin

Updates the plugin of a specific DataSource. This method resets the plugin data in the DataSource to update the `metadata`.

> **POST** /cost-analysis/v1/data-source/update-plugin

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

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

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

* **data\_source\_id** (string) `Required`
* **version** (string)
* **options** (Struct)
* **upgrade\_mode** (UpgradeMode)

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "version": "1.0.4", "options": {}, "upgrade\_mode": "AUTO" } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### update\_secret\_data

Updates the secret data of plugin for DataSource. This method updates the secret data in the DataSource to update the `secret_data`.

> **POST** /cost-analysis/v1/data-source/update-secret-data

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

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### verify\_plugin

Verifies the plugin of a specific DataSource. This method validates the plugin data, `version` and `endpoint`.

> **POST** /cost-analysis/v1/data-source/verify-plugin

\{{< tabs " verify\_plugin " >\}}

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

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

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

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### enable

Enables a specific DataSource. By enabling a DataSource, you can communicate with an external cloud service via the plugin.

> **POST** /cost-analysis/v1/data-source/enable

\{{< tabs " enable " >\}}

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

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

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

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789" } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### disable

Disables a specific DataSource. By disabling a DataSource, you can block communication with an external cloud service via the plugin.

> **POST** /cost-analysis/v1/data-source/disable

\{{< tabs " disable " >\}}

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

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

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

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789" } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### deregister

Deregisters and deletes a specific DataSource. You must specify the `data_source_id` of the DataSource to deregister.

> **POST** /cost-analysis/v1/data-source/deregister

\{{< tabs " deregister " >\}}

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

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

* **data\_source\_id** (string) `Required`
*   **cascade\_delete\_cost** (bool)

    _Default value is true. If true delete all cost data related to data\_source\_id_

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "cascade\_delete\_cost": true, "domain\_id": "domain-085d1e872789" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### sync

Manually runs a specific DataSource to collect the cost data. This method is to get up-to-date cost data.

> **POST** /cost-analysis/v1/data-source/sync

\


### get

Gets a specific DataSource. Prints detailed information about the DataSource, including `name`, `state`, and `plugin_info`.

> **POST** /cost-analysis/v1/data-source/get

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

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

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

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

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789" } \{{< /highlight >\}} \{{< /tab >\}}

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

[DataSourceInfo](#DATASOURCEINFO)

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **last\_synchronized\_at** (string) `Required`

\{{< highlight json >\}} { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### list

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

> **POST** /cost-analysis/v1/data-source/list

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

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

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

* **workspace\_id** (string) `Required`
* **query** (Query)
* **data\_source\_id** (string)
* **name** (string)
* **state** (string)
* **data\_source\_type** (DataSourceType)
* **provider** (string)
* **connected\_workspace\_id** (string)

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

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

[DataSourcesInfo](#DATASOURCESINFO)

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

\{{< highlight json >\}} { "results": \[ { "data\_source\_id": "ds-085d1e872789", "name": "AWS HyperBilling Data Source test", "state": "ENABLED", "data\_source\_type": "EXTERNAL", "plugin\_info": { "plugin\_id": "plugin-aws-hyperbilling-cost-datasource", "version": "1.0.4", "options": {}, "metadata": { "data\_source\_rules": \[ { "options": { "stop\_processing": true }, "actions": { "match\_service\_account": { "source": "account", "target": "data.account\_id" } }, "domain\_id": "domain-58010aa2e451", "conditions": \[], "name": "match\_service\_account", "tags": {}, "data\_source\_id": "ds-085d1e872789", "conditions\_policy": "ALWAYS" } ] }, "secret\_id": "secret-ca134639483", "upgrade\_mode": "AUTO" }, "template": {}, "tags": { "a": "b" }, "cost\_tag\_keys": \[ "Name", "Environment", "Role", "Service" ], "cost\_additional\_info\_keys": \[ "Instance Type", "Usage Type Details" ], "cost\_data\_keys": \[ "AmortizedCost", "BlendedCost", ] "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-19T10:58:36.080Z" } ], "total\_count": 2 } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### stat

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

\
\


## Message

### DataSourceInfo

* **data\_source\_id** (string) `Required`
* **name** (string) `Required`
* **state** (State) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **permissions** (Struct) `Required`
* **provider** (string) `Required`
* **secret\_type** (SecretType) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **template** (Struct) `Required`
* **tags** (Struct) `Required`
* **cost\_tag\_keys** (string) `Repeated` `Required`
* **cost\_additional\_info\_keys** (string) `Repeated` `Required`
* **cost\_data\_keys** (string) `Repeated` `Required`
* **data\_source\_account\_count** (int32) `Required`
* **connected\_workspace\_count** (int32) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
*   **last\_synchronized\_at** (string) `Required`

    \


### DataSourceQuery

* **workspace\_id** (string) `Required`
* **query** (Query)
* **data\_source\_id** (string)
* **name** (string)
* **state** (string)
* **data\_source\_type** (DataSourceType)
* **provider** (string)
*   **connected\_workspace\_id** (string)

    \


### DataSourceRequest

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

    \


### DataSourceStatQuery

*   **query** (StatisticsQuery) `Required`

    \


### DataSourcesInfo

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

    \


### DeregisterDataSourceRequest

* **data\_source\_id** (string) `Required`
*   **cascade\_delete\_cost** (bool)

    _Default value is true. If true delete all cost data related to data\_source\_id_

    \


### PluginInfo

* **plugin\_id** (string) `Required`
* **version** (string) `Required`
* **options** (Struct) `Required`
* **metadata** (Struct) `Required`
* **secret\_data** (Struct) `Required`
* **schema\_id** (string) `Required`
* **secret\_id** (string) `Required`
*   **upgrade\_mode** (UpgradeMode) `Required`

    \


### RegisterDataSourceRequest

* **name** (string) `Required`
* **data\_source\_type** (DataSourceType) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **provider** (string)
* **secret\_type** (SecretType)
* **secret\_filter** (SecretFilter)
* **template** (Struct)
* **plugin\_info** (PluginInfo)
* **tags** (Struct)
*   **workspace\_id** (string)

    \


### SecretFilter

* **state** (SecretFilterState) `Required`
* **secrets** (string) `Repeated` `Required`
* **service\_accounts** (string) `Repeated` `Required`
*   **schemas** (string) `Repeated` `Required`

    \


### SyncDataSourceRequest

* **data\_source\_id** (string) `Required`
* **start** (string)
*   **no\_preload\_cache** (bool)

    \


### UpdateDataSourcePermissionsRequest

* **data\_source\_id** (string) `Required`
*   **permissions** (Struct) `Required`

    \


### UpdateDataSourcePluginRequest

* **data\_source\_id** (string) `Required`
* **version** (string)
* **options** (Struct)
*   **upgrade\_mode** (UpgradeMode)

    \


### UpdateDataSourceRequest

* **data\_source\_id** (string) `Required`
* **name** (string)
* **secret\_filter** (SecretFilter)
* **template** (Struct)
*   **tags** (Struct)

    \


### UpdateSecretDataSourceRequest

* **data\_source\_id** (string) `Required`
* **secret\_schema\_id** (string) `Required`
*   **secret\_data** (Struct) `Required`

    \
