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:
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
{{< tabs " create " >}}
{{< tab "Request Example" >}}
data_source_id (string)
Requiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredresource_group (ResourceGroup)
Requiredworkspace_id (string)
Requiredname (string)
conditions (DataSourceRuleCondition)
Repeatedoptions (DataSourceRuleOptions)
tags (Struct)
{{< highlight json >}} { "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"} } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
data_source_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (DataSourceRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredoptions (DataSourceRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requireddata_source_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "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" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
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
{{< tabs " update " >}}
{{< tab "Request Example" >}}
data_source_rule_id (string)
Requiredname (string)
conditions (DataSourceRuleCondition)
Repeatedconditions_policy (ConditionsPolicy)
actions (DataSourceRuleActions)
options (DataSourceRuleOptions)
tags (Struct)
{{< highlight json >}} { "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"} } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
data_source_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (DataSourceRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredoptions (DataSourceRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requireddata_source_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "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" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
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
{{< tabs " change_order " >}}
{{< tab "Request Example" >}}
ChangeDataSourceRuleOrderRequest
data_source_rule_id (string)
Requiredorder (int32)
Required
{{< highlight json >}} { "data_source_rule_id": "rule-c8055231e212", "order": 2 } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
data_source_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (DataSourceRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredoptions (DataSourceRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requireddata_source_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "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" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
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
{{< tabs " delete " >}}
{{< tab "Request Example" >}}
data_source_rule_id (string)
Required
{{< highlight json >}} { "data_source_rule_id": "rule-22fab02f6b51" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
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
{{< tabs " get " >}}
{{< tab "Request Example" >}}
data_source_rule_id (string)
Required
{{< highlight json >}} { "data_source_rule_id": "rule-22fab02f6b51" } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
data_source_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (DataSourceRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredoptions (DataSourceRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requireddata_source_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "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" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
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
{{< tabs " list " >}}
{{< tab "Request Example" >}}
query (Query)
data_source_rule_id (string)
name (string)
rule_type (RuleType)
workspace_id (string)
data_source_id (string)
{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
results (DataSourceRuleInfo)
RepeatedRequiredtotal_count (int32)
Required
{{< highlight json >}} { "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 } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
stat
POST /cost-analysis/v1/data-source-rule/stat
Message
ChangeDataSourceRuleOrderRequest
data_source_rule_id (string)
Requiredorder (int32)
Required
CreateDataSourceRuleRequest
data_source_id (string)
Requiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredresource_group (ResourceGroup)
Requiredworkspace_id (string)
Requiredname (string)
conditions (DataSourceRuleCondition)
Repeatedoptions (DataSourceRuleOptions)
tags (Struct)
DataSourceRuleActions
match_service_account (MatchRule)
Requiredmatch_project (MatchRule)
Requiredchange_project (string)
Requiredmatch_workspace (MatchRule)
Requiredadd_additional_info (Struct)
Required
DataSourceRuleCondition
key (string)
Requiredvalue (string)
Requiredoperator (string)
Required
DataSourceRuleInfo
data_source_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (DataSourceRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (DataSourceRuleActions)
Requiredoptions (DataSourceRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requireddata_source_id (string)
Requiredcreated_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)
RepeatedRequiredtotal_count (int32)
Required
MatchRule
source (string)
Requiredtarget (string)
Requiredall_workspaces (bool)
Required
UpdateDataSourceRuleRequest
data_source_rule_id (string)
Requiredname (string)
conditions (DataSourceRuleCondition)
Repeatedconditions_policy (ConditionsPolicy)
actions (DataSourceRuleActions)
options (DataSourceRuleOptions)
tags (Struct)
Last updated