Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional group-bys support to security signals #1748

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-07 09:02:06.404689",
"spec_repo_commit": "c7428dad"
"regenerated": "2023-11-09 10:45:49.710867",
"spec_repo_commit": "66a4cef6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-07 09:02:06.418647",
"spec_repo_commit": "c7428dad"
"regenerated": "2023-11-09 10:45:49.725898",
"spec_repo_commit": "66a4cef6"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15010,6 +15010,13 @@ components:
description: Field.
type: string
type: array
hasOptionalGroupByFields:
description: When false, events without a group-by value are ignored by
the rule. When true, events with missing group-by fields are processed
with `N/A`, replacing the missing values.
example: false
readOnly: true
type: boolean
metric:
deprecated: true
description: '(Deprecated) The target field to aggregate over when using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def __init__(self, **kwargs):
:param group_by_fields: Fields to group by.
:type group_by_fields: [str], optional

:param has_optional_group_by_fields: When false, events without a group-by value are ignored by the rule. When true, events with missing group-by fields are processed with `N/A`, replacing the missing values.
:type has_optional_group_by_fields: bool, optional

:param metric: (Deprecated) The target field to aggregate over when using the sum or max
aggregations. `metrics` field should be used instead.
:type metric: str, optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def openapi_types(_):
"aggregation": (SecurityMonitoringRuleQueryAggregation,),
"distinct_fields": ([str],),
"group_by_fields": ([str],),
"has_optional_group_by_fields": (bool,),
"metric": (str,),
"metrics": ([str],),
"name": (str,),
Expand All @@ -40,17 +41,22 @@ def openapi_types(_):
"aggregation": "aggregation",
"distinct_fields": "distinctFields",
"group_by_fields": "groupByFields",
"has_optional_group_by_fields": "hasOptionalGroupByFields",
"metric": "metric",
"metrics": "metrics",
"name": "name",
"query": "query",
}
read_only_vars = {
"has_optional_group_by_fields",
}

def __init__(
self_,
aggregation: Union[SecurityMonitoringRuleQueryAggregation, UnsetType] = unset,
distinct_fields: Union[List[str], UnsetType] = unset,
group_by_fields: Union[List[str], UnsetType] = unset,
has_optional_group_by_fields: Union[bool, UnsetType] = unset,
metric: Union[str, UnsetType] = unset,
metrics: Union[List[str], UnsetType] = unset,
name: Union[str, UnsetType] = unset,
Expand All @@ -69,6 +75,9 @@ def __init__(
:param group_by_fields: Fields to group by.
:type group_by_fields: [str], optional

:param has_optional_group_by_fields: When false, events without a group-by value are ignored by the rule. When true, events with missing group-by fields are processed with ``N/A`` , replacing the missing values.
:type has_optional_group_by_fields: bool, optional

:param metric: (Deprecated) The target field to aggregate over when using the sum or max
aggregations. ``metrics`` field should be used instead. **Deprecated**.
:type metric: str, optional
Expand All @@ -88,6 +97,8 @@ def __init__(
kwargs["distinct_fields"] = distinct_fields
if group_by_fields is not unset:
kwargs["group_by_fields"] = group_by_fields
if has_optional_group_by_fields is not unset:
kwargs["has_optional_group_by_fields"] = has_optional_group_by_fields
if metric is not unset:
kwargs["metric"] = metric
if metrics is not unset:
Expand Down
Loading