From 4954b2405e78a88f2fc637a55b3354b8ea707f2d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 13 Nov 2025 18:30:22 +0000 Subject: [PATCH] Regenerate client from commit 134fe40 of spec repo --- .generator/schemas/v1/openapi.yaml | 80 +++++++++++++++ features/v1/monitors.feature | 2 +- .../src/support/scenarios_model_mapping.ts | 4 + services/monitors/src/v1/MonitorsApi.ts | 14 +++ services/monitors/src/v1/index.ts | 3 + services/monitors/src/v1/models/Monitor.ts | 9 ++ .../monitors/src/v1/models/MonitorAsset.ts | 99 +++++++++++++++++++ .../src/v1/models/MonitorAssetCategory.ts | 13 +++ .../src/v1/models/MonitorAssetResourceType.ts | 7 ++ .../src/v1/models/MonitorUpdateRequest.ts | 9 ++ services/monitors/src/v1/models/TypingInfo.ts | 4 + 11 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 services/monitors/src/v1/models/MonitorAsset.ts create mode 100644 services/monitors/src/v1/models/MonitorAssetCategory.ts create mode 100644 services/monitors/src/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/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/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index e17570286950..2bbe7aa95ffe 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -1581,6 +1581,10 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { type: "boolean", format: "", }, + withAssets: { + type: "boolean", + format: "", + }, operationResponseType: "Monitor", }, "MonitorsApi.V1.UpdateMonitor": { diff --git a/services/monitors/src/v1/MonitorsApi.ts b/services/monitors/src/v1/MonitorsApi.ts index 661db4764ac7..9bca86f986aa 100644 --- a/services/monitors/src/v1/MonitorsApi.ts +++ b/services/monitors/src/v1/MonitorsApi.ts @@ -201,6 +201,7 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { monitorId: number, groupStates?: string, withDowntimes?: boolean, + withAssets?: boolean, _options?: Configuration, ): Promise { const _config = _options || this.configuration; @@ -249,6 +250,13 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { "", ); } + if (withAssets !== undefined) { + requestContext.setQueryParam( + "with_assets", + serialize(withAssets, TypingInfo, "boolean", ""), + "", + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -1318,6 +1326,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 { @@ -1779,6 +1792,7 @@ export class MonitorsApi { param.monitorId, param.groupStates, param.withDowntimes, + param.withAssets, options, ); return requestContextPromise.then((requestContext) => { diff --git a/services/monitors/src/v1/index.ts b/services/monitors/src/v1/index.ts index f87973879d8f..1c535d8ce46b 100644 --- a/services/monitors/src/v1/index.ts +++ b/services/monitors/src/v1/index.ts @@ -19,6 +19,9 @@ export { Creator } from "./models/Creator"; export { DeletedMonitor } from "./models/DeletedMonitor"; export { MatchingDowntime } from "./models/MatchingDowntime"; 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/services/monitors/src/v1/models/Monitor.ts b/services/monitors/src/v1/models/Monitor.ts index f4cd9f5e6605..4fda4a73ed4c 100644 --- a/services/monitors/src/v1/models/Monitor.ts +++ b/services/monitors/src/v1/models/Monitor.ts @@ -2,6 +2,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; import { Creator } from "./Creator"; import { MatchingDowntime } from "./MatchingDowntime"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorDraftStatus } from "./MonitorDraftStatus"; import { MonitorOptions } from "./MonitorOptions"; import { MonitorOverallStates } from "./MonitorOverallStates"; @@ -12,6 +13,10 @@ import { MonitorType } from "./MonitorType"; * 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. */ @@ -104,6 +109,10 @@ export class Monitor { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + assets: { + baseName: "assets", + type: "Array", + }, created: { baseName: "created", type: "Date", diff --git a/services/monitors/src/v1/models/MonitorAsset.ts b/services/monitors/src/v1/models/MonitorAsset.ts new file mode 100644 index 000000000000..f968f2dee38d --- /dev/null +++ b/services/monitors/src/v1/models/MonitorAsset.ts @@ -0,0 +1,99 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { MonitorAssetCategory } from "./MonitorAssetCategory"; +import { MonitorAssetResourceType } from "./MonitorAssetResourceType"; + +/** + * 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/services/monitors/src/v1/models/MonitorAssetCategory.ts b/services/monitors/src/v1/models/MonitorAssetCategory.ts new file mode 100644 index 000000000000..018dd50314a2 --- /dev/null +++ b/services/monitors/src/v1/models/MonitorAssetCategory.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * 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/services/monitors/src/v1/models/MonitorAssetResourceType.ts b/services/monitors/src/v1/models/MonitorAssetResourceType.ts new file mode 100644 index 000000000000..1778d7a65ae2 --- /dev/null +++ b/services/monitors/src/v1/models/MonitorAssetResourceType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of internal datadog resource associated with a monitor asset. + */ +export type MonitorAssetResourceType = typeof NOTEBOOK | UnparsedObject; +export const NOTEBOOK = "notebook"; diff --git a/services/monitors/src/v1/models/MonitorUpdateRequest.ts b/services/monitors/src/v1/models/MonitorUpdateRequest.ts index d104cf678e71..27d969d0cddb 100644 --- a/services/monitors/src/v1/models/MonitorUpdateRequest.ts +++ b/services/monitors/src/v1/models/MonitorUpdateRequest.ts @@ -1,6 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; import { Creator } from "./Creator"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorDraftStatus } from "./MonitorDraftStatus"; import { MonitorOptions } from "./MonitorOptions"; import { MonitorOverallStates } from "./MonitorOverallStates"; @@ -11,6 +12,10 @@ import { MonitorType } from "./MonitorType"; * 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. */ @@ -99,6 +104,10 @@ export class MonitorUpdateRequest { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + assets: { + baseName: "assets", + type: "Array", + }, created: { baseName: "created", type: "Date", diff --git a/services/monitors/src/v1/models/TypingInfo.ts b/services/monitors/src/v1/models/TypingInfo.ts index fc1085445067..d616bcd6187d 100644 --- a/services/monitors/src/v1/models/TypingInfo.ts +++ b/services/monitors/src/v1/models/TypingInfo.ts @@ -7,6 +7,7 @@ import { Creator } from "./Creator"; import { DeletedMonitor } from "./DeletedMonitor"; import { MatchingDowntime } from "./MatchingDowntime"; import { Monitor } from "./Monitor"; +import { MonitorAsset } from "./MonitorAsset"; import { MonitorFormulaAndFunctionCostQueryDefinition } from "./MonitorFormulaAndFunctionCostQueryDefinition"; import { MonitorFormulaAndFunctionEventQueryDefinition } from "./MonitorFormulaAndFunctionEventQueryDefinition"; import { MonitorFormulaAndFunctionEventQueryDefinitionCompute } from "./MonitorFormulaAndFunctionEventQueryDefinitionCompute"; @@ -36,6 +37,8 @@ import { MonitorUpdateRequest } from "./MonitorUpdateRequest"; export const TypingInfo: ModelTypingInfo = { enumsMap: { + MonitorAssetCategory: ["dashboard", "workflow", "runbook"], + MonitorAssetResourceType: ["notebook"], MonitorDeviceID: [ "laptop_large", "tablet", @@ -148,6 +151,7 @@ export const TypingInfo: ModelTypingInfo = { DeletedMonitor: DeletedMonitor, MatchingDowntime: MatchingDowntime, Monitor: Monitor, + MonitorAsset: MonitorAsset, MonitorFormulaAndFunctionCostQueryDefinition: MonitorFormulaAndFunctionCostQueryDefinition, MonitorFormulaAndFunctionEventQueryDefinition: