# Data Source Rule

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

## DataSourceRule

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

| Method                             | Request                                                               | Response                                                                                                           |
| ---------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [**create**](#create)              | [CreateDataSourceRuleRequest](#createdatasourcerulerequest)           | [DataSourceRuleInfo](#datasourceruleinfo)                                                                          |
| [**update**](#update)              | [UpdateDataSourceRuleRequest](#updatedatasourcerulerequest)           | [DataSourceRuleInfo](#datasourceruleinfo)                                                                          |
| [**change\_order**](#change_order) | [ChangeDataSourceRuleOrderRequest](#changedatasourceruleorderrequest) | [DataSourceRuleInfo](#datasourceruleinfo)                                                                          |
| [**delete**](#delete)              | [DataSourceRuleRequest](#datasourcerulerequest)                       | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |
| [**get**](#get)                    | [GetDataSourceRuleRequest](#getdatasourcerulerequest)                 | [DataSourceRuleInfo](#datasourceruleinfo)                                                                          |
| [**list**](#list)                  | [DataSourceRuleQuery](#datasourcerulequery)                           | [DataSourceRulesInfo](#datasourcerulesinfo)                                                                        |
| [**stat**](#stat)                  | [DataSourceRuleStatQuery](#datasourcerulestatquery)                   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

### create

> **POST** /cost-analysis/v1/data\_source\_rules

| Type     | Message                                                     |
| -------- | ----------------------------------------------------------- |
| Request  | [CreateDataSourceRuleRequest](#createdatasourcerulerequest) |
| Response | [DataSourceRuleInfo](#datasourceruleinfo)                   |

### update

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

| Type     | Message                                                     |
| -------- | ----------------------------------------------------------- |
| Request  | [UpdateDataSourceRuleRequest](#updatedatasourcerulerequest) |
| Response | [DataSourceRuleInfo](#datasourceruleinfo)                   |

### change\_order

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

| Type     | Message                                                               |
| -------- | --------------------------------------------------------------------- |
| Request  | [ChangeDataSourceRuleOrderRequest](#changedatasourceruleorderrequest) |
| Response | [DataSourceRuleInfo](#datasourceruleinfo)                             |

### delete

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

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

### get

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

| Type     | Message                                               |
| -------- | ----------------------------------------------------- |
| Request  | [GetDataSourceRuleRequest](#getdatasourcerulerequest) |
| Response | [DataSourceRuleInfo](#datasourceruleinfo)             |

### list

> **GET** /cost-analysis/v1/data\_source\_rules
>
> **POST** /cost-analysis/v1/data\_source\_rules/search

| Type     | Message                                     |
| -------- | ------------------------------------------- |
| Request  | [DataSourceRuleQuery](#datasourcerulequery) |
| Response | [DataSourceRulesInfo](#datasourcerulesinfo) |

### stat

> **POST** /cost-analysis/v1/data\_source\_rules/stat

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

##

## Message

### ChangeDataSourceRuleOrderRequest

| Field                  | Type                                                                                            | Required | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------- | :------: | ----------- |
| data\_source\_rule\_id | string                                                                                          |     ✔    |             |
| order                  | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |     ✔    |             |
| domain\_id             | string                                                                                          |     ✔    |             |

### CreateDataSourceRuleRequest

| Field              | Type                                                                                                               | Required | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| name               | string                                                                                                             | ✘        |             |
| conditions         | [list of DataSourceRuleCondition](#datasourcerulecondition)                                                        | ✘        |             |
| conditions\_policy | <ul><li>NONE</li><li>ALL</li><li>ANY</li><li>ALWAYS</li></ul>                                                      | ✔        |             |
| actions            | [DataSourceRuleActions](#datasourceruleactions)                                                                    | ✔        |             |
| options            | [DataSourceRuleOptions](#datasourceruleoptions)                                                                    | ✘        |             |
| tags               | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ✘        |             |
| data\_source\_id   | string                                                                                                             | ✔        |             |
| domain\_id         | string                                                                                                             | ✔        |             |

### DataSourceRuleActions

| Field                   | Type                                                                                                               | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| change\_project         | string                                                                                                             |             |
| match\_project          | [MatchRule](#matchrule)                                                                                            |             |
| match\_service\_account | [MatchRule](#matchrule)                                                                                            |             |
| add\_additional\_info   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### DataSourceRuleCondition

| Field    | Type   | Description |
| -------- | ------ | ----------- |
| key      | string |             |
| value    | string |             |
| operator | string |             |

### DataSourceRuleInfo

| Field                  | Type                                                                                                               | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| data\_source\_rule\_id | string                                                                                                             |             |
| name                   | string                                                                                                             |             |
| order                  | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |             |
| conditions             | [list of DataSourceRuleCondition](#datasourcerulecondition)                                                        |             |
| conditions\_policy     | <ul><li>NONE</li><li>ALL</li><li>ANY</li><li>ALWAYS</li></ul>                                                      |             |
| actions                | [DataSourceRuleActions](#datasourceruleactions)                                                                    |             |
| options                | [DataSourceRuleOptions](#datasourceruleoptions)                                                                    |             |
| tags                   | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| data\_source\_id       | string                                                                                                             |             |
| domain\_id             | string                                                                                                             |             |
| created\_at            | string                                                                                                             |             |

### DataSourceRuleOptions

| Field            | Type | Description |
| ---------------- | ---- | ----------- |
| stop\_processing | bool |             |

### DataSourceRuleQuery

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

### DataSourceRuleRequest

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

### DataSourceRuleStatQuery

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

### DataSourceRulesInfo

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

### GetDataSourceRuleRequest

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

### MatchRule

| Field  | Type   | Description |
| ------ | ------ | ----------- |
| source | string |             |
| target | string |             |

### UpdateDataSourceRuleRequest

| Field                  | Type                                                                                                               | Required | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| data\_source\_rule\_id | string                                                                                                             | ✔        |             |
| name                   | string                                                                                                             | ✘        |             |
| conditions             | [list of DataSourceRuleCondition](#datasourcerulecondition)                                                        | ✘        |             |
| conditions\_policy     | <ul><li>NONE</li><li>ALL</li><li>ANY</li><li>ALWAYS</li></ul>                                                      | ✘        |             |
| actions                | [DataSourceRuleActions](#datasourceruleactions)                                                                    | ✘        |             |
| options                | [DataSourceRuleOptions](#datasourceruleoptions)                                                                    | ✘        |             |
| 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-rule.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.
