Skip to content

Commit 0e49095

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 71c00e7 of spec repo
1 parent b25c67e commit 0e49095

File tree

12 files changed

+351
-17
lines changed

12 files changed

+351
-17
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7255,6 +7255,13 @@ components:
72557255
Monitor:
72567256
description: Object describing a monitor.
72577257
properties:
7258+
assets:
7259+
description: The list of monitor assets tied to a monitor which represents
7260+
key links for users to help take actions on monitor alerts (for example,
7261+
runbooks).
7262+
items:
7263+
$ref: '#/components/schemas/MonitorAsset'
7264+
type: array
72587265
created:
72597266
description: Timestamp of the monitor creation.
72607267
format: date-time
@@ -7338,6 +7345,49 @@ components:
73387345
- type
73397346
- query
73407347
type: object
7348+
MonitorAsset:
7349+
description: 'Represents key links tied to a monitor to help users take action
7350+
on alerts (runbooks, dashboards, Workflows).
7351+
7352+
This feature is in Preview and only available to users with the feature enabled.'
7353+
properties:
7354+
category:
7355+
$ref: '#/components/schemas/MonitorAssetCategory'
7356+
name:
7357+
description: Name for the monitor asset
7358+
example: Monitor Runbook
7359+
type: string
7360+
resource_key:
7361+
description: Represents the identifier of the internal datadog resource
7362+
that this asset represents. IDs in this field should be passed in as strings.
7363+
example: '12345'
7364+
type: string
7365+
resource_type:
7366+
$ref: '#/components/schemas/MonitorAssetResourceType'
7367+
url:
7368+
description: Url link for the asset
7369+
example: https://app.datadoghq.com
7370+
type: string
7371+
required:
7372+
- name
7373+
- url
7374+
- category
7375+
type: object
7376+
MonitorAssetCategory:
7377+
description: Indicates the type of asset this entity represents on a monitor.
7378+
enum:
7379+
- runbook
7380+
example: dashboard
7381+
type: string
7382+
x-enum-varnames:
7383+
- RUNBOOK
7384+
MonitorAssetResourceType:
7385+
description: Type of internal datadog resource associated with a monitor asset.
7386+
enum:
7387+
- notebook
7388+
type: string
7389+
x-enum-varnames:
7390+
- NOTEBOOK
73417391
MonitorDeviceID:
73427392
description: ID of the device the Synthetics monitor is running on. Same as
73437393
`SyntheticsDeviceID`.
@@ -8452,6 +8502,14 @@ components:
84528502
MonitorUpdateRequest:
84538503
description: Object describing a monitor update request.
84548504
properties:
8505+
assets:
8506+
description: The list of monitor assets tied to a monitor, which represents
8507+
key links for users to help take actions on monitor alerts (for example,
8508+
runbooks).
8509+
items:
8510+
$ref: '#/components/schemas/MonitorAsset'
8511+
nullable: true
8512+
type: array
84558513
created:
84568514
description: Timestamp of the monitor creation.
84578515
format: date-time
@@ -31584,6 +31642,13 @@ paths:
3158431642
required: false
3158531643
schema:
3158631644
type: boolean
31645+
- description: If this argument is set to `true`, then the returned data includes
31646+
all assets tied to this monitor.
31647+
in: query
31648+
name: with_assets
31649+
required: false
31650+
schema:
31651+
type: boolean
3158731652
responses:
3158831653
'200':
3158931654
content:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-10-10T16:41:03.364Z
1+
2025-11-21T17:43:02.419Z

cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@
565565
"monitor_id" => "Integer",
566566
"group_states" => "String",
567567
"with_downtimes" => "Boolean",
568+
"with_assets" => "Boolean",
568569
},
569570
"v1.UpdateMonitor" => {
570571
"monitor_id" => "Integer",

features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Feature: Monitors
169169
Scenario: Edit a monitor returns "Bad Request" response
170170
Given new "UpdateMonitor" request
171171
And request contains "monitor_id" parameter from "REPLACE.ME"
172-
And body with value {"draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
172+
And body with value {"assets": [{"category": "dashboard", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "https://app.datadoghq.com"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
173173
When the request is sent
174174
Then the response status is 400 Bad Request
175175

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ def overrides
321321
"v1.metrics_query_response" => "MetricsQueryResponse",
322322
"v1.metrics_query_unit" => "MetricsQueryUnit",
323323
"v1.monitor" => "Monitor",
324+
"v1.monitor_asset" => "MonitorAsset",
325+
"v1.monitor_asset_category" => "MonitorAssetCategory",
326+
"v1.monitor_asset_resource_type" => "MonitorAssetResourceType",
324327
"v1.monitor_device_id" => "MonitorDeviceID",
325328
"v1.monitor_draft_status" => "MonitorDraftStatus",
326329
"v1.monitor_formula_and_function_cost_aggregator" => "MonitorFormulaAndFunctionCostAggregator",

lib/datadog_api_client/v1/api/monitors_api.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ def get_monitor(monitor_id, opts = {})
456456
# @param opts [Hash] the optional parameters
457457
# @option opts [String] :group_states When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`.
458458
# @option opts [Boolean] :with_downtimes If this argument is set to true, then the returned data includes all current active downtimes for the monitor.
459+
# @option opts [Boolean] :with_assets If this argument is set to `true`, then the returned data includes all assets tied to this monitor.
459460
# @return [Array<(Monitor, Integer, Hash)>] Monitor data, response status code and response headers
460461
def get_monitor_with_http_info(monitor_id, opts = {})
461462

@@ -473,6 +474,7 @@ def get_monitor_with_http_info(monitor_id, opts = {})
473474
query_params = opts[:query_params] || {}
474475
query_params[:'group_states'] = opts[:'group_states'] if !opts[:'group_states'].nil?
475476
query_params[:'with_downtimes'] = opts[:'with_downtimes'] if !opts[:'with_downtimes'].nil?
477+
query_params[:'with_assets'] = opts[:'with_assets'] if !opts[:'with_assets'].nil?
476478

477479
# header parameters
478480
header_params = opts[:header_params] || {}

lib/datadog_api_client/v1/models/monitor.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module DatadogAPIClient::V1
2121
class Monitor
2222
include BaseGenericModel
2323

24+
# The list of monitor assets tied to a monitor which represents key links for users to help take actions on monitor alerts (for example, runbooks).
25+
attr_accessor :assets
26+
2427
# Timestamp of the monitor creation.
2528
attr_accessor :created
2629

@@ -86,6 +89,7 @@ class Monitor
8689
# @!visibility private
8790
def self.attribute_map
8891
{
92+
:'assets' => :'assets',
8993
:'created' => :'created',
9094
:'creator' => :'creator',
9195
:'deleted' => :'deleted',
@@ -111,6 +115,7 @@ def self.attribute_map
111115
# @!visibility private
112116
def self.openapi_types
113117
{
118+
:'assets' => :'Array<MonitorAsset>',
114119
:'created' => :'Time',
115120
:'creator' => :'Creator',
116121
:'deleted' => :'Time',
@@ -160,6 +165,12 @@ def initialize(attributes = {})
160165
end
161166
}
162167

168+
if attributes.key?(:'assets')
169+
if (value = attributes[:'assets']).is_a?(Array)
170+
self.assets = value
171+
end
172+
end
173+
163174
if attributes.key?(:'created')
164175
self.created = attributes[:'created']
165176
end
@@ -294,6 +305,7 @@ def to_hash
294305
def ==(o)
295306
return true if self.equal?(o)
296307
self.class == o.class &&
308+
assets == o.assets &&
297309
created == o.created &&
298310
creator == o.creator &&
299311
deleted == o.deleted &&
@@ -319,7 +331,7 @@ def ==(o)
319331
# @return [Integer] Hash code
320332
# @!visibility private
321333
def hash
322-
[created, creator, deleted, draft_status, id, matching_downtimes, message, modified, multi, name, options, overall_state, priority, query, restricted_roles, state, tags, type, additional_properties].hash
334+
[assets, created, creator, deleted, draft_status, id, matching_downtimes, message, modified, multi, name, options, overall_state, priority, query, restricted_roles, state, tags, type, additional_properties].hash
323335
end
324336
end
325337
end

0 commit comments

Comments
 (0)