Skip to content

Commit db341d6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b8458ae of spec repo
1 parent fd58c5a commit db341d6

11 files changed

Lines changed: 221 additions & 1 deletion

.generator/schemas/v1/openapi.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8067,6 +8067,36 @@ components:
80678067
- data_source
80688068
- query
80698069
type: object
8070+
MonitorFormulaAndFunctionDataJobsQueryDefinition:
8071+
description: A formula and functions data jobs query.
8072+
properties:
8073+
job_type:
8074+
description: |-
8075+
The type of job being monitored. Known values include:
8076+
`databricks.job`, `spark.application`, `airflow.dag`,
8077+
`dbt.job`, `dbt.model`, `dbt.test`, `glue.job`.
8078+
Custom job types are supported with the `custom.ol.` prefix.
8079+
example: "databricks.job"
8080+
type: string
8081+
jobs_query:
8082+
description: Filter expression used to select the jobs to monitor.
8083+
example: "job_name:smoke*"
8084+
type: string
8085+
name:
8086+
description: Name of the query for use in formulas. Must be `run_query`.
8087+
example: "run_query"
8088+
type: string
8089+
query_dialect:
8090+
description: |-
8091+
Query dialect for data jobs queries. Currently only `metric` is supported.
8092+
example: "metric"
8093+
type: string
8094+
required:
8095+
- name
8096+
- jobs_query
8097+
- job_type
8098+
- query_dialect
8099+
type: object
80708100
MonitorFormulaAndFunctionDataQualityDataSource:
80718101
description: Data source for data quality queries.
80728102
enum:
@@ -8373,6 +8403,7 @@ components:
83738403
- $ref: "#/components/schemas/MonitorFormulaAndFunctionEventQueryDefinition"
83748404
- $ref: "#/components/schemas/MonitorFormulaAndFunctionCostQueryDefinition"
83758405
- $ref: "#/components/schemas/MonitorFormulaAndFunctionDataQualityQueryDefinition"
8406+
- $ref: "#/components/schemas/MonitorFormulaAndFunctionDataJobsQueryDefinition"
83768407
- $ref: "#/components/schemas/MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition"
83778408
- $ref: "#/components/schemas/MonitorFormulaAndFunctionAggregateFilteredQueryDefinition"
83788409
MonitorFormulaAndFunctionReferenceTableColumn:
@@ -9205,6 +9236,7 @@ components:
92059236
- "cost alert"
92069237
- "data-quality alert"
92079238
- "network-path alert"
9239+
- "data-jobs alert"
92089240
example: "query alert"
92099241
type: string
92109242
x-enum-varnames:
@@ -9229,6 +9261,7 @@ components:
92299261
- COST_ALERT
92309262
- DATA_QUALITY_ALERT
92319263
- NETWORK_PATH_ALERT
9264+
- DATA_JOBS_ALERT
92329265
MonitorUpdateRequest:
92339266
description: Object describing a monitor update request.
92349267
properties:

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,6 +2608,13 @@ datadog\_api\_client.v1.model.monitor\_formula\_and\_function\_cost\_query\_defi
26082608
:members:
26092609
:show-inheritance:
26102610

2611+
datadog\_api\_client.v1.model.monitor\_formula\_and\_function\_data\_jobs\_query\_definition module
2612+
---------------------------------------------------------------------------------------------------
2613+
2614+
.. automodule:: datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition
2615+
:members:
2616+
:show-inheritance:
2617+
26112618
datadog\_api\_client.v1.model.monitor\_formula\_and\_function\_data\_quality\_data\_source module
26122619
-------------------------------------------------------------------------------------------------
26132620

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
Create a Data Jobs monitor returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.monitors_api import MonitorsApi
7+
from datadog_api_client.v1.model.monitor import Monitor
8+
from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import (
9+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
10+
)
11+
from datadog_api_client.v1.model.monitor_options import MonitorOptions
12+
from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds
13+
from datadog_api_client.v1.model.monitor_type import MonitorType
14+
15+
body = Monitor(
16+
name="Example-Monitor",
17+
type=MonitorType.DATA_JOBS_ALERT,
18+
query='formula("failed_runs(run_query)").by(job_name,workspace_name).last(10d) > 0',
19+
message="Data jobs alert triggered",
20+
tags=[
21+
"test:examplemonitor",
22+
"env:ci",
23+
],
24+
options=MonitorOptions(
25+
thresholds=MonitorThresholds(
26+
critical=0.0,
27+
),
28+
variables=[
29+
MonitorFormulaAndFunctionDataJobsQueryDefinition(
30+
name="run_query",
31+
jobs_query="job_name:*",
32+
job_type="databricks.job",
33+
query_dialect="metric",
34+
),
35+
],
36+
),
37+
)
38+
39+
configuration = Configuration()
40+
with ApiClient(configuration) as api_client:
41+
api_instance = MonitorsApi(api_client)
42+
response = api_instance.create_monitor(body=body)
43+
44+
print(response)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelNormal,
9+
cached_property,
10+
)
11+
12+
13+
class MonitorFormulaAndFunctionDataJobsQueryDefinition(ModelNormal):
14+
@cached_property
15+
def openapi_types(_):
16+
return {
17+
"job_type": (str,),
18+
"jobs_query": (str,),
19+
"name": (str,),
20+
"query_dialect": (str,),
21+
}
22+
23+
attribute_map = {
24+
"job_type": "job_type",
25+
"jobs_query": "jobs_query",
26+
"name": "name",
27+
"query_dialect": "query_dialect",
28+
}
29+
30+
def __init__(self_, job_type: str, jobs_query: str, name: str, query_dialect: str, **kwargs):
31+
"""
32+
A formula and functions data jobs query.
33+
34+
:param job_type: The type of job being monitored. Known values include:
35+
``databricks.job`` , ``spark.application`` , ``airflow.dag`` ,
36+
``dbt.job`` , ``dbt.model`` , ``dbt.test`` , ``glue.job``.
37+
Custom job types are supported with the ``custom.ol.`` prefix.
38+
:type job_type: str
39+
40+
:param jobs_query: Filter expression used to select the jobs to monitor.
41+
:type jobs_query: str
42+
43+
:param name: Name of the query for use in formulas. Must be ``run_query``.
44+
:type name: str
45+
46+
:param query_dialect: Query dialect for data jobs queries. Currently only ``metric`` is supported.
47+
:type query_dialect: str
48+
"""
49+
super().__init__(kwargs)
50+
51+
self_.job_type = job_type
52+
self_.jobs_query = jobs_query
53+
self_.name = name
54+
self_.query_dialect = query_dialect

src/datadog_api_client/v1/model/monitor_formula_and_function_query_definition.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ def __init__(self, **kwargs):
5858
This is useful when an entity has been configured to emit metrics with additional tags.
5959
:type scope: str, optional
6060
61+
:param job_type: The type of job being monitored. Known values include:
62+
`databricks.job`, `spark.application`, `airflow.dag`,
63+
`dbt.job`, `dbt.model`, `dbt.test`, `glue.job`.
64+
Custom job types are supported with the `custom.ol.` prefix.
65+
:type job_type: str
66+
67+
:param jobs_query: Filter expression used to select the jobs to monitor.
68+
:type jobs_query: str
69+
70+
:param query_dialect: Query dialect for data jobs queries. Currently only `metric` is supported.
71+
:type query_dialect: str
72+
6173
:param augment_query: Augment query for aggregate augmented queries. Can be an events query or a reference table query.
6274
:type augment_query: MonitorFormulaAndFunctionAggregateAugmentQuery
6375
@@ -93,6 +105,9 @@ def _composed_schemas(_):
93105
from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_query_definition import (
94106
MonitorFormulaAndFunctionDataQualityQueryDefinition,
95107
)
108+
from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import (
109+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
110+
)
96111
from datadog_api_client.v1.model.monitor_formula_and_function_aggregate_augmented_query_definition import (
97112
MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition,
98113
)
@@ -105,6 +120,7 @@ def _composed_schemas(_):
105120
MonitorFormulaAndFunctionEventQueryDefinition,
106121
MonitorFormulaAndFunctionCostQueryDefinition,
107122
MonitorFormulaAndFunctionDataQualityQueryDefinition,
123+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
108124
MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition,
109125
MonitorFormulaAndFunctionAggregateFilteredQueryDefinition,
110126
],

src/datadog_api_client/v1/model/monitor_options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_query_definition import (
3636
MonitorFormulaAndFunctionDataQualityQueryDefinition,
3737
)
38+
from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import (
39+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
40+
)
3841
from datadog_api_client.v1.model.monitor_formula_and_function_aggregate_augmented_query_definition import (
3942
MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition,
4043
)
@@ -183,6 +186,7 @@ def __init__(
183186
MonitorFormulaAndFunctionEventQueryDefinition,
184187
MonitorFormulaAndFunctionCostQueryDefinition,
185188
MonitorFormulaAndFunctionDataQualityQueryDefinition,
189+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
186190
MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition,
187191
MonitorFormulaAndFunctionAggregateFilteredQueryDefinition,
188192
]

src/datadog_api_client/v1/model/monitor_type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MonitorType(ModelSimple):
1616
"""
1717
The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs.
1818
19-
:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert", "database-monitoring alert", "network-performance alert", "cost alert", "data-quality alert", "network-path alert"].
19+
:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert", "database-monitoring alert", "network-performance alert", "cost alert", "data-quality alert", "network-path alert", "data-jobs alert"].
2020
:type value: str
2121
"""
2222

@@ -42,6 +42,7 @@ class MonitorType(ModelSimple):
4242
"cost alert",
4343
"data-quality alert",
4444
"network-path alert",
45+
"data-jobs alert",
4546
}
4647
COMPOSITE: ClassVar["MonitorType"]
4748
EVENT_ALERT: ClassVar["MonitorType"]
@@ -64,6 +65,7 @@ class MonitorType(ModelSimple):
6465
COST_ALERT: ClassVar["MonitorType"]
6566
DATA_QUALITY_ALERT: ClassVar["MonitorType"]
6667
NETWORK_PATH_ALERT: ClassVar["MonitorType"]
68+
DATA_JOBS_ALERT: ClassVar["MonitorType"]
6769

6870
@cached_property
6971
def openapi_types(_):
@@ -93,3 +95,4 @@ def openapi_types(_):
9395
MonitorType.COST_ALERT = MonitorType("cost alert")
9496
MonitorType.DATA_QUALITY_ALERT = MonitorType("data-quality alert")
9597
MonitorType.NETWORK_PATH_ALERT = MonitorType("network-path alert")
98+
MonitorType.DATA_JOBS_ALERT = MonitorType("data-jobs alert")

src/datadog_api_client/v1/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@
450450
from datadog_api_client.v1.model.monitor_formula_and_function_cost_query_definition import (
451451
MonitorFormulaAndFunctionCostQueryDefinition,
452452
)
453+
from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import (
454+
MonitorFormulaAndFunctionDataJobsQueryDefinition,
455+
)
453456
from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_data_source import (
454457
MonitorFormulaAndFunctionDataQualityDataSource,
455458
)
@@ -1718,6 +1721,7 @@
17181721
"MonitorFormulaAndFunctionCostAggregator",
17191722
"MonitorFormulaAndFunctionCostDataSource",
17201723
"MonitorFormulaAndFunctionCostQueryDefinition",
1724+
"MonitorFormulaAndFunctionDataJobsQueryDefinition",
17211725
"MonitorFormulaAndFunctionDataQualityDataSource",
17221726
"MonitorFormulaAndFunctionDataQualityModelTypeOverride",
17231727
"MonitorFormulaAndFunctionDataQualityMonitorOptions",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-05-14T09:10:37.399Z
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
interactions:
2+
- request:
3+
body: '{"message":"Data jobs alert triggered","name":"Test-Create_a_Data_Jobs_monitor_returns_OK_response-1778749837","options":{"thresholds":{"critical":0},"variables":[{"job_type":"databricks.job","jobs_query":"job_name:smoke*","name":"run_query","query_dialect":"metric"}]},"query":"formula(\"failed_runs(run_query)\").by(job_name).last(10d)
4+
> 0","tags":["test:testcreateadatajobsmonitorreturnsokresponse1778749837","env:ci"],"type":"data-jobs
5+
alert"}'
6+
headers:
7+
accept:
8+
- application/json
9+
content-type:
10+
- application/json
11+
method: POST
12+
uri: https://api.datadoghq.com/api/v1/monitor
13+
response:
14+
body:
15+
string: '{"id":283043175,"org_id":321813,"type":"data-jobs alert","name":"Test-Create_a_Data_Jobs_monitor_returns_OK_response-1778749837","message":"Data
16+
jobs alert triggered","tags":["test:testcreateadatajobsmonitorreturnsokresponse1778749837","env:ci"],"query":"formula(\"failed_runs(run_query)\").by(job_name).last(10d)
17+
> 0","options":{"thresholds":{"critical":0.0},"variables":[{"job_type":"databricks.job","jobs_query":"job_name:smoke*","name":"run_query","query_dialect":"metric"}],"notify_no_data":false,"notify_audit":false,"new_host_delay":300,"include_tags":true,"silenced":{}},"multi":true,"created_at":1778749837000,"created":"2026-05-14T09:10:37.623425+00:00","modified":"2026-05-14T09:10:37.623425+00:00","deleted":null,"priority":null,"restricted_roles":null,"restriction_policy":null,"draft_status":"published","assets":[],"overall_state_modified":null,"overall_state":"No
18+
Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}}
19+
20+
'
21+
headers:
22+
content-type:
23+
- application/json
24+
status:
25+
code: 200
26+
message: OK
27+
- request:
28+
body: null
29+
headers:
30+
accept:
31+
- application/json
32+
method: DELETE
33+
uri: https://api.datadoghq.com/api/v1/monitor/283043175
34+
response:
35+
body:
36+
string: '{"deleted_monitor_id":283043175}
37+
38+
'
39+
headers:
40+
content-type:
41+
- application/json
42+
status:
43+
code: 200
44+
message: OK
45+
version: 1

0 commit comments

Comments
 (0)