Skip to content

Remove caseIndex from historical jobs API spec #2625

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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": "2025-06-13 13:39:11.219540",
"spec_repo_commit": "9757e1ea"
"regenerated": "2025-06-13 20:50:47.970284",
"spec_repo_commit": "7fe71d9f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-13 13:39:11.262516",
"spec_repo_commit": "9757e1ea"
"regenerated": "2025-06-13 20:50:47.985129",
"spec_repo_commit": "7fe71d9f"
}
}
}
7 changes: 0 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19273,12 +19273,6 @@ components:
JobDefinitionFromRule:
description: Definition of a historical job based on a security monitoring rule.
properties:
caseIndex:
description: Index of the rule case applied by the job.
example: 0
format: int32
maximum: 9
type: integer
from:
description: Starting time of data analyzed by the job.
example: 1729843470000
Expand Down Expand Up @@ -19309,7 +19303,6 @@ components:
- from
- to
- index
- caseIndex
type: object
KindAttributes:
description: Kind attributes.
Expand Down
21 changes: 1 addition & 20 deletions src/datadog_api_client/v2/model/job_definition_from_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@


class JobDefinitionFromRule(ModelNormal):
validations = {
"case_index": {
"inclusive_maximum": 9,
},
}

@cached_property
def openapi_types(_):
return {
"case_index": (int,),
"_from": (int,),
"id": (str,),
"index": (str,),
Expand All @@ -32,7 +25,6 @@ def openapi_types(_):
}

attribute_map = {
"case_index": "caseIndex",
"_from": "from",
"id": "id",
"index": "index",
Expand All @@ -41,21 +33,11 @@ def openapi_types(_):
}

def __init__(
self_,
case_index: int,
_from: int,
id: str,
index: str,
to: int,
notifications: Union[List[str], UnsetType] = unset,
**kwargs,
self_, _from: int, id: str, index: str, to: int, notifications: Union[List[str], UnsetType] = unset, **kwargs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
self_, _from: int, id: str, index: str, to: int, notifications: Union[List[str], UnsetType] = unset, **kwargs
self, _from: int, id: str, index: str, to: int, notifications: Union[List[str], UnsetType] = unset, **kwargs
first parameter of a class function should be self (...read more)

In a class method (that is not a class method nor a static method), the first argument must be self by convention.

Learn More

View in Datadog  Leave us feedback  Documentation

):
"""
Definition of a historical job based on a security monitoring rule.

:param case_index: Index of the rule case applied by the job.
:type case_index: int

:param _from: Starting time of data analyzed by the job.
:type _from: int

Expand All @@ -75,7 +57,6 @@ def __init__(
kwargs["notifications"] = notifications
super().__init__(kwargs)

self_.case_index = case_index
self_._from = _from
self_.id = id
self_.index = index
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-08T09:54:40.192Z
2025-06-12T14:01:05.945Z
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interactions:
- request:
body: '{"data":{"attributes":{"fromRule":{"caseIndex":0,"from":1730201035064,"id":"non-existng","index":"main","notifications":[],"to":1730204635115}},"type":"historicalDetectionsJobCreate"}}'
body: '{"data":{"attributes":{"fromRule":{"from":1730201035064,"id":"non-existng","index":"main","notifications":[],"to":1730204635115}},"type":"historicalDetectionsJobCreate"}}'
headers:
accept:
- application/json
Expand All @@ -10,7 +10,7 @@ interactions:
uri: https://api.datadoghq.com/api/v2/siem-historical-detections/jobs
response:
body:
string: '{"errors":[{"status":"404","detail":"failed to get rule details"}]}'
string: '{"errors":[{"status":"404","title":"Not Found"}]}'
headers:
content-type:
- application/vnd.api+json
Expand Down
2 changes: 1 addition & 1 deletion tests/v2/features/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ Feature: Security Monitoring
Scenario: Run a historical job returns "Not Found" response
Given operation "RunHistoricalJob" enabled
And new "RunHistoricalJob" request
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"caseIndex": 0, "from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
When the request is sent
Then the response status is 404 Not Found

Expand Down