rules
Protocol buffer definition for rules
sift/rules/v1/rules.proto
AnnotationActionConfiguration
Field | Type | Label | Description |
---|---|---|---|
tag_ids | string | repeated | |
annotation_type | sift.annotations.v1.AnnotationType | ||
assigned_to_user_id | string | optional |
AssetExpressionValidationResult
Field | Type | Label | Description |
---|---|---|---|
asset_id | string | ||
asset_name | string | ||
asset_tag_id | string | asset_tag_id is the tag_id that caused this asset to be included in the rule | |
error | string | optional |
BatchDeleteRulesRequest
BatchDeleteRulesRequest is used to delete a rule by rule_id or client_key. For each rule if both are provided, only rule_id will be used.
BatchDeleteRulesResponse
BatchGetRuleVersionsRequest
Field | Type | Label | Description |
---|---|---|---|
rule_version_ids | string | repeated |
BatchGetRuleVersionsResponse
Field | Type | Label | Description |
---|---|---|---|
rules | Rule | repeated |
BatchGetRulesRequest
BatchGetRulesRequest is used to retrieve rules by rule_ids or client_keys. If both are provided, both will be used to retrieve rules.
BatchGetRulesResponse
Field | Type | Label | Description |
---|---|---|---|
rules | Rule | repeated |
BatchUndeleteRulesRequest
BatchUndeleteRulesRequest is used to delete a rule by rule_id or client_key. For each rule if both are provided, only rule_id will be used.
BatchUndeleteRulesResponse
BatchUpdateRulesRequest
Field | Type | Label | Description |
---|---|---|---|
rules | UpdateRuleRequest | repeated | rules are limited 1000 rules at a time |
validate_only | bool | If validate_only is true, the request will only validate the request and not save the rules. | |
override_expression_validation | bool | If override_expression_validation is true, the request will save the rules even if the expressions are invalid. This can be useful for multi-asset rules where an invalid expression for one asset should not prevent the rule from being saved. |
BatchUpdateRulesResponse
Field | Type | Label | Description |
---|---|---|---|
success | bool | ||
rules_created_count | int32 | The total number of rules created in the request. If validate_only is true, this will indicate how many rules would have been created. | |
rules_updated_count | int32 | The total number of rules updated in the request. If validate_only is true, this will indicate how many rules would have been updated. | |
validate_only | bool | This will be true if the request only validated the request and did not save the rules. | |
validation_results | ValidationResult | repeated | One ValidationResult per rule in the request will be returned |
CalculatedChannelConfig
Field | Type | Label | Description |
---|---|---|---|
channel_references | CalculatedChannelConfig.ChannelReferencesEntry | repeated | |
expression | string |
CalculatedChannelConfig.ChannelReferencesEntry
Field | Type | Label | Description |
---|---|---|---|
key | string | ||
value | ChannelReference |
ChannelReference
ContextualChannels
Field | Type | Label | Description |
---|---|---|---|
channels | ChannelReference | repeated |
CreateRuleRequest
Field | Type | Label | Description |
---|---|---|---|
update | UpdateRuleRequest |
CreateRuleResponse
Field | Type | Label | Description |
---|---|---|---|
rule_id | string |
DeleteRuleRequest
DeleteRuleRequest is used to delete a rule by rule_id or client_key. If both are provided, only rule_id will be used.
DeleteRuleResponse
DryRunAnnotation
Field | Type | Label | Description |
---|---|---|---|
condition_id | string | ||
name | string | ||
start_time | google.protobuf.Timestamp | ||
end_time | google.protobuf.Timestamp | ||
condition_version_id | string |
EvaluateRulesRequest
Deprecated - use RuleEvaluationService instead.
Field | Type | Label | Description |
---|---|---|---|
rule_ids | string | repeated | |
annotation_options | EvaluatedAnnotationOptions | ||
run_id | string | ||
time_range | TimeRangeQuery | ||
dry_run | bool |
EvaluateRulesResponse
Deprecated - use RuleEvaluationService instead.
Field | Type | Label | Description |
---|---|---|---|
created_annotation_count | int32 | ||
dry_run_annotations | DryRunAnnotation | repeated | If dry_run is true, this will be populated with the annotations that would be created |
job_id | string | optional | job_id and report_id will be set if the job has an extended run time and is being processed asynchronously. |
report_id | string | optional |
EvaluatedAnnotationOptions
Field | Type | Label | Description |
---|---|---|---|
tag_ids | string | repeated |
GetRuleRequest
GetRuleRequest is used to retrieve a rule by rule_id or client_key. If both are provided, only rule_id will be used.
GetRuleResponse
Field | Type | Label | Description |
---|---|---|---|
rule | Rule |
GetRuleVersionRequest
Field | Type | Label | Description |
---|---|---|---|
rule_version_id | string |
GetRuleVersionResponse
Field | Type | Label | Description |
---|---|---|---|
rule | Rule |
JsonRulesRequest
JsonRulesResponse
Field | Type | Label | Description |
---|---|---|---|
success | bool | ||
total_rules_count | int32 | ||
rules_created_count | int32 | ||
rules_updated_count | int32 | ||
rules_deleted_count | int32 | ||
error_messages | string | optional |
LastValueThreshold
ListRuleVersionsRequest
Field | Type | Label | Description |
---|---|---|---|
rule_id | string | ||
page_size | uint32 | The maximum number of Rule Versions to return. The service may return fewer than this value. If unspecified, at most 50 Rule Versions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. | |
page_token | string | A page token, received from a previous ListRuleVersions call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListRuleVersions must match the call that provided the page token. | |
filter | string | A Common Expression Language (CEL) filter string. Available fields to filter by are rule_version_id , user_notes , and change_message . For further information about how to use CELs, please refer to this guide. Optional. |
ListRuleVersionsResponse
Field | Type | Label | Description |
---|---|---|---|
rule_versions | RuleVersion | repeated | |
next_page_token | string |
NotificationActionConfiguration
Field | Type | Label | Description |
---|---|---|---|
recipient_user_ids | string | repeated |
Rule
Field | Type | Label | Description |
---|---|---|---|
rule_id | string | ||
asset_id | string | Deprecated. | |
name | string | ||
description | string | ||
is_enabled | bool | ||
created_date | google.protobuf.Timestamp | ||
modified_date | google.protobuf.Timestamp | ||
created_by_user_id | string | ||
modified_by_user_id | string | ||
organization_id | string | ||
conditions | RuleCondition | repeated | |
rule_version | RuleVersion | ||
client_key | string | client_key is a client provided identifier for the rule. It is immutable after rule creation. | |
asset_configuration | RuleAssetConfiguration | ||
contextual_channels | ContextualChannels | ||
deleted_date | google.protobuf.Timestamp |
RuleAction
Field | Type | Label | Description |
---|---|---|---|
rule_action_id | string | ||
rule_condition_id | string | ||
action_type | ActionKind | ||
configuration | RuleActionConfiguration | ||
created_date | google.protobuf.Timestamp | ||
modified_date | google.protobuf.Timestamp | ||
created_by_user_id | string | ||
modified_by_user_id | string | ||
rule_action_version_id | string |
RuleActionConfiguration
Field | Type | Label | Description |
---|---|---|---|
notification | NotificationActionConfiguration | ||
annotation | AnnotationActionConfiguration |
RuleAssetConfiguration
RuleCondition
Field | Type | Label | Description |
---|---|---|---|
rule_condition_id | string | ||
rule_id | string | ||
expression | RuleConditionExpression | ||
created_date | google.protobuf.Timestamp | ||
modified_date | google.protobuf.Timestamp | ||
created_by_user_id | string | ||
modified_by_user_id | string | ||
actions | RuleAction | repeated | |
rule_condition_version_id | string |
RuleConditionExpression
Field | Type | Label | Description |
---|---|---|---|
single_channel_comparison | SingleChannelComparisonExpression | Deprecated. | |
calculated_channel | CalculatedChannelConfig |
RuleVersion
Field | Type | Label | Description |
---|---|---|---|
rule_id | string | ||
rule_version_id | string | ||
version | string | ||
created_date | google.protobuf.Timestamp | ||
created_by_user_id | string | ||
version_notes | string | ||
generated_change_message | string | ||
deleted_date | google.protobuf.Timestamp |
SearchRulesRequest
Field | Type | Label | Description |
---|---|---|---|
limit | uint32 | optional | Max number of rules to return (returns all if omitted). |
offset | uint32 | Only applies if limit provided. | |
order | SearchOrder | optional | Order to sort results by (defaults to ascending). |
name_matches | string | ||
case_sensitive | bool | ||
regexp | bool | ||
order_by | string | optional | |
rule_ids | string | repeated | If provided, only returns rules with the given ids |
asset_ids | string | repeated | If provided, only returns rules that apply to the given asset ids |
include_deleted | bool | ||
asset_tags | sift.common.type.v1.NamedResources | If provided, returns rules with assets that have the given tags |
SearchRulesResponse
Field | Type | Label | Description |
---|---|---|---|
count | uint32 | ||
rules | Rule | repeated | Conditions are not included in the search response. The latest version of the rule is returned. |
SingleChannelComparisonExpression
Deprecated - use CalculatedChannelConfig.
Field | Type | Label | Description |
---|---|---|---|
channel_component | string | ||
channel_name | string | ||
comparator | ConditionComparator | ||
double | double | ||
string | string | ||
last_value | LastValueThreshold |
TimeRangeQuery
Field | Type | Label | Description |
---|---|---|---|
start_time | google.protobuf.Timestamp | ||
end_time | google.protobuf.Timestamp |
UndeleteRuleRequest
UndeleteRuleRequest is used to undelete a rule by rule_id or client_key. If both are provided, only rule_id will be used.
UndeleteRuleResponse
UpdateActionRequest
Field | Type | Label | Description |
---|---|---|---|
rule_action_id | string | optional | |
action_type | ActionKind | ||
configuration | RuleActionConfiguration |
UpdateConditionRequest
Field | Type | Label | Description |
---|---|---|---|
rule_condition_id | string | optional | |
expression | RuleConditionExpression | ||
actions | UpdateActionRequest | repeated |
UpdateHumanFriendlyRulesRequest
Deprecated - use UpdateJsonRulesRequest.
UpdateHumanFriendlyRulesResponse
Deprecated - use UpdateJsonRulesResponse.
UpdateJsonRulesRequest
Field | Type | Label | Description |
---|---|---|---|
request | JsonRulesRequest |
UpdateJsonRulesResponse
Field | Type | Label | Description |
---|---|---|---|
response | JsonRulesResponse |
UpdateRuleRequest
UpdateRuleRequest is used to create or update a rule. If the rule_id or client_key is provided, the rule will be updated. If not, a new rule will be created.
Field | Type | Label | Description |
---|---|---|---|
rule_id | string | optional | |
name | string | ||
description | string | ||
asset_id | string | Deprecated. Deprecated - use asset_configuration instead. | |
is_enabled | bool | ||
conditions | UpdateConditionRequest | repeated | |
organization_id | string | ||
version_notes | string | ||
client_key | string | optional | client_key is a client provided identifier for the rule. It is immutable after being set |
asset_configuration | RuleAssetConfiguration | ||
contextual_channels | ContextualChannels |
UpdateRuleResponse
Field | Type | Label | Description |
---|---|---|---|
rule_id | string |
ValidateJsonRulesRequest
Field | Type | Label | Description |
---|---|---|---|
request | JsonRulesRequest |
ValidateJsonRulesResponse
Field | Type | Label | Description |
---|---|---|---|
response | JsonRulesResponse |
ValidationResult
Field | Type | Label | Description |
---|---|---|---|
rule_id | string | ||
client_key | string | ||
asset_expression_validation_results | AssetExpressionValidationResult | repeated | If the expression is invalid for an asset, one or more AssetExpressionValidationResult will be returned. This may block saving if the override_expression_validation flag is not set. |
error | string | optional | If the rule is invalid and unable to be saved, this will contain the error message. Expression errors will be returned in the asset_expression_validation_results. |
ViewHumanFriendlyRulesRequest
Deprecated - use ViewJsonRulesRequest.
Field | Type | Label | Description |
---|---|---|---|
asset_id | string |
ViewHumanFriendlyRulesResponse
Deprecated - use ViewJsonRulesResponse.
Field | Type | Label | Description |
---|---|---|---|
rules_json | string |
ViewJsonRulesRequest
Field | Type | Label | Description |
---|---|---|---|
asset_id | string |
ViewJsonRulesResponse
Field | Type | Label | Description |
---|---|---|---|
rules_json | string |
ActionKind
Name | Number | Description |
---|---|---|
ACTION_KIND_UNSPECIFIED | 0 | |
NOTIFICATION | 1 | |
ANNOTATION | 2 |
ConditionComparator
Name | Number | Description |
---|---|---|
CONDITION_COMPARATOR_UNSPECIFIED | 0 | |
LESS_THAN | 1 | |
LESS_THAN_OR_EQUAL | 2 | |
GREATER_THAN | 3 | |
GREATER_THAN_OR_EQUAL | 4 | |
EQUAL | 5 | |
NOT_EQUAL | 6 |
SearchOrder
Name | Number | Description |
---|---|---|
SEARCH_ORDER_UNSPECIFIED | 0 | |
SEARCH_ORDER_ASC | 1 | |
SEARCH_ORDER_DESC | 2 |
RuleService
Method Name | Request Type | Response Type | Description |
---|---|---|---|
SearchRules | SearchRulesRequest | SearchRulesResponse | Queries rules based on provided search parameters. |
GetRule | GetRuleRequest | GetRuleResponse | Retrieves the latest version of a rule. |
BatchGetRules | BatchGetRulesRequest | BatchGetRulesResponse | Retrieve multiple rules. |
CreateRule | CreateRuleRequest | CreateRuleResponse | Creates a rule. |
UpdateRule | UpdateRuleRequest | UpdateRuleResponse | Updates an existing rule. |
BatchUpdateRules | BatchUpdateRulesRequest | BatchUpdateRulesResponse | Updates existing rules or creates rules that do not exist. |
DeleteRule | DeleteRuleRequest | DeleteRuleResponse | Deletes a rule |
BatchDeleteRules | BatchDeleteRulesRequest | BatchDeleteRulesResponse | Deletes multiple rules |
UndeleteRule | UndeleteRuleRequest | UndeleteRuleResponse | Undeletes a rule |
BatchUndeleteRules | BatchUndeleteRulesRequest | BatchUndeleteRulesResponse | Undeletes multiple rules |
EvaluateRules | EvaluateRulesRequest | EvaluateRulesResponse | Deprecated - use RuleEvaluationService instead. |
ViewHumanFriendlyRules | ViewHumanFriendlyRulesRequest | ViewHumanFriendlyRulesResponse | Deprecated - use ViewJsonRules instead. Retrieve a JSON object containing all of the rules for a given asset. |
ViewJsonRules | ViewJsonRulesRequest | ViewJsonRulesResponse | Deprecated - use BatchGetRules instead. Retrieve a JSON object containing all of the rules for a given asset. |
UpdateHumanFriendlyRules | UpdateHumanFriendlyRulesRequest | UpdateHumanFriendlyRulesResponse | Deprecated - use BatchUpdateRules instead. Batch update rules given the rules_json which is a JSON list of rules. |
ValidateJsonRules | ValidateJsonRulesRequest | ValidateJsonRulesResponse | Deprecated - use BatchUpdateRules with validate_only flag instead. Validate a batch update for rules given the rules_json which is a JSON list of rules. This is a dry-run operation. |
UpdateJsonRules | UpdateJsonRulesRequest | UpdateJsonRulesResponse | Deprecated - use BatchUpdateRules instead. Batch update rules given the rules_json which is a JSON list of rules. |
ListRuleVersions | ListRuleVersionsRequest | ListRuleVersionsResponse | Retrieves a list of rule versions for the given rule. |
GetRuleVersion | GetRuleVersionRequest | GetRuleVersionResponse | Retrieves a specific version of a rule. |
BatchGetRuleVersions | BatchGetRuleVersionsRequest | BatchGetRuleVersionsResponse | Retrieves multiple rules by rule versions. |