Skip to content
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
29 changes: 29 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59300,6 +59300,33 @@ components:
type: string
x-enum-varnames:
- HISTORICALDETECTIONSJOB
HistoricalJobFailure:
description: |-
Details about why the job failed. Only present when the job has failed and won't be retried.
properties:
hint:
description: A suggestion to fix the failure.
example: Narrow the time range or reduce the data scanned.
type: string
reason:
$ref: "#/components/schemas/HistoricalJobFailureReason"
type: object
HistoricalJobFailureReason:
description: The reason why the job failed.
enum:
- rule_configuration
- query_too_expensive
- internal_error
example: query_too_expensive
type: string
x-enum-descriptions:
- The rule, or the dataset it references, can't run as written.
- The query scans too much data.
- An internal error occurred. These are usually temporary.
x-enum-varnames:
- RULE_CONFIGURATION
- QUERY_TOO_EXPENSIVE
- INTERNAL_ERROR
HistoricalJobListMeta:
description: Metadata about the list of jobs.
properties:
Expand Down Expand Up @@ -59426,6 +59453,8 @@ components:
createdFromRuleId:
description: ID of the rule used to create the job (if it is created from a rule).
type: string
failure:
$ref: "#/components/schemas/HistoricalJobFailure"
jobDefinition:
$ref: "#/components/schemas/JobDefinition"
jobName:
Expand Down
54 changes: 54 additions & 0 deletions src/datadog_api_client/v2/model/historical_job_failure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.historical_job_failure_reason import HistoricalJobFailureReason


class HistoricalJobFailure(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.historical_job_failure_reason import HistoricalJobFailureReason

return {
"hint": (str,),
"reason": (HistoricalJobFailureReason,),
}

attribute_map = {
"hint": "hint",
"reason": "reason",
}

def __init__(
self_,
hint: Union[str, UnsetType] = unset,
reason: Union[HistoricalJobFailureReason, UnsetType] = unset,
**kwargs,
):
"""
Details about why the job failed. Only present when the job has failed and won't be retried.

:param hint: A suggestion to fix the failure.
:type hint: str, optional

:param reason: The reason why the job failed.
:type reason: HistoricalJobFailureReason, optional
"""
if hint is not unset:
kwargs["hint"] = hint
if reason is not unset:
kwargs["reason"] = reason
super().__init__(kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class HistoricalJobFailureReason(ModelSimple):
"""
The reason why the job failed.

:param value: Must be one of ["rule_configuration", "query_too_expensive", "internal_error"].
:type value: str
"""

allowed_values = {
"rule_configuration",
"query_too_expensive",
"internal_error",
}
RULE_CONFIGURATION: ClassVar["HistoricalJobFailureReason"]
QUERY_TOO_EXPENSIVE: ClassVar["HistoricalJobFailureReason"]
INTERNAL_ERROR: ClassVar["HistoricalJobFailureReason"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


HistoricalJobFailureReason.RULE_CONFIGURATION = HistoricalJobFailureReason("rule_configuration")
HistoricalJobFailureReason.QUERY_TOO_EXPENSIVE = HistoricalJobFailureReason("query_too_expensive")
HistoricalJobFailureReason.INTERNAL_ERROR = HistoricalJobFailureReason("internal_error")
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.historical_job_failure import HistoricalJobFailure
from datadog_api_client.v2.model.job_definition import JobDefinition


class HistoricalJobResponseAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.historical_job_failure import HistoricalJobFailure
from datadog_api_client.v2.model.job_definition import JobDefinition

return {
"created_at": (str,),
"created_by_handle": (str,),
"created_by_name": (str,),
"created_from_rule_id": (str,),
"failure": (HistoricalJobFailure,),
"job_definition": (JobDefinition,),
"job_name": (str,),
"job_status": (str,),
Expand All @@ -40,6 +43,7 @@ def openapi_types(_):
"created_by_handle": "createdByHandle",
"created_by_name": "createdByName",
"created_from_rule_id": "createdFromRuleId",
"failure": "failure",
"job_definition": "jobDefinition",
"job_name": "jobName",
"job_status": "jobStatus",
Expand All @@ -54,6 +58,7 @@ def __init__(
created_by_handle: Union[str, UnsetType] = unset,
created_by_name: Union[str, UnsetType] = unset,
created_from_rule_id: Union[str, UnsetType] = unset,
failure: Union[HistoricalJobFailure, UnsetType] = unset,
job_definition: Union[JobDefinition, UnsetType] = unset,
job_name: Union[str, UnsetType] = unset,
job_status: Union[str, UnsetType] = unset,
Expand All @@ -77,6 +82,9 @@ def __init__(
:param created_from_rule_id: ID of the rule used to create the job (if it is created from a rule).
:type created_from_rule_id: str, optional

:param failure: Details about why the job failed. Only present when the job has failed and won't be retried.
:type failure: HistoricalJobFailure, optional

:param job_definition: Definition of a historical job.
:type job_definition: JobDefinition, optional

Expand All @@ -103,6 +111,8 @@ def __init__(
kwargs["created_by_name"] = created_by_name
if created_from_rule_id is not unset:
kwargs["created_from_rule_id"] = created_from_rule_id
if failure is not unset:
kwargs["failure"] = failure
if job_definition is not unset:
kwargs["job_definition"] = job_definition
if job_name is not unset:
Expand Down
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4657,6 +4657,8 @@
from datadog_api_client.v2.model.hamr_org_connection_status import HamrOrgConnectionStatus
from datadog_api_client.v2.model.hamr_org_connection_type import HamrOrgConnectionType
from datadog_api_client.v2.model.historical_job_data_type import HistoricalJobDataType
from datadog_api_client.v2.model.historical_job_failure import HistoricalJobFailure
from datadog_api_client.v2.model.historical_job_failure_reason import HistoricalJobFailureReason
from datadog_api_client.v2.model.historical_job_list_meta import HistoricalJobListMeta
from datadog_api_client.v2.model.historical_job_options import HistoricalJobOptions
from datadog_api_client.v2.model.historical_job_query import HistoricalJobQuery
Expand Down Expand Up @@ -16244,6 +16246,8 @@
"HamrOrgConnectionStatus",
"HamrOrgConnectionType",
"HistoricalJobDataType",
"HistoricalJobFailure",
"HistoricalJobFailureReason",
"HistoricalJobListMeta",
"HistoricalJobOptions",
"HistoricalJobQuery",
Expand Down
Loading