From 28d82c915186194b7af339f1cc1d14afddd7c19d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 13 Nov 2025 18:33:04 +0000 Subject: [PATCH] Regenerate client from commit 134fe40 of spec repo --- .generator/schemas/v1/openapi.yaml | 80 +++++++++++++ features/support/scenarios_model_mapping.ts | 4 + features/v1/monitors.feature | 2 +- .../datadog-api-client-v1/apis/MonitorsApi.ts | 14 +++ packages/datadog-api-client-v1/index.ts | 3 + .../datadog-api-client-v1/models/Monitor.ts | 9 ++ .../models/MonitorAsset.ts | 106 ++++++++++++++++++ .../models/MonitorAssetCategory.ts | 20 ++++ .../models/MonitorAssetResourceType.ts | 14 +++ .../models/MonitorUpdateRequest.ts | 9 ++ .../models/ObjectSerializer.ts | 4 + 11 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 packages/datadog-api-client-v1/models/MonitorAsset.ts create mode 100644 packages/datadog-api-client-v1/models/MonitorAssetCategory.ts create mode 100644 packages/datadog-api-client-v1/models/MonitorAssetResourceType.ts diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 233d5549307e..a36ac5c047aa 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -7255,6 +7255,13 @@ components: Monitor: description: Object describing a monitor. properties: + assets: + description: 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). + items: + $ref: '#/components/schemas/MonitorAsset' + type: array created: description: Timestamp of the monitor creation. format: date-time @@ -7338,6 +7345,64 @@ components: - type - query type: object + MonitorAsset: + description: 'Represents key links tied to a monitor to help users take action + on alerts (runbooks, dashboards, Workflows). + + This feature is in Preview and only available to users with the feature enabled.' + properties: + category: + $ref: '#/components/schemas/MonitorAssetCategory' + name: + description: Name for the monitor asset + example: Monitor Runbook + type: string + options: + description: Additional options that you can set on a monitor asset. + example: + hide_in_monitor_message: true + type: object + resource_key: + description: Represents the identifier of the internal datadog resource + that this asset represents. IDs in this field should be passed in as strings. + example: '12345' + type: string + resource_type: + $ref: '#/components/schemas/MonitorAssetResourceType' + template_variables: + description: Allows you to parameterize the URL for the monitor asset. + example: + env: prod + region: us-east-1 + type: object + url: + description: Url link for the asset + example: https://app.datadoghq.com + type: string + required: + - name + - url + - category + type: object + MonitorAssetCategory: + description: Indicates the type of asset this entity represents on a monitor. + enum: + - dashboard + - workflow + - runbook + example: dashboard + type: string + x-enum-varnames: + - DASHBOARD + - WORKFLOW + - RUNBOOK + MonitorAssetResourceType: + description: Type of internal datadog resource associated with a monitor asset. + enum: + - notebook + type: string + x-enum-varnames: + - NOTEBOOK MonitorDeviceID: description: ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`. @@ -8452,6 +8517,14 @@ components: MonitorUpdateRequest: description: Object describing a monitor update request. properties: + assets: + description: 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). + items: + $ref: '#/components/schemas/MonitorAsset' + nullable: true + type: array created: description: Timestamp of the monitor creation. format: date-time @@ -31569,6 +31642,13 @@ paths: required: false schema: type: boolean + - description: If this argument is set to `true`, then the returned data includes + all assets tied to this monitor. + in: query + name: with_assets + required: false + schema: + type: boolean responses: '200': content: diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 6f2a638fbd06..6265cda83973 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -1571,6 +1571,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "boolean", "format": "", }, + "withAssets": { + "type": "boolean", + "format": "", + }, "operationResponseType": "Monitor", }, "v1.UpdateMonitor": { diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index 64e72f698b4d..249e41a31763 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -169,7 +169,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - 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"} + And body with value {"assets": [{"category": "dashboard", "name": "Monitor Runbook", "options": {"hide_in_monitor_message": true}, "resource_key": "12345", "resource_type": "notebook", "template_variables": {"env": "prod", "region": "us-east-1"}, "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"} When the request is sent Then the response status is 400 Bad Request diff --git a/packages/datadog-api-client-v1/apis/MonitorsApi.ts b/packages/datadog-api-client-v1/apis/MonitorsApi.ts index 0d9753c6a1b5..96a4dc383299 100644 --- a/packages/datadog-api-client-v1/apis/MonitorsApi.ts +++ b/packages/datadog-api-client-v1/apis/MonitorsApi.ts @@ -155,6 +155,7 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { monitorId: number, groupStates?: string, withDowntimes?: boolean, + withAssets?: boolean, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -192,6 +193,13 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { "" ); } + if (withAssets !== undefined) { + requestContext.setQueryParam( + "with_assets", + ObjectSerializer.serialize(withAssets, "boolean", ""), + "" + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -1221,6 +1229,11 @@ export interface MonitorsApiGetMonitorRequest { * @type boolean */ withDowntimes?: boolean; + /** + * If this argument is set to `true`, then the returned data includes all assets tied to this monitor. + * @type boolean + */ + withAssets?: boolean; } export interface MonitorsApiListMonitorsRequest { @@ -1680,6 +1693,7 @@ export class MonitorsApi { param.monitorId, param.groupStates, param.withDowntimes, + param.withAssets, options ); return requestContextPromise.then((requestContext) => { diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 2b27b1c2f27a..67b2b224bf5d 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -643,6 +643,9 @@ export { MetricsQueryMetadata } from "./models/MetricsQueryMetadata"; export { MetricsQueryResponse } from "./models/MetricsQueryResponse"; export { MetricsQueryUnit } from "./models/MetricsQueryUnit"; export { Monitor } from "./models/Monitor"; +export { MonitorAsset } from "./models/MonitorAsset"; +export { MonitorAssetCategory } from "./models/MonitorAssetCategory"; +export { MonitorAssetResourceType } from "./models/MonitorAssetResourceType"; export { MonitorDeviceID } from "./models/MonitorDeviceID"; export { MonitorDraftStatus } from "./models/MonitorDraftStatus"; export { MonitorFormulaAndFunctionCostAggregator } from "./models/MonitorFormulaAndFunctionCostAggregator"; diff --git a/packages/datadog-api-client-v1/models/Monitor.ts b/packages/datadog-api-client-v1/models/Monitor.ts index c787629d1f90..bc0a8a34bd62 100644 --- a/packages/datadog-api-client-v1/models/Monitor.ts +++ b/packages/datadog-api-client-v1/models/Monitor.ts @@ -5,6 +5,7 @@ */ import { Creator } from "./Creator"; import { MatchingDowntime } from "./MatchingDowntime"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorDraftStatus } from "./MonitorDraftStatus"; import { MonitorOptions } from "./MonitorOptions"; import { MonitorOverallStates } from "./MonitorOverallStates"; @@ -17,6 +18,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Object describing a monitor. */ export class Monitor { + /** + * 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). + */ + "assets"?: Array; /** * Timestamp of the monitor creation. */ @@ -111,6 +116,10 @@ export class Monitor { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + assets: { + baseName: "assets", + type: "Array", + }, created: { baseName: "created", type: "Date", diff --git a/packages/datadog-api-client-v1/models/MonitorAsset.ts b/packages/datadog-api-client-v1/models/MonitorAsset.ts new file mode 100644 index 000000000000..c191a1549088 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonitorAsset.ts @@ -0,0 +1,106 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { MonitorAssetCategory } from "./MonitorAssetCategory"; +import { MonitorAssetResourceType } from "./MonitorAssetResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Represents key links tied to a monitor to help users take action on alerts (runbooks, dashboards, Workflows). + * This feature is in Preview and only available to users with the feature enabled. + */ +export class MonitorAsset { + /** + * Indicates the type of asset this entity represents on a monitor. + */ + "category": MonitorAssetCategory; + /** + * Name for the monitor asset + */ + "name": string; + /** + * Additional options that you can set on a monitor asset. + */ + "options"?: any; + /** + * Represents the identifier of the internal datadog resource that this asset represents. IDs in this field should be passed in as strings. + */ + "resourceKey"?: string; + /** + * Type of internal datadog resource associated with a monitor asset. + */ + "resourceType"?: MonitorAssetResourceType; + /** + * Allows you to parameterize the URL for the monitor asset. + */ + "templateVariables"?: any; + /** + * Url link for the asset + */ + "url": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + category: { + baseName: "category", + type: "MonitorAssetCategory", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "any", + }, + resourceKey: { + baseName: "resource_key", + type: "string", + }, + resourceType: { + baseName: "resource_type", + type: "MonitorAssetResourceType", + }, + templateVariables: { + baseName: "template_variables", + type: "any", + }, + url: { + baseName: "url", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorAsset.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/MonitorAssetCategory.ts b/packages/datadog-api-client-v1/models/MonitorAssetCategory.ts new file mode 100644 index 000000000000..eded1630d13e --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonitorAssetCategory.ts @@ -0,0 +1,20 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Indicates the type of asset this entity represents on a monitor. + */ + +export type MonitorAssetCategory = + | typeof DASHBOARD + | typeof WORKFLOW + | typeof RUNBOOK + | UnparsedObject; +export const DASHBOARD = "dashboard"; +export const WORKFLOW = "workflow"; +export const RUNBOOK = "runbook"; diff --git a/packages/datadog-api-client-v1/models/MonitorAssetResourceType.ts b/packages/datadog-api-client-v1/models/MonitorAssetResourceType.ts new file mode 100644 index 000000000000..454867eca755 --- /dev/null +++ b/packages/datadog-api-client-v1/models/MonitorAssetResourceType.ts @@ -0,0 +1,14 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of internal datadog resource associated with a monitor asset. + */ + +export type MonitorAssetResourceType = typeof NOTEBOOK | UnparsedObject; +export const NOTEBOOK = "notebook"; diff --git a/packages/datadog-api-client-v1/models/MonitorUpdateRequest.ts b/packages/datadog-api-client-v1/models/MonitorUpdateRequest.ts index 712acf256b1d..bfa7223b14e4 100644 --- a/packages/datadog-api-client-v1/models/MonitorUpdateRequest.ts +++ b/packages/datadog-api-client-v1/models/MonitorUpdateRequest.ts @@ -4,6 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { Creator } from "./Creator"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorDraftStatus } from "./MonitorDraftStatus"; import { MonitorOptions } from "./MonitorOptions"; import { MonitorOverallStates } from "./MonitorOverallStates"; @@ -16,6 +17,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Object describing a monitor update request. */ export class MonitorUpdateRequest { + /** + * 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). + */ + "assets"?: Array; /** * Timestamp of the monitor creation. */ @@ -106,6 +111,10 @@ export class MonitorUpdateRequest { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + assets: { + baseName: "assets", + type: "Array", + }, created: { baseName: "created", type: "Date", diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 62bf0555bdd8..fed4e2cdc150 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -214,6 +214,7 @@ import { MetricsQueryMetadata } from "./MetricsQueryMetadata"; import { MetricsQueryResponse } from "./MetricsQueryResponse"; import { MetricsQueryUnit } from "./MetricsQueryUnit"; import { Monitor } from "./Monitor"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorFormulaAndFunctionCostQueryDefinition } from "./MonitorFormulaAndFunctionCostQueryDefinition"; import { MonitorFormulaAndFunctionEventQueryDefinition } from "./MonitorFormulaAndFunctionEventQueryDefinition"; import { MonitorFormulaAndFunctionEventQueryDefinitionCompute } from "./MonitorFormulaAndFunctionEventQueryDefinitionCompute"; @@ -971,6 +972,8 @@ const enumsMap: { [key: string]: any[] } = { LogsURLParserType: ["url-parser"], LogsUserAgentParserType: ["user-agent-parser"], MetricContentEncoding: ["deflate", "gzip"], + MonitorAssetCategory: ["dashboard", "workflow", "runbook"], + MonitorAssetResourceType: ["notebook"], MonitorDeviceID: [ "laptop_large", "tablet", @@ -1949,6 +1952,7 @@ const typeMap: { [index: string]: any } = { MetricsQueryResponse: MetricsQueryResponse, MetricsQueryUnit: MetricsQueryUnit, Monitor: Monitor, + MonitorAsset: MonitorAsset, MonitorFormulaAndFunctionCostQueryDefinition: MonitorFormulaAndFunctionCostQueryDefinition, MonitorFormulaAndFunctionEventQueryDefinition: