# ExchangeRate

An ExchangeRate is a resource defining the exchange rate of currencies. This resource can set a custom exchange rate for a specific domain, separately from the exchange rate of the default domain set in `config`.

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

\
\


## ExchangeRate

**ExchangeRate Methods:**

| Method                                                                                                                         | Request                                                                                                                                                  | Response                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [**set**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#set)         | [SetExchangeRateRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#setexchangeraterequest) | [ExchangeRateInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangerateinfo)   |
| [**reset**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#reset)     | [ExchangeRateRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeraterequest)       | [ExchangeRateInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangerateinfo)   |
| [**enable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#enable)   | [ExchangeRateRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeraterequest)       | [ExchangeRateInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangerateinfo)   |
| [**disable**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#disable) | [ExchangeRateRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeraterequest)       | [ExchangeRateInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangerateinfo)   |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#get)         | [ExchangeRateRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeraterequest)       | [ExchangeRateInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangerateinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#list)       | [ExchangeRateQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeratequery)           | [ExchangeRatesInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/ExchangeRate/README.md#exchangeratesinfo) |

\


### set

Overrides a value of a specific ExchangeRate. This method is used to change the ExchangeRate in a specific domain. You can set the `currency` and `rate` of the resource.

> **POST** /cost-analysis/v1/exchange-rate/set

\{{< tabs " set " >\}}

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

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

* **currency** (string) `Required`
* **rate** (float) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300 } \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRateInfo](#EXCHANGERATEINFO)

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300.0, "state": "ENABLED", "is\_default": true } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### reset

Resets a value of a specific ExchangeRate and changes the ExchangeRate to the ExchangeRate of the `default` domain.

> **POST** /cost-analysis/v1/exchange-rate/reset

\{{< tabs " reset " >\}}

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

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

* **currency** (string) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW" } \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRateInfo](#EXCHANGERATEINFO)

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300.0, "state": "ENABLED", "is\_default": true } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### enable

> **POST** /cost-analysis/v1/exchange-rate/enable

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

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

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

* **currency** (string) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW" } \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRateInfo](#EXCHANGERATEINFO)

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300.0, "state": "ENABLED", "is\_default": true } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### disable

> **POST** /cost-analysis/v1/exchange-rate/disable

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

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

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

* **currency** (string) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW" } \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRateInfo](#EXCHANGERATEINFO)

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300.0, "state": "ENABLED", "is\_default": true } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### get

Gets a specific ExchangeRate. Prints detailed information about the ExchangeRate, including `currency` and `rate`.

> **POST** /cost-analysis/v1/exchange-rate/get

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

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

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

* **currency** (string) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW" } \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRateInfo](#EXCHANGERATEINFO)

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
* **domain\_id** (string) `Required`

\{{< highlight json >\}} { "currency": "KRW", "rate": 1300.0, "state": "ENABLED", "is\_default": true } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### list

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

> **POST** /cost-analysis/v1/exchange-rate/list

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

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

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

* **domain\_id** (string) `Required`

\{{< highlight json >\}} {

} \{{< /highlight >\}} \{{< /tab >\}}

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

[ExchangeRatesInfo](#EXCHANGERATESINFO)

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

\{{< highlight json >\}} { "results": \[ { "currency": "JPY", "rate": 129.8, "state": "ENABLED", "is\_default": true, "domain\_id": "domain-58010aa2e451" }, { "currency": "KRW", "rate": 1242.7, "state": "ENABLED", "is\_default": true, "domain\_id": "domain-58010aa2e451" } ], "total\_count": 2 } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\
\


## Message

### ExchangeRateInfo

* **currency** (string) `Required`
* **rate** (float) `Required`
* **state** (State) `Required`
* **is\_default** (bool) `Required`
*   **domain\_id** (string) `Required`

    \


### ExchangeRateQuery

*   **domain\_id** (string) `Required`

    \


### ExchangeRateRequest

* **currency** (string) `Required`
*   **domain\_id** (string) `Required`

    \


### ExchangeRatesInfo

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

    \


### SetExchangeRateRequest

* **currency** (string) `Required`
* **rate** (float) `Required`
*   **domain\_id** (string) `Required`

    \
