Skip to content

Commit 85bfe0b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
add timeframe_type param for cost monitors (#2386)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent a4bc820 commit 85bfe0b

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-29 14:55:52.778358",
8-
"spec_repo_commit": "14f5d952"
7+
"regenerated": "2025-01-30 13:13:54.596747",
8+
"spec_repo_commit": "833109b8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-29 14:55:52.793962",
13-
"spec_repo_commit": "14f5d952"
12+
"regenerated": "2025-01-30 13:13:54.612098",
13+
"spec_repo_commit": "833109b8"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+15-12
Original file line numberDiff line numberDiff line change
@@ -29252,19 +29252,22 @@ paths:
2925229252
or the facet name you want to use.\n- `time_window` #m (between 1 and 2880),
2925329253
#h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n-
2925429254
`#` an integer or decimal number used to set the threshold.\n\n**Cost Alert
29255-
Query**\n\nExample: `formula(query).last(time_window).function(parameter)
29255+
Query**\n\nExample: `formula(query).timeframe_type(time_window).function(parameter)
2925629256
operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n-
29257-
`time_window` - supports daily roll-up e.g. `7d`\n- `function` - [optional,
29258-
defaults to `threshold` monitor if omitted] supports `change`, `anomaly`,
29259-
`forecast`\n- `parameter` Specify the parameter of the type\n - for `change`:\n
29260-
\ - supports `relative`, `absolute`\n - [optional] supports `#`,
29261-
where `#` is an integer or decimal number used to set the threshold\n -
29262-
for `anomaly`:\n - supports `direction=both`, `direction=above`, `direction=below`\n
29263-
\ - [optional] supports `threshold=#`, where `#` is an integer or decimal
29264-
number used to set the threshold\n- `operator`\n - for `threshold` supports
29265-
`<`, `<=`, `>`, `>=`, `==`, or `!=`\n - for `change` supports `>`, `<`\n
29266-
\ - for `anomaly` supports `>=`\n - for `forecast` supports `>`\n- `#`
29267-
an integer or decimal number used to set the threshold."
29257+
`timeframe_type` The timeframe type to evaluate the cost\n - for `forecast`
29258+
supports `current`\n - for `change`, `anomaly`, `threshold` supports
29259+
`last`\n- `time_window` - supports daily roll-up e.g. `7d`\n- `function` -
29260+
[optional, defaults to `threshold` monitor if omitted] supports `change`,
29261+
`anomaly`, `forecast`\n- `parameter` Specify the parameter of the type\n -
29262+
for `change`:\n - supports `relative`, `absolute`\n - [optional]
29263+
supports `#`, where `#` is an integer or decimal number used to set the threshold\n
29264+
\ - for `anomaly`:\n - supports `direction=both`, `direction=above`,
29265+
`direction=below`\n - [optional] supports `threshold=#`, where `#`
29266+
is an integer or decimal number used to set the threshold\n- `operator`\n
29267+
\ - for `threshold` supports `<`, `<=`, `>`, `>=`, `==`, or `!=`\n -
29268+
for `change` supports `>`, `<`\n - for `anomaly` supports `>=`\n - for
29269+
`forecast` supports `>`\n- `#` an integer or decimal number used to set the
29270+
threshold."
2926829271
operationId: CreateMonitor
2926929272
requestBody:
2927029273
content:

src/datadog_api_client/v1/api/monitors_api.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,15 @@ def create_monitor(
567567
568568
**Cost Alert Query**
569569
570-
Example: ``formula(query).last(time_window).function(parameter) operator #``
570+
Example: ``formula(query).timeframe_type(time_window).function(parameter) operator #``
571571
572572
* ``query`` The search query - following the `Log search syntax <https://docs.datadoghq.com/logs/search_syntax/>`_.
573+
* ``timeframe_type`` The timeframe type to evaluate the cost
574+
.. code-block::
575+
576+
- for `forecast` supports `current`
577+
- for `change`, `anomaly`, `threshold` supports `last`
578+
573579
* ``time_window`` - supports daily roll-up e.g. ``7d``
574580
* ``function`` - [optional, defaults to ``threshold`` monitor if omitted] supports ``change`` , ``anomaly`` , ``forecast``
575581
* ``parameter`` Specify the parameter of the type

0 commit comments

Comments
 (0)