CollectorRule
A CollectorRule is a cloud service resource filtering the raw data from the Collector. The Cloud Service resource is created after the raw data is filtered by the CollectorRule.
Package : spaceone.api.inventory.v1
CollectorRule
CollectorRule Methods:
create
Creates a new CollectorRule. When creating the cloud service, this method can apply two types of conditions: mapping projects where the cloud service incurred to the Cloud Service, and mapping cloud service accounts to the Cloud Service. By adjusting the condition_policy parameter, the CollectorRule 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 /inventory/v1/collector-rule/create
{{< tabs " create " >}}
{{< tab "Request Example" >}}
collector_id (string)
Requiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredname (string)
conditions (CollectorRuleCondition)
Repeatedoptions (CollectorRuleOptions)
tags (Struct)
{{< highlight json >}} { "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"}, "collector_id": "collector-2e39891cbbb5" } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
collector_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (CollectorRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredoptions (CollectorRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requiredcollector_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-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" }, "collector_id": "collector-2e39891cbbb5", "domain_id": "domain-58010aa2e451", "created_at": "2022-07-19T10:13:28.335Z" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
update
Updates a specific CollectorRule. You can make changes in CollectorRule settings, including filtering conditions.
POST /inventory/v1/collector-rule/update
{{< tabs " update " >}}
{{< tab "Request Example" >}}
collector_rule_id (string)
Requiredname (string)
conditions (CollectorRuleCondition)
Repeatedconditions_policy (ConditionsPolicy)
actions (CollectorRuleActions)
options (CollectorRuleOptions)
tags (Struct)
{{< highlight json >}} { "collector_rule_id": "collector-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" >}}
collector_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (CollectorRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredoptions (CollectorRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requiredcollector_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-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" }, "collector_id": "collector-2e39891cbbb5", "domain_id": "domain-58010aa2e451", "created_at": "2022-07-19T10:13:28.335Z" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
change_order
Changes the priority order of the CollectorRules to apply. If there are multiple CollectorRules applied in a specific service account, the priority order of the resources is required. This method changes the priority order to apply CollectorRules.
POST /inventory/v1/collector-rule/change-order
{{< tabs " change_order " >}}
{{< tab "Request Example" >}}
ChangeCollectorRuleOrderRequest
collector_rule_id (string)
Requiredorder (int32)
Required
{{< highlight json >}} { "collector_rule_id": "collector-rule-c8055231e212", "order": 2 } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
collector_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (CollectorRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredoptions (CollectorRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requiredcollector_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-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" }, "collector_id": "collector-2e39891cbbb5", "domain_id": "domain-58010aa2e451", "created_at": "2022-07-19T10:13:28.335Z" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
delete
Deletes a specific CollectorRule. You must specify the collector_rule_id of the CollectorRule to delete.
POST /inventory/v1/collector-rule/delete
{{< tabs " delete " >}}
{{< tab "Request Example" >}}
collector_rule_id (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-rule-c8055231e212", } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
get
Gets a specific CollectorRule. Prints detailed information about the CollectorRule, including conditions_policy and conditions applied to Collector.
POST /inventory/v1/collector-rule/get
{{< tabs " get " >}}
{{< tab "Request Example" >}}
collector_rule_id (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-rule-c8055231e212", } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
collector_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (CollectorRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredoptions (CollectorRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requiredcollector_id (string)
Requiredcreated_at (string)
Required
{{< highlight json >}} { "collector_rule_id": "collector-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" }, "collector_id": "collector-2e39891cbbb5", "domain_id": "domain-58010aa2e451", "created_at": "2022-07-19T10:13:28.335Z" } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
list
Gets a list of all CollectorRules. You can use a query to get a filtered list of CollectorRules.
POST /inventory/v1/collector-rule/list
{{< tabs " list " >}}
{{< tab "Request Example" >}}
query (Query)
collector_rule_id (string)
name (string)
rule_type (RuleType)
workspace_id (string)
collector_id (string)
{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}
{{< tab "Response Example" >}}
results (CollectorRuleInfo)
RepeatedRequiredtotal_count (int32)
Required
{{< highlight json >}} { "results": [ { "collector_rule_id": "collector-rule-c8055231e212", "name": "match_service_account", "order": 1, "conditions_policy": "ALWAYS", "actions": { "match_service_account": { "source": "account", "target": "data.project_id" } }, "options": { "stop_processing": true }, "tags": {}, "collector_id": "collector-2e39891cbbb5", "domain_id": "domain-58010aa2e451", "created_at": "2022-05-25T16:01:51.858Z" }, { "collector_rule_id": "collector-rule-t3345231e167", "name": "match_service_account", "order": 1, "conditions_policy": "ALWAYS", "actions": { "match_service_account": { "source": "account", "target": "data.account_id" } }, "options": { "stop_processing": true }, "tags": {}, "collector_id": "collector-7163022d49a1", "domain_id": "domain-58010aa2e451", "created_at": "2022-06-03T16:00:54.099Z" } ], "total_count": 2 } {{< /highlight >}} {{< /tab >}}
{{< /tabs >}}
stat
POST /inventory/v1/collector-rule/stat
Message
ChangeCollectorRuleOrderRequest
collector_rule_id (string)
Requiredorder (int32)
Required
CollectorRuleActions
change_project (string)
Requiredmatch_project (MatchRule)
Requiredmatch_service_account (MatchRule)
Requiredadd_additional_info (Struct)
Required
CollectorRuleCondition
key (string)
Requiredvalue (string)
Requiredoperator (string)
Required
CollectorRuleInfo
collector_rule_id (string)
Requiredname (string)
Requiredrule_type (RuleType)
Requiredorder (int32)
Requiredconditions (CollectorRuleCondition)
RepeatedRequiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredoptions (CollectorRuleOptions)
Requiredtags (Struct)
Requiredresource_group (ResourceGroup)
Requireddomain_id (string)
Requiredworkspace_id (string)
Requiredcollector_id (string)
Requiredcreated_at (string)
Required
CollectorRuleOptions
stop_processing (bool)
Required
CollectorRuleQuery
query (Query)
collector_rule_id (string)
name (string)
rule_type (RuleType)
workspace_id (string)
collector_id (string)
CollectorRuleRequest
collector_rule_id (string)
Required
CollectorRuleStatQuery
query (StatisticsQuery)
Required
CollectorRulesInfo
results (CollectorRuleInfo)
RepeatedRequiredtotal_count (int32)
Required
CreateCollectorRuleRequest
collector_id (string)
Requiredconditions_policy (ConditionsPolicy)
Requiredactions (CollectorRuleActions)
Requiredname (string)
conditions (CollectorRuleCondition)
Repeatedoptions (CollectorRuleOptions)
tags (Struct)
MatchRule
source (string)
Requiredtarget (string)
Required
UpdateCollectorRuleRequest
collector_rule_id (string)
Requiredname (string)
conditions (CollectorRuleCondition)
Repeatedconditions_policy (ConditionsPolicy)
actions (CollectorRuleActions)
options (CollectorRuleOptions)
tags (Struct)
Last updated