DataSourceRule

DataSourceRule #

A DataSourceRule is a resource filtering the raw data from the DataSource. The Cost resource is created after the raw data is filtered by the DataSourceRule.

Package : spaceone.api.cost_analysis.v1



DataSourceRule #

DataSourceRule Methods:

MethodRequestResponse
createCreateDataSourceRuleRequestDataSourceRuleInfo
updateUpdateDataSourceRuleRequestDataSourceRuleInfo
change_orderChangeDataSourceRuleOrderRequestDataSourceRuleInfo
deleteDataSourceRuleRequestEmpty
getDataSourceRuleRequestDataSourceRuleInfo
listDataSourceRuleQueryDataSourceRulesInfo
statDataSourceRuleStatQueryStruct

create #

Creates a new DataSourceRule. When creating the resource, this method can apply two types of conditions: mapping projects where the cost incurred to the Cost, and mapping cloud service accounts to the Cost. By adjusting the condition_policy parameter, the DataSourceRule can be applied when all conditions are met, applied when any of the conditions are met, or always applied regardless of whether the conditions are met.

POST /cost-analysis/v1/data-source-rule/create

CreateDataSourceRuleRequest

  • data_source_id (string) Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • resource_group (ResourceGroup) Required

  • workspace_id (string) Required

  • name (string)

  • conditions (DataSourceRuleCondition) Repeated

  • options (DataSourceRuleOptions)

  • tags (Struct)

{
   "data_source_id": "ds-c96609f5afeb",
   "name": "match_service_account_test",
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {"source": "account", "target": "data.project_id"}
   },
   "options": {"stop_processing": true},
   "tags": {"b": "c", "a": "b"}
}

DataSourceRuleInfo

  • data_source_rule_id (string) Required

  • name (string) Required

  • rule_type (RuleType) Required

  • order (int32) Required

  • conditions (DataSourceRuleCondition) Repeated Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • options (DataSourceRuleOptions) Required

  • tags (Struct) Required

  • resource_group (ResourceGroup) Required

  • domain_id (string) Required

  • workspace_id (string) Required

  • data_source_id (string) Required

  • created_at (string) Required

{
   "data_source_rule_id": "rule-c8055231e212",
   "name": "match_service_account_test",
   "order": 2,
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {
           "source": "account",
           "target": "data.project_id"
       }
   },
   "options": {
       "stop_processing": true
   },
   "tags": {
       "a": "b",
       "b": "c"
   },
   "data_source_id": "ds-c96609f5afeb",
   "domain_id": "domain-58010aa2e451",
   "created_at": "2022-07-19T10:13:28.335Z"
}

update #

Updates a specific DataSourceRule. You can make changes in DataSourceRule settings, including filtering conditions. If the parameter is_default is true, only Admin type User can use this method.

POST /cost-analysis/v1/data-source-rule/update

UpdateDataSourceRuleRequest

  • data_source_rule_id (string) Required

  • name (string)

  • conditions (DataSourceRuleCondition) Repeated

  • conditions_policy (ConditionsPolicy)

  • actions (DataSourceRuleActions)

  • options (DataSourceRuleOptions)

  • tags (Struct)

{
   "data_source_rule_id": "rule-c8055231e212",
   "name": "match_service_account_test",
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {
           "source": "account",
           "target": "data.project_id"
       }
   },
   "options": {
       "stop_processing": true
   },
   "tags": {"b": "c", "a": "b"}
}

DataSourceRuleInfo

  • data_source_rule_id (string) Required

  • name (string) Required

  • rule_type (RuleType) Required

  • order (int32) Required

  • conditions (DataSourceRuleCondition) Repeated Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • options (DataSourceRuleOptions) Required

  • tags (Struct) Required

  • resource_group (ResourceGroup) Required

  • domain_id (string) Required

  • workspace_id (string) Required

  • data_source_id (string) Required

  • created_at (string) Required

{
   "data_source_rule_id": "rule-c8055231e212",
   "name": "match_service_account_test",
   "order": 2,
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {
           "source": "account",
           "target": "data.project_id"
       }
   },
   "options": {
       "stop_processing": true
   },
   "tags": {
       "a": "b",
       "b": "c"
   },
   "data_source_id": "ds-c96609f5afeb",
   "domain_id": "domain-58010aa2e451",
   "created_at": "2022-07-19T10:13:28.335Z"
}

change_order #

Changes the priority order of the DataSourceRules to apply. If there are multiple DataSourceRules applied in a specific service account, the priority order of the resources is requried. This method changes the priority order to apply DataSourceRules.

POST /cost-analysis/v1/data-source-rule/change-order

ChangeDataSourceRuleOrderRequest

  • data_source_rule_id (string) Required

  • order (int32) Required

{
   "data_source_rule_id": "rule-c8055231e212",
   "order": 2
}

DataSourceRuleInfo

  • data_source_rule_id (string) Required

  • name (string) Required

  • rule_type (RuleType) Required

  • order (int32) Required

  • conditions (DataSourceRuleCondition) Repeated Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • options (DataSourceRuleOptions) Required

  • tags (Struct) Required

  • resource_group (ResourceGroup) Required

  • domain_id (string) Required

  • workspace_id (string) Required

  • data_source_id (string) Required

  • created_at (string) Required

{
   "data_source_rule_id": "rule-c8055231e212",
   "name": "match_service_account_test",
   "order": 2,
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {
           "source": "account",
           "target": "data.project_id"
       }
   },
   "options": {
       "stop_processing": true
   },
   "tags": {
       "a": "b",
       "b": "c"
   },
   "data_source_id": "ds-c96609f5afeb",
   "domain_id": "domain-58010aa2e451",
   "created_at": "2022-07-19T10:13:28.335Z"
}

delete #

Deletes a specific DataSourceRule. You must specify the data_source_rule_id of the DataSourceRule to delete. If the parameter is_default is true, only Admin type User can use this method.

POST /cost-analysis/v1/data-source-rule/delete

DataSourceRuleRequest

  • data_source_rule_id (string) Required
{
   "data_source_rule_id": "rule-22fab02f6b51"
}

get #

Gets a specific DataSourceRule. Prints detailed information about the DataSourceRule, including conditions_policy and conditions applied to DataSources.

POST /cost-analysis/v1/data-source-rule/get

DataSourceRuleRequest

  • data_source_rule_id (string) Required
{
   "data_source_rule_id": "rule-22fab02f6b51"
}

DataSourceRuleInfo

  • data_source_rule_id (string) Required

  • name (string) Required

  • rule_type (RuleType) Required

  • order (int32) Required

  • conditions (DataSourceRuleCondition) Repeated Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • options (DataSourceRuleOptions) Required

  • tags (Struct) Required

  • resource_group (ResourceGroup) Required

  • domain_id (string) Required

  • workspace_id (string) Required

  • data_source_id (string) Required

  • created_at (string) Required

{
   "data_source_rule_id": "rule-c8055231e212",
   "name": "match_service_account_test",
   "order": 2,
   "conditions_policy": "ALWAYS",
   "actions": {
       "match_service_account": {
           "source": "account",
           "target": "data.project_id"
       }
   },
   "options": {
       "stop_processing": true
   },
   "tags": {
       "a": "b",
       "b": "c"
   },
   "data_source_id": "ds-c96609f5afeb",
   "domain_id": "domain-58010aa2e451",
   "created_at": "2022-07-19T10:13:28.335Z"
}

list #

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

POST /cost-analysis/v1/data-source-rule/list

DataSourceRuleQuery

  • query (Query)

  • data_source_rule_id (string)

  • name (string)

  • rule_type (RuleType)

  • workspace_id (string)

  • data_source_id (string)

{
 "query": {}
}

DataSourceRulesInfo

  • results (DataSourceRuleInfo) Repeated Required

  • total_count (int32) Required

{
       "results": [
           {
               "data_source_rule_id": "rule-22fab02f6b51",
               "name": "match_service_account",
               "order": 1,
               "conditions_policy": "ALWAYS",
               "actions": {
                   "match_service_account": {
                       "source": "account",
                       "target": "data.project_id"
                   }
               },
               "options": {
                   "stop_processing": true
               },
               "tags": {},
               "data_source_id": "ds-c96609f5afeb",
               "domain_id": "domain-58010aa2e451",
               "created_at": "2022-05-25T16:01:51.858Z"
           },
           {
               "data_source_rule_id": "rule-188d366e9817",
               "name": "match_service_account",
               "order": 1,
               "conditions_policy": "ALWAYS",
               "actions": {
                   "match_service_account": {
                       "source": "account",
                       "target": "data.account_id"
                   }
               },
               "options": {
                   "stop_processing": true
               },
               "tags": {},
               "data_source_id": "ds-fcba92ca73b1",
               "domain_id": "domain-58010aa2e451",
               "created_at": "2022-06-03T16:00:54.099Z"
           }
       ],
       "total_count": 2
}

stat #

POST /cost-analysis/v1/data-source-rule/stat



Message #

ChangeDataSourceRuleOrderRequest #

  • data_source_rule_id (string) Required

  • order (int32) Required


CreateDataSourceRuleRequest #

  • data_source_id (string) Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • resource_group (ResourceGroup) Required

  • workspace_id (string) Required

  • name (string)

  • conditions (DataSourceRuleCondition) Repeated

  • options (DataSourceRuleOptions)

  • tags (Struct)


DataSourceRuleActions #

  • match_service_account (MatchRule) Required

  • match_project (MatchRule) Required

  • change_project (string) Required

  • match_workspace (MatchRule) Required

  • add_additional_info (Struct) Required


DataSourceRuleCondition #

  • key (string) Required

  • value (string) Required

  • operator (string) Required


DataSourceRuleInfo #

  • data_source_rule_id (string) Required

  • name (string) Required

  • rule_type (RuleType) Required

  • order (int32) Required

  • conditions (DataSourceRuleCondition) Repeated Required

  • conditions_policy (ConditionsPolicy) Required

  • actions (DataSourceRuleActions) Required

  • options (DataSourceRuleOptions) Required

  • tags (Struct) Required

  • resource_group (ResourceGroup) Required

  • domain_id (string) Required

  • workspace_id (string) Required

  • data_source_id (string) Required

  • created_at (string) Required


DataSourceRuleOptions #

  • stop_processing (bool) Required


DataSourceRuleQuery #

  • query (Query)

  • data_source_rule_id (string)

  • name (string)

  • rule_type (RuleType)

  • workspace_id (string)

  • data_source_id (string)


DataSourceRuleRequest #

  • data_source_rule_id (string) Required


DataSourceRuleStatQuery #

  • query (StatisticsQuery) Required


DataSourceRulesInfo #

  • results (DataSourceRuleInfo) Repeated Required

  • total_count (int32) Required


MatchRule #

  • source (string) Required

  • target (string) Required

  • all_workspaces (bool) Required


UpdateDataSourceRuleRequest #

  • data_source_rule_id (string) Required

  • name (string)

  • conditions (DataSourceRuleCondition) Repeated

  • conditions_policy (ConditionsPolicy)

  • actions (DataSourceRuleActions)

  • options (DataSourceRuleOptions)

  • tags (Struct)


Calendar November 4, 2024
Edit Edit this page