From 63d9cc02e33391d54f673d70f3a7328ce49e2cfa Mon Sep 17 00:00:00 2001 From: Gavin Kline Date: Thu, 13 Aug 2026 20:39:51 -0400 Subject: [PATCH 1/2] feat(datadog): add the Datadog v1 SDK (monitors + service level objectives) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New @distilled.cloud/datadog package generated from Datadog's official v1 OpenAPI description (sparse-checked-out submodule of DataDog/datadog-api-client-typescript), following the GitHub tag-bucketed pipeline. Tags are allowlisted — Monitors and Service Level Objectives to start — and grow as alchemy resources are brought up on them. Co-Authored-By: Claude Fable 5 --- .gitmodules | 3 + .../datadog/.generated-specs/monitors.json | 4115 +++++++++++++++++ .../service_level_objectives.json | 3737 +++++++++++++++ packages/datadog/README.md | 52 + packages/datadog/package.json | 79 + packages/datadog/scripts/convert.ts | 174 + packages/datadog/scripts/generate.ts | 110 + .../specs/datadog-api-client-typescript | 1 + packages/datadog/src/credentials.ts | 130 + packages/datadog/src/errors.ts | 41 + packages/datadog/src/index.ts | 31 + packages/datadog/src/protocol.ts | 92 + packages/datadog/src/retry.ts | 54 + packages/datadog/src/services/index.ts | 3 + packages/datadog/src/services/monitors.ts | 2302 +++++++++ .../src/services/service_level_objectives.ts | 2283 +++++++++ packages/datadog/src/traits.ts | 44 + packages/datadog/tsconfig.json | 14 + packages/datadog/tsconfig.scripts.json | 17 + tsconfig.json | 2 + 20 files changed, 13284 insertions(+) create mode 100644 packages/datadog/.generated-specs/monitors.json create mode 100644 packages/datadog/.generated-specs/service_level_objectives.json create mode 100644 packages/datadog/README.md create mode 100644 packages/datadog/package.json create mode 100644 packages/datadog/scripts/convert.ts create mode 100644 packages/datadog/scripts/generate.ts create mode 160000 packages/datadog/specs/datadog-api-client-typescript create mode 100644 packages/datadog/src/credentials.ts create mode 100644 packages/datadog/src/errors.ts create mode 100644 packages/datadog/src/index.ts create mode 100644 packages/datadog/src/protocol.ts create mode 100644 packages/datadog/src/retry.ts create mode 100644 packages/datadog/src/services/index.ts create mode 100644 packages/datadog/src/services/monitors.ts create mode 100644 packages/datadog/src/services/service_level_objectives.ts create mode 100644 packages/datadog/src/traits.ts create mode 100644 packages/datadog/tsconfig.json create mode 100644 packages/datadog/tsconfig.scripts.json diff --git a/.gitmodules b/.gitmodules index 3c8e9b30fe..533ec729ea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -84,3 +84,6 @@ path = packages/discord/specs/discord-api-spec url = https://github.com/discord/discord-api-spec.git ignore = dirty +[submodule "packages/datadog/specs/datadog-api-client-typescript"] + path = packages/datadog/specs/datadog-api-client-typescript + url = https://github.com/DataDog/datadog-api-client-typescript.git diff --git a/packages/datadog/.generated-specs/monitors.json b/packages/datadog/.generated-specs/monitors.json new file mode 100644 index 0000000000..42ef1095ea --- /dev/null +++ b/packages/datadog/.generated-specs/monitors.json @@ -0,0 +1,4115 @@ +{ + "smithy": "2.0", + "metadata": { + "suppressions": [ + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "UnreferencedShape", + "namespace": "*" + } + ] + }, + "shapes": { + "com.datadog.monitors#ListMonitorsRequest": { + "type": "structure", + "members": { + "group_states": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "group_states", + "smithy.api#documentation": "When specified, shows additional information about the group states.\nChoose one or more from `all`, `alert`, `warn`, and `no data`." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "name", + "smithy.api#documentation": "A string to filter monitors by name." + } + }, + "tags": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "tags", + "smithy.api#documentation": "A comma separated list indicating what tags, if any, should be used to filter the list of monitors by scope.\nFor example, `host:host0`." + } + }, + "monitor_tags": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "monitor_tags", + "smithy.api#documentation": "A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors.\nTags created in the Datadog UI automatically have the service key prepended. For example, `service:my-app`." + } + }, + "with_downtimes": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "with_downtimes", + "smithy.api#documentation": "If this argument is set to true, then the returned data includes all current active downtimes for each monitor." + } + }, + "id_offset": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "id_offset", + "smithy.api#documentation": "Use this parameter for paginating through large sets of monitors. Start with a value of zero, make a request, set the value to the last ID of result set, and then repeat until the response is empty." + } + }, + "page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page", + "smithy.api#documentation": "The page to start paginating from. If this argument is not specified, the request returns all monitors without pagination." + } + }, + "page_size": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page_size", + "smithy.api#documentation": "The number of monitors to return per page. If the page argument is not specified, the default behavior returns all monitors without a `page_size` limit. However, if page is specified and `page_size` is not, the argument defaults to 100." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#Monitor": { + "type": "structure", + "members": { + "assets": { + "target": "com.datadog.monitors#MonitorAssetsList", + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "created": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Timestamp of the monitor creation." + } + }, + "creator": { + "target": "com.datadog.monitors#Creator" + }, + "deleted": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Whether or not the monitor is deleted. (Always `null`)", + "com.distilled.openapi#nullable": {} + } + }, + "draft_status": { + "target": "com.datadog.monitors#MonitorDraftStatus" + }, + "id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "ID of this monitor." + } + }, + "matching_downtimes": { + "target": "com.datadog.monitors#MonitorMatchingDowntimesList", + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message to include with notifications for this monitor." + } + }, + "modified": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Last timestamp when the monitor was edited." + } + }, + "multi": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not the monitor is broken down on different groups." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "options": { + "target": "com.datadog.monitors#MonitorOptions" + }, + "overall_state": { + "target": "com.datadog.monitors#MonitorOverallStates" + }, + "priority": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Integer from 1 (high) to 5 (low) indicating alert severity.", + "com.distilled.openapi#nullable": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query.", + "smithy.api#required": {} + } + }, + "restricted_roles": { + "target": "com.datadog.monitors#MonitorRestrictedRolesList", + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles.", + "com.distilled.openapi#nullable": {} + } + }, + "state": { + "target": "com.datadog.monitors#MonitorState" + }, + "tags": { + "target": "com.datadog.monitors#MonitorTagsList", + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing a monitor." + } + }, + "com.datadog.monitors#MonitorAsset": { + "type": "structure", + "members": { + "category": { + "target": "com.datadog.monitors#MonitorAssetCategory", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name for the monitor asset", + "smithy.api#required": {} + } + }, + "resource_key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Represents the identifier of the internal Datadog resource that this asset represents. IDs in this field should be passed in as strings." + } + }, + "resource_type": { + "target": "com.datadog.monitors#MonitorAssetResourceType" + }, + "url": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "URL link for the asset. For links with an internal resource type set, this should be the relative path to where the Datadog domain is appended internally. For external links, this should be the full URL path.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents key links tied to a monitor to help users take action on alerts.\nThis feature is in Preview and only available to users with the feature enabled." + } + }, + "com.datadog.monitors#MonitorAssetCategory": { + "type": "enum", + "members": { + "RUNBOOK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "runbook" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates the type of asset this entity represents on a monitor." + } + }, + "com.datadog.monitors#MonitorAssetResourceType": { + "type": "enum", + "members": { + "NOTEBOOK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "notebook" + } + } + }, + "traits": { + "smithy.api#documentation": "Type of internal Datadog resource associated with a monitor asset." + } + }, + "com.datadog.monitors#MonitorAssetsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorAsset" + }, + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "com.datadog.monitors#Creator": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email of the creator." + } + }, + "handle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Handle of the creator." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the creator.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing the creator of the shared element." + } + }, + "com.datadog.monitors#MonitorDraftStatus": { + "type": "enum", + "members": { + "DRAFT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "draft" + } + }, + "PUBLISHED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "published" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates whether the monitor is in a draft or published state.\n\n`draft`: The monitor appears as Draft and does not send notifications.\n`published`: The monitor is active and evaluates conditions and notify as configured.\n\nThis field is in preview. The draft value is only available to customers with the feature enabled." + } + }, + "com.datadog.monitors#MatchingDowntime": { + "type": "structure", + "members": { + "end": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "POSIX timestamp to end the downtime.", + "com.distilled.openapi#nullable": {} + } + }, + "id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The downtime ID.", + "smithy.api#required": {} + } + }, + "scope": { + "target": "com.datadog.monitors#MatchingDowntimeScopeList", + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`.\nProvide multiple scopes as a comma-separated list like `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`)." + } + }, + "start": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "POSIX timestamp to start the downtime." + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing a downtime that matches this monitor." + } + }, + "com.datadog.monitors#MatchingDowntimeScopeList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`.\nProvide multiple scopes as a comma-separated list like `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`)." + } + }, + "com.datadog.monitors#MonitorMatchingDowntimesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MatchingDowntime" + }, + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "com.datadog.monitors#MonitorOptions": { + "type": "structure", + "members": { + "aggregation": { + "target": "com.datadog.monitors#MonitorOptionsAggregation" + }, + "device_ids": { + "target": "com.datadog.monitors#MonitorOptionsDeviceIdsList", + "traits": { + "smithy.api#documentation": "IDs of the device the Synthetics monitor is running on." + } + }, + "enable_logs_sample": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not to send a log sample when the log monitor triggers." + } + }, + "enable_samples": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors." + } + }, + "escalation_message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify/?tab=is_alert#renotify),\nblock in the original message instead.\nA message to include with a re-notification. Supports the `@username` notification we allow elsewhere.\nNot applicable if `renotify_interval` is `None`." + } + }, + "evaluation_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min),\nthe timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55.\nThis is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.", + "com.distilled.openapi#nullable": {} + } + }, + "group_retention_duration": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The time span after which groups with missing data are dropped from the monitor state.\nThe minimum value is one hour, and the maximum value is 72 hours.\nExample values are: \"60m\", \"1h\", and \"2d\".\nThis option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors." + } + }, + "groupby_simple_monitor": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead." + } + }, + "include_tags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title.\n\n**Examples**\n- If `True`, `[Triggered on {host:h1}] Monitor Title`\n- If `False`, `[Triggered] Monitor Title`" + } + }, + "locked": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead." + } + }, + "min_failure_duration": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "How long the test should be in failure before alerting (integer, number of seconds, max 7200).", + "com.distilled.openapi#nullable": {} + } + }, + "min_location_failed": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The minimum number of locations in failure at the same time during\nat least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration`\nare part of the advanced alerting rules - integer, >= 1).", + "com.distilled.openapi#nullable": {} + } + }, + "new_group_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to skip evaluations for new groups.\n\nFor example, this option can be used to skip evaluations for new hosts while they initialize.\n\nMust be a non negative integer.", + "com.distilled.openapi#nullable": {} + } + }, + "new_host_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to allow a host to boot and applications\nto fully start before starting the evaluation of monitor results.\nShould be a non negative integer.\n\nUse new_group_delay instead.", + "com.distilled.openapi#nullable": {} + } + }, + "no_data_timeframe": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of minutes before a monitor notifies after data stops reporting.\nDatadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks.\nIf omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks.", + "com.distilled.openapi#nullable": {} + } + }, + "notification_preset_name": { + "target": "com.datadog.monitors#MonitorOptionsNotificationPresets" + }, + "notify_audit": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether tagged users is notified on changes to this monitor." + } + }, + "notify_by": { + "target": "com.datadog.monitors#MonitorOptionsNotifyByList", + "traits": { + "smithy.api#documentation": "Controls what granularity a monitor alerts on. Only available for monitors with groupings.\nFor instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each\nnew `cluster` violating the alert conditions by setting `notify_by` to `[\"cluster\"]`. Tags mentioned\nin `notify_by` must be a subset of the grouping tags in the query.\nFor example, a query grouped by `cluster` and `namespace` cannot notify on `region`.\nSetting `notify_by` to `[\"*\"]` configures the monitor to notify as a simple-alert." + } + }, + "notify_no_data": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`." + } + }, + "on_missing_data": { + "target": "com.datadog.monitors#OnMissingDataOption" + }, + "renotify_interval": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of minutes after the last notification before a monitor re-notifies on the current status.\nIt only re-notifies if it’s not resolved.", + "com.distilled.openapi#nullable": {} + } + }, + "renotify_occurrences": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of times re-notification messages should be sent on the current status at the provided re-notification interval.", + "com.distilled.openapi#nullable": {} + } + }, + "renotify_statuses": { + "target": "com.datadog.monitors#MonitorOptionsRenotifyStatusesList", + "traits": { + "smithy.api#documentation": "The types of monitor statuses for which re-notification messages are sent.\nDefault: **null** if `renotify_interval` is **null**.\nIf `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`.", + "com.distilled.openapi#nullable": {} + } + }, + "require_full_window": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether this monitor needs a full window of data before it’s evaluated.\nWe highly recommend you set this to `false` for sparse metrics,\notherwise some evaluations are skipped. Default is false. This setting only applies to\nmetric monitors." + } + }, + "scheduling_options": { + "target": "com.datadog.monitors#MonitorOptionsSchedulingOptions" + }, + "silenced": { + "target": "com.datadog.monitors#MonitorOptionsSilencedMap", + "traits": { + "smithy.api#documentation": "Information about the downtime applied to the monitor. Only shows v1 downtimes." + } + }, + "synthetics_check_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ID of the corresponding Synthetic check.", + "com.distilled.openapi#nullable": {} + } + }, + "threshold_windows": { + "target": "com.datadog.monitors#MonitorThresholdWindowOptions" + }, + "thresholds": { + "target": "com.datadog.monitors#MonitorThresholds" + }, + "timeout_h": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours.", + "com.distilled.openapi#nullable": {} + } + }, + "variables": { + "target": "com.datadog.monitors#MonitorOptionsVariablesList", + "traits": { + "smithy.api#documentation": "List of requests that can be used in the monitor query. **This feature is currently in beta.**" + } + } + }, + "traits": { + "smithy.api#documentation": "List of options associated with your monitor." + } + }, + "com.datadog.monitors#MonitorOptionsAggregation": { + "type": "structure", + "members": { + "group_by": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Group to break down the monitor on." + } + }, + "metric": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Metric name used in the monitor." + } + }, + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Metric type used in the monitor." + } + } + }, + "traits": { + "smithy.api#documentation": "Type of aggregation performed in the monitor query." + } + }, + "com.datadog.monitors#MonitorDeviceID": { + "type": "enum", + "members": { + "LAPTOP_LARGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "laptop_large" + } + }, + "TABLET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "tablet" + } + }, + "MOBILE_SMALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mobile_small" + } + }, + "CHROME_LAPTOP_LARGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "chrome.laptop_large" + } + }, + "CHROME_TABLET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "chrome.tablet" + } + }, + "CHROME_MOBILE_SMALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "chrome.mobile_small" + } + }, + "FIREFOX_LAPTOP_LARGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "firefox.laptop_large" + } + }, + "FIREFOX_TABLET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "firefox.tablet" + } + }, + "FIREFOX_MOBILE_SMALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "firefox.mobile_small" + } + } + }, + "traits": { + "smithy.api#documentation": "ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`." + } + }, + "com.datadog.monitors#MonitorOptionsDeviceIdsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorDeviceID" + }, + "traits": { + "smithy.api#documentation": "IDs of the device the Synthetics monitor is running on." + } + }, + "com.datadog.monitors#MonitorOptionsNotificationPresets": { + "type": "enum", + "members": { + "SHOW_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "show_all" + } + }, + "HIDE_QUERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hide_query" + } + }, + "HIDE_HANDLES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hide_handles" + } + }, + "HIDE_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hide_all" + } + }, + "HIDE_QUERY_AND_HANDLES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hide_query_and_handles" + } + }, + "SHOW_ONLY_SNAPSHOT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "show_only_snapshot" + } + }, + "HIDE_HANDLES_AND_FOOTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hide_handles_and_footer" + } + } + }, + "traits": { + "smithy.api#documentation": "Toggles the display of additional content sent in the monitor notification." + } + }, + "com.datadog.monitors#MonitorOptionsNotifyByList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Controls what granularity a monitor alerts on. Only available for monitors with groupings.\nFor instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each\nnew `cluster` violating the alert conditions by setting `notify_by` to `[\"cluster\"]`. Tags mentioned\nin `notify_by` must be a subset of the grouping tags in the query.\nFor example, a query grouped by `cluster` and `namespace` cannot notify on `region`.\nSetting `notify_by` to `[\"*\"]` configures the monitor to notify as a simple-alert." + } + }, + "com.datadog.monitors#OnMissingDataOption": { + "type": "enum", + "members": { + "DEFAULT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "default" + } + }, + "SHOW_NO_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "show_no_data" + } + }, + "SHOW_AND_NOTIFY_NO_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "show_and_notify_no_data" + } + }, + "RESOLVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "resolve" + } + } + }, + "traits": { + "smithy.api#documentation": "Controls how groups or monitors are treated if an evaluation does not return any data points.\nThe default option results in different behavior depending on the monitor query type.\nFor monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to the threshold conditions.\nFor monitors using any query type other than Count, for example Gauge, Measure, or Rate, the monitor shows the last known status.\nThis option is available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors.\nIt is also required for metric monitors that use `scheduling_options.custom_schedule`." + } + }, + "com.datadog.monitors#MonitorRenotifyStatusType": { + "type": "enum", + "members": { + "ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "alert" + } + }, + "WARN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "warn" + } + }, + "NO_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "no data" + } + } + }, + "traits": { + "smithy.api#documentation": "The different statuses for which renotification is supported." + } + }, + "com.datadog.monitors#MonitorOptionsRenotifyStatusesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorRenotifyStatusType" + }, + "traits": { + "smithy.api#documentation": "The types of monitor statuses for which re-notification messages are sent.\nDefault: **null** if `renotify_interval` is **null**.\nIf `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`." + } + }, + "com.datadog.monitors#MonitorOptionsSchedulingOptions": { + "type": "structure", + "members": { + "custom_schedule": { + "target": "com.datadog.monitors#MonitorOptionsCustomSchedule" + }, + "evaluation_window": { + "target": "com.datadog.monitors#MonitorOptionsSchedulingOptionsEvaluationWindow" + } + }, + "traits": { + "smithy.api#documentation": "Configuration options for scheduling." + } + }, + "com.datadog.monitors#MonitorOptionsCustomSchedule": { + "type": "structure", + "members": { + "recurrences": { + "target": "com.datadog.monitors#MonitorOptionsCustomScheduleRecurrencesList", + "traits": { + "smithy.api#documentation": "Array of custom schedule recurrences." + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration options for the custom schedule. **This feature is in private beta.**" + } + }, + "com.datadog.monitors#MonitorOptionsCustomScheduleRecurrence": { + "type": "structure", + "members": { + "rrule": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines the recurrence rule (RRULE) for a given schedule." + } + }, + "start": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines the start date and time of the recurring schedule." + } + }, + "timezone": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines the timezone the schedule runs on." + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration for a recurrence set on the monitor options for custom schedule." + } + }, + "com.datadog.monitors#MonitorOptionsCustomScheduleRecurrencesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorOptionsCustomScheduleRecurrence" + }, + "traits": { + "smithy.api#documentation": "Array of custom schedule recurrences." + } + }, + "com.datadog.monitors#MonitorOptionsSchedulingOptionsEvaluationWindow": { + "type": "structure", + "members": { + "day_starts": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The time of the day at which a one day cumulative evaluation window starts." + } + }, + "hour_starts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The minute of the hour at which a one hour cumulative evaluation window starts." + } + }, + "month_starts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The day of the month at which a one month cumulative evaluation window starts." + } + }, + "timezone": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The timezone of the time of the day of the cumulative evaluation window start." + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration options for the evaluation window. If `hour_starts` is set, no other fields may be set. Otherwise, `day_starts` and `month_starts` must be set together." + } + }, + "com.datadog.monitors#MonitorOptionsSilencedMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "Information about the downtime applied to the monitor. Only shows v1 downtimes." + } + }, + "com.datadog.monitors#MonitorThresholdWindowOptions": { + "type": "structure", + "members": { + "recovery_window": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Describes how long an anomalous metric must be normal before the alert recovers.", + "com.distilled.openapi#nullable": {} + } + }, + "trigger_window": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Describes how long a metric must be anomalous before an alert triggers.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Alerting time window options." + } + }, + "com.datadog.monitors#MonitorThresholds": { + "type": "structure", + "members": { + "critical": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor `CRITICAL` threshold." + } + }, + "critical_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview." + } + }, + "critical_recovery": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor `CRITICAL` recovery threshold.", + "com.distilled.openapi#nullable": {} + } + }, + "critical_recovery_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview." + } + }, + "ok": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor `OK` threshold.", + "com.distilled.openapi#nullable": {} + } + }, + "unknown": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor UNKNOWN threshold.", + "com.distilled.openapi#nullable": {} + } + }, + "warning": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor `WARNING` threshold.", + "com.distilled.openapi#nullable": {} + } + }, + "warning_recovery": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The monitor `WARNING` recovery threshold.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "List of the different monitor threshold available." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionQueryDefinition": { + "type": "union", + "members": { + "MonitorFormulaAndFunctionEventQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinition" + }, + "MonitorFormulaAndFunctionCostQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionCostQueryDefinition" + }, + "MonitorFormulaAndFunctionDataQualityQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityQueryDefinition" + }, + "MonitorFormulaAndFunctionDataJobsQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataJobsQueryDefinition" + }, + "MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition" + }, + "MonitorFormulaAndFunctionAggregateFilteredQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinition" + } + }, + "traits": { + "smithy.api#documentation": "A formula and function query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinition": { + "type": "structure", + "members": { + "compute": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionCompute", + "traits": { + "smithy.api#required": {} + } + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventsDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "group_by": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionGroupByList", + "traits": { + "smithy.api#documentation": "Group by options." + } + }, + "indexes": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionIndexesList", + "traits": { + "smithy.api#documentation": "An array of index names to query in the stream. Omit or use `[]` to query all indexes at once." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas.", + "smithy.api#required": {} + } + }, + "search": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionSearch" + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions events query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionCompute": { + "type": "structure", + "members": { + "aggregation": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventAggregation", + "traits": { + "smithy.api#required": {} + } + }, + "interval": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "A time interval in milliseconds." + } + }, + "metric": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Measurable attribute to compute." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name assigned to this aggregation, when multiple aggregations are defined for a query." + } + }, + "source": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Source reference for composite query payloads." + } + } + }, + "traits": { + "smithy.api#documentation": "Compute options." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventAggregation": { + "type": "enum", + "members": { + "COUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "count" + } + }, + "CARDINALITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cardinality" + } + }, + "MEDIAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "median" + } + }, + "PC75": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pc75" + } + }, + "PC90": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pc90" + } + }, + "PC95": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pc95" + } + }, + "PC98": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pc98" + } + }, + "PC99": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pc99" + } + }, + "SUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sum" + } + }, + "MIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "min" + } + }, + "MAX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "max" + } + }, + "AVG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "avg" + } + } + }, + "traits": { + "smithy.api#documentation": "Aggregation methods for event platform queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventsDataSource": { + "type": "enum", + "members": { + "RUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "rum" + } + }, + "CI_PIPELINES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ci_pipelines" + } + }, + "CI_TESTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ci_tests" + } + }, + "AUDIT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "audit" + } + }, + "EVENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "events" + } + }, + "LOGS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "logs" + } + }, + "SPANS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "spans" + } + }, + "DATABASE_QUERIES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "database_queries" + } + }, + "NETWORK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "network" + } + }, + "NETWORK_PATH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "network_path" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for event platform-based queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBy": { + "type": "structure", + "members": { + "facet": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Event facet.", + "smithy.api#required": {} + } + }, + "limit": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Number of groups to return." + } + }, + "sort": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBySort" + }, + "source": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Source reference for composite query payloads." + } + } + }, + "traits": { + "smithy.api#documentation": "List of objects used to group by." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBySort": { + "type": "structure", + "members": { + "aggregation": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventAggregation", + "traits": { + "smithy.api#required": {} + } + }, + "metric": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Metric used for sorting group by results." + } + }, + "order": { + "target": "com.datadog.monitors#QuerySortOrder" + } + }, + "traits": { + "smithy.api#documentation": "Options for sorting group by results." + } + }, + "com.datadog.monitors#QuerySortOrder": { + "type": "enum", + "members": { + "ASC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "asc" + } + }, + "DESC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "desc" + } + } + }, + "traits": { + "smithy.api#documentation": "Direction of sort." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionGroupByList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBy" + }, + "traits": { + "smithy.api#documentation": "Group by options." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionIndexesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of index names to query in the stream. Omit or use `[]` to query all indexes at once." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionSearch": { + "type": "structure", + "members": { + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Events search string.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Search options." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionCostQueryDefinition": { + "type": "structure", + "members": { + "aggregator": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionCostAggregator" + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionCostDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas.", + "smithy.api#required": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions cost query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionCostAggregator": { + "type": "enum", + "members": { + "AVG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "avg" + } + }, + "SUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sum" + } + }, + "MAX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "max" + } + }, + "MIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "min" + } + }, + "LAST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "last" + } + }, + "AREA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "area" + } + }, + "L2NORM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "l2norm" + } + }, + "PERCENTILE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "percentile" + } + }, + "STDDEV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "stddev" + } + } + }, + "traits": { + "smithy.api#documentation": "Aggregation methods for metric queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionCostDataSource": { + "type": "enum", + "members": { + "METRICS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "metrics" + } + }, + "CLOUD_COST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cloud_cost" + } + }, + "DATADOG_USAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "datadog_usage" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for cost queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityQueryDefinition": { + "type": "structure", + "members": { + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "filter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Filter expression used to match on data entities. Uses Aastra query syntax.", + "smithy.api#required": {} + } + }, + "group_by": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList", + "traits": { + "smithy.api#documentation": "Optional grouping fields for aggregation." + } + }, + "measure": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "monitor_options": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityMonitorOptions" + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas.", + "smithy.api#required": {} + } + }, + "schema_version": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Schema version for the data quality query." + } + }, + "scope": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Optional scoping expression to further filter metrics. Uses metrics filter syntax.\nThis is useful when an entity has been configured to emit metrics with additional tags." + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions data quality query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityDataSource": { + "type": "enum", + "members": { + "DATA_QUALITY_METRICS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "data_quality_metrics" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for data quality queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Optional grouping fields for aggregation." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityMonitorOptions": { + "type": "structure", + "members": { + "crontab_override": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Crontab expression to override the default schedule." + } + }, + "custom_sql": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Custom SQL query for the monitor." + } + }, + "custom_where": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Custom WHERE clause for the query." + } + }, + "group_by_columns": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList", + "traits": { + "smithy.api#documentation": "Columns to group results by." + } + }, + "model_type_override": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityModelTypeOverride" + }, + "sensitivity": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Sensitivity of the anomaly detection model, expressed as a multiplier on the width\nof the predicted bounds. Higher values widen the bounds and produce fewer alerts;\nlower values tighten them and produce more alerts. Defaults to `3.0`." + } + } + }, + "traits": { + "smithy.api#documentation": "Monitor configuration options for data quality queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Columns to group results by." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataQualityModelTypeOverride": { + "type": "enum", + "members": { + "FRESHNESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "freshness" + } + }, + "PERCENTAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "percentage" + } + }, + "ANY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "any" + } + } + }, + "traits": { + "smithy.api#documentation": "Override for the model type used in anomaly detection." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionDataJobsQueryDefinition": { + "type": "structure", + "members": { + "job_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The type of job being monitored. Valid values include:\n`databricks.job`, `spark.application`, `airflow.dag`,\n`dbt.job`, `dbt.model`, `dbt.test`, `glue.job`.\nCustom job types are supported with the `custom.ol.` prefix.", + "smithy.api#required": {} + } + }, + "jobs_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Filter expression used to select the jobs to monitor.", + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas. Must be `run_query`.", + "smithy.api#required": {} + } + }, + "query_dialect": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query dialect for data jobs queries. Currently only `metric` is supported.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions data jobs query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition": { + "type": "structure", + "members": { + "augment_query": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentQuery", + "traits": { + "smithy.api#required": {} + } + }, + "base_query": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateBaseQuery", + "traits": { + "smithy.api#required": {} + } + }, + "compute": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList", + "traits": { + "smithy.api#documentation": "Compute options for the query.", + "smithy.api#required": {} + } + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "group_by": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList", + "traits": { + "smithy.api#documentation": "Group by options for the query.", + "smithy.api#required": {} + } + }, + "join_condition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryJoinCondition", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas." + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions aggregate augmented query. Used to enrich base query results with data from a reference table." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentQuery": { + "type": "union", + "members": { + "MonitorFormulaAndFunctionEventQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinition" + }, + "MonitorFormulaAndFunctionReferenceTableQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableQueryDefinition" + } + }, + "traits": { + "smithy.api#documentation": "Augment query for aggregate augmented queries. Can be an events query or a reference table query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableQueryDefinition": { + "type": "structure", + "members": { + "columns": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList", + "traits": { + "smithy.api#documentation": "List of columns to retrieve from the reference table." + } + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query." + } + }, + "query_filter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Optional filter expression for the reference table query." + } + }, + "table_name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the reference table.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A reference table query for use in aggregate queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableColumn": { + "type": "structure", + "members": { + "alias": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Optional alias for the column." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the column.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A column definition for reference table queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableColumn" + }, + "traits": { + "smithy.api#documentation": "List of columns to retrieve from the reference table." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableDataSource": { + "type": "enum", + "members": { + "REFERENCE_TABLE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "reference_table" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for reference table queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateBaseQuery": { + "type": "union", + "members": { + "MonitorFormulaAndFunctionEventQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinition" + }, + "MonitorFormulaAndFunctionMetricsQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionMetricsQueryDefinition" + } + }, + "traits": { + "smithy.api#documentation": "Base query for aggregate queries. Can be an events query or a metrics query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionMetricsQueryDefinition": { + "type": "structure", + "members": { + "aggregator": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionMetricsAggregator" + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionMetricsDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas." + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The metrics query definition.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions metrics query for use in aggregate queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionMetricsAggregator": { + "type": "enum", + "members": { + "AVG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "avg" + } + }, + "MIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "min" + } + }, + "MAX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "max" + } + }, + "SUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sum" + } + }, + "LAST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "last" + } + }, + "MEAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mean" + } + }, + "AREA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "area" + } + }, + "L2NORM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "l2norm" + } + }, + "PERCENTILE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "percentile" + } + }, + "STDDEV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "stddev" + } + }, + "COUNT_UNIQUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "count_unique" + } + } + }, + "traits": { + "smithy.api#documentation": "Aggregator for metrics queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionMetricsDataSource": { + "type": "enum", + "members": { + "METRICS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "metrics" + } + }, + "CLOUD_COST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cloud_cost" + } + }, + "DATADOG_USAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "datadog_usage" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for metrics queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionCompute" + }, + "traits": { + "smithy.api#documentation": "Compute options for the query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedDataSource": { + "type": "enum", + "members": { + "AGGREGATE_AUGMENTED_QUERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "aggregate_augmented_query" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for aggregate augmented queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBy" + }, + "traits": { + "smithy.api#documentation": "Group by options for the query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryJoinCondition": { + "type": "structure", + "members": { + "augment_attribute": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Attribute from the augment query to join on.", + "smithy.api#required": {} + } + }, + "base_attribute": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Attribute from the base query to join on.", + "smithy.api#required": {} + } + }, + "join_type": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryJoinType", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Join condition for aggregate augmented queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryJoinType": { + "type": "enum", + "members": { + "INNER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "inner" + } + }, + "LEFT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "left" + } + } + }, + "traits": { + "smithy.api#documentation": "Join type for aggregate query join conditions." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinition": { + "type": "structure", + "members": { + "base_query": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateBaseQuery", + "traits": { + "smithy.api#required": {} + } + }, + "compute": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList", + "traits": { + "smithy.api#documentation": "Compute options for the query." + } + }, + "data_source": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "filter_query": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilterQuery", + "traits": { + "smithy.api#required": {} + } + }, + "filters": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList", + "traits": { + "smithy.api#documentation": "Filter conditions for the query.", + "smithy.api#required": {} + } + }, + "group_by": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList", + "traits": { + "smithy.api#documentation": "Group by options for the query." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas." + } + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions aggregate filtered query. Used to filter base query results using data from another source." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinitionCompute" + }, + "traits": { + "smithy.api#documentation": "Compute options for the query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredDataSource": { + "type": "enum", + "members": { + "AGGREGATE_FILTERED_QUERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "aggregate_filtered_query" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for aggregate filtered queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilterQuery": { + "type": "union", + "members": { + "MonitorFormulaAndFunctionEventQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryDefinition" + }, + "MonitorFormulaAndFunctionReferenceTableQueryDefinition": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionReferenceTableQueryDefinition" + } + }, + "traits": { + "smithy.api#documentation": "Filter query for aggregate filtered queries. Can be an events query or a reference table query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryFilter": { + "type": "structure", + "members": { + "base_attribute": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Attribute from the base query to filter on.", + "smithy.api#required": {} + } + }, + "exclude": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether to exclude matching records instead of including them." + } + }, + "filter_attribute": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Attribute from the filter query to match against.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Filter definition for aggregate filtered queries." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionAggregateQueryFilter" + }, + "traits": { + "smithy.api#documentation": "Filter conditions for the query." + } + }, + "com.datadog.monitors#MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionEventQueryGroupBy" + }, + "traits": { + "smithy.api#documentation": "Group by options for the query." + } + }, + "com.datadog.monitors#MonitorOptionsVariablesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionQueryDefinition" + }, + "traits": { + "smithy.api#documentation": "List of requests that can be used in the monitor query. **This feature is currently in beta.**" + } + }, + "com.datadog.monitors#MonitorOverallStates": { + "type": "enum", + "members": { + "ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Alert" + } + }, + "IGNORED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Ignored" + } + }, + "NO_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "No Data" + } + }, + "OK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OK" + } + }, + "SKIPPED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Skipped" + } + }, + "UNKNOWN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Unknown" + } + }, + "WARN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Warn" + } + } + }, + "traits": { + "smithy.api#documentation": "The different states your monitor can be in." + } + }, + "com.datadog.monitors#MonitorRestrictedRolesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles." + } + }, + "com.datadog.monitors#MonitorState": { + "type": "structure", + "members": { + "groups": { + "target": "com.datadog.monitors#MonitorStateGroupsMap", + "traits": { + "smithy.api#documentation": "Dictionary where the keys are groups (comma separated lists of tags) and the values are\nthe list of groups your monitor is broken down on." + } + } + }, + "traits": { + "smithy.api#documentation": "Wrapper object with the different monitor states." + } + }, + "com.datadog.monitors#MonitorStateGroup": { + "type": "structure", + "members": { + "last_nodata_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor was in NO_DATA state." + } + }, + "last_notified_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp of the notification sent for this monitor group." + } + }, + "last_resolved_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor group was resolved." + } + }, + "last_triggered_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor group triggered." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the monitor." + } + }, + "status": { + "target": "com.datadog.monitors#MonitorOverallStates" + } + }, + "traits": { + "smithy.api#documentation": "Monitor state for a single group." + } + }, + "com.datadog.monitors#MonitorStateGroupsMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "com.datadog.monitors#MonitorStateGroup" + }, + "traits": { + "smithy.api#documentation": "Dictionary where the keys are groups (comma separated lists of tags) and the values are\nthe list of groups your monitor is broken down on." + } + }, + "com.datadog.monitors#MonitorTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "com.datadog.monitors#MonitorType": { + "type": "enum", + "members": { + "COMPOSITE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "composite" + } + }, + "EVENT_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "event alert" + } + }, + "LOG_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "log alert" + } + }, + "METRIC_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "metric alert" + } + }, + "PROCESS_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "process alert" + } + }, + "QUERY_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "query alert" + } + }, + "RUM_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "rum alert" + } + }, + "SERVICE_CHECK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "service check" + } + }, + "SYNTHETICS_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "synthetics alert" + } + }, + "TRACE_ANALYTICS_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "trace-analytics alert" + } + }, + "SLO_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "slo alert" + } + }, + "EVENT_V2_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "event-v2 alert" + } + }, + "AUDIT_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "audit alert" + } + }, + "CI_PIPELINES_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ci-pipelines alert" + } + }, + "CI_TESTS_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ci-tests alert" + } + }, + "ERROR_TRACKING_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "error-tracking alert" + } + }, + "DATABASE_MONITORING_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "database-monitoring alert" + } + }, + "NETWORK_PERFORMANCE_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "network-performance alert" + } + }, + "COST_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cost alert" + } + }, + "DATA_QUALITY_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "data-quality alert" + } + }, + "NETWORK_PATH_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "network-path alert" + } + }, + "DATA_JOBS_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "data-jobs alert" + } + }, + "LLM_OBSERVABILITY_ALERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "llm-observability alert" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs." + } + }, + "com.datadog.monitors#ListMonitorsResponseBodyList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#Monitor" + }, + "traits": { + "smithy.api#documentation": "An array of monitor objects." + } + }, + "com.datadog.monitors#ListMonitorsResponse": { + "type": "structure", + "members": { + "body": { + "target": "com.datadog.monitors#ListMonitorsResponseBodyList", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.datadog.monitors#ListMonitors": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#ListMonitorsRequest" + }, + "output": { + "target": "com.datadog.monitors#ListMonitorsResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/monitor", + "code": 200 + }, + "smithy.api#documentation": "Get all monitors\n\nGet all monitors from your organization." + } + }, + "com.datadog.monitors#CreateMonitorRequestAssetsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorAsset" + }, + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "com.datadog.monitors#MatchingDowntimeInput": { + "type": "structure", + "members": { + "end": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "POSIX timestamp to end the downtime.", + "com.distilled.openapi#nullable": {} + } + }, + "scope": { + "target": "com.datadog.monitors#MatchingDowntimeInputScopeList", + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`.\nProvide multiple scopes as a comma-separated list like `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`)." + } + }, + "start": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "POSIX timestamp to start the downtime." + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing a downtime that matches this monitor." + } + }, + "com.datadog.monitors#MatchingDowntimeInputScopeList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`.\nProvide multiple scopes as a comma-separated list like `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`)." + } + }, + "com.datadog.monitors#CreateMonitorRequestMatchingDowntimesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MatchingDowntimeInput" + }, + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "com.datadog.monitors#MonitorOptionsInput": { + "type": "structure", + "members": { + "enable_logs_sample": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not to send a log sample when the log monitor triggers." + } + }, + "enable_samples": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors." + } + }, + "escalation_message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify/?tab=is_alert#renotify),\nblock in the original message instead.\nA message to include with a re-notification. Supports the `@username` notification we allow elsewhere.\nNot applicable if `renotify_interval` is `None`." + } + }, + "evaluation_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min),\nthe timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55.\nThis is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.", + "com.distilled.openapi#nullable": {} + } + }, + "group_retention_duration": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The time span after which groups with missing data are dropped from the monitor state.\nThe minimum value is one hour, and the maximum value is 72 hours.\nExample values are: \"60m\", \"1h\", and \"2d\".\nThis option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors." + } + }, + "groupby_simple_monitor": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead." + } + }, + "include_tags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title.\n\n**Examples**\n- If `True`, `[Triggered on {host:h1}] Monitor Title`\n- If `False`, `[Triggered] Monitor Title`" + } + }, + "locked": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead." + } + }, + "min_failure_duration": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "How long the test should be in failure before alerting (integer, number of seconds, max 7200).", + "com.distilled.openapi#nullable": {} + } + }, + "min_location_failed": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The minimum number of locations in failure at the same time during\nat least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration`\nare part of the advanced alerting rules - integer, >= 1).", + "com.distilled.openapi#nullable": {} + } + }, + "new_group_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to skip evaluations for new groups.\n\nFor example, this option can be used to skip evaluations for new hosts while they initialize.\n\nMust be a non negative integer.", + "com.distilled.openapi#nullable": {} + } + }, + "new_host_delay": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Time (in seconds) to allow a host to boot and applications\nto fully start before starting the evaluation of monitor results.\nShould be a non negative integer.\n\nUse new_group_delay instead.", + "com.distilled.openapi#nullable": {} + } + }, + "no_data_timeframe": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of minutes before a monitor notifies after data stops reporting.\nDatadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks.\nIf omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks.", + "com.distilled.openapi#nullable": {} + } + }, + "notification_preset_name": { + "target": "com.datadog.monitors#MonitorOptionsNotificationPresets" + }, + "notify_audit": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether tagged users is notified on changes to this monitor." + } + }, + "notify_by": { + "target": "com.datadog.monitors#MonitorOptionsInputNotifyByList", + "traits": { + "smithy.api#documentation": "Controls what granularity a monitor alerts on. Only available for monitors with groupings.\nFor instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each\nnew `cluster` violating the alert conditions by setting `notify_by` to `[\"cluster\"]`. Tags mentioned\nin `notify_by` must be a subset of the grouping tags in the query.\nFor example, a query grouped by `cluster` and `namespace` cannot notify on `region`.\nSetting `notify_by` to `[\"*\"]` configures the monitor to notify as a simple-alert." + } + }, + "notify_no_data": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`." + } + }, + "on_missing_data": { + "target": "com.datadog.monitors#OnMissingDataOption" + }, + "renotify_interval": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of minutes after the last notification before a monitor re-notifies on the current status.\nIt only re-notifies if it’s not resolved.", + "com.distilled.openapi#nullable": {} + } + }, + "renotify_occurrences": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of times re-notification messages should be sent on the current status at the provided re-notification interval.", + "com.distilled.openapi#nullable": {} + } + }, + "renotify_statuses": { + "target": "com.datadog.monitors#MonitorOptionsInputRenotifyStatusesList", + "traits": { + "smithy.api#documentation": "The types of monitor statuses for which re-notification messages are sent.\nDefault: **null** if `renotify_interval` is **null**.\nIf `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`.", + "com.distilled.openapi#nullable": {} + } + }, + "require_full_window": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A Boolean indicating whether this monitor needs a full window of data before it’s evaluated.\nWe highly recommend you set this to `false` for sparse metrics,\notherwise some evaluations are skipped. Default is false. This setting only applies to\nmetric monitors." + } + }, + "scheduling_options": { + "target": "com.datadog.monitors#MonitorOptionsSchedulingOptions" + }, + "silenced": { + "target": "com.datadog.monitors#MonitorOptionsInputSilencedMap", + "traits": { + "smithy.api#documentation": "Information about the downtime applied to the monitor. Only shows v1 downtimes." + } + }, + "synthetics_check_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ID of the corresponding Synthetic check.", + "com.distilled.openapi#nullable": {} + } + }, + "threshold_windows": { + "target": "com.datadog.monitors#MonitorThresholdWindowOptions" + }, + "thresholds": { + "target": "com.datadog.monitors#MonitorThresholds" + }, + "timeout_h": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours.", + "com.distilled.openapi#nullable": {} + } + }, + "variables": { + "target": "com.datadog.monitors#MonitorOptionsInputVariablesList", + "traits": { + "smithy.api#documentation": "List of requests that can be used in the monitor query. **This feature is currently in beta.**" + } + } + }, + "traits": { + "smithy.api#documentation": "List of options associated with your monitor." + } + }, + "com.datadog.monitors#MonitorOptionsInputNotifyByList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Controls what granularity a monitor alerts on. Only available for monitors with groupings.\nFor instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each\nnew `cluster` violating the alert conditions by setting `notify_by` to `[\"cluster\"]`. Tags mentioned\nin `notify_by` must be a subset of the grouping tags in the query.\nFor example, a query grouped by `cluster` and `namespace` cannot notify on `region`.\nSetting `notify_by` to `[\"*\"]` configures the monitor to notify as a simple-alert." + } + }, + "com.datadog.monitors#MonitorOptionsInputRenotifyStatusesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorRenotifyStatusType" + }, + "traits": { + "smithy.api#documentation": "The types of monitor statuses for which re-notification messages are sent.\nDefault: **null** if `renotify_interval` is **null**.\nIf `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`." + } + }, + "com.datadog.monitors#MonitorOptionsInputSilencedMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "Information about the downtime applied to the monitor. Only shows v1 downtimes." + } + }, + "com.datadog.monitors#MonitorOptionsInputVariablesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorFormulaAndFunctionQueryDefinition" + }, + "traits": { + "smithy.api#documentation": "List of requests that can be used in the monitor query. **This feature is currently in beta.**" + } + }, + "com.datadog.monitors#CreateMonitorRequestRestrictedRolesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles." + } + }, + "com.datadog.monitors#CreateMonitorRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "com.datadog.monitors#CreateMonitorRequest": { + "type": "structure", + "members": { + "assets": { + "target": "com.datadog.monitors#CreateMonitorRequestAssetsList", + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "draft_status": { + "target": "com.datadog.monitors#MonitorDraftStatus" + }, + "matching_downtimes": { + "target": "com.datadog.monitors#CreateMonitorRequestMatchingDowntimesList", + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message to include with notifications for this monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "options": { + "target": "com.datadog.monitors#MonitorOptionsInput" + }, + "priority": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Integer from 1 (high) to 5 (low) indicating alert severity.", + "com.distilled.openapi#nullable": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query.", + "smithy.api#required": {} + } + }, + "restricted_roles": { + "target": "com.datadog.monitors#CreateMonitorRequestRestrictedRolesList", + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles.", + "com.distilled.openapi#nullable": {} + } + }, + "tags": { + "target": "com.datadog.monitors#CreateMonitorRequestTagsList", + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#CreateMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#CreateMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#Monitor" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/monitor", + "code": 200 + }, + "smithy.api#documentation": "Create a monitor\n\nCreate a monitor using the specified options.\n\n#### Monitor Types\n\nThe type of monitor chosen from:\n\n- anomaly: `query alert`\n- APM: `query alert` or `trace-analytics alert`\n- composite: `composite`\n- custom: `service check`\n- forecast: `query alert`\n- host: `service check`\n- integration: `query alert` or `service check`\n- live process: `process alert`\n- logs: `log alert`\n- metric: `query alert`\n- network: `service check`\n- outlier: `query alert`\n- process: `service check`\n- rum: `rum alert`\n- SLO: `slo alert`\n- watchdog: `event-v2 alert`\n- event-v2: `event-v2 alert`\n- audit: `audit alert`\n- error-tracking: `error-tracking alert`\n- database-monitoring: `database-monitoring alert`\n- network-performance: `network-performance alert`\n- cloud cost: `cost alert`\n- network-path: `network-path alert`\n\n**Notes**:\n- Synthetic monitors are created through the Synthetics API. See the [Synthetics API](https://docs.datadoghq.com/api/latest/synthetics/) documentation for more information.\n- Log monitors require an unscoped App Key.\n\n#### Query Types\n\n##### Metric Alert Query\n\nExample: `time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #`\n\n- `time_aggr`: avg, sum, max, min, change, or pct_change\n- `time_window`: `last_#m` (with `#` between 1 and 10080 depending on the monitor type) or `last_#h`(with `#` between 1 and 168 depending on the monitor type) or `last_1d`, or `last_1w`\n- `space_aggr`: avg, sum, min, or max\n- `tags`: one or more tags (comma-separated), or *\n- `key`: a 'key' in key:value tag syntax; defines a separate alert for each tag in the group (multi-alert)\n- `operator`: <, <=, >, >=, ==, or !=\n- `#`: an integer or decimal number used to set the threshold\n\nTo use a dynamic threshold on a metric monitor with a formula query, replace `#` with the `threshold` keyword\n(for example, `... > threshold`) and provide the threshold as a query via `critical_query` on `options.thresholds`.\nThis feature is in preview.\n\nIf you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window),\ntimeshift):space_aggr:metric{tags} [by {key}] operator #` with:\n\n- `change_aggr` change, pct_change\n- `time_aggr` avg, sum, max, min [Learn more](https://docs.datadoghq.com/monitors/create/types/#define-the-conditions)\n- `time_window` last\\_#m (between 1 and 2880 depending on the monitor type), last\\_#h (between 1 and 48 depending on the monitor type), or last_#d (1 or 2)\n- `timeshift` #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago\n\nUse this to create an outlier monitor using the following query:\n`avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, 'dbscan', 7) > 0`\n\n##### Service Check Query\n\nExample: `\"check\".over(tags).last(count).by(group).count_by_status()`\n\n- `check` name of the check, for example `datadog.agent.up`\n- `tags` one or more quoted tags (comma-separated), or \"*\". for example: `.over(\"env:prod\", \"role:db\")`; `over` cannot be blank.\n- `count` must be at greater than or equal to your max threshold (defined in the `options`). It is limited to 100.\nFor example, if you've specified to notify on 1 critical, 3 ok, and 2 warn statuses, `count` should be at least 3.\n- `group` must be specified for check monitors. Per-check grouping is already explicitly known for some service checks.\nFor example, Postgres integration monitors are tagged by `db`, `host`, and `port`, and Network monitors by `host`, `instance`, and `url`. See [Service Checks](https://docs.datadoghq.com/api/latest/service-checks/) documentation for more information.\n\n##### Event Alert Query\n\n**Note:** The Event Alert Query has been replaced by the Event V2 Alert Query. For more information, see the [Event Migration guide](https://docs.datadoghq.com/service_management/events/guides/migrating_to_new_events_features/).\n\n##### Event V2 Alert Query\n\nExample: `events(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n##### Process Alert Query\n\nExample: `processes(search).over(tags).rollup('count').last(timeframe) operator #`\n\n- `search` free text search string for querying processes.\nMatching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) page.\n- `tags` one or more tags (comma-separated)\n- `timeframe` the timeframe to roll up the counts. Examples: 10m, 4h. Supported timeframes: s, m, h and d\n- `operator` <, <=, >, >=, ==, or !=\n- `#` an integer or decimal number used to set the threshold\n\n##### Logs Alert Query\n\nExample: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `index_name` For multi-index organizations, the log index in which the request is performed.\n- `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n##### Composite Query\n\nExample: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite monitors\n\n* `name` [*required*, *default* = **dynamic, based on query**]: The name of the alert.\n* `message` [*required*, *default* = **dynamic, based on query**]: A message to include with notifications for this monitor.\nEmail notifications can be sent to specific users by using the same '@username' notation as events.\n* `tags` [*optional*, *default* = **empty list**]: A list of tags to associate with your monitor.\nWhen getting all monitor details via the API, use the `monitor_tags` argument to filter results by these tags.\nIt is only available via the API and isn't visible or editable in the Datadog UI.\n\n##### SLO Alert Query\n\nExample: `error_budget(\"slo_id\").over(\"time_window\") operator #`\n\n- `slo_id`: The alphanumeric SLO ID of the SLO you are configuring the alert for.\n- `time_window`: The time window of the SLO target you wish to alert on. Valid options: `7d`, `30d`, `90d`.\n- `operator`: `>=` or `>`\n\n##### Audit Alert Query\n\nExample: `audits(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n##### CI Pipelines Alert Query\n\nExample: `ci-pipelines(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n##### CI Tests Alert Query\n\nExample: `ci-tests(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n##### Error Tracking Alert Query\n\n\"New issue\" example: `error-tracking(query).source(issue_source).new().rollup(rollup_method[, measure]).by(group_by).last(time_window) operator #`\n\"High impact issue\" example: `error-tracking(query).source(issue_source).impact().rollup(rollup_method[, measure]).by(group_by).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `issue_source` The issue source - supports `all`, `browser`, `mobile` and `backend` and defaults to `all` if omitted.\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality` and defaults to `count` if omitted.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `group by` Comma-separated list of attributes to group by - should contain at least `issue.id`.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n**Database Monitoring Alert Query**\n\nExample: `database-monitoring(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n**Network Performance Alert Query**\n\nExample: `network-performance(query).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold.\n\n**Cost Alert Query**\n\nExample: `formula(query).timeframe_type(time_window).function(parameter) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `timeframe_type` The timeframe type to evaluate the cost\n - for `forecast` supports `current`\n - for `change`, `anomaly`, `threshold` supports `last`\n- `time_window` - supports daily roll-up e.g. `7d`\n- `function` - [optional, defaults to `threshold` monitor if omitted] supports `change`, `anomaly`, `forecast`\n- `parameter` Specify the parameter of the type\n - for `change`:\n - supports `relative`, `absolute`\n - [optional] supports `#`, where `#` is an integer or decimal number used to set the threshold\n - for `anomaly`:\n - supports `direction=both`, `direction=above`, `direction=below`\n - [optional] supports `threshold=#`, where `#` is an integer or decimal number used to set the threshold\n- `operator`\n - for `threshold` supports `<`, `<=`, `>`, `>=`, `==`, or `!=`\n - for `change` supports `>`, `<`\n - for `anomaly` supports `>=`\n - for `forecast` supports `>`\n- `#` an integer or decimal number used to set the threshold.\n\n**Network Path Alert Query**\n\nExample: `network-path(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #`\n\n- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).\n- `index_name` The data type to monitor on - supports `netpath-path` and `netpath-hop`.\n- `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.\n- `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.\n- `time_window` #m (between 1 and 2880), #h (between 1 and 48).\n- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.\n- `#` an integer or decimal number used to set the threshold." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorRequestMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": {} + }, + "com.datadog.monitors#CheckCanDeleteMonitorRequest": { + "type": "structure", + "members": { + "monitor_ids": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorRequestMonitorIdsList", + "traits": { + "smithy.api#httpQuery": "monitor_ids", + "smithy.api#required": {}, + "smithy.api#documentation": "The IDs of the monitor to check." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorResponseData", + "traits": { + "smithy.api#required": {} + } + }, + "errors": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorResponseErrorsMap", + "traits": { + "smithy.api#documentation": "A mapping of Monitor ID to strings denoting where it's used.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Response of monitor IDs that can or can't be safely deleted." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorResponseData": { + "type": "structure", + "members": { + "ok": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorResponseDataOkList", + "traits": { + "smithy.api#documentation": "An array of Monitor IDs that can be safely deleted." + } + } + }, + "traits": { + "smithy.api#documentation": "Wrapper object with the list of monitor IDs." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorResponseDataOkList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "An array of Monitor IDs that can be safely deleted." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorResponseErrorsValueList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Strings denoting where a monitor is used." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitorResponseErrorsMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorResponseErrorsValueList" + }, + "traits": { + "smithy.api#documentation": "A mapping of Monitor ID to strings denoting where it's used." + } + }, + "com.datadog.monitors#CheckCanDeleteMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#CheckCanDeleteMonitorResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + }, + { + "target": "com.datadog.monitors#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/monitor/can_delete", + "code": 200 + }, + "smithy.api#documentation": "Check if a monitor can be deleted\n\nCheck if the given monitors can be deleted." + } + }, + "com.datadog.monitors#SearchMonitorGroupsRequest": { + "type": "structure", + "members": { + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "query", + "smithy.api#documentation": "After entering a search query on the [Triggered Monitors page][1], use the query parameter value in the\nURL of the page as a value for this parameter. For more information, see the [Manage Monitors documentation][2].\n\nThe query can contain any number of space-separated monitor attributes, for instance: `query=\"type:metric group_status:alert\"`.\n\n[1]: https://app.datadoghq.com/monitors/triggered\n[2]: /monitors/manage/#triggered-monitors" + } + }, + "page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page", + "smithy.api#documentation": "Page to start paginating from." + } + }, + "per_page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "per_page", + "smithy.api#documentation": "Number of monitors to return per page." + } + }, + "sort": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "sort", + "smithy.api#documentation": "String for sort order, composed of field and sort order separate by a comma, for example `name,asc`. Supported sort directions: `asc`, `desc`. Supported fields:\n\n* `name`\n* `status`\n* `tags`" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#MonitorGroupSearchResponse": { + "type": "structure", + "members": { + "counts": { + "target": "com.datadog.monitors#MonitorGroupSearchResponseCounts" + }, + "groups": { + "target": "com.datadog.monitors#MonitorGroupSearchResponseGroupsList", + "traits": { + "smithy.api#documentation": "The list of found monitor groups." + } + }, + "metadata": { + "target": "com.datadog.monitors#MonitorSearchResponseMetadata" + } + }, + "traits": { + "smithy.api#documentation": "The response of a monitor group search." + } + }, + "com.datadog.monitors#MonitorGroupSearchResponseCounts": { + "type": "structure", + "members": { + "status": { + "target": "com.datadog.monitors#MonitorSearchCount" + }, + "type": { + "target": "com.datadog.monitors#MonitorSearchCount" + } + }, + "traits": { + "smithy.api#documentation": "The counts of monitor groups per different criteria." + } + }, + "com.datadog.monitors#MonitorSearchCount": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorSearchCountItem" + }, + "traits": { + "smithy.api#documentation": "Search facets." + } + }, + "com.datadog.monitors#MonitorSearchCountItem": { + "type": "structure", + "members": { + "count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of found monitors with the listed value." + } + }, + "name": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "The facet value." + } + } + }, + "traits": { + "smithy.api#documentation": "A facet item." + } + }, + "com.datadog.monitors#MonitorGroupSearchResult": { + "type": "structure", + "members": { + "group": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the group." + } + }, + "group_tags": { + "target": "com.datadog.monitors#MonitorGroupSearchResultGroupTagsList", + "traits": { + "smithy.api#documentation": "The list of tags of the monitor group." + } + }, + "last_nodata_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor group was in NO_DATA state." + } + }, + "last_triggered_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor group triggered.", + "com.distilled.openapi#nullable": {} + } + }, + "monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The ID of the monitor." + } + }, + "monitor_name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the monitor." + } + }, + "status": { + "target": "com.datadog.monitors#MonitorOverallStates" + } + }, + "traits": { + "smithy.api#documentation": "A single monitor group search result." + } + }, + "com.datadog.monitors#MonitorGroupSearchResultGroupTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The list of tags of the monitor group." + } + }, + "com.datadog.monitors#MonitorGroupSearchResponseGroupsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorGroupSearchResult" + }, + "traits": { + "smithy.api#documentation": "The list of found monitor groups." + } + }, + "com.datadog.monitors#MonitorSearchResponseMetadata": { + "type": "structure", + "members": { + "page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The page to start paginating from." + } + }, + "page_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of pages." + } + }, + "per_page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of monitors to return per page." + } + }, + "total_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The total number of monitors." + } + } + }, + "traits": { + "smithy.api#documentation": "Metadata about the response." + } + }, + "com.datadog.monitors#SearchMonitorGroups": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#SearchMonitorGroupsRequest" + }, + "output": { + "target": "com.datadog.monitors#MonitorGroupSearchResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/monitor/groups/search", + "code": 200 + }, + "smithy.api#documentation": "Monitors group search\n\nSearch and filter your monitor groups details." + } + }, + "com.datadog.monitors#SearchMonitorsRequest": { + "type": "structure", + "members": { + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "query", + "smithy.api#documentation": "After entering a search query in your [Manage Monitor page][1] use the query parameter value in the\nURL of the page as value for this parameter. Consult the dedicated [manage monitor documentation][2]\npage to learn more.\n\nThe query can contain any number of space-separated monitor attributes, for instance `query=\"type:metric status:alert\"`.\n\n[1]: https://app.datadoghq.com/monitors/manage\n[2]: /monitors/manage/#find-the-monitors" + } + }, + "page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page", + "smithy.api#documentation": "Page to start paginating from." + } + }, + "per_page": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "per_page", + "smithy.api#documentation": "Number of monitors to return per page." + } + }, + "sort": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "sort", + "smithy.api#documentation": "String for sort order, composed of field and sort order separate by a comma, for example `name,asc`. Supported sort directions: `asc`, `desc`. Supported fields:\n\n* `name`\n* `status`\n* `tags`" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#MonitorSearchResponse": { + "type": "structure", + "members": { + "counts": { + "target": "com.datadog.monitors#MonitorSearchResponseCounts" + }, + "metadata": { + "target": "com.datadog.monitors#MonitorSearchResponseMetadata" + }, + "monitors": { + "target": "com.datadog.monitors#MonitorSearchResponseMonitorsList", + "traits": { + "smithy.api#documentation": "The list of found monitors." + } + } + }, + "traits": { + "smithy.api#documentation": "The response from a monitor search." + } + }, + "com.datadog.monitors#MonitorSearchResponseCounts": { + "type": "structure", + "members": { + "muted": { + "target": "com.datadog.monitors#MonitorSearchCount" + }, + "status": { + "target": "com.datadog.monitors#MonitorSearchCount" + }, + "tag": { + "target": "com.datadog.monitors#MonitorSearchCount" + }, + "type": { + "target": "com.datadog.monitors#MonitorSearchCount" + } + }, + "traits": { + "smithy.api#documentation": "The counts of monitors per different criteria." + } + }, + "com.datadog.monitors#MonitorSearchResult": { + "type": "structure", + "members": { + "classification": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Classification of the monitor." + } + }, + "creator": { + "target": "com.datadog.monitors#Creator" + }, + "id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "ID of the monitor." + } + }, + "last_triggered_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Latest timestamp the monitor triggered.", + "com.distilled.openapi#nullable": {} + } + }, + "metrics": { + "target": "com.datadog.monitors#MonitorSearchResultMetricsList", + "traits": { + "smithy.api#documentation": "Metrics used by the monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "notifications": { + "target": "com.datadog.monitors#MonitorSearchResultNotificationsList", + "traits": { + "smithy.api#documentation": "The notification triggered by the monitor." + } + }, + "org_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The ID of the organization." + } + }, + "quality_issues": { + "target": "com.datadog.monitors#MonitorSearchResultQualityIssuesList", + "traits": { + "smithy.api#documentation": "Quality issues detected with the monitor." + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query." + } + }, + "scopes": { + "target": "com.datadog.monitors#MonitorSearchResultScopesList", + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies, for example `host:app2`.\nProvide multiple scopes as a comma-separated list, for example `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes\n(that is `env:dev AND env:prod`), NOT any of them." + } + }, + "status": { + "target": "com.datadog.monitors#MonitorOverallStates" + }, + "tags": { + "target": "com.datadog.monitors#MonitorSearchResultTagsList", + "traits": { + "smithy.api#documentation": "Tags associated with the monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType" + } + }, + "traits": { + "smithy.api#documentation": "Holds search results." + } + }, + "com.datadog.monitors#MonitorSearchResultMetricsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Metrics used by the monitor." + } + }, + "com.datadog.monitors#MonitorSearchResultNotification": { + "type": "structure", + "members": { + "handle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The email address that received the notification." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The username receiving the notification" + } + } + }, + "traits": { + "smithy.api#documentation": "A notification triggered by the monitor." + } + }, + "com.datadog.monitors#MonitorSearchResultNotificationsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorSearchResultNotification" + }, + "traits": { + "smithy.api#documentation": "The notification triggered by the monitor." + } + }, + "com.datadog.monitors#MonitorSearchResultQualityIssuesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Quality issues detected with the monitor." + } + }, + "com.datadog.monitors#MonitorSearchResultScopesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The scope(s) to which the downtime applies, for example `host:app2`.\nProvide multiple scopes as a comma-separated list, for example `env:dev,env:prod`.\nThe resulting downtime applies to sources that matches ALL provided scopes\n(that is `env:dev AND env:prod`), NOT any of them." + } + }, + "com.datadog.monitors#MonitorSearchResultTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated with the monitor." + } + }, + "com.datadog.monitors#MonitorSearchResponseMonitorsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorSearchResult" + }, + "traits": { + "smithy.api#documentation": "The list of found monitors." + } + }, + "com.datadog.monitors#SearchMonitors": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#SearchMonitorsRequest" + }, + "output": { + "target": "com.datadog.monitors#MonitorSearchResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/monitor/search", + "code": 200 + }, + "smithy.api#documentation": "Monitors search\n\nSearch and filter your monitors details." + } + }, + "com.datadog.monitors#ValidateMonitorRequestAssetsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorAsset" + }, + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "com.datadog.monitors#ValidateMonitorRequestMatchingDowntimesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MatchingDowntimeInput" + }, + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "com.datadog.monitors#ValidateMonitorRequestRestrictedRolesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles." + } + }, + "com.datadog.monitors#ValidateMonitorRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "com.datadog.monitors#ValidateMonitorRequest": { + "type": "structure", + "members": { + "assets": { + "target": "com.datadog.monitors#ValidateMonitorRequestAssetsList", + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "draft_status": { + "target": "com.datadog.monitors#MonitorDraftStatus" + }, + "matching_downtimes": { + "target": "com.datadog.monitors#ValidateMonitorRequestMatchingDowntimesList", + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message to include with notifications for this monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "options": { + "target": "com.datadog.monitors#MonitorOptionsInput" + }, + "priority": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Integer from 1 (high) to 5 (low) indicating alert severity.", + "com.distilled.openapi#nullable": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query.", + "smithy.api#required": {} + } + }, + "restricted_roles": { + "target": "com.datadog.monitors#ValidateMonitorRequestRestrictedRolesList", + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles.", + "com.distilled.openapi#nullable": {} + } + }, + "tags": { + "target": "com.datadog.monitors#ValidateMonitorRequestTagsList", + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#ValidateMonitorResponse": { + "type": "structure", + "members": { + "body": { + "target": "smithy.api#Document", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.datadog.monitors#ValidateMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#ValidateMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#ValidateMonitorResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/monitor/validate", + "code": 200 + }, + "smithy.api#documentation": "Validate a monitor\n\nValidate the monitor provided in the request.\n\n**Note**: Log monitors require an unscoped App Key and `logs_read_data` permission." + } + }, + "com.datadog.monitors#GetMonitorRequest": { + "type": "structure", + "members": { + "monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the monitor" + } + }, + "group_states": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "group_states", + "smithy.api#documentation": "When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`." + } + }, + "with_downtimes": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "with_downtimes", + "smithy.api#documentation": "If this argument is set to true, then the returned data includes all current active downtimes for the monitor." + } + }, + "with_assets": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "with_assets", + "smithy.api#documentation": "If this argument is set to `true`, the returned data includes all assets tied to this monitor." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#GetMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#GetMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#Monitor" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + }, + { + "target": "com.datadog.monitors#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/monitor/{monitor_id}", + "code": 200 + }, + "smithy.api#documentation": "Get a monitor's details\n\nGet details about the specified monitor from your organization." + } + }, + "com.datadog.monitors#UpdateMonitorRequestAssetsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorAsset" + }, + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "com.datadog.monitors#UpdateMonitorRequestRestrictedRolesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles." + } + }, + "com.datadog.monitors#UpdateMonitorRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "com.datadog.monitors#UpdateMonitorRequest": { + "type": "structure", + "members": { + "monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the monitor." + } + }, + "assets": { + "target": "com.datadog.monitors#UpdateMonitorRequestAssetsList", + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks).", + "com.distilled.openapi#nullable": {} + } + }, + "draft_status": { + "target": "com.datadog.monitors#MonitorDraftStatus" + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message to include with notifications for this monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "options": { + "target": "com.datadog.monitors#MonitorOptionsInput" + }, + "priority": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Integer from 1 (high) to 5 (low) indicating alert severity.", + "com.distilled.openapi#nullable": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query." + } + }, + "restricted_roles": { + "target": "com.datadog.monitors#UpdateMonitorRequestRestrictedRolesList", + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles.", + "com.distilled.openapi#nullable": {} + } + }, + "tags": { + "target": "com.datadog.monitors#UpdateMonitorRequestTagsList", + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#UpdateMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#UpdateMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#Monitor" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + }, + { + "target": "com.datadog.monitors#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "PUT", + "uri": "/api/v1/monitor/{monitor_id}", + "code": 200 + }, + "smithy.api#documentation": "Edit a monitor\n\nEdit the specified monitor." + } + }, + "com.datadog.monitors#DeleteMonitorRequest": { + "type": "structure", + "members": { + "monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the monitor." + } + }, + "force": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "force", + "smithy.api#documentation": "Delete the monitor even if it's referenced by other resources (for example SLO, composite monitor)." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#DeletedMonitor": { + "type": "structure", + "members": { + "deleted_monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "ID of the deleted monitor." + } + } + }, + "traits": { + "smithy.api#documentation": "Response from the delete monitor call." + } + }, + "com.datadog.monitors#DeleteMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#DeleteMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#DeletedMonitor" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + }, + { + "target": "com.datadog.monitors#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/api/v1/monitor/{monitor_id}", + "code": 200 + }, + "smithy.api#documentation": "Delete a monitor\n\nDelete the specified monitor" + } + }, + "com.datadog.monitors#ValidateExistingMonitorRequestAssetsList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MonitorAsset" + }, + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "com.datadog.monitors#ValidateExistingMonitorRequestMatchingDowntimesList": { + "type": "list", + "member": { + "target": "com.datadog.monitors#MatchingDowntimeInput" + }, + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "com.datadog.monitors#ValidateExistingMonitorRequestRestrictedRolesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles." + } + }, + "com.datadog.monitors#ValidateExistingMonitorRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "com.datadog.monitors#ValidateExistingMonitorRequest": { + "type": "structure", + "members": { + "monitor_id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the monitor" + } + }, + "assets": { + "target": "com.datadog.monitors#ValidateExistingMonitorRequestAssetsList", + "traits": { + "smithy.api#documentation": "The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks)." + } + }, + "draft_status": { + "target": "com.datadog.monitors#MonitorDraftStatus" + }, + "matching_downtimes": { + "target": "com.datadog.monitors#ValidateExistingMonitorRequestMatchingDowntimesList", + "traits": { + "smithy.api#documentation": "A list of active v1 downtimes that match this monitor." + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message to include with notifications for this monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor name." + } + }, + "options": { + "target": "com.datadog.monitors#MonitorOptionsInput" + }, + "priority": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Integer from 1 (high) to 5 (low) indicating alert severity.", + "com.distilled.openapi#nullable": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The monitor query.", + "smithy.api#required": {} + } + }, + "restricted_roles": { + "target": "com.datadog.monitors#ValidateExistingMonitorRequestRestrictedRolesList", + "traits": { + "smithy.api#documentation": "A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles.", + "com.distilled.openapi#nullable": {} + } + }, + "tags": { + "target": "com.datadog.monitors#ValidateExistingMonitorRequestTagsList", + "traits": { + "smithy.api#documentation": "Tags associated to your monitor." + } + }, + "type": { + "target": "com.datadog.monitors#MonitorType", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.monitors#ValidateExistingMonitorResponse": { + "type": "structure", + "members": { + "body": { + "target": "smithy.api#Document", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.datadog.monitors#ValidateExistingMonitor": { + "type": "operation", + "input": { + "target": "com.datadog.monitors#ValidateExistingMonitorRequest" + }, + "output": { + "target": "com.datadog.monitors#ValidateExistingMonitorResponse" + }, + "errors": [ + { + "target": "com.datadog.monitors#BadRequest" + }, + { + "target": "com.datadog.monitors#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/monitor/{monitor_id}/validate", + "code": 200 + }, + "smithy.api#documentation": "Validate an existing monitor\n\nValidate the monitor provided in the request.\n\n**Note**: Log monitors require an unscoped App Key and `logs_read_data` permission." + } + }, + "com.datadog.monitors#BadRequest": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 400, + "com.distilled.openapi#errorMatchers": [ + { + "status": 400 + } + ] + } + }, + "com.datadog.monitors#Forbidden": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 403, + "com.distilled.openapi#errorMatchers": [ + { + "status": 403 + } + ] + } + }, + "com.datadog.monitors#Conflict": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 409, + "com.distilled.openapi#errorMatchers": [ + { + "status": 409 + } + ] + } + }, + "com.datadog.monitors#NotFound": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 404, + "com.distilled.openapi#errorMatchers": [ + { + "status": 404 + } + ] + } + }, + "com.datadog.monitors#Monitors": { + "type": "service", + "version": "1.0", + "operations": [ + { + "target": "com.datadog.monitors#ListMonitors" + }, + { + "target": "com.datadog.monitors#CreateMonitor" + }, + { + "target": "com.datadog.monitors#CheckCanDeleteMonitor" + }, + { + "target": "com.datadog.monitors#SearchMonitorGroups" + }, + { + "target": "com.datadog.monitors#SearchMonitors" + }, + { + "target": "com.datadog.monitors#ValidateMonitor" + }, + { + "target": "com.datadog.monitors#GetMonitor" + }, + { + "target": "com.datadog.monitors#UpdateMonitor" + }, + { + "target": "com.datadog.monitors#DeleteMonitor" + }, + { + "target": "com.datadog.monitors#ValidateExistingMonitor" + } + ], + "traits": { + "smithy.api#title": "Datadog API V1 Collection", + "smithy.api#documentation": "Collection of all Datadog Public endpoints." + } + } + } +} diff --git a/packages/datadog/.generated-specs/service_level_objectives.json b/packages/datadog/.generated-specs/service_level_objectives.json new file mode 100644 index 0000000000..c5093476c9 --- /dev/null +++ b/packages/datadog/.generated-specs/service_level_objectives.json @@ -0,0 +1,3737 @@ +{ + "smithy": "2.0", + "metadata": { + "suppressions": [ + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "UnreferencedShape", + "namespace": "*" + } + ] + }, + "shapes": { + "com.datadog.service_level_objectives#ListSLOsRequest": { + "type": "structure", + "members": { + "ids": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "ids", + "smithy.api#documentation": "A comma separated list of the IDs of the service level objectives objects." + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "query", + "smithy.api#documentation": "The query string to filter results based on SLO names." + } + }, + "tags_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "tags_query", + "smithy.api#documentation": "The query string to filter results based on a single SLO tag." + } + }, + "metrics_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "metrics_query", + "smithy.api#documentation": "The query string to filter results based on SLO numerator and denominator." + } + }, + "limit": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "limit", + "smithy.api#documentation": "The number of SLOs to return in the response." + } + }, + "offset": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "offset", + "smithy.api#documentation": "The specific offset to use as the beginning of the returned response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLOListResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLOListResponseDataList", + "traits": { + "smithy.api#documentation": "An array of service level objective objects." + } + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOListResponseErrorsList", + "traits": { + "smithy.api#documentation": "An array of error messages. Each endpoint documents how/whether this field is\nused." + } + }, + "metadata": { + "target": "com.datadog.service_level_objectives#SLOListResponseMetadata" + } + }, + "traits": { + "smithy.api#documentation": "A response with one or more service level objective." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjective": { + "type": "structure", + "members": { + "created_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Creation timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "creator": { + "target": "com.datadog.service_level_objectives#Creator" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A user-defined description of the service level objective.\n\nAlways included in service level objective responses (but may be `null`).\nOptional in create/update requests.", + "com.distilled.openapi#nullable": {} + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveGroupsList", + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A unique identifier for the service level objective object.\n\nAlways included in service level objective responses." + } + }, + "modified_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Modification timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "monitor_ids": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveMonitorIdsList", + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "monitor_tags": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveMonitorTagsList", + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor-based service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the service level objective object.", + "smithy.api#required": {} + } + }, + "query": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveQuery" + }, + "sli_specification": { + "target": "com.datadog.service_level_objectives#SLOSliSpec" + }, + "tags": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveTagsList", + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "target_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target threshold such that when the service level indicator is above this\nthreshold over the given timeframe, the objective is being met." + } + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveThresholdsList", + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object.", + "smithy.api#required": {} + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOType", + "traits": { + "smithy.api#required": {} + } + }, + "warning_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The optional warning threshold such that when the service level indicator is\nbelow this value for the given threshold, but above the target threshold, the\nobjective appears in a \"warning\" state. This value must be greater than the target\nthreshold." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective object includes a service level indicator, thresholds\nfor one or more timeframes, and metadata (`name`, `description`, `tags`, etc.)." + } + }, + "com.datadog.service_level_objectives#Creator": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email of the creator." + } + }, + "handle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Handle of the creator." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the creator.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing the creator of the shared element." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveGroupsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveMonitorTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor-based service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveQuery": { + "type": "structure", + "members": { + "denominator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A Datadog metric query for total (valid) events.", + "smithy.api#required": {} + } + }, + "numerator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A Datadog metric query for good events.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A count-based (metric) SLO query. This field is superseded by `sli_specification` but is retained for backwards compatibility. Note that Datadog only allows the sum by aggregator\nto be used because this will sum up all request counts instead of averaging them, or taking the max or\nmin of all of those requests." + } + }, + "com.datadog.service_level_objectives#SLOSliSpec": { + "type": "union", + "members": { + "SLOTimeSliceSpec": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceSpec" + }, + "SLOCountSpec": { + "target": "com.datadog.service_level_objectives#SLOCountSpec" + } + }, + "traits": { + "smithy.api#documentation": "A generic SLI specification. This is used for time-slice and count-based (metric) SLOs only." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceSpec": { + "type": "structure", + "members": { + "time_slice": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceCondition", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A time-slice SLI specification." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceCondition": { + "type": "structure", + "members": { + "comparator": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceComparator", + "traits": { + "smithy.api#required": {} + } + }, + "query": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceQuery", + "traits": { + "smithy.api#required": {} + } + }, + "query_interval_seconds": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceInterval" + }, + "threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The threshold value to which each SLI value will be compared.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator,\nand 3. the threshold. Optionally, a fourth part, the query interval, can be provided." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceComparator": { + "type": "enum", + "members": { + "VALUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": ">" + } + }, + "VALUE_2": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": ">=" + } + }, + "VALUE_3": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "<" + } + }, + "VALUE_4": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "<=" + } + } + }, + "traits": { + "smithy.api#documentation": "The comparator used to compare the SLI value to the threshold." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceQuery": { + "type": "structure", + "members": { + "formulas": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceQueryFormulasList", + "traits": { + "smithy.api#documentation": "A list that contains exactly one formula, as only a single formula may be used in a time-slice SLO.", + "smithy.api#required": {} + } + }, + "queries": { + "target": "com.datadog.service_level_objectives#SLOTimeSliceQueryQueriesList", + "traits": { + "smithy.api#documentation": "A list of queries that are used to calculate the SLI value.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The queries and formula used to calculate the SLI value." + } + }, + "com.datadog.service_level_objectives#SLOFormula": { + "type": "structure", + "members": { + "formula": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The formula string, which is an expression involving named queries.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A formula that specifies how to combine the results of multiple queries." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceQueryFormulasList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOFormula" + }, + "traits": { + "smithy.api#documentation": "A list that contains exactly one formula, as only a single formula may be used in a time-slice SLO." + } + }, + "com.datadog.service_level_objectives#FormulaAndFunctionMetricQueryDefinition": { + "type": "structure", + "members": { + "aggregator": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricAggregation" + }, + "cross_org_uuids": { + "target": "com.datadog.service_level_objectives#CrossOrgUuids" + }, + "data_source": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricDataSource", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the query for use in formulas.", + "smithy.api#required": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Metrics query definition.", + "smithy.api#required": {} + } + }, + "semantic_mode": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricSemanticMode" + } + }, + "traits": { + "smithy.api#documentation": "A formula and functions metrics query." + } + }, + "com.datadog.service_level_objectives#FormulaAndFunctionMetricAggregation": { + "type": "enum", + "members": { + "AVG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "avg" + } + }, + "MIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "min" + } + }, + "MAX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "max" + } + }, + "SUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sum" + } + }, + "LAST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "last" + } + }, + "AREA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "area" + } + }, + "L2NORM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "l2norm" + } + }, + "PERCENTILE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "percentile" + } + } + }, + "traits": { + "smithy.api#documentation": "The aggregation methods available for metrics queries." + } + }, + "com.datadog.service_level_objectives#CrossOrgUuids": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The source organization UUID for cross organization queries. Feature in Private Beta." + } + }, + "com.datadog.service_level_objectives#FormulaAndFunctionMetricDataSource": { + "type": "enum", + "members": { + "METRICS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "metrics" + } + } + }, + "traits": { + "smithy.api#documentation": "Data source for metrics queries." + } + }, + "com.datadog.service_level_objectives#FormulaAndFunctionMetricSemanticMode": { + "type": "enum", + "members": { + "COMBINED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "combined" + } + }, + "NATIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "native" + } + } + }, + "traits": { + "smithy.api#documentation": "Semantic mode for metrics queries. This determines how metrics from different sources are combined or displayed." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceQueryQueriesList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricQueryDefinition" + }, + "traits": { + "smithy.api#documentation": "A list of queries that are used to calculate the SLI value." + } + }, + "com.datadog.service_level_objectives#SLOTimeSliceInterval": { + "type": "intEnum", + "members": { + "_60": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": 60 + } + }, + "_300": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": 300 + } + } + }, + "traits": { + "smithy.api#documentation": "The interval used when querying data, which defines the size of a time slice.\nTwo values are allowed: 60 (1 minute) and 300 (5 minutes).\nIf not provided, the value defaults to 300 (5 minutes)." + } + }, + "com.datadog.service_level_objectives#SLOCountSpec": { + "type": "structure", + "members": { + "count": { + "target": "com.datadog.service_level_objectives#SLOCountDefinition", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A metric SLI specification." + } + }, + "com.datadog.service_level_objectives#SLOCountDefinition": { + "type": "union", + "members": { + "SLOCountDefinitionWithTotalEventsFormula": { + "target": "com.datadog.service_level_objectives#SLOCountDefinitionWithTotalEventsFormula" + }, + "SLOCountDefinitionWithBadEventsFormula": { + "target": "com.datadog.service_level_objectives#SLOCountDefinitionWithBadEventsFormula" + } + }, + "traits": { + "smithy.api#documentation": "A count-based (metric) SLI specification, composed of three parts: the good events formula,\nthe bad or total events formula, and the underlying queries.\nExactly one of `total_events_formula` or `bad_events_formula` must be provided." + } + }, + "com.datadog.service_level_objectives#SLOCountDefinitionWithTotalEventsFormula": { + "type": "structure", + "members": { + "good_events_formula": { + "target": "com.datadog.service_level_objectives#SLOFormula", + "traits": { + "smithy.api#required": {} + } + }, + "queries": { + "target": "com.datadog.service_level_objectives#SLOCountDefinitionWithTotalEventsFormulaQueriesList", + "traits": { + "smithy.api#required": {} + } + }, + "total_events_formula": { + "target": "com.datadog.service_level_objectives#SLOFormula", + "traits": { + "smithy.api#documentation": "The total events formula. Bad events queries can be defined using the `bad_events_formula` field as an alternative. Only one of `total_events_formula` or `bad_events_formula` must be provided.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "SLO count definition using a total events formula alongside a good events formula." + } + }, + "com.datadog.service_level_objectives#SLOCountDefinitionWithTotalEventsFormulaQueriesList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricQueryDefinition" + }, + "traits": {} + }, + "com.datadog.service_level_objectives#SLOCountDefinitionWithBadEventsFormula": { + "type": "structure", + "members": { + "bad_events_formula": { + "target": "com.datadog.service_level_objectives#SLOFormula", + "traits": { + "smithy.api#documentation": "The bad events formula (recommended). Total events queries can be defined using the `total_events_formula` field as an alternative. Only one of `total_events_formula` or `bad_events_formula` must be provided.", + "smithy.api#required": {} + } + }, + "good_events_formula": { + "target": "com.datadog.service_level_objectives#SLOFormula", + "traits": { + "smithy.api#required": {} + } + }, + "queries": { + "target": "com.datadog.service_level_objectives#SLOCountDefinitionWithBadEventsFormulaQueriesList", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "SLO count definition using a bad events formula alongside a good events formula." + } + }, + "com.datadog.service_level_objectives#SLOCountDefinitionWithBadEventsFormulaQueriesList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#FormulaAndFunctionMetricQueryDefinition" + }, + "traits": {} + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "com.datadog.service_level_objectives#SLOThreshold": { + "type": "structure", + "members": { + "target": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target value for the service level indicator within the corresponding\ntimeframe.", + "smithy.api#required": {} + } + }, + "target_display": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A string representation of the target that indicates its precision.\nIt uses trailing zeros to show significant decimal places (for example `98.00`).\n\nAlways included in service level objective responses. Ignored in\ncreate/update requests." + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe", + "traits": { + "smithy.api#required": {} + } + }, + "warning": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The warning value for the service level objective." + } + }, + "warning_display": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A string representation of the warning target (see the description of\nthe `target_display` field for details).\n\nIncluded in service level objective responses if a warning target exists.\nIgnored in create/update requests." + } + } + }, + "traits": { + "smithy.api#documentation": "SLO thresholds (target and optionally warning) for a single time window." + } + }, + "com.datadog.service_level_objectives#SLOTimeframe": { + "type": "enum", + "members": { + "_7D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "7d" + } + }, + "_30D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "30d" + } + }, + "_90D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "90d" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "custom" + } + } + }, + "traits": { + "smithy.api#documentation": "The SLO time window options. Note that \"custom\" is not a valid option for creating\nor updating SLOs. It is only used when querying SLO history over custom timeframes." + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectiveThresholdsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOThreshold" + }, + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "com.datadog.service_level_objectives#SLOType": { + "type": "enum", + "members": { + "METRIC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "metric" + } + }, + "MONITOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "monitor" + } + }, + "TIME_SLICE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "time_slice" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of the service level objective." + } + }, + "com.datadog.service_level_objectives#SLOListResponseDataList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjective" + }, + "traits": { + "smithy.api#documentation": "An array of service level objective objects." + } + }, + "com.datadog.service_level_objectives#SLOListResponseErrorsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of error messages. Each endpoint documents how/whether this field is\nused." + } + }, + "com.datadog.service_level_objectives#SLOListResponseMetadata": { + "type": "structure", + "members": { + "page": { + "target": "com.datadog.service_level_objectives#SLOListResponseMetadataPage" + } + }, + "traits": { + "smithy.api#documentation": "The metadata object containing additional information about the list of SLOs." + } + }, + "com.datadog.service_level_objectives#SLOListResponseMetadataPage": { + "type": "structure", + "members": { + "total_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The total number of resources that could be retrieved ignoring the parameters and filters in the request." + } + }, + "total_filtered_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The total number of resources that match the parameters and filters in the request. This attribute can be used by a client to determine the total number of pages." + } + } + }, + "traits": { + "smithy.api#documentation": "The object containing information about the pages of the list of SLOs." + } + }, + "com.datadog.service_level_objectives#ListSLOs": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#ListSLOsRequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOListResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo", + "code": 200 + }, + "smithy.api#documentation": "Get all SLOs\n\nGet a list of service level objective objects for your organization." + } + }, + "com.datadog.service_level_objectives#CreateSLORequestGroupsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "com.datadog.service_level_objectives#CreateSLORequestMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of monitor IDs that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "com.datadog.service_level_objectives#CreateSLORequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "com.datadog.service_level_objectives#CreateSLORequestThresholdsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOThreshold" + }, + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "com.datadog.service_level_objectives#CreateSLORequest": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A user-defined description of the service level objective.\n\nAlways included in service level objective responses (but may be `null`).\nOptional in create/update requests.", + "com.distilled.openapi#nullable": {} + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#CreateSLORequestGroupsList", + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "monitor_ids": { + "target": "com.datadog.service_level_objectives#CreateSLORequestMonitorIdsList", + "traits": { + "smithy.api#documentation": "A list of monitor IDs that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the service level objective object.", + "smithy.api#required": {} + } + }, + "query": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveQuery" + }, + "sli_specification": { + "target": "com.datadog.service_level_objectives#SLOSliSpec" + }, + "tags": { + "target": "com.datadog.service_level_objectives#CreateSLORequestTagsList", + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "target_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target threshold such that when the service level indicator is above this\nthreshold over the given timeframe, the objective is being met." + } + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#CreateSLORequestThresholdsList", + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object.", + "smithy.api#required": {} + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOType", + "traits": { + "smithy.api#required": {} + } + }, + "warning_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The optional warning threshold such that when the service level indicator is\nbelow this value for the given threshold, but above the target threshold, the\nobjective appears in a \"warning\" state. This value must be greater than the target\nthreshold." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#CreateSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#CreateSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOListResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/slo", + "code": 200 + }, + "smithy.api#documentation": "Create an SLO object\n\nCreate a service level objective object." + } + }, + "com.datadog.service_level_objectives#SLOBulkDelete": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteValueList" + }, + "traits": { + "smithy.api#documentation": "A map of service level objective object IDs to arrays of timeframes,\nwhich indicate the thresholds to delete for each ID." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteValueList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + }, + "traits": { + "smithy.api#documentation": "An array of all SLO timeframes." + } + }, + "com.datadog.service_level_objectives#DeleteSLOTimeframeInBulkRequest": { + "type": "structure", + "members": { + "body": { + "target": "com.datadog.service_level_objectives#SLOBulkDelete", + "traits": { + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteResponseData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteResponseErrorsList", + "traits": { + "smithy.api#documentation": "Array of errors object returned." + } + } + }, + "traits": { + "smithy.api#documentation": "The bulk partial delete service level objective object endpoint\nresponse.\n\nThis endpoint operates on multiple service level objective objects, so\nit may be partially successful. In such cases, the \"data\" and \"error\"\nfields in this response indicate which deletions succeeded and failed." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteResponseData": { + "type": "structure", + "members": { + "deleted": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteResponseDataDeletedList", + "traits": { + "smithy.api#documentation": "An array of service level objective object IDs that indicates\nwhich objects that were completely deleted." + } + }, + "updated": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteResponseDataUpdatedList", + "traits": { + "smithy.api#documentation": "An array of service level objective object IDs that indicates\nwhich objects that were modified (objects for which at least one\nthreshold was deleted, but that were not completely deleted)." + } + } + }, + "traits": { + "smithy.api#documentation": "An array of service level objective objects." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteResponseDataDeletedList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of service level objective object IDs that indicates\nwhich objects that were completely deleted." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteResponseDataUpdatedList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of service level objective object IDs that indicates\nwhich objects that were modified (objects for which at least one\nthreshold was deleted, but that were not completely deleted)." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteError": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The ID of the service level objective object associated with\nthis error.", + "smithy.api#required": {} + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The error message.", + "smithy.api#required": {} + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOErrorTimeframe", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Object describing the error." + } + }, + "com.datadog.service_level_objectives#SLOErrorTimeframe": { + "type": "enum", + "members": { + "_7D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "7d" + } + }, + "_30D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "30d" + } + }, + "_90D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "90d" + } + }, + "ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "all" + } + } + }, + "traits": { + "smithy.api#documentation": "The timeframe of the threshold associated with this error\nor \"all\" if all thresholds are affected." + } + }, + "com.datadog.service_level_objectives#SLOBulkDeleteResponseErrorsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteError" + }, + "traits": { + "smithy.api#documentation": "Array of errors object returned." + } + }, + "com.datadog.service_level_objectives#DeleteSLOTimeframeInBulk": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#DeleteSLOTimeframeInBulkRequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOBulkDeleteResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/slo/bulk_delete", + "code": 200 + }, + "smithy.api#documentation": "Bulk Delete SLO Timeframes\n\nDelete (or partially delete) multiple service level objective objects.\n\nThis endpoint facilitates deletion of one or more thresholds for one or more\nservice level objective objects. If all thresholds are deleted, the service level\nobjective object is deleted as well." + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLORequest": { + "type": "structure", + "members": { + "ids": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "ids", + "smithy.api#required": {}, + "smithy.api#documentation": "A comma separated list of the IDs of the service level objectives objects." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLOResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseErrorsMap", + "traits": { + "smithy.api#documentation": "A mapping of SLO id to it's current usages." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective response containing the requested object." + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseData": { + "type": "structure", + "members": { + "ok": { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseDataOkList", + "traits": { + "smithy.api#documentation": "An array of SLO IDs that can be safely deleted." + } + } + }, + "traits": { + "smithy.api#documentation": "An array of service level objective objects." + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseDataOkList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of SLO IDs that can be safely deleted." + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLOResponseErrorsMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A mapping of SLO id to it's current usages." + } + }, + "com.datadog.service_level_objectives#CheckCanDeleteSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLOResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo/can_delete", + "code": 200 + }, + "smithy.api#documentation": "Check if SLOs can be safely deleted\n\nCheck if an SLO can be safely deleted. For example,\nassure an SLO can be deleted without disrupting a dashboard." + } + }, + "com.datadog.service_level_objectives#SearchSLORequest": { + "type": "structure", + "members": { + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "query", + "smithy.api#documentation": "The query string to filter results based on SLO names.\nSome examples of queries include `service:`\nand ``." + } + }, + "page_size_": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page[size]", + "smithy.api#documentation": "The number of files to return in the response `[default=10]`." + } + }, + "page_number_": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "page[number]", + "smithy.api#documentation": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`." + } + }, + "include_facets": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "include_facets", + "smithy.api#documentation": "Whether or not to return facet information in the response `[default=false]`." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SearchSLOResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseData" + }, + "links": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseLinks" + }, + "meta": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseMeta" + } + }, + "traits": { + "smithy.api#documentation": "A search SLO response containing results from the search query." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseData": { + "type": "structure", + "members": { + "attributes": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributes" + }, + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Type of service level objective result." + } + } + }, + "traits": { + "smithy.api#documentation": "Data from search SLO response." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributes": { + "type": "structure", + "members": { + "facets": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacets" + }, + "slos": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesSlosList", + "traits": { + "smithy.api#documentation": "SLOs" + } + } + }, + "traits": { + "smithy.api#documentation": "Attributes" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacets": { + "type": "structure", + "members": { + "all_tags": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsAllTagsList", + "traits": { + "smithy.api#documentation": "All tags associated with an SLO." + } + }, + "creator_name": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsCreatorNameList", + "traits": { + "smithy.api#documentation": "Creator of an SLO." + } + }, + "env_tags": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsEnvTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `env` tag key." + } + }, + "service_tags": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsServiceTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `service` tag key." + } + }, + "slo_type": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsSloTypeList", + "traits": { + "smithy.api#documentation": "Type of SLO." + } + }, + "target": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTargetList", + "traits": { + "smithy.api#documentation": "SLO Target" + } + }, + "team_tags": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTeamTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `team` tag key." + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTimeframeList", + "traits": { + "smithy.api#documentation": "Timeframes of SLOs." + } + } + }, + "traits": { + "smithy.api#documentation": "Facets" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString": { + "type": "structure", + "members": { + "count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Count" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Facet" + } + } + }, + "traits": { + "smithy.api#documentation": "Facet" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsAllTagsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "All tags associated with an SLO." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsCreatorNameList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "Creator of an SLO." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsEnvTagsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "Tags with the `env` tag key." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsServiceTagsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "Tags with the `service` tag key." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectInt": { + "type": "structure", + "members": { + "count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Count" + } + }, + "name": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Facet" + } + } + }, + "traits": { + "smithy.api#documentation": "Facet" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsSloTypeList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectInt" + }, + "traits": { + "smithy.api#documentation": "Type of SLO." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTargetList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectInt" + }, + "traits": { + "smithy.api#documentation": "SLO Target" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTeamTagsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "Tags with the `team` tag key." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsTimeframeList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesFacetsObjectString" + }, + "traits": { + "smithy.api#documentation": "Timeframes of SLOs." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjective": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveData" + } + }, + "traits": { + "smithy.api#documentation": "A service level objective data container." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveData": { + "type": "structure", + "members": { + "attributes": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributes" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A unique identifier for the service level objective object.\n\nAlways included in service level objective responses." + } + }, + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The type of the object, must be `slo`." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective ID and attributes." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributes": { + "type": "structure", + "members": { + "all_tags": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesAllTagsList", + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty)." + } + }, + "created_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Creation timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "creator": { + "target": "com.datadog.service_level_objectives#SLOCreator", + "traits": { + "com.distilled.openapi#nullable": {} + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A user-defined description of the service level objective.\n\nAlways included in service level objective responses (but may be `null`).\nOptional in create/update requests.", + "com.distilled.openapi#nullable": {} + } + }, + "env_tags": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesEnvTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `env` tag key." + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesGroupsList", + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\nIncluded in service level objective responses if it is not empty.", + "com.distilled.openapi#nullable": {} + } + }, + "modified_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Modification timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "monitor_ids": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesMonitorIdsList", + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective.", + "com.distilled.openapi#nullable": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the service level objective object." + } + }, + "overall_status": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesOverallStatusList", + "traits": { + "smithy.api#documentation": "calculated status and error budget remaining." + } + }, + "query": { + "target": "com.datadog.service_level_objectives#SearchSLOQuery", + "traits": { + "com.distilled.openapi#nullable": {} + } + }, + "service_tags": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesServiceTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `service` tag key." + } + }, + "slo_type": { + "target": "com.datadog.service_level_objectives#SLOType" + }, + "status": { + "target": "com.datadog.service_level_objectives#SLOStatus" + }, + "team_tags": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesTeamTagsList", + "traits": { + "smithy.api#documentation": "Tags with the `team` tag key." + } + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesThresholdsList", + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective object includes a service level indicator, thresholds\nfor one or more timeframes, and metadata (`name`, `description`, and `tags`)." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesAllTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty)." + } + }, + "com.datadog.service_level_objectives#SLOCreator": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email of the creator." + } + }, + "id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "User ID of the creator." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the creator.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The creator of the SLO" + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesEnvTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags with the `env` tag key." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesGroupsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\nIncluded in service level objective responses if it is not empty." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective." + } + }, + "com.datadog.service_level_objectives#SLOOverallStatuses": { + "type": "structure", + "members": { + "error": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Error message if SLO status or error budget could not be calculated.", + "com.distilled.openapi#nullable": {} + } + }, + "error_budget_remaining": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Remaining error budget of the SLO in percentage.", + "com.distilled.openapi#nullable": {} + } + }, + "indexed_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "timestamp (UNIX time in seconds) of when the SLO status and error budget\nwere calculated." + } + }, + "raw_error_budget_remaining": { + "target": "com.datadog.service_level_objectives#SLORawErrorBudgetRemaining", + "traits": { + "com.distilled.openapi#nullable": {} + } + }, + "span_precision": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The amount of decimal places the SLI value is accurate to.", + "com.distilled.openapi#nullable": {} + } + }, + "state": { + "target": "com.datadog.service_level_objectives#SLOState" + }, + "status": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The status of the SLO.", + "com.distilled.openapi#nullable": {} + } + }, + "target": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target of the SLO." + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + } + }, + "traits": { + "smithy.api#documentation": "Overall status of the SLO by timeframes." + } + }, + "com.datadog.service_level_objectives#SLORawErrorBudgetRemaining": { + "type": "structure", + "members": { + "unit": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Error budget remaining unit." + } + }, + "value": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Error budget remaining value." + } + } + }, + "traits": { + "smithy.api#documentation": "Error budget remaining for an SLO." + } + }, + "com.datadog.service_level_objectives#SLOState": { + "type": "enum", + "members": { + "BREACHED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "breached" + } + }, + "WARNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "warning" + } + }, + "OK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ok" + } + }, + "NO_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "no_data" + } + } + }, + "traits": { + "smithy.api#documentation": "State of the SLO." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesOverallStatusList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOOverallStatuses" + }, + "traits": { + "smithy.api#documentation": "calculated status and error budget remaining." + } + }, + "com.datadog.service_level_objectives#SearchSLOQuery": { + "type": "structure", + "members": { + "denominator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A Datadog metric query for total (valid) events." + } + }, + "metrics": { + "target": "com.datadog.service_level_objectives#SearchSLOQueryMetricsList", + "traits": { + "smithy.api#documentation": "Metric names used in the query's numerator and denominator.\nThis field will return null and will be implemented in the next version of this endpoint.", + "com.distilled.openapi#nullable": {} + } + }, + "numerator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A Datadog metric query for good events." + } + } + }, + "traits": { + "smithy.api#documentation": "A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator\nto be used because this will sum up all request counts instead of averaging them, or taking the max or\nmin of all of those requests." + } + }, + "com.datadog.service_level_objectives#SearchSLOQueryMetricsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Metric names used in the query's numerator and denominator.\nThis field will return null and will be implemented in the next version of this endpoint." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesServiceTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags with the `service` tag key." + } + }, + "com.datadog.service_level_objectives#SLOStatus": { + "type": "structure", + "members": { + "calculation_error": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Error message if SLO status or error budget could not be calculated.", + "com.distilled.openapi#nullable": {} + } + }, + "error_budget_remaining": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Remaining error budget of the SLO in percentage.", + "com.distilled.openapi#nullable": {} + } + }, + "indexed_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "timestamp (UNIX time in seconds) of when the SLO status and error budget\nwere calculated." + } + }, + "raw_error_budget_remaining": { + "target": "com.datadog.service_level_objectives#SLORawErrorBudgetRemaining", + "traits": { + "com.distilled.openapi#nullable": {} + } + }, + "sli": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The current service level indicator (SLI) of the SLO, also known as 'status'. This is a percentage value from 0-100 (inclusive).", + "com.distilled.openapi#nullable": {} + } + }, + "span_precision": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of decimal places the SLI value is accurate to.", + "com.distilled.openapi#nullable": {} + } + }, + "state": { + "target": "com.datadog.service_level_objectives#SLOState" + } + }, + "traits": { + "smithy.api#documentation": "Status of the SLO's primary timeframe." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesTeamTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Tags with the `team` tag key." + } + }, + "com.datadog.service_level_objectives#SearchSLOThreshold": { + "type": "structure", + "members": { + "target": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target value for the service level indicator within the corresponding\ntimeframe.", + "smithy.api#required": {} + } + }, + "target_display": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A string representation of the target that indicates its precision.\nIt uses trailing zeros to show significant decimal places (for example `98.00`).\n\nAlways included in service level objective responses. Ignored in\ncreate/update requests." + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SearchSLOTimeframe", + "traits": { + "smithy.api#required": {} + } + }, + "warning": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The warning value for the service level objective.", + "com.distilled.openapi#nullable": {} + } + }, + "warning_display": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A string representation of the warning target (see the description of\nthe `target_display` field for details).\n\nIncluded in service level objective responses if a warning target exists.\nIgnored in create/update requests.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "SLO thresholds (target and optionally warning) for a single time window." + } + }, + "com.datadog.service_level_objectives#SearchSLOTimeframe": { + "type": "enum", + "members": { + "_7D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "7d" + } + }, + "_30D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "30d" + } + }, + "_90D": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "90d" + } + } + }, + "traits": { + "smithy.api#documentation": "The SLO time window options." + } + }, + "com.datadog.service_level_objectives#SearchServiceLevelObjectiveAttributesThresholdsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchSLOThreshold" + }, + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseDataAttributesSlosList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SearchServiceLevelObjective" + }, + "traits": { + "smithy.api#documentation": "SLOs" + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseLinks": { + "type": "structure", + "members": { + "first": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Link to last page." + } + }, + "last": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Link to first page.", + "com.distilled.openapi#nullable": {} + } + }, + "next": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Link to the next page." + } + }, + "prev": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Link to previous page.", + "com.distilled.openapi#nullable": {} + } + }, + "self": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Link to current page." + } + } + }, + "traits": { + "smithy.api#documentation": "Pagination links." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseMeta": { + "type": "structure", + "members": { + "pagination": { + "target": "com.datadog.service_level_objectives#SearchSLOResponseMetaPage" + } + }, + "traits": { + "smithy.api#documentation": "Searches metadata returned by the API." + } + }, + "com.datadog.service_level_objectives#SearchSLOResponseMetaPage": { + "type": "structure", + "members": { + "first_number": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The first number." + } + }, + "last_number": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The last number." + } + }, + "next_number": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The next number." + } + }, + "number": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The page number." + } + }, + "prev_number": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The previous page number." + } + }, + "size": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The size of the response." + } + }, + "total": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The total number of SLOs in the response." + } + }, + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Type of pagination." + } + } + }, + "traits": { + "smithy.api#documentation": "Pagination metadata returned by the API." + } + }, + "com.datadog.service_level_objectives#SearchSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#SearchSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SearchSLOResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo/search", + "code": 200 + }, + "smithy.api#documentation": "Search for SLOs\n\nGet a list of service level objective objects for your organization." + } + }, + "com.datadog.service_level_objectives#GetSLORequest": { + "type": "structure", + "members": { + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the service level objective object." + } + }, + "with_configured_alert_ids": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "with_configured_alert_ids", + "smithy.api#documentation": "Get the IDs of SLO monitors that reference this SLO." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLOResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLOResponseData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOResponseErrorsList", + "traits": { + "smithy.api#documentation": "An array of error messages. Each endpoint documents how/whether this field is\nused." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective response containing a single service level objective." + } + }, + "com.datadog.service_level_objectives#SLOResponseData": { + "type": "structure", + "members": { + "configured_alert_ids": { + "target": "com.datadog.service_level_objectives#SLOResponseDataConfiguredAlertIdsList", + "traits": { + "smithy.api#documentation": "A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query." + } + }, + "created_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Creation timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "creator": { + "target": "com.datadog.service_level_objectives#Creator" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A user-defined description of the service level objective.\n\nAlways included in service level objective responses (but may be `null`).\nOptional in create/update requests.", + "com.distilled.openapi#nullable": {} + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#SLOResponseDataGroupsList", + "traits": { + "smithy.api#documentation": "A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A unique identifier for the service level objective object.\n\nAlways included in service level objective responses." + } + }, + "modified_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Modification timestamp (UNIX time in seconds)\n\nAlways included in service level objective responses." + } + }, + "monitor_ids": { + "target": "com.datadog.service_level_objectives#SLOResponseDataMonitorIdsList", + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "monitor_tags": { + "target": "com.datadog.service_level_objectives#SLOResponseDataMonitorTagsList", + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the service level objective object." + } + }, + "query": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveQuery", + "traits": { + "smithy.api#documentation": "The metric query used to define a count-based SLO as the ratio of good events to total events." + } + }, + "sli_specification": { + "target": "com.datadog.service_level_objectives#SLOSliSpec", + "traits": { + "smithy.api#documentation": "A generic SLI specification. This is currently used for time-slice and count-based (metric) SLOs only." + } + }, + "tags": { + "target": "com.datadog.service_level_objectives#SLOResponseDataTagsList", + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "target_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target threshold such that when the service level indicator is above this\nthreshold over the given timeframe, the objective is being met." + } + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#SLOResponseDataThresholdsList", + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOType" + }, + "warning_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The optional warning threshold such that when the service level indicator is\nbelow this value for the given threshold, but above the target threshold, the\nobjective appears in a \"warning\" state. This value must be greater than the target\nthreshold." + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective object includes a service level indicator, thresholds\nfor one or more timeframes, and metadata (`name`, `description`, `tags`, etc.)." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataConfiguredAlertIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataGroupsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataMonitorTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "com.datadog.service_level_objectives#SLOResponseDataThresholdsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOThreshold" + }, + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "com.datadog.service_level_objectives#SLOResponseErrorsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array of error messages. Each endpoint documents how/whether this field is\nused." + } + }, + "com.datadog.service_level_objectives#GetSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#GetSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo/{slo_id}", + "code": 200 + }, + "smithy.api#documentation": "Get an SLO's details\n\nGet a service level objective object." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequestGroupsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequestMonitorIdsList": { + "type": "list", + "member": { + "target": "smithy.api#Integer" + }, + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequestMonitorTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor-based service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequestThresholdsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOThreshold" + }, + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object." + } + }, + "com.datadog.service_level_objectives#UpdateSLORequest": { + "type": "structure", + "members": { + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the service level objective object." + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A user-defined description of the service level objective.\n\nAlways included in service level objective responses (but may be `null`).\nOptional in create/update requests.", + "com.distilled.openapi#nullable": {} + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#UpdateSLORequestGroupsList", + "traits": { + "smithy.api#documentation": "A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective.\n\nIncluded in service level objective responses if it is not empty. Optional in\ncreate/update requests for monitor service level objectives, but may only be\nused when then length of the `monitor_ids` field is one." + } + }, + "monitor_ids": { + "target": "com.datadog.service_level_objectives#UpdateSLORequestMonitorIdsList", + "traits": { + "smithy.api#documentation": "A list of monitor ids that defines the scope of a monitor service level\nobjective. **Required if type is `monitor`**." + } + }, + "monitor_tags": { + "target": "com.datadog.service_level_objectives#UpdateSLORequestMonitorTagsList", + "traits": { + "smithy.api#documentation": "The union of monitor tags for all monitors referenced by the `monitor_ids`\nfield.\nAlways included in service level objective responses for monitor-based service level\nobjectives (but may be empty). Ignored in create/update requests. Does not\naffect which monitors are included in the service level objective (that is\ndetermined entirely by the `monitor_ids` field)." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the service level objective object.", + "smithy.api#required": {} + } + }, + "query": { + "target": "com.datadog.service_level_objectives#ServiceLevelObjectiveQuery" + }, + "sli_specification": { + "target": "com.datadog.service_level_objectives#SLOSliSpec" + }, + "tags": { + "target": "com.datadog.service_level_objectives#UpdateSLORequestTagsList", + "traits": { + "smithy.api#documentation": "A list of tags associated with this service level objective.\nAlways included in service level objective responses (but may be empty).\nOptional in create/update requests." + } + }, + "target_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The target threshold such that when the service level indicator is above this\nthreshold over the given timeframe, the objective is being met." + } + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#UpdateSLORequestThresholdsList", + "traits": { + "smithy.api#documentation": "The thresholds (timeframes and associated targets) for this service level\nobjective object.", + "smithy.api#required": {} + } + }, + "timeframe": { + "target": "com.datadog.service_level_objectives#SLOTimeframe" + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOType", + "traits": { + "smithy.api#required": {} + } + }, + "warning_threshold": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The optional warning threshold such that when the service level indicator is\nbelow this value for the given threshold, but above the target threshold, the\nobjective appears in a \"warning\" state. This value must be greater than the target\nthreshold." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#UpdateSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#UpdateSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOListResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "PUT", + "uri": "/api/v1/slo/{slo_id}", + "code": 200 + }, + "smithy.api#documentation": "Update an SLO\n\nUpdate the specified service level objective object." + } + }, + "com.datadog.service_level_objectives#DeleteSLORequest": { + "type": "structure", + "members": { + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the service level objective." + } + }, + "force": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "force", + "smithy.api#documentation": "Delete the monitor even if it's referenced by other resources (for example SLO, composite monitor)." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLODeleteResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLODeleteResponseDataList", + "traits": { + "smithy.api#documentation": "An array containing the ID of the deleted service level objective object." + } + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLODeleteResponseErrorsMap", + "traits": { + "smithy.api#documentation": "An dictionary containing the ID of the SLO as key and a deletion error as value." + } + } + }, + "traits": { + "smithy.api#documentation": "A response list of all service level objective deleted." + } + }, + "com.datadog.service_level_objectives#SLODeleteResponseDataList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An array containing the ID of the deleted service level objective object." + } + }, + "com.datadog.service_level_objectives#SLODeleteResponseErrorsMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "An dictionary containing the ID of the SLO as key and a deletion error as value." + } + }, + "com.datadog.service_level_objectives#DeleteSLO": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#DeleteSLORequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLODeleteResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + }, + { + "target": "com.datadog.service_level_objectives#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/api/v1/slo/{slo_id}", + "code": 200 + }, + "smithy.api#documentation": "Delete an SLO\n\nPermanently delete the specified service level objective object.\n\nIf an SLO is used in a dashboard, the `DELETE /v1/slo/` endpoint returns\na 409 conflict error because the SLO is referenced in a dashboard." + } + }, + "com.datadog.service_level_objectives#GetSLOCorrectionsRequest": { + "type": "structure", + "members": { + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the service level objective object." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLOCorrectionListResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLOCorrectionListResponseDataList", + "traits": { + "smithy.api#documentation": "The list of SLO corrections objects." + } + }, + "meta": { + "target": "com.datadog.service_level_objectives#ResponseMetaAttributes" + } + }, + "traits": { + "smithy.api#documentation": "A list of SLO correction objects." + } + }, + "com.datadog.service_level_objectives#SLOCorrection": { + "type": "structure", + "members": { + "attributes": { + "target": "com.datadog.service_level_objectives#SLOCorrectionResponseAttributes" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The ID of the SLO correction." + } + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOCorrectionType" + } + }, + "traits": { + "smithy.api#documentation": "The response object of a list of SLO corrections." + } + }, + "com.datadog.service_level_objectives#SLOCorrectionResponseAttributes": { + "type": "structure", + "members": { + "category": { + "target": "com.datadog.service_level_objectives#SLOCorrectionCategory" + }, + "created_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The epoch timestamp of when the correction was created at.", + "com.distilled.openapi#nullable": {} + } + }, + "creator": { + "target": "com.datadog.service_level_objectives#Creator" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Description of the correction being made." + } + }, + "duration": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Length of time (in seconds) for a specified `rrule` recurring SLO correction.", + "com.distilled.openapi#nullable": {} + } + }, + "end": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Ending time of the correction in epoch seconds.", + "com.distilled.openapi#nullable": {} + } + }, + "modified_at": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The epoch timestamp of when the correction was modified at.", + "com.distilled.openapi#nullable": {} + } + }, + "modifier": { + "target": "com.datadog.service_level_objectives#SLOCorrectionResponseAttributesModifier", + "traits": { + "com.distilled.openapi#nullable": {} + } + }, + "rrule": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections\nare `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.", + "com.distilled.openapi#nullable": {} + } + }, + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ID of the single SLO that this correction applies to.", + "com.distilled.openapi#nullable": {} + } + }, + "slo_query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query that matches the SLOs this correction applies to.", + "com.distilled.openapi#nullable": {} + } + }, + "start": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Starting time of the correction in epoch seconds." + } + }, + "timezone": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The timezone to display in the UI for the correction times (defaults to \"UTC\")." + } + } + }, + "traits": { + "smithy.api#documentation": "The attribute object associated with the SLO correction." + } + }, + "com.datadog.service_level_objectives#SLOCorrectionCategory": { + "type": "enum", + "members": { + "SCHEDULED_MAINTENANCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Scheduled Maintenance" + } + }, + "OUTSIDE_BUSINESS_HOURS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Outside Business Hours" + } + }, + "DEPLOYMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Deployment" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Other" + } + } + }, + "traits": { + "smithy.api#documentation": "Category the SLO correction belongs to." + } + }, + "com.datadog.service_level_objectives#SLOCorrectionResponseAttributesModifier": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email of the Modifier." + } + }, + "handle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Handle of the Modifier." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the Modifier." + } + } + }, + "traits": { + "smithy.api#documentation": "Modifier of the object." + } + }, + "com.datadog.service_level_objectives#SLOCorrectionType": { + "type": "enum", + "members": { + "CORRECTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "correction" + } + } + }, + "traits": { + "smithy.api#documentation": "SLO correction resource type." + } + }, + "com.datadog.service_level_objectives#SLOCorrectionListResponseDataList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOCorrection" + }, + "traits": { + "smithy.api#documentation": "The list of SLO corrections objects." + } + }, + "com.datadog.service_level_objectives#ResponseMetaAttributes": { + "type": "structure", + "members": { + "page": { + "target": "com.datadog.service_level_objectives#Pagination" + } + }, + "traits": { + "smithy.api#documentation": "Object describing meta attributes of response." + } + }, + "com.datadog.service_level_objectives#Pagination": { + "type": "structure", + "members": { + "total_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Total count." + } + }, + "total_filtered_count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Total count of elements matched by the filter." + } + } + }, + "traits": { + "smithy.api#documentation": "Pagination object." + } + }, + "com.datadog.service_level_objectives#GetSLOCorrections": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#GetSLOCorrectionsRequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOCorrectionListResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo/{slo_id}/corrections", + "code": 200 + }, + "smithy.api#documentation": "Get Corrections For an SLO\n\nGet corrections applied to an SLO" + } + }, + "com.datadog.service_level_objectives#GetSLOHistoryRequest": { + "type": "structure", + "members": { + "slo_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The ID of the service level objective object." + } + }, + "from_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "from_ts", + "smithy.api#required": {}, + "smithy.api#documentation": "The `from` timestamp for the query window in epoch seconds." + } + }, + "to_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "to_ts", + "smithy.api#required": {}, + "smithy.api#documentation": "The `to` timestamp for the query window in epoch seconds." + } + }, + "target": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#httpQuery": "target", + "smithy.api#documentation": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`." + } + }, + "apply_correction": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "apply_correction", + "smithy.api#documentation": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponse": { + "type": "structure", + "members": { + "data": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseErrorsList", + "traits": { + "smithy.api#documentation": "A list of errors while querying the history data for the service level objective.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A service level objective history response." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseData": { + "type": "structure", + "members": { + "from_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The `from` timestamp in epoch seconds." + } + }, + "group_by": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseDataGroupByList", + "traits": { + "smithy.api#documentation": "For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters.\n\nThis is not included in responses for `monitor` based SLOs." + } + }, + "groups": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseDataGroupsList", + "traits": { + "smithy.api#documentation": "For grouped SLOs, this represents SLI data for specific groups.\n\nThis is not included in the responses for `metric` based SLOs." + } + }, + "monitors": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseDataMonitorsList", + "traits": { + "smithy.api#documentation": "For multi-monitor SLOs, this represents SLI data for specific monitors.\n\nThis is not included in the responses for `metric` based SLOs." + } + }, + "overall": { + "target": "com.datadog.service_level_objectives#SLOHistorySLIData" + }, + "series": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetrics" + }, + "thresholds": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseDataThresholdsMap", + "traits": { + "smithy.api#documentation": "mapping of string timeframe to the SLO threshold." + } + }, + "to_ts": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The `to` timestamp in epoch seconds." + } + }, + "type": { + "target": "com.datadog.service_level_objectives#SLOType" + }, + "type_id": { + "target": "com.datadog.service_level_objectives#SLOTypeNumeric" + } + }, + "traits": { + "smithy.api#documentation": "An array of service level objective objects." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseDataGroupByList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters.\n\nThis is not included in responses for `monitor` based SLOs." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMonitor": { + "type": "structure", + "members": { + "error_budget_remaining": { + "target": "com.datadog.service_level_objectives#SLOErrorBudgetRemainingData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOHistoryMonitorErrorsList", + "traits": { + "smithy.api#documentation": "An array of error objects returned while querying the history data for the service level objective." + } + }, + "group": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For groups in a grouped SLO, this is the group name." + } + }, + "history": { + "target": "com.datadog.service_level_objectives#SLOHistoryMonitorHistoryList", + "traits": { + "smithy.api#documentation": "The state transition history for the monitor. It is represented as\nan array of pairs. Each pair is an array containing the timestamp of the transition\nas an integer in Unix epoch format in the first element, and the state as an integer in the\nsecond element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data.\nPeriods of no data are counted either as uptime or downtime depending on monitor settings.\nSee [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data)\nfor detailed information." + } + }, + "monitor_modified": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor." + } + }, + "monitor_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, this describes the type of monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name." + } + }, + "precision": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. Use `span_precision` instead." + } + }, + "preview": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime\ncalculation." + } + }, + "sli_value": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The current SLI value of the SLO over the history window.", + "com.distilled.openapi#nullable": {} + } + }, + "span_precision": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp." + } + }, + "uptime": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Use `sli_value` instead." + } + } + }, + "traits": { + "smithy.api#documentation": "An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value.\nThis can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs." + } + }, + "com.datadog.service_level_objectives#SLOErrorBudgetRemainingData": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "A mapping of threshold `timeframe` to the remaining error budget." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseErrorWithType": { + "type": "structure", + "members": { + "error_message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message with more details about the error.", + "smithy.api#required": {} + } + }, + "error_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Type of the error.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An object describing the error with error type and error message." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMonitorErrorsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseErrorWithType" + }, + "traits": { + "smithy.api#documentation": "An array of error objects returned while querying the history data for the service level objective." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMonitorHistoryItemList": { + "type": "list", + "member": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "Represents an array timeseries data." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMonitorHistoryList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryMonitorHistoryItemList" + }, + "traits": { + "smithy.api#documentation": "The state transition history for the monitor. It is represented as\nan array of pairs. Each pair is an array containing the timestamp of the transition\nas an integer in Unix epoch format in the first element, and the state as an integer in the\nsecond element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data.\nPeriods of no data are counted either as uptime or downtime depending on monitor settings.\nSee [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data)\nfor detailed information." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseDataGroupsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryMonitor" + }, + "traits": { + "smithy.api#documentation": "For grouped SLOs, this represents SLI data for specific groups.\n\nThis is not included in the responses for `metric` based SLOs." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseDataMonitorsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryMonitor" + }, + "traits": { + "smithy.api#documentation": "For multi-monitor SLOs, this represents SLI data for specific monitors.\n\nThis is not included in the responses for `metric` based SLOs." + } + }, + "com.datadog.service_level_objectives#SLOHistorySLIData": { + "type": "structure", + "members": { + "error_budget_remaining": { + "target": "com.datadog.service_level_objectives#SLOErrorBudgetRemainingData" + }, + "errors": { + "target": "com.datadog.service_level_objectives#SLOHistorySLIDataErrorsList", + "traits": { + "smithy.api#documentation": "An array of error objects returned while querying the history data for the service level objective." + } + }, + "group": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For groups in a grouped SLO, this is the group name." + } + }, + "history": { + "target": "com.datadog.service_level_objectives#SLOHistorySLIDataHistoryList", + "traits": { + "smithy.api#documentation": "The state transition history for `monitor` or `time-slice` SLOs. It is represented as\nan array of pairs. Each pair is an array containing the timestamp of the transition\nas an integer in Unix epoch format in the first element, and the state as an integer in the\nsecond element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data.\nPeriods of no data count as uptime in time-slice SLOs, while for monitor SLOs, no data is counted\neither as uptime or downtime depending on monitor settings. See\n[SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data)\nfor detailed information." + } + }, + "monitor_modified": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor." + } + }, + "monitor_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, this describes the type of monitor." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name." + } + }, + "precision": { + "target": "com.datadog.service_level_objectives#SLOHistorySLIDataPrecisionMap", + "traits": { + "smithy.api#documentation": "A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp." + } + }, + "preview": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime\ncalculation." + } + }, + "sli_value": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The current SLI value of the SLO over the history window.", + "com.distilled.openapi#nullable": {} + } + }, + "span_precision": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp." + } + }, + "uptime": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Use `sli_value` instead.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value.\nThis can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs." + } + }, + "com.datadog.service_level_objectives#SLOHistorySLIDataErrorsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseErrorWithType" + }, + "traits": { + "smithy.api#documentation": "An array of error objects returned while querying the history data for the service level objective." + } + }, + "com.datadog.service_level_objectives#SLOHistorySLIDataHistoryItemList": { + "type": "list", + "member": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "Represents an array timeseries data." + } + }, + "com.datadog.service_level_objectives#SLOHistorySLIDataHistoryList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistorySLIDataHistoryItemList" + }, + "traits": { + "smithy.api#documentation": "The state transition history for `monitor` or `time-slice` SLOs. It is represented as\nan array of pairs. Each pair is an array containing the timestamp of the transition\nas an integer in Unix epoch format in the first element, and the state as an integer in the\nsecond element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data.\nPeriods of no data count as uptime in time-slice SLOs, while for monitor SLOs, no data is counted\neither as uptime or downtime depending on monitor settings. See\n[SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data)\nfor detailed information." + } + }, + "com.datadog.service_level_objectives#SLOHistorySLIDataPrecisionMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetrics": { + "type": "structure", + "members": { + "denominator": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeries", + "traits": { + "smithy.api#required": {} + } + }, + "interval": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The aggregated query interval for the series data. It's implicit based on the query time window.", + "smithy.api#required": {} + } + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Optional message if there are specific query issues/warnings." + } + }, + "numerator": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeries", + "traits": { + "smithy.api#required": {} + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The combined numerator and denominator query CSV.", + "smithy.api#required": {} + } + }, + "res_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The series result type. This mimics `batch_query` response type.", + "smithy.api#required": {} + } + }, + "resp_version": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The series response version type. This mimics `batch_query` response type.", + "smithy.api#required": {} + } + }, + "times": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsTimesList", + "traits": { + "smithy.api#documentation": "An array of query timestamps in EPOCH milliseconds.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A `metric` based SLO history response.\n\nThis is not included in responses for `monitor` based SLOs." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsSeries": { + "type": "structure", + "members": { + "count": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Count of submitted metrics.", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadata" + }, + "sum": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Total sum of the query.", + "smithy.api#required": {} + } + }, + "values": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesValuesList", + "traits": { + "smithy.api#documentation": "The query values for each metric.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A representation of `metric` based SLO timeseries for the provided queries.\nThis is the same response type from `batch_query` endpoint." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadata": { + "type": "structure", + "members": { + "aggr": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query aggregator function." + } + }, + "expression": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query expression." + } + }, + "metric": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query metric used." + } + }, + "query_index": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Query index from original combined query." + } + }, + "scope": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Query scope." + } + }, + "unit": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadataUnitList", + "traits": { + "smithy.api#documentation": "An array of metric units that contains up to two unit objects.\nFor example, bytes represents one unit object and bytes per second represents two unit objects.\nIf a metric query only has one unit object, the second array element is null.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Query metadata." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadataUnit": { + "type": "structure", + "members": { + "family": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The family of metric unit, for example `bytes` is the family for `kibibyte`, `byte`, and `bit` units." + } + }, + "id": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The ID of the metric unit." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The unit of the metric, for instance `byte`." + } + }, + "plural": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The plural Unit of metric, for instance `bytes`.", + "com.distilled.openapi#nullable": {} + } + }, + "scale_factor": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "The scale factor of metric unit, for instance `1.0`." + } + }, + "short_name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A shorter and abbreviated version of the metric unit, for instance `B`.", + "com.distilled.openapi#nullable": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An Object of metric units." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadataUnitList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesMetadataUnit" + }, + "traits": { + "smithy.api#documentation": "An array of metric units that contains up to two unit objects.\nFor example, bytes represents one unit object and bytes per second represents two unit objects.\nIf a metric query only has one unit object, the second array element is null." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsSeriesValuesList": { + "type": "list", + "member": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "The query values for each metric." + } + }, + "com.datadog.service_level_objectives#SLOHistoryMetricsTimesList": { + "type": "list", + "member": { + "target": "smithy.api#Double" + }, + "traits": { + "smithy.api#documentation": "An array of query timestamps in EPOCH milliseconds." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseDataThresholdsMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "com.datadog.service_level_objectives#SLOThreshold" + }, + "traits": { + "smithy.api#documentation": "mapping of string timeframe to the SLO threshold." + } + }, + "com.datadog.service_level_objectives#SLOTypeNumeric": { + "type": "intEnum", + "members": { + "_0": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": 0 + } + }, + "_1": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": 1 + } + }, + "_2": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": 2 + } + } + }, + "traits": { + "smithy.api#documentation": "A numeric representation of the type of the service level objective (`0` for\nmonitor, `1` for metric). Always included in service level objective responses.\nIgnored in create/update requests." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseError": { + "type": "structure", + "members": { + "error": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Human readable error." + } + } + }, + "traits": { + "smithy.api#documentation": "A list of errors while querying the history data for the service level objective." + } + }, + "com.datadog.service_level_objectives#SLOHistoryResponseErrorsList": { + "type": "list", + "member": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponseError" + }, + "traits": { + "smithy.api#documentation": "A list of errors while querying the history data for the service level objective." + } + }, + "com.datadog.service_level_objectives#GetSLOHistory": { + "type": "operation", + "input": { + "target": "com.datadog.service_level_objectives#GetSLOHistoryRequest" + }, + "output": { + "target": "com.datadog.service_level_objectives#SLOHistoryResponse" + }, + "errors": [ + { + "target": "com.datadog.service_level_objectives#BadRequest" + }, + { + "target": "com.datadog.service_level_objectives#Forbidden" + }, + { + "target": "com.datadog.service_level_objectives#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/api/v1/slo/{slo_id}/history", + "code": 200 + }, + "smithy.api#documentation": "Get an SLO's history\n\nGet a specific SLO’s history, regardless of its SLO type.\n\nThe detailed history data is structured according to the source data type.\nFor example, metric data is included for event SLOs that use\nthe metric source, and monitor SLO types include the monitor transition history.\n\n**Note:** There are different response formats for event based and time based SLOs.\nExamples of both are shown." + } + }, + "com.datadog.service_level_objectives#BadRequest": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 400, + "com.distilled.openapi#errorMatchers": [ + { + "status": 400 + } + ] + } + }, + "com.datadog.service_level_objectives#Forbidden": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 403, + "com.distilled.openapi#errorMatchers": [ + { + "status": 403 + } + ] + } + }, + "com.datadog.service_level_objectives#NotFound": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 404, + "com.distilled.openapi#errorMatchers": [ + { + "status": 404 + } + ] + } + }, + "com.datadog.service_level_objectives#Conflict": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 409, + "com.distilled.openapi#errorMatchers": [ + { + "status": 409 + } + ] + } + }, + "com.datadog.service_level_objectives#ServiceLevelObjectives": { + "type": "service", + "version": "1.0", + "operations": [ + { + "target": "com.datadog.service_level_objectives#ListSLOs" + }, + { + "target": "com.datadog.service_level_objectives#CreateSLO" + }, + { + "target": "com.datadog.service_level_objectives#DeleteSLOTimeframeInBulk" + }, + { + "target": "com.datadog.service_level_objectives#CheckCanDeleteSLO" + }, + { + "target": "com.datadog.service_level_objectives#SearchSLO" + }, + { + "target": "com.datadog.service_level_objectives#GetSLO" + }, + { + "target": "com.datadog.service_level_objectives#UpdateSLO" + }, + { + "target": "com.datadog.service_level_objectives#DeleteSLO" + }, + { + "target": "com.datadog.service_level_objectives#GetSLOCorrections" + }, + { + "target": "com.datadog.service_level_objectives#GetSLOHistory" + } + ], + "traits": { + "smithy.api#title": "Datadog API V1 Collection", + "smithy.api#documentation": "Collection of all Datadog Public endpoints." + } + } + } +} diff --git a/packages/datadog/README.md b/packages/datadog/README.md new file mode 100644 index 0000000000..3a2fbfe85a --- /dev/null +++ b/packages/datadog/README.md @@ -0,0 +1,52 @@ +# @distilled.cloud/datadog + +Effect-native Datadog SDK, generated from Datadog's official v1 OpenAPI +description. + +## Spec source + +The generator reads a single file: + +``` +specs/datadog-api-client-typescript/.generator/schemas/v1/openapi.yaml +``` + +That file is ~1.6 MB. The repository it lives in, +[DataDog/datadog-api-client-typescript](https://github.com/DataDog/datadog-api-client-typescript), +carries the full generated TypeScript client alongside the schemas, so the +submodule is **sparse-checked-out to the one file we consume**. + +### Fetching it + +```bash +bun run specs:fetch +``` + +Run this from `packages/datadog`. It initialises the submodule, narrows it to +the single schema file, and leaves ~1.6 MB on disk. + +Note the same footgun as `packages/github`: sparse-checkout config lives in +local git config, so a plain `bun run specs:sync` at the repo root expands +this submodule to the full working tree. Not wrong, just larger than needed — +re-run `specs:fetch` here to narrow it again. + +## Coverage + +The v1 spec carries ~230 operations across 31 tags. Only allowlisted tags are +converted (see `TAG_ALLOWLIST` in `scripts/convert.ts`), so every generated +operation has a live-tested consumer in alchemy: + +- **Monitors** (`src/services/monitors.ts`) +- **Service Level Objectives** (`src/services/service_level_objectives.ts`) + +Grow coverage tag-by-tag (Downtimes, Dashboards, Synthetics, …) as resources +are brought up. + +## Regenerating + +```bash +bun run generate # convert (OpenAPI → Smithy, patched) + generate (Smithy → SDK) +``` + +API-mismatch fixes are RFC-6902 patches against the OpenAPI document in +`patches/*.patch.json` — never edits to `src/services/*.ts`. diff --git a/packages/datadog/package.json b/packages/datadog/package.json new file mode 100644 index 0000000000..efab2d1652 --- /dev/null +++ b/packages/datadog/package.json @@ -0,0 +1,79 @@ +{ + "name": "@distilled.cloud/datadog", + "version": "1.0.0-rc.4", + "repository": { + "type": "git", + "url": "https://github.com/alchemy-run/distilled", + "directory": "packages/datadog" + }, + "license": "Apache-2.0", + "type": "module", + "sideEffects": false, + "module": "src/index.ts", + "files": [ + "lib", + "src" + ], + "exports": { + ".": { + "types": "./lib/index.d.ts", + "bun": "./src/index.ts", + "worker": "./src/index.ts", + "default": "./lib/index.js" + }, + "./Credentials": { + "types": "./lib/credentials.d.ts", + "bun": "./src/credentials.ts", + "worker": "./src/credentials.ts", + "default": "./lib/credentials.js" + }, + "./Errors": { + "types": "./lib/errors.d.ts", + "bun": "./src/errors.ts", + "worker": "./src/errors.ts", + "default": "./lib/errors.js" + }, + "./Protocol": { + "types": "./lib/protocol.d.ts", + "bun": "./src/protocol.ts", + "worker": "./src/protocol.ts", + "default": "./lib/protocol.js" + }, + "./Retry": { + "types": "./lib/retry.d.ts", + "bun": "./src/retry.ts", + "worker": "./src/retry.ts", + "default": "./lib/retry.js" + }, + "./Traits": { + "types": "./lib/traits.d.ts", + "bun": "./src/traits.ts", + "worker": "./src/traits.ts", + "default": "./lib/traits.js" + }, + "./*": { + "types": "./lib/services/*.d.ts", + "bun": "./src/services/*.ts", + "worker": "./src/services/*.ts", + "default": "./lib/services/*.js" + } + }, + "scripts": { + "build": "tsc -b", + "convert": "bun scripts/convert.ts", + "generate": "bun scripts/convert.ts && bun scripts/generate.ts", + "typecheck": "tsc -p tsconfig.json", + "specs:fetch": "git submodule update --force --init --depth=1 specs/datadog-api-client-typescript && git -C specs/datadog-api-client-typescript sparse-checkout set --no-cone /.generator/schemas/v1/openapi.yaml && git -C specs/datadog-api-client-typescript checkout -- .", + "specs:update": "git -C specs/datadog-api-client-typescript fetch --depth=1 origin master && git -C specs/datadog-api-client-typescript checkout FETCH_HEAD" + }, + "dependencies": { + "@distilled.cloud/core": "workspace:*" + }, + "devDependencies": { + "@types/bun": "catalog:", + "@types/node": "catalog:" + }, + "peerDependencies": { + "effect": "catalog:" + } +} diff --git a/packages/datadog/scripts/convert.ts b/packages/datadog/scripts/convert.ts new file mode 100644 index 0000000000..7215bc2e91 --- /dev/null +++ b/packages/datadog/scripts/convert.ts @@ -0,0 +1,174 @@ +#!/usr/bin/env bun +/** + * convert — Datadog's v1 OpenAPI description → Smithy JSON models in + * .generated-specs. + * + * Datadog publishes ONE OpenAPI 3.0 document per API version in the + * datadog-api-client-typescript repo (`.generator/schemas/v1/openapi.yaml`, + * sparse-checked-out by `bun run specs:fetch`), covering ~230 operations + * across 31 tags. Following the GitHub/PostHog pipeline: + * + * 1. Read the full spec (YAML — bun parses it natively) and collapse the + * templated server (`https://{subdomain}.{site}`) to the canonical US1 + * host; the real base URL comes from Credentials at request time. + * 2. Apply ALL `patches/*.patch.json` ONCE to the full spec (RFC-6902, + * sorted name order; stale targets warn+skip — the submodule tracks + * upstream and drifts — malformed patches fail the run). + * 3. Bucket operations by PRIMARY (first) tag, keeping only the tags in + * {@link TAG_ALLOWLIST}. Coverage grows tag-by-tag: add a tag here (and + * to the allowlist comment) when its resources are brought up in + * alchemy, so every generated operation has a live consumer. + * 4. Convert each bucket through the shared `convertOpenApiToSmithy` and + * write `.generated-specs/.json`. + * + * `scripts/generate.ts` (runGeneratorCli with `patchesDir: false` — the + * patches apply HERE, to the OpenAPI document) then compiles the models. + */ +import * as fs from "node:fs"; +import * as path from "node:path"; +import { + applyOperation, + isStaleTargetError, + type PatchFile, +} from "@distilled.cloud/core/json-patch"; +import { convertOpenApiToSmithy } from "@distilled.cloud/core/codegen/openapi"; + +const rootDir = path.resolve(import.meta.dir, ".."); +const specPath = path.join( + rootDir, + "specs/datadog-api-client-typescript/.generator/schemas/v1/openapi.yaml", +); +const patchDir = path.join(rootDir, "patches"); +const outDir = path.join(rootDir, ".generated-specs"); + +const HTTP_METHODS = ["get", "post", "put", "patch", "delete"] as const; + +/** + * Tags converted into service modules. The v1 spec carries 31 tags; only the + * ones with alchemy resources built on them are generated, so every + * operation in the SDK has a live-tested consumer. Grow this list tag-by-tag + * as coverage expands (Downtimes, Dashboards, Synthetics, …). + */ +const TAG_ALLOWLIST = new Set(["Monitors", "Service Level Objectives"]); + +/** Tag → model/resource name (the generated module's filename). */ +const toSlug = (tag: string): string => + tag + .replace(/[^a-zA-Z0-9]+/g, "_") + .replace(/^_+|_+$/g, "") + .toLowerCase(); + +const toPascal = (slug: string): string => + slug + .split("_") + .filter(Boolean) + .map((s) => s.charAt(0).toUpperCase() + s.slice(1)) + .join(""); + +// ---- 1. Read the full spec ------------------------------------------------- +if (!fs.existsSync(specPath)) { + throw new Error( + `${specPath} not found — run \`bun run specs:fetch\` to check out the spec submodule`, + ); +} +const fullSpec = Bun.YAML.parse(fs.readFileSync(specPath, "utf-8")) as Record< + string, + any +>; +// The spec declares a templated server (`https://{subdomain}.{site}` over the +// regional-site enum). Collapse to the canonical US1 host — the protocol +// resolves the real base URL from Credentials on every request. +fullSpec.servers = [{ url: "https://api.datadoghq.com" }]; + +// ---- 2. Apply the patch chain ONCE to the full spec ------------------------ +let patchFiles = 0; +let staleOps = 0; +const badPatches: string[] = []; +if (fs.existsSync(patchDir)) { + for (const pf of fs + .readdirSync(patchDir) + .filter((f) => f.endsWith(".patch.json")) + .sort((a, b) => a.localeCompare(b))) { + const parsed = JSON.parse( + fs.readFileSync(path.join(patchDir, pf), "utf-8"), + ) as PatchFile; + for (const patchOp of parsed.patches ?? []) { + try { + applyOperation(fullSpec, patchOp); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + if (isStaleTargetError(msg)) { + staleOps++; + console.warn(` ⚠️ stale: ${pf} [${patchOp.op} ${patchOp.path}]`); + } else { + badPatches.push(`${pf} [${patchOp.op} ${patchOp.path}]: ${msg}`); + } + } + } + patchFiles++; + } +} +if (badPatches.length) { + for (const b of badPatches) console.error(`❌ bad patch: ${b}`); + throw new Error( + `${badPatches.length} malformed patch operation(s) — fix or remove them`, + ); +} +console.log( + `🩹 ${patchFiles} patch files applied` + + (staleOps ? ` (${staleOps} stale op(s) skipped)` : ""), +); + +// ---- 3. Bucket paths by primary tag (allowlisted tags only) ---------------- +const tagBuckets = new Map>>(); +for (const [pathTemplate, pathItem] of Object.entries>( + fullSpec.paths, +)) { + for (const method of HTTP_METHODS) { + const op = (pathItem as Record)[method]; + if (!op) continue; + const rawTag: string = + Array.isArray(op.tags) && op.tags.length > 0 ? op.tags[0] : "default"; + if (!TAG_ALLOWLIST.has(rawTag)) continue; + const slug = toSlug(rawTag); + if (!tagBuckets.has(slug)) tagBuckets.set(slug, {}); + const bucketPaths = tagBuckets.get(slug)!; + if (!bucketPaths[pathTemplate]) { + // Carry any path-level params into the slice. + const pathParams = (pathItem as Record).parameters; + bucketPaths[pathTemplate] = pathParams ? { parameters: pathParams } : {}; + } + (bucketPaths[pathTemplate] as Record)[method] = op; + } +} + +// ---- 4. Convert each bucket ------------------------------------------------ +fs.rmSync(outDir, { recursive: true, force: true }); +fs.mkdirSync(outDir, { recursive: true }); + +let written = 0; +let totalOps = 0; +for (const slug of [...tagBuckets.keys()].sort()) { + const subSpec = { ...fullSpec, paths: tagBuckets.get(slug)! }; + const model = convertOpenApiToSmithy(subSpec, { + namespace: `com.datadog.${slug}`, + serviceName: toPascal(slug), + skipDeprecated: true, + // Converter defaults: 400 BadRequest / 403 Forbidden / 404 NotFound / + // 409 Conflict / 422 UnprocessableEntity typed per-op; 401/429/500/503 + // ride the common DatadogOpError union (429 is declared on every + // operation in the spec and is retried by the throttling policy). + }); + const opCount = Object.values(model.shapes).filter( + (s: any) => s.type === "operation", + ).length; + if (opCount === 0) continue; // all-deprecated bucket + fs.writeFileSync( + path.join(outDir, `${slug}.json`), + JSON.stringify(model, null, 2) + "\n", + ); + written++; + totalOps += opCount; +} + +console.log(`✅ ${written} Smithy models (${totalOps} operations) → ${outDir}`); diff --git a/packages/datadog/scripts/generate.ts b/packages/datadog/scripts/generate.ts new file mode 100644 index 0000000000..e0b1ce3aef --- /dev/null +++ b/packages/datadog/scripts/generate.ts @@ -0,0 +1,110 @@ +#!/usr/bin/env bun +/** + * generate — turn the Smithy JSON models in .generated-specs into the Datadog + * Effect SDK. + * + * Input: .generated-specs/.json (one model per allowlisted Datadog + * tag, written by scripts/convert.ts) + * Output: src/services/.ts + src/services/index.ts + * + * The smithy→SDK compiler and CLI pipeline live in + * `@distilled.cloud/core/codegen`; this script is Datadog's provider spec. + * + * Datadog keeps its wire member names verbatim (snake_case) on the TS + * surface. Module files are named after the tag slug + * (`service_level_objectives.ts`) while the barrel exports them camelCased + * (`Services.serviceLevelObjectives.getSLO`). + * + * No pagination profiles are emitted: the generated v1 list endpoints + * paginate with plain `page`/`page_size` (monitors) or `limit`/`offset` + * (SLOs) query params and no in-body next-page token — callers advance them. + */ +import { type SdkSpec } from "@distilled.cloud/core/codegen/generator"; +import { runGeneratorCli } from "@distilled.cloud/core/codegen/cli"; + +const NULLABLE_TRAIT = "com.distilled.openapi#nullable"; +const ERROR_MATCHERS_TRAIT = "com.distilled.openapi#errorMatchers"; +const RAW_RESPONSE_TRAIT = "com.distilled.openapi#rawResponse"; +const SENSITIVE_TRAIT = "smithy.api#sensitive"; + +/** `service_level_objectives` → `serviceLevelObjectives` (the barrel's export name). */ +const camel = (slug: string): string => + slug + .split("_") + .filter(Boolean) + .map((s, i) => (i === 0 ? s : s.charAt(0).toUpperCase() + s.slice(1))) + .join(""); + +/** Datadog's provider spec for the shared smithy→SDK compiler. */ +const spec: SdkSpec = { + // Wire names ARE the TS surface (snake_case) — no renaming. + nullableTrait: NULLABLE_TRAIT, + errorMatchersTrait: ERROR_MATCHERS_TRAIT, + + extraBindings: [ + { + // Sole member of a synthesized wrapper for bare array/scalar response + // bodies; as the response's only member, the response IS the payload. + trait: RAW_RESPONSE_TRAIT, + binding: "rawResponse", + pipe: "T.RawResponse()", + rootPipe: "T.RawResponseRoot()", + }, + ], + + // Sensitive strings (API/application key values): Redacted on the way out, + // `string | Redacted` accepted on the way in (the REST protocol unwraps). + memberTraitPipes: { + [SENSITIVE_TRAIT]: "T.SensitiveValue", + }, + memberTsType: (m) => + SENSITIVE_TRAIT in m.traits + ? `string | Redacted.Redacted${m.nullable ? " | null" : ""}` + : undefined, + + // Datadog's oneOf unions (monitor `restricted_roles | null` alternates, + // SLO data-source query variants) are decoded passthrough: the TS type is + // the case union, the schema stays opaque — the API returns one arm's + // plain value, so no runtime case discrimination is needed. + union: ({ name, caseTargets, tsRef }) => [ + `export type ${name} = ${caseTargets.map(tsRef).join(" | ") || "unknown"};`, + `export const ${name} = /*@__PURE__*/ S.Unknown as any as S.Schema<${name}>;\n`, + ], + + sourceNote: + ".generated-specs (specs/datadog-api-client-typescript .generator/schemas/v1)", + + operationDecl: { + contextType: "DatadogOpContext", + commonErrorType: "DatadogOpError", + // Per-op error lists carry exactly the statuses the spec declares + // (400/403/404/409); 401/429/500/503 ride DatadogOpError. + commonErrorClasses: [], + protocol: "DatadogProtocol", + retry: "Retry.Retry", + }, + + // `effect/Redacted` is only referenced by modules with sensitive members — + // import it exactly there. With commonErrorClasses empty the default + // header's `import { } from "../errors.ts"` is dead weight — drop it. + postProcess: (code) => { + let out = code.replace(/import \{\s*\} from "\.\.\/errors\.ts";\n/, ""); + if (out.includes("Redacted.Redacted<")) { + out = out.replace( + `import * as S from "@distilled.cloud/core/schema";`, + `import * as S from "@distilled.cloud/core/schema";\nimport * as Redacted from "effect/Redacted";`, + ); + } + return out; + }, +}; + +runGeneratorCli({ + description: "Generate the Datadog Effect SDK from the Smithy models", + root: `${import.meta.dir}/..`, + // The RFC-6902 patch chain in patches/ applies to the OpenAPI document in + // scripts/convert.ts — never to the Smithy models. + patchesDir: false, + barrelExportName: camel, + spec: () => spec, +}); diff --git a/packages/datadog/specs/datadog-api-client-typescript b/packages/datadog/specs/datadog-api-client-typescript new file mode 160000 index 0000000000..f0a753fdd9 --- /dev/null +++ b/packages/datadog/specs/datadog-api-client-typescript @@ -0,0 +1 @@ +Subproject commit f0a753fdd9eaf9ba159cebe1ad7d79a4d8a58757 diff --git a/packages/datadog/src/credentials.ts b/packages/datadog/src/credentials.ts new file mode 100644 index 0000000000..d03e6c25d5 --- /dev/null +++ b/packages/datadog/src/credentials.ts @@ -0,0 +1,130 @@ +/** + * Datadog credentials — hand-written. + * + * The `Credentials` service holds an *effect* that resolves the current + * credentials on every request (the protocol layer resolves it per request + * on the calling fiber). + * + * Datadog authenticates with two header-borne keys: the org-wide API key + * (`DD-API-KEY`) and a per-user/service application key + * (`DD-APPLICATION-KEY`). Reads and management endpoints (monitors, SLOs, + * dashboards, …) require both; a handful of intake endpoints accept the API + * key alone, so `appKey` is optional here and the header is only sent when + * set. + */ +import * as EffectConfig from "effect/Config"; +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import * as Option from "effect/Option"; +import * as Redacted from "effect/Redacted"; +import { ConfigError } from "@distilled.cloud/core/errors"; + +/** Default base URL for Datadog US1. */ +export const DEFAULT_API_BASE_URL = "https://api.datadoghq.com"; + +/** Datadog US1. Other sites: `us3.datadoghq.com`, `us5.datadoghq.com`, `datadoghq.eu`, `ap1.datadoghq.com`, `ddog-gov.com`, … */ +export const DEFAULT_SITE = "datadoghq.com"; + +/** + * Resolve a Datadog "site" (e.g. `us5.datadoghq.com`) into the API base URL + * (`https://api.us5.datadoghq.com`). A value that is already a URL is used + * verbatim, so a full endpoint override (proxies, testing) also works. + */ +export const siteToApiBaseUrl = (site: string): string => + site.startsWith("http://") || site.startsWith("https://") + ? site.replace(/\/+$/, "") + : `https://api.${site}`; + +export interface Config { + /** The Datadog API key, sent as the `DD-API-KEY` header. */ + readonly apiKey: Redacted.Redacted; + /** + * The Datadog application key, sent as the `DD-APPLICATION-KEY` header + * when set. Required by management endpoints (monitors, SLOs, …); the + * key's scopes (e.g. `monitors_write`, `slos_write`) bound what it can do. + */ + readonly appKey?: Redacted.Redacted; + /** API base URL, e.g. `https://api.datadoghq.com`. */ + readonly apiBaseUrl: string; +} + +export class Credentials extends Context.Service< + Credentials, + Effect.Effect +>()("DatadogCredentials") {} + +const redact = ( + value: string | Redacted.Redacted, +): Redacted.Redacted => + Redacted.isRedacted(value) ? value : Redacted.make(value); + +/** Layer from plain keys + optional site / base URL override. */ +export const fromKeys = (config: { + readonly apiKey: string | Redacted.Redacted; + readonly appKey?: string | Redacted.Redacted; + /** A site (`us5.datadoghq.com`) or a full base URL (`https://…`). */ + readonly site?: string; +}): Layer.Layer => + Layer.succeed( + Credentials, + Effect.succeed({ + apiKey: redact(config.apiKey), + appKey: config.appKey !== undefined ? redact(config.appKey) : undefined, + apiBaseUrl: siteToApiBaseUrl(config.site ?? DEFAULT_SITE), + }), + ); + +const envConfig = EffectConfig.all({ + apiKey: EffectConfig.option(EffectConfig.redacted("DD_API_KEY")), + apiKeyAlias: EffectConfig.option(EffectConfig.redacted("DATADOG_API_KEY")), + appKey: EffectConfig.option(EffectConfig.redacted("DD_APP_KEY")), + appKeyAlias: EffectConfig.option(EffectConfig.redacted("DATADOG_APP_KEY")), + site: EffectConfig.option(EffectConfig.string("DD_SITE")), + siteAlias: EffectConfig.option(EffectConfig.string("DATADOG_SITE")), +}); + +/** + * Build {@link Credentials} from environment variables. + * + * - `DD_API_KEY` or `DATADOG_API_KEY` (required) — the org API key. + * - `DD_APP_KEY` or `DATADOG_APP_KEY` (optional) — the application key, + * required by management endpoints. + * - `DD_SITE` or `DATADOG_SITE` (optional) — the regional site + * (`us5.datadoghq.com`, `datadoghq.eu`, …) or a full base URL. Defaults + * to `datadoghq.com` (US1). + */ +export const CredentialsFromEnv: Layer.Layer = Layer.succeed( + Credentials, + Effect.gen(function* () { + const config = yield* envConfig.pipe( + Effect.mapError( + () => + new ConfigError({ + message: + "DD_API_KEY (or DATADOG_API_KEY) environment variable is required", + }), + ), + ); + const apiKey = + Option.getOrUndefined(config.apiKey) ?? + Option.getOrUndefined(config.apiKeyAlias); + if (!apiKey) { + return yield* new ConfigError({ + message: + "DD_API_KEY (or DATADOG_API_KEY) environment variable is required", + }); + } + const site = + Option.getOrUndefined(config.site) ?? + Option.getOrUndefined(config.siteAlias) ?? + DEFAULT_SITE; + return { + apiKey, + appKey: + Option.getOrUndefined(config.appKey) ?? + Option.getOrUndefined(config.appKeyAlias), + apiBaseUrl: siteToApiBaseUrl(site), + }; + }).pipe(Effect.orDie), +); diff --git a/packages/datadog/src/errors.ts b/packages/datadog/src/errors.ts new file mode 100644 index 0000000000..1375f1335c --- /dev/null +++ b/packages/datadog/src/errors.ts @@ -0,0 +1,41 @@ +/** + * Datadog-specific error types. + * + * Re-exports the common HTTP errors from core and adds the Datadog fallback + * error. Note the generated service modules additionally define their own + * per-status matcher classes (BadRequest/NotFound/…) for the statuses each + * operation declares — those share `_tag`s with the core classes here, so + * `catchTag` works against either. + */ +export { + BadGateway, + BadRequest, + Conflict, + ConfigError, + Forbidden, + GatewayTimeout, + InternalServerError, + Locked, + NotFound, + ServiceUnavailable, + TooManyRequests, + Unauthorized, + UnprocessableEntity, + HTTP_STATUS_MAP, + DEFAULT_ERRORS, + API_ERRORS, +} from "@distilled.cloud/core/errors"; +export type { DefaultErrors } from "@distilled.cloud/core/errors"; + +import * as Schema from "effect/Schema"; +import * as Category from "@distilled.cloud/core/category"; + +/** Unknown Datadog error — returned when nothing else matches the failure. */ +export class UnknownDatadogError extends Schema.TaggedError()( + "UnknownDatadogError", + { + code: Schema.optional(Schema.String), + message: Schema.optional(Schema.String), + body: Schema.Unknown, + }, +).pipe(Category.withServerError) {} diff --git a/packages/datadog/src/index.ts b/packages/datadog/src/index.ts new file mode 100644 index 0000000000..fe10d0afd1 --- /dev/null +++ b/packages/datadog/src/index.ts @@ -0,0 +1,31 @@ +/** + * @distilled.cloud/datadog — Datadog SDK for Effect. + * + * `./services` is generated by `scripts/generate.ts` from the Smithy models + * in `.generated-specs` (written by `scripts/convert.ts` from Datadog's + * official v1 OpenAPI description submodule, allowlisted tag-by-tag). + * Everything else in this folder is hand-written. + * + * Service modules are also available under their own subpath imports (the + * per-status error classes each module defines would collide on a root + * spread): + * + * @example + * ```ts + * import * as Datadog from "@distilled.cloud/datadog"; + * import * as Monitors from "@distilled.cloud/datadog/monitors"; + * + * const monitor = yield* Monitors.createMonitor({ ... }); + * const slos = yield* Datadog.Services.serviceLevelObjectives.listSLOs({}); + * ``` + */ +export * from "./credentials.ts"; +export * from "./errors.ts"; +export * as T from "./traits.ts"; +export { + DatadogProtocol, + type DatadogOpError, + type DatadogOpContext, +} from "./protocol.ts"; +export * as Retry from "./retry.ts"; +export * as Services from "./services/index.ts"; diff --git a/packages/datadog/src/protocol.ts b/packages/datadog/src/protocol.ts new file mode 100644 index 0000000000..77845e1bd2 --- /dev/null +++ b/packages/datadog/src/protocol.ts @@ -0,0 +1,92 @@ +/** + * DatadogProtocol — hand-written. + * + * Datadog speaks plain key-authenticated JSON REST (no response envelope on + * v1 endpoints; SLO responses carry a `data` wrapper that is part of the + * schema, not the protocol), so the whole protocol is one `makeRestProtocol` + * call from `core/protocol-rest`: + * + * request: credentials → `DD-API-KEY` (+ `DD-APPLICATION-KEY` when set) + * headers + base URL (default https://api.datadoghq.com; other + * regional sites via Credentials), resolved from the calling + * fiber on every request + * + * response: 2xx JSON is the payload; non-2xx bodies map to the operation's + * typed error classes by status, then the shared HTTP-status + * classes, then {@link UnknownDatadogError}. Datadog error + * bodies are `{ "errors": ["…"] }` — the envelope surfaces the + * first entry as the message; the HTTP status stays the + * authoritative signal. + */ +import * as Effect from "effect/Effect"; +import type * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; +import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type * as HttpClientError from "effect/unstable/http/HttpClientError"; +import type * as API from "@distilled.cloud/core/api"; +import type { ConfigError } from "@distilled.cloud/core/errors"; +import { + makeRestProtocol, + type RestErrorEnvelope, +} from "@distilled.cloud/core/protocol-rest"; +import { Credentials, type Config } from "./credentials.ts"; +import { UnknownDatadogError, type DefaultErrors } from "./errors.ts"; + +/** + * Error channel shared by every generated Datadog operation. Generated + * service files annotate operations with `API.OperationMethod` explicitly so the compiler never infers + * these back out of the schema generics. + */ +export type DatadogOpError = + | DefaultErrors + | ConfigError + | HttpClientError.HttpClientError; + +/** Context (requirements) shared by every generated Datadog operation. */ +export type DatadogOpContext = Credentials | HttpClient.HttpClient; + +/** + * Datadog error bodies are `{ "errors": ["…", …] }` (occasionally an + * `{ "errors": { … } }` object on newer endpoints). The envelope surfaces + * the first string entry as the message; Datadog has no machine-readable + * error code on v1 — the HTTP status is the signal. + */ +const errorEnvelope = (body: unknown): RestErrorEnvelope | undefined => { + if (body === null || typeof body !== "object") return undefined; + const errors = (body as Record).errors; + if (Array.isArray(errors)) { + const first = errors.find((e): e is string => typeof e === "string"); + return { message: first }; + } + return undefined; +}; + +export const DatadogProtocol: Layer.Layer = + makeRestProtocol({ + // The Credentials service holds an effect — resolving it here (per + // request, on the calling fiber) picks up context-provided credentials. + credentials: Effect.gen(function* () { + const resolve = yield* Credentials; + return yield* resolve; + }), + baseUrl: (creds) => creds.apiBaseUrl, + headers: (creds) => ({ + "DD-API-KEY": Redacted.value(creds.apiKey), + ...(creds.appKey + ? { "DD-APPLICATION-KEY": Redacted.value(creds.appKey) } + : {}), + }), + errorEnvelope, + unknownError: ({ code, message, body }) => + new UnknownDatadogError({ + code: + typeof code === "string" + ? code + : code !== undefined + ? String(code) + : undefined, + message, + body, + }), + }); diff --git a/packages/datadog/src/retry.ts b/packages/datadog/src/retry.ts new file mode 100644 index 0000000000..f20ff55d62 --- /dev/null +++ b/packages/datadog/src/retry.ts @@ -0,0 +1,54 @@ +/** + * Datadog retry configuration. + * + * Defines the per-SDK `Retry` Context.Service tag that generated operations + * wire into `API.make`. Callers can install a blanket retry policy at the + * layer level and have every Datadog API call below it pick it up: + * + * @example + * ```ts + * import * as Datadog from "@distilled.cloud/datadog"; + * + * myEffect.pipe(Datadog.Retry.transient); + * Effect.provide(myEffect, Layer.succeed(Datadog.Retry.Retry, customPolicy)); + * ``` + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import { + type Policy, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +export { + type Options, + type Factory, + type Policy, + makeDefault, + jittered, + capped, + throttlingOptions, + transientOptions, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +/** Context tag for configuring retry behavior of Datadog API calls. */ +export class Retry extends Context.Service()("DatadogRetry") {} + +/** Provides a custom retry policy to every Datadog API call below it. */ +export const policy = (optionsOrFactory: Policy) => + Effect.provide(Layer.succeed(Retry, optionsOrFactory)); + +/** Disables all automatic retries. */ +export const none = Effect.provide( + Layer.succeed(Retry, { while: () => false }), +); + +/** Apply the throttling retry policy (retries throttling errors indefinitely). */ +export const throttling = policy(throttlingFactory); + +/** Apply the transient retry policy (retries all transient errors indefinitely). */ +export const transient = policy(transientFactory); diff --git a/packages/datadog/src/services/index.ts b/packages/datadog/src/services/index.ts new file mode 100644 index 0000000000..f97861ed1e --- /dev/null +++ b/packages/datadog/src/services/index.ts @@ -0,0 +1,3 @@ +// AUTO-GENERATED by scripts/generate.ts. Do not edit. +export * as monitors from "./monitors.ts"; +export * as serviceLevelObjectives from "./service_level_objectives.ts"; diff --git a/packages/datadog/src/services/monitors.ts b/packages/datadog/src/services/monitors.ts new file mode 100644 index 0000000000..5d60600f15 --- /dev/null +++ b/packages/datadog/src/services/monitors.ts @@ -0,0 +1,2302 @@ +// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/datadog-api-client-typescript .generator/schemas/v1). Do not edit. +import * as S from "@distilled.cloud/core/schema"; +import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; +import * as T from "../traits.ts"; +import { + DatadogProtocol, + type DatadogOpError, + type DatadogOpContext, +} from "../protocol.ts"; +import * as Retry from "../retry.ts"; + +export type { DatadogOpError, DatadogOpContext }; + +export class BadRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRequest", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 400 }], + ) {} + +export class Conflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Conflict", { + code: S.Number, + message: S.String, + }).pipe(C.withConflictError), + [{ status: 409 }], + ) {} + +export class Forbidden + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Forbidden", { + code: S.Number, + message: S.String, + }).pipe(C.withAuthError), + [{ status: 403 }], + ) {} + +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 404 }], + ) {} + +export type CheckCanDeleteMonitorRequestMonitorIdsList = Array; +export const CheckCanDeleteMonitorRequestMonitorIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +export interface CheckCanDeleteMonitorRequest { + /** The IDs of the monitor to check. */ + monitor_ids: CheckCanDeleteMonitorRequestMonitorIdsList; +} +export const CheckCanDeleteMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + monitor_ids: CheckCanDeleteMonitorRequestMonitorIdsList.pipe(T.Query()), + }).pipe( + T.Http({ method: "GET", uri: "/api/v1/monitor/can_delete", code: 200 }), + ), +).annotate({ + identifier: "CheckCanDeleteMonitorRequest", +}) as any as S.Schema; + +/** An array of Monitor IDs that can be safely deleted. */ +export type CheckCanDeleteMonitorResponseDataOkList = Array; +export const CheckCanDeleteMonitorResponseDataOkList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** Wrapper object with the list of monitor IDs. */ +export interface CheckCanDeleteMonitorResponseData { + /** An array of Monitor IDs that can be safely deleted. */ + ok?: CheckCanDeleteMonitorResponseDataOkList; +} +export const CheckCanDeleteMonitorResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + ok: S.optional(CheckCanDeleteMonitorResponseDataOkList), + }), +).annotate({ + identifier: "CheckCanDeleteMonitorResponseData", +}) as any as S.Schema; + +/** Strings denoting where a monitor is used. */ +export type CheckCanDeleteMonitorResponseErrorsValueList = Array; +export const CheckCanDeleteMonitorResponseErrorsValueList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** A mapping of Monitor ID to strings denoting where it's used. */ +export type CheckCanDeleteMonitorResponseErrorsMap = { + [key: string]: CheckCanDeleteMonitorResponseErrorsValueList | undefined; +}; +export const CheckCanDeleteMonitorResponseErrorsMap = /*@__PURE__*/ S.Record( + S.String, + CheckCanDeleteMonitorResponseErrorsValueList, +) as any as S.Schema; + +/** Response of monitor IDs that can or can't be safely deleted. */ +export interface CheckCanDeleteMonitorResponse { + data: CheckCanDeleteMonitorResponseData; + /** A mapping of Monitor ID to strings denoting where it's used. */ + errors?: CheckCanDeleteMonitorResponseErrorsMap | null; +} +export const CheckCanDeleteMonitorResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: CheckCanDeleteMonitorResponseData, + errors: S.optional(S.NullOr(CheckCanDeleteMonitorResponseErrorsMap)), + }), +).annotate({ + identifier: "CheckCanDeleteMonitorResponse", +}) as any as S.Schema; + +/** Indicates the type of asset this entity represents on a monitor. */ +export type MonitorAssetCategory = "runbook"; +export const MonitorAssetCategory = /*@__PURE__*/ S.String; + +/** Type of internal Datadog resource associated with a monitor asset. */ +export type MonitorAssetResourceType = "notebook"; +export const MonitorAssetResourceType = /*@__PURE__*/ S.String; + +/** Represents key links tied to a monitor to help users take action on alerts. This feature is in Preview and only available to users with the feature enabled. */ +export interface MonitorAsset { + category: MonitorAssetCategory | (string & {}); + /** Name for the monitor asset */ + name: string; + /** Represents the identifier of the internal Datadog resource that this asset represents. IDs in this field should be passed in as strings. */ + resource_key?: string; + resource_type?: MonitorAssetResourceType | (string & {}); + /** URL link for the asset. For links with an internal resource type set, this should be the relative path to where the Datadog domain is appended internally. For external links, this should be the full URL path. */ + url: string; +} +export const MonitorAsset = /*@__PURE__*/ S.suspend(() => + S.Struct({ + category: MonitorAssetCategory, + name: S.String, + resource_key: S.optional(S.String), + resource_type: S.optional(MonitorAssetResourceType), + url: S.String, + }), +).annotate({ identifier: "MonitorAsset" }) as any as S.Schema; + +/** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ +export type CreateMonitorRequestAssetsList = Array; +export const CreateMonitorRequestAssetsList = /*@__PURE__*/ S.Array( + MonitorAsset, +) as any as S.Schema; + +/** Indicates whether the monitor is in a draft or published state. `draft`: The monitor appears as Draft and does not send notifications. `published`: The monitor is active and evaluates conditions and notify as configured. This field is in preview. The draft value is only available to customers with the feature enabled. */ +export type MonitorDraftStatus = "draft" | "published"; +export const MonitorDraftStatus = /*@__PURE__*/ S.String; + +/** The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). */ +export type MatchingDowntimeInputScopeList = Array; +export const MatchingDowntimeInputScopeList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Object describing a downtime that matches this monitor. */ +export interface MatchingDowntimeInput { + /** POSIX timestamp to end the downtime. */ + end?: number | null; + /** The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). */ + scope?: MatchingDowntimeInputScopeList; + /** POSIX timestamp to start the downtime. */ + start?: number; +} +export const MatchingDowntimeInput = /*@__PURE__*/ S.suspend(() => + S.Struct({ + end: S.optional(S.NullOr(S.Number)), + scope: S.optional(MatchingDowntimeInputScopeList), + start: S.optional(S.Number), + }), +).annotate({ + identifier: "MatchingDowntimeInput", +}) as any as S.Schema; + +/** A list of active v1 downtimes that match this monitor. */ +export type CreateMonitorRequestMatchingDowntimesList = + Array; +export const CreateMonitorRequestMatchingDowntimesList = /*@__PURE__*/ S.Array( + MatchingDowntimeInput, +) as any as S.Schema; + +/** Toggles the display of additional content sent in the monitor notification. */ +export type MonitorOptionsNotificationPresets = + | "show_all" + | "hide_query" + | "hide_handles" + | "hide_all" + | "hide_query_and_handles" + | "show_only_snapshot" + | "hide_handles_and_footer"; +export const MonitorOptionsNotificationPresets = /*@__PURE__*/ S.String; + +/** Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert. */ +export type MonitorOptionsInputNotifyByList = Array; +export const MonitorOptionsInputNotifyByList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Controls how groups or monitors are treated if an evaluation does not return any data points. The default option results in different behavior depending on the monitor query type. For monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to the threshold conditions. For monitors using any query type other than Count, for example Gauge, Measure, or Rate, the monitor shows the last known status. This option is available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. It is also required for metric monitors that use `scheduling_options.custom_schedule`. */ +export type OnMissingDataOption = + | "default" + | "show_no_data" + | "show_and_notify_no_data" + | "resolve"; +export const OnMissingDataOption = /*@__PURE__*/ S.String; + +/** The different statuses for which renotification is supported. */ +export type MonitorRenotifyStatusType = "alert" | "warn" | "no data"; +export const MonitorRenotifyStatusType = /*@__PURE__*/ S.String; + +/** The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`. */ +export type MonitorOptionsInputRenotifyStatusesList = Array< + MonitorRenotifyStatusType | (string & {}) +>; +export const MonitorOptionsInputRenotifyStatusesList = /*@__PURE__*/ S.Array( + MonitorRenotifyStatusType, +) as any as S.Schema; + +/** Configuration for a recurrence set on the monitor options for custom schedule. */ +export interface MonitorOptionsCustomScheduleRecurrence { + /** Defines the recurrence rule (RRULE) for a given schedule. */ + rrule?: string; + /** Defines the start date and time of the recurring schedule. */ + start?: string; + /** Defines the timezone the schedule runs on. */ + timezone?: string; +} +export const MonitorOptionsCustomScheduleRecurrence = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + rrule: S.optional(S.String), + start: S.optional(S.String), + timezone: S.optional(S.String), + }), +).annotate({ + identifier: "MonitorOptionsCustomScheduleRecurrence", +}) as any as S.Schema; + +/** Array of custom schedule recurrences. */ +export type MonitorOptionsCustomScheduleRecurrencesList = + Array; +export const MonitorOptionsCustomScheduleRecurrencesList = + /*@__PURE__*/ S.Array( + MonitorOptionsCustomScheduleRecurrence, + ) as any as S.Schema; + +/** Configuration options for the custom schedule. **This feature is in private beta.** */ +export interface MonitorOptionsCustomSchedule { + /** Array of custom schedule recurrences. */ + recurrences?: MonitorOptionsCustomScheduleRecurrencesList; +} +export const MonitorOptionsCustomSchedule = /*@__PURE__*/ S.suspend(() => + S.Struct({ + recurrences: S.optional(MonitorOptionsCustomScheduleRecurrencesList), + }), +).annotate({ + identifier: "MonitorOptionsCustomSchedule", +}) as any as S.Schema; + +/** Configuration options for the evaluation window. If `hour_starts` is set, no other fields may be set. Otherwise, `day_starts` and `month_starts` must be set together. */ +export interface MonitorOptionsSchedulingOptionsEvaluationWindow { + /** The time of the day at which a one day cumulative evaluation window starts. */ + day_starts?: string; + /** The minute of the hour at which a one hour cumulative evaluation window starts. */ + hour_starts?: number; + /** The day of the month at which a one month cumulative evaluation window starts. */ + month_starts?: number; + /** The timezone of the time of the day of the cumulative evaluation window start. */ + timezone?: string; +} +export const MonitorOptionsSchedulingOptionsEvaluationWindow = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + day_starts: S.optional(S.String), + hour_starts: S.optional(S.Number), + month_starts: S.optional(S.Number), + timezone: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorOptionsSchedulingOptionsEvaluationWindow", + }) as any as S.Schema; + +/** Configuration options for scheduling. */ +export interface MonitorOptionsSchedulingOptions { + custom_schedule?: MonitorOptionsCustomSchedule; + evaluation_window?: MonitorOptionsSchedulingOptionsEvaluationWindow; +} +export const MonitorOptionsSchedulingOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + custom_schedule: S.optional(MonitorOptionsCustomSchedule), + evaluation_window: S.optional( + MonitorOptionsSchedulingOptionsEvaluationWindow, + ), + }), +).annotate({ + identifier: "MonitorOptionsSchedulingOptions", +}) as any as S.Schema; + +/** Information about the downtime applied to the monitor. Only shows v1 downtimes. */ +export type MonitorOptionsInputSilencedMap = { + [key: string]: number | undefined; +}; +export const MonitorOptionsInputSilencedMap = /*@__PURE__*/ S.Record( + S.String, + S.Number, +) as any as S.Schema; + +/** Alerting time window options. */ +export interface MonitorThresholdWindowOptions { + /** Describes how long an anomalous metric must be normal before the alert recovers. */ + recovery_window?: string | null; + /** Describes how long a metric must be anomalous before an alert triggers. */ + trigger_window?: string | null; +} +export const MonitorThresholdWindowOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + recovery_window: S.optional(S.NullOr(S.String)), + trigger_window: S.optional(S.NullOr(S.String)), + }), +).annotate({ + identifier: "MonitorThresholdWindowOptions", +}) as any as S.Schema; + +/** List of the different monitor threshold available. */ +export interface MonitorThresholds { + /** The monitor `CRITICAL` threshold. */ + critical?: number; + /** Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. */ + critical_query?: string; + /** The monitor `CRITICAL` recovery threshold. */ + critical_recovery?: number | null; + /** Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. */ + critical_recovery_query?: string; + /** The monitor `OK` threshold. */ + ok?: number | null; + /** The monitor UNKNOWN threshold. */ + unknown?: number | null; + /** The monitor `WARNING` threshold. */ + warning?: number | null; + /** The monitor `WARNING` recovery threshold. */ + warning_recovery?: number | null; +} +export const MonitorThresholds = /*@__PURE__*/ S.suspend(() => + S.Struct({ + critical: S.optional(S.Number), + critical_query: S.optional(S.String), + critical_recovery: S.optional(S.NullOr(S.Number)), + critical_recovery_query: S.optional(S.String), + ok: S.optional(S.NullOr(S.Number)), + unknown: S.optional(S.NullOr(S.Number)), + warning: S.optional(S.NullOr(S.Number)), + warning_recovery: S.optional(S.NullOr(S.Number)), + }), +).annotate({ + identifier: "MonitorThresholds", +}) as any as S.Schema; + +/** Aggregation methods for event platform queries. */ +export type MonitorFormulaAndFunctionEventAggregation = + | "count" + | "cardinality" + | "median" + | "pc75" + | "pc90" + | "pc95" + | "pc98" + | "pc99" + | "sum" + | "min" + | "max" + | "avg"; +export const MonitorFormulaAndFunctionEventAggregation = /*@__PURE__*/ S.String; + +/** Compute options. */ +export interface MonitorFormulaAndFunctionEventQueryDefinitionCompute { + aggregation: MonitorFormulaAndFunctionEventAggregation | (string & {}); + /** A time interval in milliseconds. */ + interval?: number; + /** Measurable attribute to compute. */ + metric?: string; + /** The name assigned to this aggregation, when multiple aggregations are defined for a query. */ + name?: string; + /** Source reference for composite query payloads. */ + source?: string; +} +export const MonitorFormulaAndFunctionEventQueryDefinitionCompute = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggregation: MonitorFormulaAndFunctionEventAggregation, + interval: S.optional(S.Number), + metric: S.optional(S.String), + name: S.optional(S.String), + source: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionEventQueryDefinitionCompute", + }) as any as S.Schema; + +/** Data source for event platform-based queries. */ +export type MonitorFormulaAndFunctionEventsDataSource = + | "rum" + | "ci_pipelines" + | "ci_tests" + | "audit" + | "events" + | "logs" + | "spans" + | "database_queries" + | "network" + | "network_path"; +export const MonitorFormulaAndFunctionEventsDataSource = /*@__PURE__*/ S.String; + +/** Direction of sort. */ +export type QuerySortOrder = "asc" | "desc"; +export const QuerySortOrder = /*@__PURE__*/ S.String; + +/** Options for sorting group by results. */ +export interface MonitorFormulaAndFunctionEventQueryGroupBySort { + aggregation: MonitorFormulaAndFunctionEventAggregation | (string & {}); + /** Metric used for sorting group by results. */ + metric?: string; + order?: QuerySortOrder | (string & {}); +} +export const MonitorFormulaAndFunctionEventQueryGroupBySort = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggregation: MonitorFormulaAndFunctionEventAggregation, + metric: S.optional(S.String), + order: S.optional(QuerySortOrder), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionEventQueryGroupBySort", + }) as any as S.Schema; + +/** List of objects used to group by. */ +export interface MonitorFormulaAndFunctionEventQueryGroupBy { + /** Event facet. */ + facet: string; + /** Number of groups to return. */ + limit?: number; + sort?: MonitorFormulaAndFunctionEventQueryGroupBySort; + /** Source reference for composite query payloads. */ + source?: string; +} +export const MonitorFormulaAndFunctionEventQueryGroupBy = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + facet: S.String, + limit: S.optional(S.Number), + sort: S.optional(MonitorFormulaAndFunctionEventQueryGroupBySort), + source: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionEventQueryGroupBy", + }) as any as S.Schema; + +/** Group by options. */ +export type MonitorFormulaAndFunctionEventQueryDefinitionGroupByList = + Array; +export const MonitorFormulaAndFunctionEventQueryDefinitionGroupByList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionEventQueryGroupBy, + ) as any as S.Schema; + +/** An array of index names to query in the stream. Omit or use `[]` to query all indexes at once. */ +export type MonitorFormulaAndFunctionEventQueryDefinitionIndexesList = + Array; +export const MonitorFormulaAndFunctionEventQueryDefinitionIndexesList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Search options. */ +export interface MonitorFormulaAndFunctionEventQueryDefinitionSearch { + /** Events search string. */ + query: string; +} +export const MonitorFormulaAndFunctionEventQueryDefinitionSearch = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + query: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionEventQueryDefinitionSearch", + }) as any as S.Schema; + +/** A formula and functions events query. */ +export interface MonitorFormulaAndFunctionEventQueryDefinition { + compute: MonitorFormulaAndFunctionEventQueryDefinitionCompute; + data_source: MonitorFormulaAndFunctionEventsDataSource | (string & {}); + /** Group by options. */ + group_by?: MonitorFormulaAndFunctionEventQueryDefinitionGroupByList; + /** An array of index names to query in the stream. Omit or use `[]` to query all indexes at once. */ + indexes?: MonitorFormulaAndFunctionEventQueryDefinitionIndexesList; + /** Name of the query for use in formulas. */ + name: string; + search?: MonitorFormulaAndFunctionEventQueryDefinitionSearch; +} +export const MonitorFormulaAndFunctionEventQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + compute: MonitorFormulaAndFunctionEventQueryDefinitionCompute, + data_source: MonitorFormulaAndFunctionEventsDataSource, + group_by: S.optional( + MonitorFormulaAndFunctionEventQueryDefinitionGroupByList, + ), + indexes: S.optional( + MonitorFormulaAndFunctionEventQueryDefinitionIndexesList, + ), + name: S.String, + search: S.optional(MonitorFormulaAndFunctionEventQueryDefinitionSearch), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionEventQueryDefinition", + }) as any as S.Schema; + +/** Aggregation methods for metric queries. */ +export type MonitorFormulaAndFunctionCostAggregator = + | "avg" + | "sum" + | "max" + | "min" + | "last" + | "area" + | "l2norm" + | "percentile" + | "stddev"; +export const MonitorFormulaAndFunctionCostAggregator = /*@__PURE__*/ S.String; + +/** Data source for cost queries. */ +export type MonitorFormulaAndFunctionCostDataSource = + | "metrics" + | "cloud_cost" + | "datadog_usage"; +export const MonitorFormulaAndFunctionCostDataSource = /*@__PURE__*/ S.String; + +/** A formula and functions cost query. */ +export interface MonitorFormulaAndFunctionCostQueryDefinition { + aggregator?: MonitorFormulaAndFunctionCostAggregator | (string & {}); + data_source: MonitorFormulaAndFunctionCostDataSource | (string & {}); + /** Name of the query for use in formulas. */ + name: string; + /** The monitor query. */ + query: string; +} +export const MonitorFormulaAndFunctionCostQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggregator: S.optional(MonitorFormulaAndFunctionCostAggregator), + data_source: MonitorFormulaAndFunctionCostDataSource, + name: S.String, + query: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionCostQueryDefinition", + }) as any as S.Schema; + +/** Data source for data quality queries. */ +export type MonitorFormulaAndFunctionDataQualityDataSource = + "data_quality_metrics"; +export const MonitorFormulaAndFunctionDataQualityDataSource = + /*@__PURE__*/ S.String; + +/** Optional grouping fields for aggregation. */ +export type MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList = + Array; +export const MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Columns to group results by. */ +export type MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList = + Array; +export const MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Override for the model type used in anomaly detection. */ +export type MonitorFormulaAndFunctionDataQualityModelTypeOverride = + | "freshness" + | "percentage" + | "any"; +export const MonitorFormulaAndFunctionDataQualityModelTypeOverride = + /*@__PURE__*/ S.String; + +/** Monitor configuration options for data quality queries. */ +export interface MonitorFormulaAndFunctionDataQualityMonitorOptions { + /** Crontab expression to override the default schedule. */ + crontab_override?: string; + /** Custom SQL query for the monitor. */ + custom_sql?: string; + /** Custom WHERE clause for the query. */ + custom_where?: string; + /** Columns to group results by. */ + group_by_columns?: MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList; + model_type_override?: + | MonitorFormulaAndFunctionDataQualityModelTypeOverride + | (string & {}); + /** Sensitivity of the anomaly detection model, expressed as a multiplier on the width of the predicted bounds. Higher values widen the bounds and produce fewer alerts; lower values tighten them and produce more alerts. Defaults to `3.0`. */ + sensitivity?: number; +} +export const MonitorFormulaAndFunctionDataQualityMonitorOptions = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + crontab_override: S.optional(S.String), + custom_sql: S.optional(S.String), + custom_where: S.optional(S.String), + group_by_columns: S.optional( + MonitorFormulaAndFunctionDataQualityMonitorOptionsGroupByColumnsList, + ), + model_type_override: S.optional( + MonitorFormulaAndFunctionDataQualityModelTypeOverride, + ), + sensitivity: S.optional(S.Number), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionDataQualityMonitorOptions", + }) as any as S.Schema; + +/** A formula and functions data quality query. */ +export interface MonitorFormulaAndFunctionDataQualityQueryDefinition { + data_source: MonitorFormulaAndFunctionDataQualityDataSource; + /** Filter expression used to match on data entities. Uses Aastra query syntax. */ + filter: string; + /** Optional grouping fields for aggregation. */ + group_by?: MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList; + measure: string; + monitor_options?: MonitorFormulaAndFunctionDataQualityMonitorOptions; + /** Name of the query for use in formulas. */ + name: string; + /** Schema version for the data quality query. */ + schema_version?: string; + /** Optional scoping expression to further filter metrics. Uses metrics filter syntax. This is useful when an entity has been configured to emit metrics with additional tags. */ + scope?: string; +} +export const MonitorFormulaAndFunctionDataQualityQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + data_source: MonitorFormulaAndFunctionDataQualityDataSource, + filter: S.String, + group_by: S.optional( + MonitorFormulaAndFunctionDataQualityQueryDefinitionGroupByList, + ), + measure: S.String, + monitor_options: S.optional( + MonitorFormulaAndFunctionDataQualityMonitorOptions, + ), + name: S.String, + schema_version: S.optional(S.String), + scope: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionDataQualityQueryDefinition", + }) as any as S.Schema; + +/** A formula and functions data jobs query. */ +export interface MonitorFormulaAndFunctionDataJobsQueryDefinition { + /** The type of job being monitored. Valid values include: `databricks.job`, `spark.application`, `airflow.dag`, `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. Custom job types are supported with the `custom.ol.` prefix. */ + job_type: string; + /** Filter expression used to select the jobs to monitor. */ + jobs_query: string; + /** Name of the query for use in formulas. Must be `run_query`. */ + name: string; + /** Query dialect for data jobs queries. Currently only `metric` is supported. */ + query_dialect: string; +} +export const MonitorFormulaAndFunctionDataJobsQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + job_type: S.String, + jobs_query: S.String, + name: S.String, + query_dialect: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionDataJobsQueryDefinition", + }) as any as S.Schema; + +/** A column definition for reference table queries. */ +export interface MonitorFormulaAndFunctionReferenceTableColumn { + /** Optional alias for the column. */ + alias?: string; + /** Name of the column. */ + name: string; +} +export const MonitorFormulaAndFunctionReferenceTableColumn = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + alias: S.optional(S.String), + name: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionReferenceTableColumn", + }) as any as S.Schema; + +/** List of columns to retrieve from the reference table. */ +export type MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList = + Array; +export const MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionReferenceTableColumn, + ) as any as S.Schema; + +/** Data source for reference table queries. */ +export type MonitorFormulaAndFunctionReferenceTableDataSource = + "reference_table"; +export const MonitorFormulaAndFunctionReferenceTableDataSource = + /*@__PURE__*/ S.String; + +/** A reference table query for use in aggregate queries. */ +export interface MonitorFormulaAndFunctionReferenceTableQueryDefinition { + /** List of columns to retrieve from the reference table. */ + columns?: MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList; + data_source: MonitorFormulaAndFunctionReferenceTableDataSource; + /** Name of the query. */ + name?: string; + /** Optional filter expression for the reference table query. */ + query_filter?: string; + /** Name of the reference table. */ + table_name: string; +} +export const MonitorFormulaAndFunctionReferenceTableQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + columns: S.optional( + MonitorFormulaAndFunctionReferenceTableQueryDefinitionColumnsList, + ), + data_source: MonitorFormulaAndFunctionReferenceTableDataSource, + name: S.optional(S.String), + query_filter: S.optional(S.String), + table_name: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionReferenceTableQueryDefinition", + }) as any as S.Schema; + +/** Augment query for aggregate augmented queries. Can be an events query or a reference table query. */ +export type MonitorFormulaAndFunctionAggregateAugmentQuery = + | MonitorFormulaAndFunctionEventQueryDefinition + | MonitorFormulaAndFunctionReferenceTableQueryDefinition; +export const MonitorFormulaAndFunctionAggregateAugmentQuery = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Aggregator for metrics queries. */ +export type MonitorFormulaAndFunctionMetricsAggregator = + | "avg" + | "min" + | "max" + | "sum" + | "last" + | "mean" + | "area" + | "l2norm" + | "percentile" + | "stddev" + | "count_unique"; +export const MonitorFormulaAndFunctionMetricsAggregator = + /*@__PURE__*/ S.String; + +/** Data source for metrics queries. */ +export type MonitorFormulaAndFunctionMetricsDataSource = + | "metrics" + | "cloud_cost" + | "datadog_usage"; +export const MonitorFormulaAndFunctionMetricsDataSource = + /*@__PURE__*/ S.String; + +/** A formula and functions metrics query for use in aggregate queries. */ +export interface MonitorFormulaAndFunctionMetricsQueryDefinition { + aggregator?: MonitorFormulaAndFunctionMetricsAggregator | (string & {}); + data_source: MonitorFormulaAndFunctionMetricsDataSource | (string & {}); + /** Name of the query for use in formulas. */ + name?: string; + /** The metrics query definition. */ + query: string; +} +export const MonitorFormulaAndFunctionMetricsQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggregator: S.optional(MonitorFormulaAndFunctionMetricsAggregator), + data_source: MonitorFormulaAndFunctionMetricsDataSource, + name: S.optional(S.String), + query: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionMetricsQueryDefinition", + }) as any as S.Schema; + +/** Base query for aggregate queries. Can be an events query or a metrics query. */ +export type MonitorFormulaAndFunctionAggregateBaseQuery = + | MonitorFormulaAndFunctionEventQueryDefinition + | MonitorFormulaAndFunctionMetricsQueryDefinition; +export const MonitorFormulaAndFunctionAggregateBaseQuery = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Compute options for the query. */ +export type MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList = + Array; +export const MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionEventQueryDefinitionCompute, + ) as any as S.Schema; + +/** Data source for aggregate augmented queries. */ +export type MonitorFormulaAndFunctionAggregateAugmentedDataSource = + "aggregate_augmented_query"; +export const MonitorFormulaAndFunctionAggregateAugmentedDataSource = + /*@__PURE__*/ S.String; + +/** Group by options for the query. */ +export type MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList = + Array; +export const MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionEventQueryGroupBy, + ) as any as S.Schema; + +/** Join type for aggregate query join conditions. */ +export type MonitorFormulaAndFunctionAggregateQueryJoinType = "inner" | "left"; +export const MonitorFormulaAndFunctionAggregateQueryJoinType = + /*@__PURE__*/ S.String; + +/** Join condition for aggregate augmented queries. */ +export interface MonitorFormulaAndFunctionAggregateQueryJoinCondition { + /** Attribute from the augment query to join on. */ + augment_attribute: string; + /** Attribute from the base query to join on. */ + base_attribute: string; + join_type: MonitorFormulaAndFunctionAggregateQueryJoinType | (string & {}); +} +export const MonitorFormulaAndFunctionAggregateQueryJoinCondition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + augment_attribute: S.String, + base_attribute: S.String, + join_type: MonitorFormulaAndFunctionAggregateQueryJoinType, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionAggregateQueryJoinCondition", + }) as any as S.Schema; + +/** A formula and functions aggregate augmented query. Used to enrich base query results with data from a reference table. */ +export interface MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition { + augment_query: MonitorFormulaAndFunctionAggregateAugmentQuery; + base_query: MonitorFormulaAndFunctionAggregateBaseQuery; + /** Compute options for the query. */ + compute: MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList; + data_source: MonitorFormulaAndFunctionAggregateAugmentedDataSource; + /** Group by options for the query. */ + group_by: MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList; + join_condition: MonitorFormulaAndFunctionAggregateQueryJoinCondition; + /** Name of the query for use in formulas. */ + name?: string; +} +export const MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + augment_query: MonitorFormulaAndFunctionAggregateAugmentQuery, + base_query: MonitorFormulaAndFunctionAggregateBaseQuery, + compute: + MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionComputeList, + data_source: MonitorFormulaAndFunctionAggregateAugmentedDataSource, + group_by: + MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionGroupByList, + join_condition: MonitorFormulaAndFunctionAggregateQueryJoinCondition, + name: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition", + }) as any as S.Schema; + +/** Compute options for the query. */ +export type MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList = + Array; +export const MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionEventQueryDefinitionCompute, + ) as any as S.Schema; + +/** Data source for aggregate filtered queries. */ +export type MonitorFormulaAndFunctionAggregateFilteredDataSource = + "aggregate_filtered_query"; +export const MonitorFormulaAndFunctionAggregateFilteredDataSource = + /*@__PURE__*/ S.String; + +/** Filter query for aggregate filtered queries. Can be an events query or a reference table query. */ +export type MonitorFormulaAndFunctionAggregateFilterQuery = + | MonitorFormulaAndFunctionEventQueryDefinition + | MonitorFormulaAndFunctionReferenceTableQueryDefinition; +export const MonitorFormulaAndFunctionAggregateFilterQuery = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Filter definition for aggregate filtered queries. */ +export interface MonitorFormulaAndFunctionAggregateQueryFilter { + /** Attribute from the base query to filter on. */ + base_attribute: string; + /** Whether to exclude matching records instead of including them. */ + exclude?: boolean; + /** Attribute from the filter query to match against. */ + filter_attribute: string; +} +export const MonitorFormulaAndFunctionAggregateQueryFilter = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + base_attribute: S.String, + exclude: S.optional(S.Boolean), + filter_attribute: S.String, + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionAggregateQueryFilter", + }) as any as S.Schema; + +/** Filter conditions for the query. */ +export type MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList = + Array; +export const MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionAggregateQueryFilter, + ) as any as S.Schema; + +/** Group by options for the query. */ +export type MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList = + Array; +export const MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList = + /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionEventQueryGroupBy, + ) as any as S.Schema; + +/** A formula and functions aggregate filtered query. Used to filter base query results using data from another source. */ +export interface MonitorFormulaAndFunctionAggregateFilteredQueryDefinition { + base_query: MonitorFormulaAndFunctionAggregateBaseQuery; + /** Compute options for the query. */ + compute?: MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList; + data_source: MonitorFormulaAndFunctionAggregateFilteredDataSource; + filter_query: MonitorFormulaAndFunctionAggregateFilterQuery; + /** Filter conditions for the query. */ + filters: MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList; + /** Group by options for the query. */ + group_by?: MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList; + /** Name of the query for use in formulas. */ + name?: string; +} +export const MonitorFormulaAndFunctionAggregateFilteredQueryDefinition = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + base_query: MonitorFormulaAndFunctionAggregateBaseQuery, + compute: S.optional( + MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionComputeList, + ), + data_source: MonitorFormulaAndFunctionAggregateFilteredDataSource, + filter_query: MonitorFormulaAndFunctionAggregateFilterQuery, + filters: + MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionFiltersList, + group_by: S.optional( + MonitorFormulaAndFunctionAggregateFilteredQueryDefinitionGroupByList, + ), + name: S.optional(S.String), + }), + ).annotate({ + identifier: "MonitorFormulaAndFunctionAggregateFilteredQueryDefinition", + }) as any as S.Schema; + +/** A formula and function query. */ +export type MonitorFormulaAndFunctionQueryDefinition = + | MonitorFormulaAndFunctionEventQueryDefinition + | MonitorFormulaAndFunctionCostQueryDefinition + | MonitorFormulaAndFunctionDataQualityQueryDefinition + | MonitorFormulaAndFunctionDataJobsQueryDefinition + | MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition + | MonitorFormulaAndFunctionAggregateFilteredQueryDefinition; +export const MonitorFormulaAndFunctionQueryDefinition = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** List of requests that can be used in the monitor query. **This feature is currently in beta.** */ +export type MonitorOptionsInputVariablesList = + Array; +export const MonitorOptionsInputVariablesList = /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionQueryDefinition, +) as any as S.Schema; + +/** List of options associated with your monitor. */ +export interface MonitorOptionsInput { + /** Whether or not to send a log sample when the log monitor triggers. */ + enable_logs_sample?: boolean; + /** Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors. */ + enable_samples?: boolean; + /** We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify/?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the `@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`. */ + escalation_message?: string; + /** Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation. */ + evaluation_delay?: number | null; + /** The time span after which groups with missing data are dropped from the monitor state. The minimum value is one hour, and the maximum value is 72 hours. Example values are: "60m", "1h", and "2d". This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. */ + group_retention_duration?: string; + /** Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead. */ + groupby_simple_monitor?: boolean; + /** A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title. **Examples** - If `True`, `[Triggered on {host:h1}] Monitor Title` - If `False`, `[Triggered] Monitor Title` */ + include_tags?: boolean; + /** Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead. */ + locked?: boolean; + /** How long the test should be in failure before alerting (integer, number of seconds, max 7200). */ + min_failure_duration?: number | null; + /** The minimum number of locations in failure at the same time during at least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1). */ + min_location_failed?: number | null; + /** Time (in seconds) to skip evaluations for new groups. For example, this option can be used to skip evaluations for new hosts while they initialize. Must be a non negative integer. */ + new_group_delay?: number | null; + /** Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer. Use new_group_delay instead. */ + new_host_delay?: number | null; + /** The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks. */ + no_data_timeframe?: number | null; + notification_preset_name?: MonitorOptionsNotificationPresets | (string & {}); + /** A Boolean indicating whether tagged users is notified on changes to this monitor. */ + notify_audit?: boolean; + /** Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert. */ + notify_by?: MonitorOptionsInputNotifyByList; + /** A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`. */ + notify_no_data?: boolean; + on_missing_data?: OnMissingDataOption | (string & {}); + /** The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved. */ + renotify_interval?: number | null; + /** The number of times re-notification messages should be sent on the current status at the provided re-notification interval. */ + renotify_occurrences?: number | null; + /** The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`. */ + renotify_statuses?: MonitorOptionsInputRenotifyStatusesList | null; + /** A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. This setting only applies to metric monitors. */ + require_full_window?: boolean; + scheduling_options?: MonitorOptionsSchedulingOptions; + /** Information about the downtime applied to the monitor. Only shows v1 downtimes. */ + silenced?: MonitorOptionsInputSilencedMap; + /** ID of the corresponding Synthetic check. */ + synthetics_check_id?: string | null; + threshold_windows?: MonitorThresholdWindowOptions; + thresholds?: MonitorThresholds; + /** The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours. */ + timeout_h?: number | null; + /** List of requests that can be used in the monitor query. **This feature is currently in beta.** */ + variables?: MonitorOptionsInputVariablesList; +} +export const MonitorOptionsInput = /*@__PURE__*/ S.suspend(() => + S.Struct({ + enable_logs_sample: S.optional(S.Boolean), + enable_samples: S.optional(S.Boolean), + escalation_message: S.optional(S.String), + evaluation_delay: S.optional(S.NullOr(S.Number)), + group_retention_duration: S.optional(S.String), + groupby_simple_monitor: S.optional(S.Boolean), + include_tags: S.optional(S.Boolean), + locked: S.optional(S.Boolean), + min_failure_duration: S.optional(S.NullOr(S.Number)), + min_location_failed: S.optional(S.NullOr(S.Number)), + new_group_delay: S.optional(S.NullOr(S.Number)), + new_host_delay: S.optional(S.NullOr(S.Number)), + no_data_timeframe: S.optional(S.NullOr(S.Number)), + notification_preset_name: S.optional(MonitorOptionsNotificationPresets), + notify_audit: S.optional(S.Boolean), + notify_by: S.optional(MonitorOptionsInputNotifyByList), + notify_no_data: S.optional(S.Boolean), + on_missing_data: S.optional(OnMissingDataOption), + renotify_interval: S.optional(S.NullOr(S.Number)), + renotify_occurrences: S.optional(S.NullOr(S.Number)), + renotify_statuses: S.optional( + S.NullOr(MonitorOptionsInputRenotifyStatusesList), + ), + require_full_window: S.optional(S.Boolean), + scheduling_options: S.optional(MonitorOptionsSchedulingOptions), + silenced: S.optional(MonitorOptionsInputSilencedMap), + synthetics_check_id: S.optional(S.NullOr(S.String)), + threshold_windows: S.optional(MonitorThresholdWindowOptions), + thresholds: S.optional(MonitorThresholds), + timeout_h: S.optional(S.NullOr(S.Number)), + variables: S.optional(MonitorOptionsInputVariablesList), + }), +).annotate({ + identifier: "MonitorOptionsInput", +}) as any as S.Schema; + +/** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ +export type CreateMonitorRequestRestrictedRolesList = Array; +export const CreateMonitorRequestRestrictedRolesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Tags associated to your monitor. */ +export type CreateMonitorRequestTagsList = Array; +export const CreateMonitorRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs. */ +export type MonitorType = + | "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" + | "llm-observability alert"; +export const MonitorType = /*@__PURE__*/ S.String; + +export interface CreateMonitorRequest { + /** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ + assets?: CreateMonitorRequestAssetsList; + draft_status?: MonitorDraftStatus | (string & {}); + /** A list of active v1 downtimes that match this monitor. */ + matching_downtimes?: CreateMonitorRequestMatchingDowntimesList; + /** A message to include with notifications for this monitor. */ + message?: string; + /** The monitor name. */ + name?: string; + options?: MonitorOptionsInput; + /** Integer from 1 (high) to 5 (low) indicating alert severity. */ + priority?: number | null; + /** The monitor query. */ + query: string; + /** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ + restricted_roles?: CreateMonitorRequestRestrictedRolesList | null; + /** Tags associated to your monitor. */ + tags?: CreateMonitorRequestTagsList; + type: MonitorType | (string & {}); +} +export const CreateMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + assets: S.optional(CreateMonitorRequestAssetsList), + draft_status: S.optional(MonitorDraftStatus), + matching_downtimes: S.optional(CreateMonitorRequestMatchingDowntimesList), + message: S.optional(S.String), + name: S.optional(S.String), + options: S.optional(MonitorOptionsInput), + priority: S.optional(S.NullOr(S.Number)), + query: S.String, + restricted_roles: S.optional( + S.NullOr(CreateMonitorRequestRestrictedRolesList), + ), + tags: S.optional(CreateMonitorRequestTagsList), + type: MonitorType, + }).pipe(T.Http({ method: "POST", uri: "/api/v1/monitor", code: 200 })), +).annotate({ + identifier: "CreateMonitorRequest", +}) as any as S.Schema; + +/** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ +export type MonitorAssetsList = Array; +export const MonitorAssetsList = /*@__PURE__*/ S.Array( + MonitorAsset, +) as any as S.Schema; + +/** Object describing the creator of the shared element. */ +export interface Creator { + /** Email of the creator. */ + email?: string; + /** Handle of the creator. */ + handle?: string; + /** Name of the creator. */ + name?: string | null; +} +export const Creator = /*@__PURE__*/ S.suspend(() => + S.Struct({ + email: S.optional(S.String), + handle: S.optional(S.String), + name: S.optional(S.NullOr(S.String)), + }), +).annotate({ identifier: "Creator" }) as any as S.Schema; + +/** The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). */ +export type MatchingDowntimeScopeList = Array; +export const MatchingDowntimeScopeList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Object describing a downtime that matches this monitor. */ +export interface MatchingDowntime { + /** POSIX timestamp to end the downtime. */ + end?: number | null; + /** The downtime ID. */ + id: number; + /** The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). */ + scope?: MatchingDowntimeScopeList; + /** POSIX timestamp to start the downtime. */ + start?: number; +} +export const MatchingDowntime = /*@__PURE__*/ S.suspend(() => + S.Struct({ + end: S.optional(S.NullOr(S.Number)), + id: S.Number, + scope: S.optional(MatchingDowntimeScopeList), + start: S.optional(S.Number), + }), +).annotate({ + identifier: "MatchingDowntime", +}) as any as S.Schema; + +/** A list of active v1 downtimes that match this monitor. */ +export type MonitorMatchingDowntimesList = Array; +export const MonitorMatchingDowntimesList = /*@__PURE__*/ S.Array( + MatchingDowntime, +) as any as S.Schema; + +/** Type of aggregation performed in the monitor query. */ +export interface MonitorOptionsAggregation { + /** Group to break down the monitor on. */ + group_by?: string; + /** Metric name used in the monitor. */ + metric?: string; + /** Metric type used in the monitor. */ + type?: string; +} +export const MonitorOptionsAggregation = /*@__PURE__*/ S.suspend(() => + S.Struct({ + group_by: S.optional(S.String), + metric: S.optional(S.String), + type: S.optional(S.String), + }), +).annotate({ + identifier: "MonitorOptionsAggregation", +}) as any as S.Schema; + +/** ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`. */ +export type MonitorDeviceID = + | "laptop_large" + | "tablet" + | "mobile_small" + | "chrome.laptop_large" + | "chrome.tablet" + | "chrome.mobile_small" + | "firefox.laptop_large" + | "firefox.tablet" + | "firefox.mobile_small"; +export const MonitorDeviceID = /*@__PURE__*/ S.String; + +/** IDs of the device the Synthetics monitor is running on. */ +export type MonitorOptionsDeviceIdsList = Array; +export const MonitorOptionsDeviceIdsList = /*@__PURE__*/ S.Array( + MonitorDeviceID, +) as any as S.Schema; + +/** Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert. */ +export type MonitorOptionsNotifyByList = Array; +export const MonitorOptionsNotifyByList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`. */ +export type MonitorOptionsRenotifyStatusesList = + Array; +export const MonitorOptionsRenotifyStatusesList = /*@__PURE__*/ S.Array( + MonitorRenotifyStatusType, +) as any as S.Schema; + +/** Information about the downtime applied to the monitor. Only shows v1 downtimes. */ +export type MonitorOptionsSilencedMap = { [key: string]: number | undefined }; +export const MonitorOptionsSilencedMap = /*@__PURE__*/ S.Record( + S.String, + S.Number, +) as any as S.Schema; + +/** List of requests that can be used in the monitor query. **This feature is currently in beta.** */ +export type MonitorOptionsVariablesList = + Array; +export const MonitorOptionsVariablesList = /*@__PURE__*/ S.Array( + MonitorFormulaAndFunctionQueryDefinition, +) as any as S.Schema; + +/** List of options associated with your monitor. */ +export interface MonitorOptions { + aggregation?: MonitorOptionsAggregation; + /** IDs of the device the Synthetics monitor is running on. */ + device_ids?: MonitorOptionsDeviceIdsList; + /** Whether or not to send a log sample when the log monitor triggers. */ + enable_logs_sample?: boolean; + /** Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors. */ + enable_samples?: boolean; + /** We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify/?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the `@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`. */ + escalation_message?: string; + /** Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation. */ + evaluation_delay?: number | null; + /** The time span after which groups with missing data are dropped from the monitor state. The minimum value is one hour, and the maximum value is 72 hours. Example values are: "60m", "1h", and "2d". This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. */ + group_retention_duration?: string; + /** Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead. */ + groupby_simple_monitor?: boolean; + /** A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title. **Examples** - If `True`, `[Triggered on {host:h1}] Monitor Title` - If `False`, `[Triggered] Monitor Title` */ + include_tags?: boolean; + /** Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead. */ + locked?: boolean; + /** How long the test should be in failure before alerting (integer, number of seconds, max 7200). */ + min_failure_duration?: number | null; + /** The minimum number of locations in failure at the same time during at least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1). */ + min_location_failed?: number | null; + /** Time (in seconds) to skip evaluations for new groups. For example, this option can be used to skip evaluations for new hosts while they initialize. Must be a non negative integer. */ + new_group_delay?: number | null; + /** Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer. Use new_group_delay instead. */ + new_host_delay?: number | null; + /** The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks. */ + no_data_timeframe?: number | null; + notification_preset_name?: MonitorOptionsNotificationPresets; + /** A Boolean indicating whether tagged users is notified on changes to this monitor. */ + notify_audit?: boolean; + /** Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert. */ + notify_by?: MonitorOptionsNotifyByList; + /** A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`. */ + notify_no_data?: boolean; + on_missing_data?: OnMissingDataOption; + /** The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved. */ + renotify_interval?: number | null; + /** The number of times re-notification messages should be sent on the current status at the provided re-notification interval. */ + renotify_occurrences?: number | null; + /** The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`. */ + renotify_statuses?: MonitorOptionsRenotifyStatusesList | null; + /** A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. This setting only applies to metric monitors. */ + require_full_window?: boolean; + scheduling_options?: MonitorOptionsSchedulingOptions; + /** Information about the downtime applied to the monitor. Only shows v1 downtimes. */ + silenced?: MonitorOptionsSilencedMap; + /** ID of the corresponding Synthetic check. */ + synthetics_check_id?: string | null; + threshold_windows?: MonitorThresholdWindowOptions; + thresholds?: MonitorThresholds; + /** The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours. */ + timeout_h?: number | null; + /** List of requests that can be used in the monitor query. **This feature is currently in beta.** */ + variables?: MonitorOptionsVariablesList; +} +export const MonitorOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggregation: S.optional(MonitorOptionsAggregation), + device_ids: S.optional(MonitorOptionsDeviceIdsList), + enable_logs_sample: S.optional(S.Boolean), + enable_samples: S.optional(S.Boolean), + escalation_message: S.optional(S.String), + evaluation_delay: S.optional(S.NullOr(S.Number)), + group_retention_duration: S.optional(S.String), + groupby_simple_monitor: S.optional(S.Boolean), + include_tags: S.optional(S.Boolean), + locked: S.optional(S.Boolean), + min_failure_duration: S.optional(S.NullOr(S.Number)), + min_location_failed: S.optional(S.NullOr(S.Number)), + new_group_delay: S.optional(S.NullOr(S.Number)), + new_host_delay: S.optional(S.NullOr(S.Number)), + no_data_timeframe: S.optional(S.NullOr(S.Number)), + notification_preset_name: S.optional(MonitorOptionsNotificationPresets), + notify_audit: S.optional(S.Boolean), + notify_by: S.optional(MonitorOptionsNotifyByList), + notify_no_data: S.optional(S.Boolean), + on_missing_data: S.optional(OnMissingDataOption), + renotify_interval: S.optional(S.NullOr(S.Number)), + renotify_occurrences: S.optional(S.NullOr(S.Number)), + renotify_statuses: S.optional(S.NullOr(MonitorOptionsRenotifyStatusesList)), + require_full_window: S.optional(S.Boolean), + scheduling_options: S.optional(MonitorOptionsSchedulingOptions), + silenced: S.optional(MonitorOptionsSilencedMap), + synthetics_check_id: S.optional(S.NullOr(S.String)), + threshold_windows: S.optional(MonitorThresholdWindowOptions), + thresholds: S.optional(MonitorThresholds), + timeout_h: S.optional(S.NullOr(S.Number)), + variables: S.optional(MonitorOptionsVariablesList), + }), +).annotate({ identifier: "MonitorOptions" }) as any as S.Schema; + +/** The different states your monitor can be in. */ +export type MonitorOverallStates = + | "Alert" + | "Ignored" + | "No Data" + | "OK" + | "Skipped" + | "Unknown" + | "Warn"; +export const MonitorOverallStates = /*@__PURE__*/ S.String; + +/** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ +export type MonitorRestrictedRolesList = Array; +export const MonitorRestrictedRolesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Monitor state for a single group. */ +export interface MonitorStateGroup { + /** Latest timestamp the monitor was in NO_DATA state. */ + last_nodata_ts?: number; + /** Latest timestamp of the notification sent for this monitor group. */ + last_notified_ts?: number; + /** Latest timestamp the monitor group was resolved. */ + last_resolved_ts?: number; + /** Latest timestamp the monitor group triggered. */ + last_triggered_ts?: number; + /** The name of the monitor. */ + name?: string; + status?: MonitorOverallStates; +} +export const MonitorStateGroup = /*@__PURE__*/ S.suspend(() => + S.Struct({ + last_nodata_ts: S.optional(S.Number), + last_notified_ts: S.optional(S.Number), + last_resolved_ts: S.optional(S.Number), + last_triggered_ts: S.optional(S.Number), + name: S.optional(S.String), + status: S.optional(MonitorOverallStates), + }), +).annotate({ + identifier: "MonitorStateGroup", +}) as any as S.Schema; + +/** Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on. */ +export type MonitorStateGroupsMap = { + [key: string]: MonitorStateGroup | undefined; +}; +export const MonitorStateGroupsMap = /*@__PURE__*/ S.Record( + S.String, + MonitorStateGroup, +) as any as S.Schema; + +/** Wrapper object with the different monitor states. */ +export interface MonitorState { + /** Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on. */ + groups?: MonitorStateGroupsMap; +} +export const MonitorState = /*@__PURE__*/ S.suspend(() => + S.Struct({ + groups: S.optional(MonitorStateGroupsMap), + }), +).annotate({ identifier: "MonitorState" }) as any as S.Schema; + +/** Tags associated to your monitor. */ +export type MonitorTagsList = Array; +export const MonitorTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Object describing a monitor. */ +export interface Monitor { + /** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ + assets?: MonitorAssetsList; + /** Timestamp of the monitor creation. */ + created?: string; + creator?: Creator; + /** Whether or not the monitor is deleted. (Always `null`) */ + deleted?: string | null; + draft_status?: MonitorDraftStatus; + /** ID of this monitor. */ + id?: number; + /** A list of active v1 downtimes that match this monitor. */ + matching_downtimes?: MonitorMatchingDowntimesList; + /** A message to include with notifications for this monitor. */ + message?: string; + /** Last timestamp when the monitor was edited. */ + modified?: string; + /** Whether or not the monitor is broken down on different groups. */ + multi?: boolean; + /** The monitor name. */ + name?: string; + options?: MonitorOptions; + overall_state?: MonitorOverallStates; + /** Integer from 1 (high) to 5 (low) indicating alert severity. */ + priority?: number | null; + /** The monitor query. */ + query: string; + /** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ + restricted_roles?: MonitorRestrictedRolesList | null; + state?: MonitorState; + /** Tags associated to your monitor. */ + tags?: MonitorTagsList; + type: MonitorType; +} +export const Monitor = /*@__PURE__*/ S.suspend(() => + S.Struct({ + assets: S.optional(MonitorAssetsList), + created: S.optional(S.String), + creator: S.optional(Creator), + deleted: S.optional(S.NullOr(S.String)), + draft_status: S.optional(MonitorDraftStatus), + id: S.optional(S.Number), + matching_downtimes: S.optional(MonitorMatchingDowntimesList), + message: S.optional(S.String), + modified: S.optional(S.String), + multi: S.optional(S.Boolean), + name: S.optional(S.String), + options: S.optional(MonitorOptions), + overall_state: S.optional(MonitorOverallStates), + priority: S.optional(S.NullOr(S.Number)), + query: S.String, + restricted_roles: S.optional(S.NullOr(MonitorRestrictedRolesList)), + state: S.optional(MonitorState), + tags: S.optional(MonitorTagsList), + type: MonitorType, + }), +).annotate({ identifier: "Monitor" }) as any as S.Schema; + +export interface DeleteMonitorRequest { + /** The ID of the monitor. */ + monitor_id: number; + /** Delete the monitor even if it's referenced by other resources (for example SLO, composite monitor). */ + force?: string; +} +export const DeleteMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + monitor_id: S.Number.pipe(T.Label()), + force: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/api/v1/monitor/{monitor_id}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteMonitorRequest", +}) as any as S.Schema; + +/** Response from the delete monitor call. */ +export interface DeletedMonitor { + /** ID of the deleted monitor. */ + deleted_monitor_id?: number; +} +export const DeletedMonitor = /*@__PURE__*/ S.suspend(() => + S.Struct({ + deleted_monitor_id: S.optional(S.Number), + }), +).annotate({ identifier: "DeletedMonitor" }) as any as S.Schema; + +export interface GetMonitorRequest { + /** The ID of the monitor */ + monitor_id: number; + /** When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. */ + group_states?: string; + /** If this argument is set to true, then the returned data includes all current active downtimes for the monitor. */ + with_downtimes?: boolean; + /** If this argument is set to `true`, the returned data includes all assets tied to this monitor. */ + with_assets?: boolean; +} +export const GetMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + monitor_id: S.Number.pipe(T.Label()), + group_states: S.optional(S.String.pipe(T.Query())), + with_downtimes: S.optional(S.Boolean.pipe(T.Query())), + with_assets: S.optional(S.Boolean.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/api/v1/monitor/{monitor_id}", code: 200 }), + ), +).annotate({ + identifier: "GetMonitorRequest", +}) as any as S.Schema; + +export interface ListMonitorsRequest { + /** When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. */ + group_states?: string; + /** A string to filter monitors by name. */ + name?: string; + /** A comma separated list indicating what tags, if any, should be used to filter the list of monitors by scope. For example, `host:host0`. */ + tags?: string; + /** A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended. For example, `service:my-app`. */ + monitor_tags?: string; + /** If this argument is set to true, then the returned data includes all current active downtimes for each monitor. */ + with_downtimes?: boolean; + /** Use this parameter for paginating through large sets of monitors. Start with a value of zero, make a request, set the value to the last ID of result set, and then repeat until the response is empty. */ + id_offset?: number; + /** The page to start paginating from. If this argument is not specified, the request returns all monitors without pagination. */ + page?: number; + /** The number of monitors to return per page. If the page argument is not specified, the default behavior returns all monitors without a `page_size` limit. However, if page is specified and `page_size` is not, the argument defaults to 100. */ + page_size?: number; +} +export const ListMonitorsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + group_states: S.optional(S.String.pipe(T.Query())), + name: S.optional(S.String.pipe(T.Query())), + tags: S.optional(S.String.pipe(T.Query())), + monitor_tags: S.optional(S.String.pipe(T.Query())), + with_downtimes: S.optional(S.Boolean.pipe(T.Query())), + id_offset: S.optional(S.Number.pipe(T.Query())), + page: S.optional(S.Number.pipe(T.Query())), + page_size: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/monitor", code: 200 })), +).annotate({ + identifier: "ListMonitorsRequest", +}) as any as S.Schema; + +/** An array of monitor objects. */ +export type ListMonitorsResponseBodyList = Array; +export const ListMonitorsResponseBodyList = /*@__PURE__*/ S.Array( + Monitor, +) as any as S.Schema; + +export type ListMonitorsResponse = ListMonitorsResponseBodyList; +export const ListMonitorsResponse = /*@__PURE__*/ S.suspend(() => + ListMonitorsResponseBodyList.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "ListMonitorsResponse", +}) as any as S.Schema; + +export interface SearchMonitorGroupsRequest { + /** After entering a search query on the [Triggered Monitors page][1], use the query parameter value in the URL of the page as a value for this parameter. For more information, see the [Manage Monitors documentation][2]. The query can contain any number of space-separated monitor attributes, for instance: `query="type:metric group_status:alert"`. [1]: https://app.datadoghq.com/monitors/triggered [2]: /monitors/manage/#triggered-monitors */ + query?: string; + /** Page to start paginating from. */ + page?: number; + /** Number of monitors to return per page. */ + per_page?: number; + /** String for sort order, composed of field and sort order separate by a comma, for example `name,asc`. Supported sort directions: `asc`, `desc`. Supported fields: * `name` * `status` * `tags` */ + sort?: string; +} +export const SearchMonitorGroupsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + query: S.optional(S.String.pipe(T.Query())), + page: S.optional(S.Number.pipe(T.Query())), + per_page: S.optional(S.Number.pipe(T.Query())), + sort: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/api/v1/monitor/groups/search", code: 200 }), + ), +).annotate({ + identifier: "SearchMonitorGroupsRequest", +}) as any as S.Schema; + +/** A facet item. */ +export interface MonitorSearchCountItem { + /** The number of found monitors with the listed value. */ + count?: number; + /** The facet value. */ + name?: unknown; +} +export const MonitorSearchCountItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + count: S.optional(S.Number), + name: S.optional(S.Unknown), + }), +).annotate({ + identifier: "MonitorSearchCountItem", +}) as any as S.Schema; + +/** Search facets. */ +export type MonitorSearchCount = Array; +export const MonitorSearchCount = /*@__PURE__*/ S.Array( + MonitorSearchCountItem, +) as any as S.Schema; + +/** The counts of monitor groups per different criteria. */ +export interface MonitorGroupSearchResponseCounts { + status?: MonitorSearchCount; + type?: MonitorSearchCount; +} +export const MonitorGroupSearchResponseCounts = /*@__PURE__*/ S.suspend(() => + S.Struct({ + status: S.optional(MonitorSearchCount), + type: S.optional(MonitorSearchCount), + }), +).annotate({ + identifier: "MonitorGroupSearchResponseCounts", +}) as any as S.Schema; + +/** The list of tags of the monitor group. */ +export type MonitorGroupSearchResultGroupTagsList = Array; +export const MonitorGroupSearchResultGroupTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A single monitor group search result. */ +export interface MonitorGroupSearchResult { + /** The name of the group. */ + group?: string; + /** The list of tags of the monitor group. */ + group_tags?: MonitorGroupSearchResultGroupTagsList; + /** Latest timestamp the monitor group was in NO_DATA state. */ + last_nodata_ts?: number; + /** Latest timestamp the monitor group triggered. */ + last_triggered_ts?: number | null; + /** The ID of the monitor. */ + monitor_id?: number; + /** The name of the monitor. */ + monitor_name?: string; + status?: MonitorOverallStates; +} +export const MonitorGroupSearchResult = /*@__PURE__*/ S.suspend(() => + S.Struct({ + group: S.optional(S.String), + group_tags: S.optional(MonitorGroupSearchResultGroupTagsList), + last_nodata_ts: S.optional(S.Number), + last_triggered_ts: S.optional(S.NullOr(S.Number)), + monitor_id: S.optional(S.Number), + monitor_name: S.optional(S.String), + status: S.optional(MonitorOverallStates), + }), +).annotate({ + identifier: "MonitorGroupSearchResult", +}) as any as S.Schema; + +/** The list of found monitor groups. */ +export type MonitorGroupSearchResponseGroupsList = + Array; +export const MonitorGroupSearchResponseGroupsList = /*@__PURE__*/ S.Array( + MonitorGroupSearchResult, +) as any as S.Schema; + +/** Metadata about the response. */ +export interface MonitorSearchResponseMetadata { + /** The page to start paginating from. */ + page?: number; + /** The number of pages. */ + page_count?: number; + /** The number of monitors to return per page. */ + per_page?: number; + /** The total number of monitors. */ + total_count?: number; +} +export const MonitorSearchResponseMetadata = /*@__PURE__*/ S.suspend(() => + S.Struct({ + page: S.optional(S.Number), + page_count: S.optional(S.Number), + per_page: S.optional(S.Number), + total_count: S.optional(S.Number), + }), +).annotate({ + identifier: "MonitorSearchResponseMetadata", +}) as any as S.Schema; + +/** The response of a monitor group search. */ +export interface MonitorGroupSearchResponse { + counts?: MonitorGroupSearchResponseCounts; + /** The list of found monitor groups. */ + groups?: MonitorGroupSearchResponseGroupsList; + metadata?: MonitorSearchResponseMetadata; +} +export const MonitorGroupSearchResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + counts: S.optional(MonitorGroupSearchResponseCounts), + groups: S.optional(MonitorGroupSearchResponseGroupsList), + metadata: S.optional(MonitorSearchResponseMetadata), + }), +).annotate({ + identifier: "MonitorGroupSearchResponse", +}) as any as S.Schema; + +export interface SearchMonitorsRequest { + /** After entering a search query in your [Manage Monitor page][1] use the query parameter value in the URL of the page as value for this parameter. Consult the dedicated [manage monitor documentation][2] page to learn more. The query can contain any number of space-separated monitor attributes, for instance `query="type:metric status:alert"`. [1]: https://app.datadoghq.com/monitors/manage [2]: /monitors/manage/#find-the-monitors */ + query?: string; + /** Page to start paginating from. */ + page?: number; + /** Number of monitors to return per page. */ + per_page?: number; + /** String for sort order, composed of field and sort order separate by a comma, for example `name,asc`. Supported sort directions: `asc`, `desc`. Supported fields: * `name` * `status` * `tags` */ + sort?: string; +} +export const SearchMonitorsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + query: S.optional(S.String.pipe(T.Query())), + page: S.optional(S.Number.pipe(T.Query())), + per_page: S.optional(S.Number.pipe(T.Query())), + sort: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/monitor/search", code: 200 })), +).annotate({ + identifier: "SearchMonitorsRequest", +}) as any as S.Schema; + +/** The counts of monitors per different criteria. */ +export interface MonitorSearchResponseCounts { + muted?: MonitorSearchCount; + status?: MonitorSearchCount; + tag?: MonitorSearchCount; + type?: MonitorSearchCount; +} +export const MonitorSearchResponseCounts = /*@__PURE__*/ S.suspend(() => + S.Struct({ + muted: S.optional(MonitorSearchCount), + status: S.optional(MonitorSearchCount), + tag: S.optional(MonitorSearchCount), + type: S.optional(MonitorSearchCount), + }), +).annotate({ + identifier: "MonitorSearchResponseCounts", +}) as any as S.Schema; + +/** Metrics used by the monitor. */ +export type MonitorSearchResultMetricsList = Array; +export const MonitorSearchResultMetricsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A notification triggered by the monitor. */ +export interface MonitorSearchResultNotification { + /** The email address that received the notification. */ + handle?: string; + /** The username receiving the notification */ + name?: string; +} +export const MonitorSearchResultNotification = /*@__PURE__*/ S.suspend(() => + S.Struct({ + handle: S.optional(S.String), + name: S.optional(S.String), + }), +).annotate({ + identifier: "MonitorSearchResultNotification", +}) as any as S.Schema; + +/** The notification triggered by the monitor. */ +export type MonitorSearchResultNotificationsList = + Array; +export const MonitorSearchResultNotificationsList = /*@__PURE__*/ S.Array( + MonitorSearchResultNotification, +) as any as S.Schema; + +/** Quality issues detected with the monitor. */ +export type MonitorSearchResultQualityIssuesList = Array; +export const MonitorSearchResultQualityIssuesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The scope(s) to which the downtime applies, for example `host:app2`. Provide multiple scopes as a comma-separated list, for example `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (that is `env:dev AND env:prod`), NOT any of them. */ +export type MonitorSearchResultScopesList = Array; +export const MonitorSearchResultScopesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Tags associated with the monitor. */ +export type MonitorSearchResultTagsList = Array; +export const MonitorSearchResultTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Holds search results. */ +export interface MonitorSearchResult { + /** Classification of the monitor. */ + classification?: string; + creator?: Creator; + /** ID of the monitor. */ + id?: number; + /** Latest timestamp the monitor triggered. */ + last_triggered_ts?: number | null; + /** Metrics used by the monitor. */ + metrics?: MonitorSearchResultMetricsList; + /** The monitor name. */ + name?: string; + /** The notification triggered by the monitor. */ + notifications?: MonitorSearchResultNotificationsList; + /** The ID of the organization. */ + org_id?: number; + /** Quality issues detected with the monitor. */ + quality_issues?: MonitorSearchResultQualityIssuesList; + /** The monitor query. */ + query?: string; + /** The scope(s) to which the downtime applies, for example `host:app2`. Provide multiple scopes as a comma-separated list, for example `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (that is `env:dev AND env:prod`), NOT any of them. */ + scopes?: MonitorSearchResultScopesList; + status?: MonitorOverallStates; + /** Tags associated with the monitor. */ + tags?: MonitorSearchResultTagsList; + type?: MonitorType; +} +export const MonitorSearchResult = /*@__PURE__*/ S.suspend(() => + S.Struct({ + classification: S.optional(S.String), + creator: S.optional(Creator), + id: S.optional(S.Number), + last_triggered_ts: S.optional(S.NullOr(S.Number)), + metrics: S.optional(MonitorSearchResultMetricsList), + name: S.optional(S.String), + notifications: S.optional(MonitorSearchResultNotificationsList), + org_id: S.optional(S.Number), + quality_issues: S.optional(MonitorSearchResultQualityIssuesList), + query: S.optional(S.String), + scopes: S.optional(MonitorSearchResultScopesList), + status: S.optional(MonitorOverallStates), + tags: S.optional(MonitorSearchResultTagsList), + type: S.optional(MonitorType), + }), +).annotate({ + identifier: "MonitorSearchResult", +}) as any as S.Schema; + +/** The list of found monitors. */ +export type MonitorSearchResponseMonitorsList = Array; +export const MonitorSearchResponseMonitorsList = /*@__PURE__*/ S.Array( + MonitorSearchResult, +) as any as S.Schema; + +/** The response from a monitor search. */ +export interface MonitorSearchResponse { + counts?: MonitorSearchResponseCounts; + metadata?: MonitorSearchResponseMetadata; + /** The list of found monitors. */ + monitors?: MonitorSearchResponseMonitorsList; +} +export const MonitorSearchResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + counts: S.optional(MonitorSearchResponseCounts), + metadata: S.optional(MonitorSearchResponseMetadata), + monitors: S.optional(MonitorSearchResponseMonitorsList), + }), +).annotate({ + identifier: "MonitorSearchResponse", +}) as any as S.Schema; + +/** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ +export type UpdateMonitorRequestAssetsList = Array; +export const UpdateMonitorRequestAssetsList = /*@__PURE__*/ S.Array( + MonitorAsset, +) as any as S.Schema; + +/** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ +export type UpdateMonitorRequestRestrictedRolesList = Array; +export const UpdateMonitorRequestRestrictedRolesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Tags associated to your monitor. */ +export type UpdateMonitorRequestTagsList = Array; +export const UpdateMonitorRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface UpdateMonitorRequest { + /** The ID of the monitor. */ + monitor_id: number; + /** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ + assets?: UpdateMonitorRequestAssetsList | null; + draft_status?: MonitorDraftStatus | (string & {}); + /** A message to include with notifications for this monitor. */ + message?: string; + /** The monitor name. */ + name?: string; + options?: MonitorOptionsInput; + /** Integer from 1 (high) to 5 (low) indicating alert severity. */ + priority?: number | null; + /** The monitor query. */ + query?: string; + /** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ + restricted_roles?: UpdateMonitorRequestRestrictedRolesList | null; + /** Tags associated to your monitor. */ + tags?: UpdateMonitorRequestTagsList; + type?: MonitorType | (string & {}); +} +export const UpdateMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + monitor_id: S.Number.pipe(T.Label()), + assets: S.optional(S.NullOr(UpdateMonitorRequestAssetsList)), + draft_status: S.optional(MonitorDraftStatus), + message: S.optional(S.String), + name: S.optional(S.String), + options: S.optional(MonitorOptionsInput), + priority: S.optional(S.NullOr(S.Number)), + query: S.optional(S.String), + restricted_roles: S.optional( + S.NullOr(UpdateMonitorRequestRestrictedRolesList), + ), + tags: S.optional(UpdateMonitorRequestTagsList), + type: S.optional(MonitorType), + }).pipe( + T.Http({ method: "PUT", uri: "/api/v1/monitor/{monitor_id}", code: 200 }), + ), +).annotate({ + identifier: "UpdateMonitorRequest", +}) as any as S.Schema; + +/** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ +export type ValidateExistingMonitorRequestAssetsList = Array; +export const ValidateExistingMonitorRequestAssetsList = /*@__PURE__*/ S.Array( + MonitorAsset, +) as any as S.Schema; + +/** A list of active v1 downtimes that match this monitor. */ +export type ValidateExistingMonitorRequestMatchingDowntimesList = + Array; +export const ValidateExistingMonitorRequestMatchingDowntimesList = + /*@__PURE__*/ S.Array( + MatchingDowntimeInput, + ) as any as S.Schema; + +/** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ +export type ValidateExistingMonitorRequestRestrictedRolesList = Array; +export const ValidateExistingMonitorRequestRestrictedRolesList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Tags associated to your monitor. */ +export type ValidateExistingMonitorRequestTagsList = Array; +export const ValidateExistingMonitorRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface ValidateExistingMonitorRequest { + /** The ID of the monitor */ + monitor_id: number; + /** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ + assets?: ValidateExistingMonitorRequestAssetsList; + draft_status?: MonitorDraftStatus | (string & {}); + /** A list of active v1 downtimes that match this monitor. */ + matching_downtimes?: ValidateExistingMonitorRequestMatchingDowntimesList; + /** A message to include with notifications for this monitor. */ + message?: string; + /** The monitor name. */ + name?: string; + options?: MonitorOptionsInput; + /** Integer from 1 (high) to 5 (low) indicating alert severity. */ + priority?: number | null; + /** The monitor query. */ + query: string; + /** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ + restricted_roles?: ValidateExistingMonitorRequestRestrictedRolesList | null; + /** Tags associated to your monitor. */ + tags?: ValidateExistingMonitorRequestTagsList; + type: MonitorType | (string & {}); +} +export const ValidateExistingMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + monitor_id: S.Number.pipe(T.Label()), + assets: S.optional(ValidateExistingMonitorRequestAssetsList), + draft_status: S.optional(MonitorDraftStatus), + matching_downtimes: S.optional( + ValidateExistingMonitorRequestMatchingDowntimesList, + ), + message: S.optional(S.String), + name: S.optional(S.String), + options: S.optional(MonitorOptionsInput), + priority: S.optional(S.NullOr(S.Number)), + query: S.String, + restricted_roles: S.optional( + S.NullOr(ValidateExistingMonitorRequestRestrictedRolesList), + ), + tags: S.optional(ValidateExistingMonitorRequestTagsList), + type: MonitorType, + }).pipe( + T.Http({ + method: "POST", + uri: "/api/v1/monitor/{monitor_id}/validate", + code: 200, + }), + ), +).annotate({ + identifier: "ValidateExistingMonitorRequest", +}) as any as S.Schema; + +export type ValidateExistingMonitorResponse = unknown; +export const ValidateExistingMonitorResponse = /*@__PURE__*/ S.suspend(() => + S.Unknown.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "ValidateExistingMonitorResponse", +}) as any as S.Schema; + +/** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ +export type ValidateMonitorRequestAssetsList = Array; +export const ValidateMonitorRequestAssetsList = /*@__PURE__*/ S.Array( + MonitorAsset, +) as any as S.Schema; + +/** A list of active v1 downtimes that match this monitor. */ +export type ValidateMonitorRequestMatchingDowntimesList = + Array; +export const ValidateMonitorRequestMatchingDowntimesList = + /*@__PURE__*/ S.Array( + MatchingDowntimeInput, + ) as any as S.Schema; + +/** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ +export type ValidateMonitorRequestRestrictedRolesList = Array; +export const ValidateMonitorRequestRestrictedRolesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Tags associated to your monitor. */ +export type ValidateMonitorRequestTagsList = Array; +export const ValidateMonitorRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface ValidateMonitorRequest { + /** The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks). */ + assets?: ValidateMonitorRequestAssetsList; + draft_status?: MonitorDraftStatus | (string & {}); + /** A list of active v1 downtimes that match this monitor. */ + matching_downtimes?: ValidateMonitorRequestMatchingDowntimesList; + /** A message to include with notifications for this monitor. */ + message?: string; + /** The monitor name. */ + name?: string; + options?: MonitorOptionsInput; + /** Integer from 1 (high) to 5 (low) indicating alert severity. */ + priority?: number | null; + /** The monitor query. */ + query: string; + /** A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage write authorization for individual monitors by teams and users, in addition to roles. */ + restricted_roles?: ValidateMonitorRequestRestrictedRolesList | null; + /** Tags associated to your monitor. */ + tags?: ValidateMonitorRequestTagsList; + type: MonitorType | (string & {}); +} +export const ValidateMonitorRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + assets: S.optional(ValidateMonitorRequestAssetsList), + draft_status: S.optional(MonitorDraftStatus), + matching_downtimes: S.optional(ValidateMonitorRequestMatchingDowntimesList), + message: S.optional(S.String), + name: S.optional(S.String), + options: S.optional(MonitorOptionsInput), + priority: S.optional(S.NullOr(S.Number)), + query: S.String, + restricted_roles: S.optional( + S.NullOr(ValidateMonitorRequestRestrictedRolesList), + ), + tags: S.optional(ValidateMonitorRequestTagsList), + type: MonitorType, + }).pipe( + T.Http({ method: "POST", uri: "/api/v1/monitor/validate", code: 200 }), + ), +).annotate({ + identifier: "ValidateMonitorRequest", +}) as any as S.Schema; + +export type ValidateMonitorResponse = unknown; +export const ValidateMonitorResponse = /*@__PURE__*/ S.suspend(() => + S.Unknown.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "ValidateMonitorResponse", +}) as any as S.Schema; + +export type CheckCanDeleteMonitorError = + | BadRequest + | Forbidden + | Conflict + | DatadogOpError; +/** Check if a monitor can be deleted Check if the given monitors can be deleted. */ +export const checkCanDeleteMonitor: API.OperationMethod< + CheckCanDeleteMonitorRequest, + CheckCanDeleteMonitorResponse, + CheckCanDeleteMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CheckCanDeleteMonitorRequest, + output: CheckCanDeleteMonitorResponse, + errors: [BadRequest, Forbidden, Conflict], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type CreateMonitorError = BadRequest | Forbidden | DatadogOpError; +/** Create a monitor Create a monitor using the specified options. #### Monitor Types The type of monitor chosen from: - anomaly: `query alert` - APM: `query alert` or `trace-analytics alert` - composite: `composite` - custom: `service check` - forecast: `query alert` - host: `service check` - integration: `query alert` or `service check` - live process: `process alert` - logs: `log alert` - metric: `query alert` - network: `service check` - outlier: `query alert` - process: `service check` - rum: `rum alert` - SLO: `slo alert` - watchdog: `event-v2 alert` - event-v2: `event-v2 alert` - audit: `audit alert` - error-tracking: `error-tracking alert` - database-monitoring: `database-monitoring alert` - network-performance: `network-performance alert` - cloud cost: `cost alert` - network-path: `network-path alert` **Notes**: - Synthetic monitors are created through the Synthetics API. See the [Synthetics API](https://docs.datadoghq.com/api/latest/synthetics/) documentation for more information. - Log monitors require an unscoped App Key. #### Query Types ##### Metric Alert Query Example: `time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #` - `time_aggr`: avg, sum, max, min, change, or pct_change - `time_window`: `last_#m` (with `#` between 1 and 10080 depending on the monitor type) or `last_#h`(with `#` between 1 and 168 depending on the monitor type) or `last_1d`, or `last_1w` - `space_aggr`: avg, sum, min, or max - `tags`: one or more tags (comma-separated), or * - `key`: a 'key' in key:value tag syntax; defines a separate alert for each tag in the group (multi-alert) - `operator`: <, <=, >, >=, ==, or != - `#`: an integer or decimal number used to set the threshold To use a dynamic threshold on a metric monitor with a formula query, replace `#` with the `threshold` keyword (for example, `... > threshold`) and provide the threshold as a query via `critical_query` on `options.thresholds`. This feature is in preview. If you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window), timeshift):space_aggr:metric{tags} [by {key}] operator #` with: - `change_aggr` change, pct_change - `time_aggr` avg, sum, max, min [Learn more](https://docs.datadoghq.com/monitors/create/types/#define-the-conditions) - `time_window` last\_#m (between 1 and 2880 depending on the monitor type), last\_#h (between 1 and 48 depending on the monitor type), or last_#d (1 or 2) - `timeshift` #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago Use this to create an outlier monitor using the following query: `avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, 'dbscan', 7) > 0` ##### Service Check Query Example: `"check".over(tags).last(count).by(group).count_by_status()` - `check` name of the check, for example `datadog.agent.up` - `tags` one or more quoted tags (comma-separated), or "*". for example: `.over("env:prod", "role:db")`; `over` cannot be blank. - `count` must be at greater than or equal to your max threshold (defined in the `options`). It is limited to 100. For example, if you've specified to notify on 1 critical, 3 ok, and 2 warn statuses, `count` should be at least 3. - `group` must be specified for check monitors. Per-check grouping is already explicitly known for some service checks. For example, Postgres integration monitors are tagged by `db`, `host`, and `port`, and Network monitors by `host`, `instance`, and `url`. See [Service Checks](https://docs.datadoghq.com/api/latest/service-checks/) documentation for more information. ##### Event Alert Query **Note:** The Event Alert Query has been replaced by the Event V2 Alert Query. For more information, see the [Event Migration guide](https://docs.datadoghq.com/service_management/events/guides/migrating_to_new_events_features/). ##### Event V2 Alert Query Example: `events(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. ##### Process Alert Query Example: `processes(search).over(tags).rollup('count').last(timeframe) operator #` - `search` free text search string for querying processes. Matching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) page. - `tags` one or more tags (comma-separated) - `timeframe` the timeframe to roll up the counts. Examples: 10m, 4h. Supported timeframes: s, m, h and d - `operator` <, <=, >, >=, ==, or != - `#` an integer or decimal number used to set the threshold ##### Logs Alert Query Example: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `index_name` For multi-index organizations, the log index in which the request is performed. - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. ##### Composite Query Example: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite monitors * `name` [*required*, *default* = **dynamic, based on query**]: The name of the alert. * `message` [*required*, *default* = **dynamic, based on query**]: A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same '@username' notation as events. * `tags` [*optional*, *default* = **empty list**]: A list of tags to associate with your monitor. When getting all monitor details via the API, use the `monitor_tags` argument to filter results by these tags. It is only available via the API and isn't visible or editable in the Datadog UI. ##### SLO Alert Query Example: `error_budget("slo_id").over("time_window") operator #` - `slo_id`: The alphanumeric SLO ID of the SLO you are configuring the alert for. - `time_window`: The time window of the SLO target you wish to alert on. Valid options: `7d`, `30d`, `90d`. - `operator`: `>=` or `>` ##### Audit Alert Query Example: `audits(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. ##### CI Pipelines Alert Query Example: `ci-pipelines(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. ##### CI Tests Alert Query Example: `ci-tests(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. ##### Error Tracking Alert Query "New issue" example: `error-tracking(query).source(issue_source).new().rollup(rollup_method[, measure]).by(group_by).last(time_window) operator #` "High impact issue" example: `error-tracking(query).source(issue_source).impact().rollup(rollup_method[, measure]).by(group_by).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `issue_source` The issue source - supports `all`, `browser`, `mobile` and `backend` and defaults to `all` if omitted. - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality` and defaults to `count` if omitted. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `group by` Comma-separated list of attributes to group by - should contain at least `issue.id`. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. **Database Monitoring Alert Query** Example: `database-monitoring(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. **Network Performance Alert Query** Example: `network-performance(query).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. **Cost Alert Query** Example: `formula(query).timeframe_type(time_window).function(parameter) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `timeframe_type` The timeframe type to evaluate the cost - for `forecast` supports `current` - for `change`, `anomaly`, `threshold` supports `last` - `time_window` - supports daily roll-up e.g. `7d` - `function` - [optional, defaults to `threshold` monitor if omitted] supports `change`, `anomaly`, `forecast` - `parameter` Specify the parameter of the type - for `change`: - supports `relative`, `absolute` - [optional] supports `#`, where `#` is an integer or decimal number used to set the threshold - for `anomaly`: - supports `direction=both`, `direction=above`, `direction=below` - [optional] supports `threshold=#`, where `#` is an integer or decimal number used to set the threshold - `operator` - for `threshold` supports `<`, `<=`, `>`, `>=`, `==`, or `!=` - for `change` supports `>`, `<` - for `anomaly` supports `>=` - for `forecast` supports `>` - `#` an integer or decimal number used to set the threshold. **Network Path Alert Query** Example: `network-path(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #` - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - `index_name` The data type to monitor on - supports `netpath-path` and `netpath-hop`. - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`. - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. */ +export const createMonitor: API.OperationMethod< + CreateMonitorRequest, + Monitor, + CreateMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateMonitorRequest, + output: Monitor, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type DeleteMonitorError = + | BadRequest + | Forbidden + | NotFound + | DatadogOpError; +/** Delete a monitor Delete the specified monitor */ +export const deleteMonitor: API.OperationMethod< + DeleteMonitorRequest, + DeletedMonitor, + DeleteMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteMonitorRequest, + output: DeletedMonitor, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type GetMonitorError = + | BadRequest + | Forbidden + | NotFound + | DatadogOpError; +/** Get a monitor's details Get details about the specified monitor from your organization. */ +export const getMonitor: API.OperationMethod< + GetMonitorRequest, + Monitor, + GetMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetMonitorRequest, + output: Monitor, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type ListMonitorsError = BadRequest | Forbidden | DatadogOpError; +/** Get all monitors Get all monitors from your organization. */ +export const listMonitors: API.OperationMethod< + ListMonitorsRequest, + ListMonitorsResponse, + ListMonitorsError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: ListMonitorsRequest, + output: ListMonitorsResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type SearchMonitorGroupsError = BadRequest | Forbidden | DatadogOpError; +/** Monitors group search Search and filter your monitor groups details. */ +export const searchMonitorGroups: API.OperationMethod< + SearchMonitorGroupsRequest, + MonitorGroupSearchResponse, + SearchMonitorGroupsError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: SearchMonitorGroupsRequest, + output: MonitorGroupSearchResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type SearchMonitorsError = BadRequest | Forbidden | DatadogOpError; +/** Monitors search Search and filter your monitors details. */ +export const searchMonitors: API.OperationMethod< + SearchMonitorsRequest, + MonitorSearchResponse, + SearchMonitorsError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: SearchMonitorsRequest, + output: MonitorSearchResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type UpdateMonitorError = + | BadRequest + | Forbidden + | NotFound + | DatadogOpError; +/** Edit a monitor Edit the specified monitor. */ +export const updateMonitor: API.OperationMethod< + UpdateMonitorRequest, + Monitor, + UpdateMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateMonitorRequest, + output: Monitor, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type ValidateExistingMonitorError = + | BadRequest + | Forbidden + | DatadogOpError; +/** Validate an existing monitor Validate the monitor provided in the request. **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. */ +export const validateExistingMonitor: API.OperationMethod< + ValidateExistingMonitorRequest, + ValidateExistingMonitorResponse, + ValidateExistingMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: ValidateExistingMonitorRequest, + output: ValidateExistingMonitorResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type ValidateMonitorError = BadRequest | Forbidden | DatadogOpError; +/** Validate a monitor Validate the monitor provided in the request. **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. */ +export const validateMonitor: API.OperationMethod< + ValidateMonitorRequest, + ValidateMonitorResponse, + ValidateMonitorError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: ValidateMonitorRequest, + output: ValidateMonitorResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); diff --git a/packages/datadog/src/services/service_level_objectives.ts b/packages/datadog/src/services/service_level_objectives.ts new file mode 100644 index 0000000000..ab7b14ce0d --- /dev/null +++ b/packages/datadog/src/services/service_level_objectives.ts @@ -0,0 +1,2283 @@ +// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/datadog-api-client-typescript .generator/schemas/v1). Do not edit. +import * as S from "@distilled.cloud/core/schema"; +import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; +import * as T from "../traits.ts"; +import { + DatadogProtocol, + type DatadogOpError, + type DatadogOpContext, +} from "../protocol.ts"; +import * as Retry from "../retry.ts"; + +export type { DatadogOpError, DatadogOpContext }; + +export class BadRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRequest", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 400 }], + ) {} + +export class Conflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Conflict", { + code: S.Number, + message: S.String, + }).pipe(C.withConflictError), + [{ status: 409 }], + ) {} + +export class Forbidden + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Forbidden", { + code: S.Number, + message: S.String, + }).pipe(C.withAuthError), + [{ status: 403 }], + ) {} + +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 404 }], + ) {} + +export interface CheckCanDeleteSLORequest { + /** A comma separated list of the IDs of the service level objectives objects. */ + ids: string; +} +export const CheckCanDeleteSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + ids: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/slo/can_delete", code: 200 })), +).annotate({ + identifier: "CheckCanDeleteSLORequest", +}) as any as S.Schema; + +/** An array of SLO IDs that can be safely deleted. */ +export type CheckCanDeleteSLOResponseDataOkList = Array; +export const CheckCanDeleteSLOResponseDataOkList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** An array of service level objective objects. */ +export interface CheckCanDeleteSLOResponseData { + /** An array of SLO IDs that can be safely deleted. */ + ok?: CheckCanDeleteSLOResponseDataOkList; +} +export const CheckCanDeleteSLOResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + ok: S.optional(CheckCanDeleteSLOResponseDataOkList), + }), +).annotate({ + identifier: "CheckCanDeleteSLOResponseData", +}) as any as S.Schema; + +/** A mapping of SLO id to it's current usages. */ +export type CheckCanDeleteSLOResponseErrorsMap = { + [key: string]: string | undefined; +}; +export const CheckCanDeleteSLOResponseErrorsMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** A service level objective response containing the requested object. */ +export interface CheckCanDeleteSLOResponse { + data?: CheckCanDeleteSLOResponseData; + /** A mapping of SLO id to it's current usages. */ + errors?: CheckCanDeleteSLOResponseErrorsMap; +} +export const CheckCanDeleteSLOResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(CheckCanDeleteSLOResponseData), + errors: S.optional(CheckCanDeleteSLOResponseErrorsMap), + }), +).annotate({ + identifier: "CheckCanDeleteSLOResponse", +}) as any as S.Schema; + +/** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ +export type CreateSLORequestGroupsList = Array; +export const CreateSLORequestGroupsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of monitor IDs that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ +export type CreateSLORequestMonitorIdsList = Array; +export const CreateSLORequestMonitorIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** A count-based (metric) SLO query. This field is superseded by `sli_specification` but is retained for backwards compatibility. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. */ +export interface ServiceLevelObjectiveQuery { + /** A Datadog metric query for total (valid) events. */ + denominator: string; + /** A Datadog metric query for good events. */ + numerator: string; +} +export const ServiceLevelObjectiveQuery = /*@__PURE__*/ S.suspend(() => + S.Struct({ + denominator: S.String, + numerator: S.String, + }), +).annotate({ + identifier: "ServiceLevelObjectiveQuery", +}) as any as S.Schema; + +/** The comparator used to compare the SLI value to the threshold. */ +export type SLOTimeSliceComparator = ">" | ">=" | "<" | "<="; +export const SLOTimeSliceComparator = /*@__PURE__*/ S.String; + +/** A formula that specifies how to combine the results of multiple queries. */ +export interface SLOFormula { + /** The formula string, which is an expression involving named queries. */ + formula: string; +} +export const SLOFormula = /*@__PURE__*/ S.suspend(() => + S.Struct({ + formula: S.String, + }), +).annotate({ identifier: "SLOFormula" }) as any as S.Schema; + +/** A list that contains exactly one formula, as only a single formula may be used in a time-slice SLO. */ +export type SLOTimeSliceQueryFormulasList = Array; +export const SLOTimeSliceQueryFormulasList = /*@__PURE__*/ S.Array( + SLOFormula, +) as any as S.Schema; + +/** The aggregation methods available for metrics queries. */ +export type FormulaAndFunctionMetricAggregation = + | "avg" + | "min" + | "max" + | "sum" + | "last" + | "area" + | "l2norm" + | "percentile"; +export const FormulaAndFunctionMetricAggregation = /*@__PURE__*/ S.String; + +/** The source organization UUID for cross organization queries. Feature in Private Beta. */ +export type CrossOrgUuids = Array; +export const CrossOrgUuids = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Data source for metrics queries. */ +export type FormulaAndFunctionMetricDataSource = "metrics"; +export const FormulaAndFunctionMetricDataSource = /*@__PURE__*/ S.String; + +/** Semantic mode for metrics queries. This determines how metrics from different sources are combined or displayed. */ +export type FormulaAndFunctionMetricSemanticMode = "combined" | "native"; +export const FormulaAndFunctionMetricSemanticMode = /*@__PURE__*/ S.String; + +/** A formula and functions metrics query. */ +export interface FormulaAndFunctionMetricQueryDefinition { + aggregator?: FormulaAndFunctionMetricAggregation | (string & {}); + cross_org_uuids?: CrossOrgUuids; + data_source: FormulaAndFunctionMetricDataSource | (string & {}); + /** Name of the query for use in formulas. */ + name: string; + /** Metrics query definition. */ + query: string; + semantic_mode?: FormulaAndFunctionMetricSemanticMode | (string & {}); +} +export const FormulaAndFunctionMetricQueryDefinition = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + aggregator: S.optional(FormulaAndFunctionMetricAggregation), + cross_org_uuids: S.optional(CrossOrgUuids), + data_source: FormulaAndFunctionMetricDataSource, + name: S.String, + query: S.String, + semantic_mode: S.optional(FormulaAndFunctionMetricSemanticMode), + }), +).annotate({ + identifier: "FormulaAndFunctionMetricQueryDefinition", +}) as any as S.Schema; + +/** A list of queries that are used to calculate the SLI value. */ +export type SLOTimeSliceQueryQueriesList = + Array; +export const SLOTimeSliceQueryQueriesList = /*@__PURE__*/ S.Array( + FormulaAndFunctionMetricQueryDefinition, +) as any as S.Schema; + +/** The queries and formula used to calculate the SLI value. */ +export interface SLOTimeSliceQuery { + /** A list that contains exactly one formula, as only a single formula may be used in a time-slice SLO. */ + formulas: SLOTimeSliceQueryFormulasList; + /** A list of queries that are used to calculate the SLI value. */ + queries: SLOTimeSliceQueryQueriesList; +} +export const SLOTimeSliceQuery = /*@__PURE__*/ S.suspend(() => + S.Struct({ + formulas: SLOTimeSliceQueryFormulasList, + queries: SLOTimeSliceQueryQueriesList, + }), +).annotate({ + identifier: "SLOTimeSliceQuery", +}) as any as S.Schema; + +/** The interval used when querying data, which defines the size of a time slice. Two values are allowed: 60 (1 minute) and 300 (5 minutes). If not provided, the value defaults to 300 (5 minutes). */ +export type SLOTimeSliceInterval = 60 | 300; +export const SLOTimeSliceInterval = /*@__PURE__*/ S.Number; + +/** The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator, and 3. the threshold. Optionally, a fourth part, the query interval, can be provided. */ +export interface SLOTimeSliceCondition { + comparator: SLOTimeSliceComparator | (string & {}); + query: SLOTimeSliceQuery; + query_interval_seconds?: SLOTimeSliceInterval | (number & {}); + /** The threshold value to which each SLI value will be compared. */ + threshold: number; +} +export const SLOTimeSliceCondition = /*@__PURE__*/ S.suspend(() => + S.Struct({ + comparator: SLOTimeSliceComparator, + query: SLOTimeSliceQuery, + query_interval_seconds: S.optional(SLOTimeSliceInterval), + threshold: S.Number, + }), +).annotate({ + identifier: "SLOTimeSliceCondition", +}) as any as S.Schema; + +/** A time-slice SLI specification. */ +export interface SLOTimeSliceSpec { + time_slice: SLOTimeSliceCondition; +} +export const SLOTimeSliceSpec = /*@__PURE__*/ S.suspend(() => + S.Struct({ + time_slice: SLOTimeSliceCondition, + }), +).annotate({ + identifier: "SLOTimeSliceSpec", +}) as any as S.Schema; + +export type SLOCountDefinitionWithTotalEventsFormulaQueriesList = + Array; +export const SLOCountDefinitionWithTotalEventsFormulaQueriesList = + /*@__PURE__*/ S.Array( + FormulaAndFunctionMetricQueryDefinition, + ) as any as S.Schema; + +/** SLO count definition using a total events formula alongside a good events formula. */ +export interface SLOCountDefinitionWithTotalEventsFormula { + good_events_formula: SLOFormula; + queries: SLOCountDefinitionWithTotalEventsFormulaQueriesList; + /** The total events formula. Bad events queries can be defined using the `bad_events_formula` field as an alternative. Only one of `total_events_formula` or `bad_events_formula` must be provided. */ + total_events_formula: SLOFormula; +} +export const SLOCountDefinitionWithTotalEventsFormula = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + good_events_formula: SLOFormula, + queries: SLOCountDefinitionWithTotalEventsFormulaQueriesList, + total_events_formula: SLOFormula, + }), +).annotate({ + identifier: "SLOCountDefinitionWithTotalEventsFormula", +}) as any as S.Schema; + +export type SLOCountDefinitionWithBadEventsFormulaQueriesList = + Array; +export const SLOCountDefinitionWithBadEventsFormulaQueriesList = + /*@__PURE__*/ S.Array( + FormulaAndFunctionMetricQueryDefinition, + ) as any as S.Schema; + +/** SLO count definition using a bad events formula alongside a good events formula. */ +export interface SLOCountDefinitionWithBadEventsFormula { + /** The bad events formula (recommended). Total events queries can be defined using the `total_events_formula` field as an alternative. Only one of `total_events_formula` or `bad_events_formula` must be provided. */ + bad_events_formula: SLOFormula; + good_events_formula: SLOFormula; + queries: SLOCountDefinitionWithBadEventsFormulaQueriesList; +} +export const SLOCountDefinitionWithBadEventsFormula = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + bad_events_formula: SLOFormula, + good_events_formula: SLOFormula, + queries: SLOCountDefinitionWithBadEventsFormulaQueriesList, + }), +).annotate({ + identifier: "SLOCountDefinitionWithBadEventsFormula", +}) as any as S.Schema; + +/** A count-based (metric) SLI specification, composed of three parts: the good events formula, the bad or total events formula, and the underlying queries. Exactly one of `total_events_formula` or `bad_events_formula` must be provided. */ +export type SLOCountDefinition = + | SLOCountDefinitionWithTotalEventsFormula + | SLOCountDefinitionWithBadEventsFormula; +export const SLOCountDefinition = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** A metric SLI specification. */ +export interface SLOCountSpec { + count: SLOCountDefinition; +} +export const SLOCountSpec = /*@__PURE__*/ S.suspend(() => + S.Struct({ + count: SLOCountDefinition, + }), +).annotate({ identifier: "SLOCountSpec" }) as any as S.Schema; + +/** A generic SLI specification. This is used for time-slice and count-based (metric) SLOs only. */ +export type SLOSliSpec = SLOTimeSliceSpec | SLOCountSpec; +export const SLOSliSpec = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ +export type CreateSLORequestTagsList = Array; +export const CreateSLORequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The SLO time window options. Note that "custom" is not a valid option for creating or updating SLOs. It is only used when querying SLO history over custom timeframes. */ +export type SLOTimeframe = "7d" | "30d" | "90d" | "custom"; +export const SLOTimeframe = /*@__PURE__*/ S.String; + +/** SLO thresholds (target and optionally warning) for a single time window. */ +export interface SLOThreshold { + /** The target value for the service level indicator within the corresponding timeframe. */ + target: number; + /** A string representation of the target that indicates its precision. It uses trailing zeros to show significant decimal places (for example `98.00`). Always included in service level objective responses. Ignored in create/update requests. */ + target_display?: string; + timeframe: SLOTimeframe | (string & {}); + /** The warning value for the service level objective. */ + warning?: number; + /** A string representation of the warning target (see the description of the `target_display` field for details). Included in service level objective responses if a warning target exists. Ignored in create/update requests. */ + warning_display?: string; +} +export const SLOThreshold = /*@__PURE__*/ S.suspend(() => + S.Struct({ + target: S.Number, + target_display: S.optional(S.String), + timeframe: SLOTimeframe, + warning: S.optional(S.Number), + warning_display: S.optional(S.String), + }), +).annotate({ identifier: "SLOThreshold" }) as any as S.Schema; + +/** The thresholds (timeframes and associated targets) for this service level objective object. */ +export type CreateSLORequestThresholdsList = Array; +export const CreateSLORequestThresholdsList = /*@__PURE__*/ S.Array( + SLOThreshold, +) as any as S.Schema; + +/** The type of the service level objective. */ +export type SLOType = "metric" | "monitor" | "time_slice"; +export const SLOType = /*@__PURE__*/ S.String; + +export interface CreateSLORequest { + /** A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. */ + description?: string | null; + /** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ + groups?: CreateSLORequestGroupsList; + /** A list of monitor IDs that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ + monitor_ids?: CreateSLORequestMonitorIdsList; + /** The name of the service level objective object. */ + name: string; + query?: ServiceLevelObjectiveQuery; + sli_specification?: SLOSliSpec; + /** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ + tags?: CreateSLORequestTagsList; + /** The target threshold such that when the service level indicator is above this threshold over the given timeframe, the objective is being met. */ + target_threshold?: number; + /** The thresholds (timeframes and associated targets) for this service level objective object. */ + thresholds: CreateSLORequestThresholdsList; + timeframe?: SLOTimeframe | (string & {}); + type: SLOType | (string & {}); + /** The optional warning threshold such that when the service level indicator is below this value for the given threshold, but above the target threshold, the objective appears in a "warning" state. This value must be greater than the target threshold. */ + warning_threshold?: number; +} +export const CreateSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.optional(S.NullOr(S.String)), + groups: S.optional(CreateSLORequestGroupsList), + monitor_ids: S.optional(CreateSLORequestMonitorIdsList), + name: S.String, + query: S.optional(ServiceLevelObjectiveQuery), + sli_specification: S.optional(SLOSliSpec), + tags: S.optional(CreateSLORequestTagsList), + target_threshold: S.optional(S.Number), + thresholds: CreateSLORequestThresholdsList, + timeframe: S.optional(SLOTimeframe), + type: SLOType, + warning_threshold: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/api/v1/slo", code: 200 })), +).annotate({ + identifier: "CreateSLORequest", +}) as any as S.Schema; + +/** Object describing the creator of the shared element. */ +export interface Creator { + /** Email of the creator. */ + email?: string; + /** Handle of the creator. */ + handle?: string; + /** Name of the creator. */ + name?: string | null; +} +export const Creator = /*@__PURE__*/ S.suspend(() => + S.Struct({ + email: S.optional(S.String), + handle: S.optional(S.String), + name: S.optional(S.NullOr(S.String)), + }), +).annotate({ identifier: "Creator" }) as any as S.Schema; + +/** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ +export type ServiceLevelObjectiveGroupsList = Array; +export const ServiceLevelObjectiveGroupsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ +export type ServiceLevelObjectiveMonitorIdsList = Array; +export const ServiceLevelObjectiveMonitorIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor-based service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ +export type ServiceLevelObjectiveMonitorTagsList = Array; +export const ServiceLevelObjectiveMonitorTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ +export type ServiceLevelObjectiveTagsList = Array; +export const ServiceLevelObjectiveTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The thresholds (timeframes and associated targets) for this service level objective object. */ +export type ServiceLevelObjectiveThresholdsList = Array; +export const ServiceLevelObjectiveThresholdsList = /*@__PURE__*/ S.Array( + SLOThreshold, +) as any as S.Schema; + +/** A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). */ +export interface ServiceLevelObjective { + /** Creation timestamp (UNIX time in seconds) Always included in service level objective responses. */ + created_at?: number; + creator?: Creator; + /** A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. */ + description?: string | null; + /** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ + groups?: ServiceLevelObjectiveGroupsList; + /** A unique identifier for the service level objective object. Always included in service level objective responses. */ + id?: string; + /** Modification timestamp (UNIX time in seconds) Always included in service level objective responses. */ + modified_at?: number; + /** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ + monitor_ids?: ServiceLevelObjectiveMonitorIdsList; + /** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor-based service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ + monitor_tags?: ServiceLevelObjectiveMonitorTagsList; + /** The name of the service level objective object. */ + name: string; + query?: ServiceLevelObjectiveQuery; + sli_specification?: SLOSliSpec; + /** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ + tags?: ServiceLevelObjectiveTagsList; + /** The target threshold such that when the service level indicator is above this threshold over the given timeframe, the objective is being met. */ + target_threshold?: number; + /** The thresholds (timeframes and associated targets) for this service level objective object. */ + thresholds: ServiceLevelObjectiveThresholdsList; + timeframe?: SLOTimeframe; + type: SLOType; + /** The optional warning threshold such that when the service level indicator is below this value for the given threshold, but above the target threshold, the objective appears in a "warning" state. This value must be greater than the target threshold. */ + warning_threshold?: number; +} +export const ServiceLevelObjective = /*@__PURE__*/ S.suspend(() => + S.Struct({ + created_at: S.optional(S.Number), + creator: S.optional(Creator), + description: S.optional(S.NullOr(S.String)), + groups: S.optional(ServiceLevelObjectiveGroupsList), + id: S.optional(S.String), + modified_at: S.optional(S.Number), + monitor_ids: S.optional(ServiceLevelObjectiveMonitorIdsList), + monitor_tags: S.optional(ServiceLevelObjectiveMonitorTagsList), + name: S.String, + query: S.optional(ServiceLevelObjectiveQuery), + sli_specification: S.optional(SLOSliSpec), + tags: S.optional(ServiceLevelObjectiveTagsList), + target_threshold: S.optional(S.Number), + thresholds: ServiceLevelObjectiveThresholdsList, + timeframe: S.optional(SLOTimeframe), + type: SLOType, + warning_threshold: S.optional(S.Number), + }), +).annotate({ + identifier: "ServiceLevelObjective", +}) as any as S.Schema; + +/** An array of service level objective objects. */ +export type SLOListResponseDataList = Array; +export const SLOListResponseDataList = /*@__PURE__*/ S.Array( + ServiceLevelObjective, +) as any as S.Schema; + +/** An array of error messages. Each endpoint documents how/whether this field is used. */ +export type SLOListResponseErrorsList = Array; +export const SLOListResponseErrorsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The object containing information about the pages of the list of SLOs. */ +export interface SLOListResponseMetadataPage { + /** The total number of resources that could be retrieved ignoring the parameters and filters in the request. */ + total_count?: number; + /** The total number of resources that match the parameters and filters in the request. This attribute can be used by a client to determine the total number of pages. */ + total_filtered_count?: number; +} +export const SLOListResponseMetadataPage = /*@__PURE__*/ S.suspend(() => + S.Struct({ + total_count: S.optional(S.Number), + total_filtered_count: S.optional(S.Number), + }), +).annotate({ + identifier: "SLOListResponseMetadataPage", +}) as any as S.Schema; + +/** The metadata object containing additional information about the list of SLOs. */ +export interface SLOListResponseMetadata { + page?: SLOListResponseMetadataPage; +} +export const SLOListResponseMetadata = /*@__PURE__*/ S.suspend(() => + S.Struct({ + page: S.optional(SLOListResponseMetadataPage), + }), +).annotate({ + identifier: "SLOListResponseMetadata", +}) as any as S.Schema; + +/** A response with one or more service level objective. */ +export interface SLOListResponse { + /** An array of service level objective objects. */ + data?: SLOListResponseDataList; + /** An array of error messages. Each endpoint documents how/whether this field is used. */ + errors?: SLOListResponseErrorsList; + metadata?: SLOListResponseMetadata; +} +export const SLOListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLOListResponseDataList), + errors: S.optional(SLOListResponseErrorsList), + metadata: S.optional(SLOListResponseMetadata), + }), +).annotate({ + identifier: "SLOListResponse", +}) as any as S.Schema; + +export interface DeleteSLORequest { + /** The ID of the service level objective. */ + slo_id: string; + /** Delete the monitor even if it's referenced by other resources (for example SLO, composite monitor). */ + force?: string; +} +export const DeleteSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + slo_id: S.String.pipe(T.Label()), + force: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "DELETE", uri: "/api/v1/slo/{slo_id}", code: 200 })), +).annotate({ + identifier: "DeleteSLORequest", +}) as any as S.Schema; + +/** An array containing the ID of the deleted service level objective object. */ +export type SLODeleteResponseDataList = Array; +export const SLODeleteResponseDataList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** An dictionary containing the ID of the SLO as key and a deletion error as value. */ +export type SLODeleteResponseErrorsMap = { [key: string]: string | undefined }; +export const SLODeleteResponseErrorsMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** A response list of all service level objective deleted. */ +export interface SLODeleteResponse { + /** An array containing the ID of the deleted service level objective object. */ + data?: SLODeleteResponseDataList; + /** An dictionary containing the ID of the SLO as key and a deletion error as value. */ + errors?: SLODeleteResponseErrorsMap; +} +export const SLODeleteResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLODeleteResponseDataList), + errors: S.optional(SLODeleteResponseErrorsMap), + }), +).annotate({ + identifier: "SLODeleteResponse", +}) as any as S.Schema; + +/** An array of all SLO timeframes. */ +export type SLOBulkDeleteValueList = Array; +export const SLOBulkDeleteValueList = /*@__PURE__*/ S.Array( + SLOTimeframe, +) as any as S.Schema; + +/** A map of service level objective object IDs to arrays of timeframes, which indicate the thresholds to delete for each ID. */ +export type SLOBulkDelete = { + [key: string]: SLOBulkDeleteValueList | undefined; +}; +export const SLOBulkDelete = /*@__PURE__*/ S.Record( + S.String, + SLOBulkDeleteValueList, +) as any as S.Schema; + +export interface DeleteSLOTimeframeInBulkRequest { + body: SLOBulkDelete; +} +export const DeleteSLOTimeframeInBulkRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + body: SLOBulkDelete.pipe(T.HttpBody()), + }).pipe( + T.Http({ method: "POST", uri: "/api/v1/slo/bulk_delete", code: 200 }), + ), +).annotate({ + identifier: "DeleteSLOTimeframeInBulkRequest", +}) as any as S.Schema; + +/** An array of service level objective object IDs that indicates which objects that were completely deleted. */ +export type SLOBulkDeleteResponseDataDeletedList = Array; +export const SLOBulkDeleteResponseDataDeletedList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** An array of service level objective object IDs that indicates which objects that were modified (objects for which at least one threshold was deleted, but that were not completely deleted). */ +export type SLOBulkDeleteResponseDataUpdatedList = Array; +export const SLOBulkDeleteResponseDataUpdatedList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** An array of service level objective objects. */ +export interface SLOBulkDeleteResponseData { + /** An array of service level objective object IDs that indicates which objects that were completely deleted. */ + deleted?: SLOBulkDeleteResponseDataDeletedList; + /** An array of service level objective object IDs that indicates which objects that were modified (objects for which at least one threshold was deleted, but that were not completely deleted). */ + updated?: SLOBulkDeleteResponseDataUpdatedList; +} +export const SLOBulkDeleteResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + deleted: S.optional(SLOBulkDeleteResponseDataDeletedList), + updated: S.optional(SLOBulkDeleteResponseDataUpdatedList), + }), +).annotate({ + identifier: "SLOBulkDeleteResponseData", +}) as any as S.Schema; + +/** The timeframe of the threshold associated with this error or "all" if all thresholds are affected. */ +export type SLOErrorTimeframe = "7d" | "30d" | "90d" | "all"; +export const SLOErrorTimeframe = /*@__PURE__*/ S.String; + +/** Object describing the error. */ +export interface SLOBulkDeleteError { + /** The ID of the service level objective object associated with this error. */ + id: string; + /** The error message. */ + message: string; + timeframe: SLOErrorTimeframe; +} +export const SLOBulkDeleteError = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String, + message: S.String, + timeframe: SLOErrorTimeframe, + }), +).annotate({ + identifier: "SLOBulkDeleteError", +}) as any as S.Schema; + +/** Array of errors object returned. */ +export type SLOBulkDeleteResponseErrorsList = Array; +export const SLOBulkDeleteResponseErrorsList = /*@__PURE__*/ S.Array( + SLOBulkDeleteError, +) as any as S.Schema; + +/** The bulk partial delete service level objective object endpoint response. This endpoint operates on multiple service level objective objects, so it may be partially successful. In such cases, the "data" and "error" fields in this response indicate which deletions succeeded and failed. */ +export interface SLOBulkDeleteResponse { + data?: SLOBulkDeleteResponseData; + /** Array of errors object returned. */ + errors?: SLOBulkDeleteResponseErrorsList; +} +export const SLOBulkDeleteResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLOBulkDeleteResponseData), + errors: S.optional(SLOBulkDeleteResponseErrorsList), + }), +).annotate({ + identifier: "SLOBulkDeleteResponse", +}) as any as S.Schema; + +export interface GetSLORequest { + /** The ID of the service level objective object. */ + slo_id: string; + /** Get the IDs of SLO monitors that reference this SLO. */ + with_configured_alert_ids?: boolean; +} +export const GetSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + slo_id: S.String.pipe(T.Label()), + with_configured_alert_ids: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/slo/{slo_id}", code: 200 })), +).annotate({ identifier: "GetSLORequest" }) as any as S.Schema; + +/** A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query. */ +export type SLOResponseDataConfiguredAlertIdsList = Array; +export const SLOResponseDataConfiguredAlertIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ +export type SLOResponseDataGroupsList = Array; +export const SLOResponseDataGroupsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ +export type SLOResponseDataMonitorIdsList = Array; +export const SLOResponseDataMonitorIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ +export type SLOResponseDataMonitorTagsList = Array; +export const SLOResponseDataMonitorTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ +export type SLOResponseDataTagsList = Array; +export const SLOResponseDataTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The thresholds (timeframes and associated targets) for this service level objective object. */ +export type SLOResponseDataThresholdsList = Array; +export const SLOResponseDataThresholdsList = /*@__PURE__*/ S.Array( + SLOThreshold, +) as any as S.Schema; + +/** A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). */ +export interface SLOResponseData { + /** A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query. */ + configured_alert_ids?: SLOResponseDataConfiguredAlertIdsList; + /** Creation timestamp (UNIX time in seconds) Always included in service level objective responses. */ + created_at?: number; + creator?: Creator; + /** A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. */ + description?: string | null; + /** A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ + groups?: SLOResponseDataGroupsList; + /** A unique identifier for the service level objective object. Always included in service level objective responses. */ + id?: string; + /** Modification timestamp (UNIX time in seconds) Always included in service level objective responses. */ + modified_at?: number; + /** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ + monitor_ids?: SLOResponseDataMonitorIdsList; + /** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ + monitor_tags?: SLOResponseDataMonitorTagsList; + /** The name of the service level objective object. */ + name?: string; + /** The metric query used to define a count-based SLO as the ratio of good events to total events. */ + query?: ServiceLevelObjectiveQuery; + /** A generic SLI specification. This is currently used for time-slice and count-based (metric) SLOs only. */ + sli_specification?: SLOSliSpec; + /** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ + tags?: SLOResponseDataTagsList; + /** The target threshold such that when the service level indicator is above this threshold over the given timeframe, the objective is being met. */ + target_threshold?: number; + /** The thresholds (timeframes and associated targets) for this service level objective object. */ + thresholds?: SLOResponseDataThresholdsList; + timeframe?: SLOTimeframe; + type?: SLOType; + /** The optional warning threshold such that when the service level indicator is below this value for the given threshold, but above the target threshold, the objective appears in a "warning" state. This value must be greater than the target threshold. */ + warning_threshold?: number; +} +export const SLOResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + configured_alert_ids: S.optional(SLOResponseDataConfiguredAlertIdsList), + created_at: S.optional(S.Number), + creator: S.optional(Creator), + description: S.optional(S.NullOr(S.String)), + groups: S.optional(SLOResponseDataGroupsList), + id: S.optional(S.String), + modified_at: S.optional(S.Number), + monitor_ids: S.optional(SLOResponseDataMonitorIdsList), + monitor_tags: S.optional(SLOResponseDataMonitorTagsList), + name: S.optional(S.String), + query: S.optional(ServiceLevelObjectiveQuery), + sli_specification: S.optional(SLOSliSpec), + tags: S.optional(SLOResponseDataTagsList), + target_threshold: S.optional(S.Number), + thresholds: S.optional(SLOResponseDataThresholdsList), + timeframe: S.optional(SLOTimeframe), + type: S.optional(SLOType), + warning_threshold: S.optional(S.Number), + }), +).annotate({ + identifier: "SLOResponseData", +}) as any as S.Schema; + +/** An array of error messages. Each endpoint documents how/whether this field is used. */ +export type SLOResponseErrorsList = Array; +export const SLOResponseErrorsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A service level objective response containing a single service level objective. */ +export interface SLOResponse { + data?: SLOResponseData; + /** An array of error messages. Each endpoint documents how/whether this field is used. */ + errors?: SLOResponseErrorsList; +} +export const SLOResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLOResponseData), + errors: S.optional(SLOResponseErrorsList), + }), +).annotate({ identifier: "SLOResponse" }) as any as S.Schema; + +export interface GetSLOCorrectionsRequest { + /** The ID of the service level objective object. */ + slo_id: string; +} +export const GetSLOCorrectionsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + slo_id: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/api/v1/slo/{slo_id}/corrections", + code: 200, + }), + ), +).annotate({ + identifier: "GetSLOCorrectionsRequest", +}) as any as S.Schema; + +/** Category the SLO correction belongs to. */ +export type SLOCorrectionCategory = + | "Scheduled Maintenance" + | "Outside Business Hours" + | "Deployment" + | "Other"; +export const SLOCorrectionCategory = /*@__PURE__*/ S.String; + +/** Modifier of the object. */ +export interface SLOCorrectionResponseAttributesModifier { + /** Email of the Modifier. */ + email?: string; + /** Handle of the Modifier. */ + handle?: string; + /** Name of the Modifier. */ + name?: string; +} +export const SLOCorrectionResponseAttributesModifier = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + email: S.optional(S.String), + handle: S.optional(S.String), + name: S.optional(S.String), + }), +).annotate({ + identifier: "SLOCorrectionResponseAttributesModifier", +}) as any as S.Schema; + +/** The attribute object associated with the SLO correction. */ +export interface SLOCorrectionResponseAttributes { + category?: SLOCorrectionCategory; + /** The epoch timestamp of when the correction was created at. */ + created_at?: number | null; + creator?: Creator; + /** Description of the correction being made. */ + description?: string; + /** Length of time (in seconds) for a specified `rrule` recurring SLO correction. */ + duration?: number | null; + /** Ending time of the correction in epoch seconds. */ + end?: number | null; + /** The epoch timestamp of when the correction was modified at. */ + modified_at?: number | null; + modifier?: SLOCorrectionResponseAttributesModifier | null; + /** The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`. */ + rrule?: string | null; + /** ID of the single SLO that this correction applies to. */ + slo_id?: string | null; + /** Query that matches the SLOs this correction applies to. */ + slo_query?: string | null; + /** Starting time of the correction in epoch seconds. */ + start?: number; + /** The timezone to display in the UI for the correction times (defaults to "UTC"). */ + timezone?: string; +} +export const SLOCorrectionResponseAttributes = /*@__PURE__*/ S.suspend(() => + S.Struct({ + category: S.optional(SLOCorrectionCategory), + created_at: S.optional(S.NullOr(S.Number)), + creator: S.optional(Creator), + description: S.optional(S.String), + duration: S.optional(S.NullOr(S.Number)), + end: S.optional(S.NullOr(S.Number)), + modified_at: S.optional(S.NullOr(S.Number)), + modifier: S.optional(S.NullOr(SLOCorrectionResponseAttributesModifier)), + rrule: S.optional(S.NullOr(S.String)), + slo_id: S.optional(S.NullOr(S.String)), + slo_query: S.optional(S.NullOr(S.String)), + start: S.optional(S.Number), + timezone: S.optional(S.String), + }), +).annotate({ + identifier: "SLOCorrectionResponseAttributes", +}) as any as S.Schema; + +/** SLO correction resource type. */ +export type SLOCorrectionType = "correction"; +export const SLOCorrectionType = /*@__PURE__*/ S.String; + +/** The response object of a list of SLO corrections. */ +export interface SLOCorrection { + attributes?: SLOCorrectionResponseAttributes; + /** The ID of the SLO correction. */ + id?: string; + type?: SLOCorrectionType; +} +export const SLOCorrection = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(SLOCorrectionResponseAttributes), + id: S.optional(S.String), + type: S.optional(SLOCorrectionType), + }), +).annotate({ identifier: "SLOCorrection" }) as any as S.Schema; + +/** The list of SLO corrections objects. */ +export type SLOCorrectionListResponseDataList = Array; +export const SLOCorrectionListResponseDataList = /*@__PURE__*/ S.Array( + SLOCorrection, +) as any as S.Schema; + +/** Pagination object. */ +export interface Pagination { + /** Total count. */ + total_count?: number; + /** Total count of elements matched by the filter. */ + total_filtered_count?: number; +} +export const Pagination = /*@__PURE__*/ S.suspend(() => + S.Struct({ + total_count: S.optional(S.Number), + total_filtered_count: S.optional(S.Number), + }), +).annotate({ identifier: "Pagination" }) as any as S.Schema; + +/** Object describing meta attributes of response. */ +export interface ResponseMetaAttributes { + page?: Pagination; +} +export const ResponseMetaAttributes = /*@__PURE__*/ S.suspend(() => + S.Struct({ + page: S.optional(Pagination), + }), +).annotate({ + identifier: "ResponseMetaAttributes", +}) as any as S.Schema; + +/** A list of SLO correction objects. */ +export interface SLOCorrectionListResponse { + /** The list of SLO corrections objects. */ + data?: SLOCorrectionListResponseDataList; + meta?: ResponseMetaAttributes; +} +export const SLOCorrectionListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLOCorrectionListResponseDataList), + meta: S.optional(ResponseMetaAttributes), + }), +).annotate({ + identifier: "SLOCorrectionListResponse", +}) as any as S.Schema; + +export interface GetSLOHistoryRequest { + /** The ID of the service level objective object. */ + slo_id: string; + /** The `from` timestamp for the query window in epoch seconds. */ + from_ts: number; + /** The `to` timestamp for the query window in epoch seconds. */ + to_ts: number; + /** The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`. */ + target?: number; + /** Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`, then the corrections will not be applied and the SLI values will not be affected. */ + apply_correction?: boolean; +} +export const GetSLOHistoryRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + slo_id: S.String.pipe(T.Label()), + from_ts: S.Number.pipe(T.Query()), + to_ts: S.Number.pipe(T.Query()), + target: S.optional(S.Number.pipe(T.Query())), + apply_correction: S.optional(S.Boolean.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/api/v1/slo/{slo_id}/history", code: 200 }), + ), +).annotate({ + identifier: "GetSLOHistoryRequest", +}) as any as S.Schema; + +/** For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. This is not included in responses for `monitor` based SLOs. */ +export type SLOHistoryResponseDataGroupByList = Array; +export const SLOHistoryResponseDataGroupByList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A mapping of threshold `timeframe` to the remaining error budget. */ +export type SLOErrorBudgetRemainingData = { [key: string]: number | undefined }; +export const SLOErrorBudgetRemainingData = /*@__PURE__*/ S.Record( + S.String, + S.Number, +) as any as S.Schema; + +/** An object describing the error with error type and error message. */ +export interface SLOHistoryResponseErrorWithType { + /** A message with more details about the error. */ + error_message: string; + /** Type of the error. */ + error_type: string; +} +export const SLOHistoryResponseErrorWithType = /*@__PURE__*/ S.suspend(() => + S.Struct({ + error_message: S.String, + error_type: S.String, + }), +).annotate({ + identifier: "SLOHistoryResponseErrorWithType", +}) as any as S.Schema; + +/** An array of error objects returned while querying the history data for the service level objective. */ +export type SLOHistoryMonitorErrorsList = + Array; +export const SLOHistoryMonitorErrorsList = /*@__PURE__*/ S.Array( + SLOHistoryResponseErrorWithType, +) as any as S.Schema; + +/** Represents an array timeseries data. */ +export type SLOHistoryMonitorHistoryItemList = Array; +export const SLOHistoryMonitorHistoryItemList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** The state transition history for the monitor. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data are counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information. */ +export type SLOHistoryMonitorHistoryList = + Array; +export const SLOHistoryMonitorHistoryList = /*@__PURE__*/ S.Array( + SLOHistoryMonitorHistoryItemList, +) as any as S.Schema; + +/** An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value. This can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs. */ +export interface SLOHistoryMonitor { + error_budget_remaining?: SLOErrorBudgetRemainingData; + /** An array of error objects returned while querying the history data for the service level objective. */ + errors?: SLOHistoryMonitorErrorsList; + /** For groups in a grouped SLO, this is the group name. */ + group?: string; + /** The state transition history for the monitor. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data are counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information. */ + history?: SLOHistoryMonitorHistoryList; + /** For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor. */ + monitor_modified?: number; + /** For `monitor` based SLOs, this describes the type of monitor. */ + monitor_type?: string; + /** For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name. */ + name?: string; + /** The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. Use `span_precision` instead. */ + precision?: number; + /** For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation. */ + preview?: boolean; + /** The current SLI value of the SLO over the history window. */ + sli_value?: number | null; + /** The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. */ + span_precision?: number; + /** Use `sli_value` instead. */ + uptime?: number; +} +export const SLOHistoryMonitor = /*@__PURE__*/ S.suspend(() => + S.Struct({ + error_budget_remaining: S.optional(SLOErrorBudgetRemainingData), + errors: S.optional(SLOHistoryMonitorErrorsList), + group: S.optional(S.String), + history: S.optional(SLOHistoryMonitorHistoryList), + monitor_modified: S.optional(S.Number), + monitor_type: S.optional(S.String), + name: S.optional(S.String), + precision: S.optional(S.Number), + preview: S.optional(S.Boolean), + sli_value: S.optional(S.NullOr(S.Number)), + span_precision: S.optional(S.Number), + uptime: S.optional(S.Number), + }), +).annotate({ + identifier: "SLOHistoryMonitor", +}) as any as S.Schema; + +/** For grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for `metric` based SLOs. */ +export type SLOHistoryResponseDataGroupsList = Array; +export const SLOHistoryResponseDataGroupsList = /*@__PURE__*/ S.Array( + SLOHistoryMonitor, +) as any as S.Schema; + +/** For multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for `metric` based SLOs. */ +export type SLOHistoryResponseDataMonitorsList = Array; +export const SLOHistoryResponseDataMonitorsList = /*@__PURE__*/ S.Array( + SLOHistoryMonitor, +) as any as S.Schema; + +/** An array of error objects returned while querying the history data for the service level objective. */ +export type SLOHistorySLIDataErrorsList = + Array; +export const SLOHistorySLIDataErrorsList = /*@__PURE__*/ S.Array( + SLOHistoryResponseErrorWithType, +) as any as S.Schema; + +/** Represents an array timeseries data. */ +export type SLOHistorySLIDataHistoryItemList = Array; +export const SLOHistorySLIDataHistoryItemList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** The state transition history for `monitor` or `time-slice` SLOs. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data count as uptime in time-slice SLOs, while for monitor SLOs, no data is counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information. */ +export type SLOHistorySLIDataHistoryList = + Array; +export const SLOHistorySLIDataHistoryList = /*@__PURE__*/ S.Array( + SLOHistorySLIDataHistoryItemList, +) as any as S.Schema; + +/** A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp. */ +export type SLOHistorySLIDataPrecisionMap = { + [key: string]: number | undefined; +}; +export const SLOHistorySLIDataPrecisionMap = /*@__PURE__*/ S.Record( + S.String, + S.Number, +) as any as S.Schema; + +/** An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value. This can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs. */ +export interface SLOHistorySLIData { + error_budget_remaining?: SLOErrorBudgetRemainingData; + /** An array of error objects returned while querying the history data for the service level objective. */ + errors?: SLOHistorySLIDataErrorsList; + /** For groups in a grouped SLO, this is the group name. */ + group?: string; + /** The state transition history for `monitor` or `time-slice` SLOs. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data count as uptime in time-slice SLOs, while for monitor SLOs, no data is counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information. */ + history?: SLOHistorySLIDataHistoryList; + /** For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor. */ + monitor_modified?: number; + /** For `monitor` based SLOs, this describes the type of monitor. */ + monitor_type?: string; + /** For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name. */ + name?: string; + /** A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp. */ + precision?: SLOHistorySLIDataPrecisionMap; + /** For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation. */ + preview?: boolean; + /** The current SLI value of the SLO over the history window. */ + sli_value?: number | null; + /** The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. */ + span_precision?: number; + /** Use `sli_value` instead. */ + uptime?: number | null; +} +export const SLOHistorySLIData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + error_budget_remaining: S.optional(SLOErrorBudgetRemainingData), + errors: S.optional(SLOHistorySLIDataErrorsList), + group: S.optional(S.String), + history: S.optional(SLOHistorySLIDataHistoryList), + monitor_modified: S.optional(S.Number), + monitor_type: S.optional(S.String), + name: S.optional(S.String), + precision: S.optional(SLOHistorySLIDataPrecisionMap), + preview: S.optional(S.Boolean), + sli_value: S.optional(S.NullOr(S.Number)), + span_precision: S.optional(S.Number), + uptime: S.optional(S.NullOr(S.Number)), + }), +).annotate({ + identifier: "SLOHistorySLIData", +}) as any as S.Schema; + +/** An Object of metric units. */ +export interface SLOHistoryMetricsSeriesMetadataUnit { + /** The family of metric unit, for example `bytes` is the family for `kibibyte`, `byte`, and `bit` units. */ + family?: string; + /** The ID of the metric unit. */ + id?: number; + /** The unit of the metric, for instance `byte`. */ + name?: string; + /** The plural Unit of metric, for instance `bytes`. */ + plural?: string | null; + /** The scale factor of metric unit, for instance `1.0`. */ + scale_factor?: number; + /** A shorter and abbreviated version of the metric unit, for instance `B`. */ + short_name?: string | null; +} +export const SLOHistoryMetricsSeriesMetadataUnit = /*@__PURE__*/ S.suspend(() => + S.Struct({ + family: S.optional(S.String), + id: S.optional(S.Number), + name: S.optional(S.String), + plural: S.optional(S.NullOr(S.String)), + scale_factor: S.optional(S.Number), + short_name: S.optional(S.NullOr(S.String)), + }), +).annotate({ + identifier: "SLOHistoryMetricsSeriesMetadataUnit", +}) as any as S.Schema; + +/** An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null. */ +export type SLOHistoryMetricsSeriesMetadataUnitList = + Array; +export const SLOHistoryMetricsSeriesMetadataUnitList = /*@__PURE__*/ S.Array( + SLOHistoryMetricsSeriesMetadataUnit, +) as any as S.Schema; + +/** Query metadata. */ +export interface SLOHistoryMetricsSeriesMetadata { + /** Query aggregator function. */ + aggr?: string; + /** Query expression. */ + expression?: string; + /** Query metric used. */ + metric?: string; + /** Query index from original combined query. */ + query_index?: number; + /** Query scope. */ + scope?: string; + /** An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null. */ + unit?: SLOHistoryMetricsSeriesMetadataUnitList | null; +} +export const SLOHistoryMetricsSeriesMetadata = /*@__PURE__*/ S.suspend(() => + S.Struct({ + aggr: S.optional(S.String), + expression: S.optional(S.String), + metric: S.optional(S.String), + query_index: S.optional(S.Number), + scope: S.optional(S.String), + unit: S.optional(S.NullOr(SLOHistoryMetricsSeriesMetadataUnitList)), + }), +).annotate({ + identifier: "SLOHistoryMetricsSeriesMetadata", +}) as any as S.Schema; + +/** The query values for each metric. */ +export type SLOHistoryMetricsSeriesValuesList = Array; +export const SLOHistoryMetricsSeriesValuesList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** A representation of `metric` based SLO timeseries for the provided queries. This is the same response type from `batch_query` endpoint. */ +export interface SLOHistoryMetricsSeries { + /** Count of submitted metrics. */ + count: number; + metadata?: SLOHistoryMetricsSeriesMetadata; + /** Total sum of the query. */ + sum: number; + /** The query values for each metric. */ + values: SLOHistoryMetricsSeriesValuesList; +} +export const SLOHistoryMetricsSeries = /*@__PURE__*/ S.suspend(() => + S.Struct({ + count: S.Number, + metadata: S.optional(SLOHistoryMetricsSeriesMetadata), + sum: S.Number, + values: SLOHistoryMetricsSeriesValuesList, + }), +).annotate({ + identifier: "SLOHistoryMetricsSeries", +}) as any as S.Schema; + +/** An array of query timestamps in EPOCH milliseconds. */ +export type SLOHistoryMetricsTimesList = Array; +export const SLOHistoryMetricsTimesList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** A `metric` based SLO history response. This is not included in responses for `monitor` based SLOs. */ +export interface SLOHistoryMetrics { + denominator: SLOHistoryMetricsSeries; + /** The aggregated query interval for the series data. It's implicit based on the query time window. */ + interval: number; + /** Optional message if there are specific query issues/warnings. */ + message?: string; + numerator: SLOHistoryMetricsSeries; + /** The combined numerator and denominator query CSV. */ + query: string; + /** The series result type. This mimics `batch_query` response type. */ + res_type: string; + /** The series response version type. This mimics `batch_query` response type. */ + resp_version: number; + /** An array of query timestamps in EPOCH milliseconds. */ + times: SLOHistoryMetricsTimesList; +} +export const SLOHistoryMetrics = /*@__PURE__*/ S.suspend(() => + S.Struct({ + denominator: SLOHistoryMetricsSeries, + interval: S.Number, + message: S.optional(S.String), + numerator: SLOHistoryMetricsSeries, + query: S.String, + res_type: S.String, + resp_version: S.Number, + times: SLOHistoryMetricsTimesList, + }), +).annotate({ + identifier: "SLOHistoryMetrics", +}) as any as S.Schema; + +/** mapping of string timeframe to the SLO threshold. */ +export type SLOHistoryResponseDataThresholdsMap = { + [key: string]: SLOThreshold | undefined; +}; +export const SLOHistoryResponseDataThresholdsMap = /*@__PURE__*/ S.Record( + S.String, + SLOThreshold, +) as any as S.Schema; + +/** A numeric representation of the type of the service level objective (`0` for monitor, `1` for metric). Always included in service level objective responses. Ignored in create/update requests. */ +export type SLOTypeNumeric = 0 | 1 | 2; +export const SLOTypeNumeric = /*@__PURE__*/ S.Number; + +/** An array of service level objective objects. */ +export interface SLOHistoryResponseData { + /** The `from` timestamp in epoch seconds. */ + from_ts?: number; + /** For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. This is not included in responses for `monitor` based SLOs. */ + group_by?: SLOHistoryResponseDataGroupByList; + /** For grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for `metric` based SLOs. */ + groups?: SLOHistoryResponseDataGroupsList; + /** For multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for `metric` based SLOs. */ + monitors?: SLOHistoryResponseDataMonitorsList; + overall?: SLOHistorySLIData; + series?: SLOHistoryMetrics; + /** mapping of string timeframe to the SLO threshold. */ + thresholds?: SLOHistoryResponseDataThresholdsMap; + /** The `to` timestamp in epoch seconds. */ + to_ts?: number; + type?: SLOType; + type_id?: SLOTypeNumeric; +} +export const SLOHistoryResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + from_ts: S.optional(S.Number), + group_by: S.optional(SLOHistoryResponseDataGroupByList), + groups: S.optional(SLOHistoryResponseDataGroupsList), + monitors: S.optional(SLOHistoryResponseDataMonitorsList), + overall: S.optional(SLOHistorySLIData), + series: S.optional(SLOHistoryMetrics), + thresholds: S.optional(SLOHistoryResponseDataThresholdsMap), + to_ts: S.optional(S.Number), + type: S.optional(SLOType), + type_id: S.optional(SLOTypeNumeric), + }), +).annotate({ + identifier: "SLOHistoryResponseData", +}) as any as S.Schema; + +/** A list of errors while querying the history data for the service level objective. */ +export interface SLOHistoryResponseError { + /** Human readable error. */ + error?: string; +} +export const SLOHistoryResponseError = /*@__PURE__*/ S.suspend(() => + S.Struct({ + error: S.optional(S.String), + }), +).annotate({ + identifier: "SLOHistoryResponseError", +}) as any as S.Schema; + +/** A list of errors while querying the history data for the service level objective. */ +export type SLOHistoryResponseErrorsList = Array; +export const SLOHistoryResponseErrorsList = /*@__PURE__*/ S.Array( + SLOHistoryResponseError, +) as any as S.Schema; + +/** A service level objective history response. */ +export interface SLOHistoryResponse { + data?: SLOHistoryResponseData; + /** A list of errors while querying the history data for the service level objective. */ + errors?: SLOHistoryResponseErrorsList | null; +} +export const SLOHistoryResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SLOHistoryResponseData), + errors: S.optional(S.NullOr(SLOHistoryResponseErrorsList)), + }), +).annotate({ + identifier: "SLOHistoryResponse", +}) as any as S.Schema; + +export interface ListSLOsRequest { + /** A comma separated list of the IDs of the service level objectives objects. */ + ids?: string; + /** The query string to filter results based on SLO names. */ + query?: string; + /** The query string to filter results based on a single SLO tag. */ + tags_query?: string; + /** The query string to filter results based on SLO numerator and denominator. */ + metrics_query?: string; + /** The number of SLOs to return in the response. */ + limit?: number; + /** The specific offset to use as the beginning of the returned response. */ + offset?: number; +} +export const ListSLOsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + ids: S.optional(S.String.pipe(T.Query())), + query: S.optional(S.String.pipe(T.Query())), + tags_query: S.optional(S.String.pipe(T.Query())), + metrics_query: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + offset: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/slo", code: 200 })), +).annotate({ + identifier: "ListSLOsRequest", +}) as any as S.Schema; + +export interface SearchSLORequest { + /** The query string to filter results based on SLO names. Some examples of queries include `service:` and ``. */ + query?: string; + /** The number of files to return in the response `[default=10]`. */ + page_size_?: number; + /** The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`. */ + page_number_?: number; + /** Whether or not to return facet information in the response `[default=false]`. */ + include_facets?: boolean; +} +export const SearchSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + query: S.optional(S.String.pipe(T.Query())), + page_size_: S.optional(S.Number.pipe(T.Query("page[size]"))), + page_number_: S.optional(S.Number.pipe(T.Query("page[number]"))), + include_facets: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/api/v1/slo/search", code: 200 })), +).annotate({ + identifier: "SearchSLORequest", +}) as any as S.Schema; + +/** Facet */ +export interface SearchSLOResponseDataAttributesFacetsObjectString { + /** Count */ + count?: number; + /** Facet */ + name?: string; +} +export const SearchSLOResponseDataAttributesFacetsObjectString = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + count: S.optional(S.Number), + name: S.optional(S.String), + }), + ).annotate({ + identifier: "SearchSLOResponseDataAttributesFacetsObjectString", + }) as any as S.Schema; + +/** All tags associated with an SLO. */ +export type SearchSLOResponseDataAttributesFacetsAllTagsList = + Array; +export const SearchSLOResponseDataAttributesFacetsAllTagsList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Creator of an SLO. */ +export type SearchSLOResponseDataAttributesFacetsCreatorNameList = + Array; +export const SearchSLOResponseDataAttributesFacetsCreatorNameList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Tags with the `env` tag key. */ +export type SearchSLOResponseDataAttributesFacetsEnvTagsList = + Array; +export const SearchSLOResponseDataAttributesFacetsEnvTagsList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Tags with the `service` tag key. */ +export type SearchSLOResponseDataAttributesFacetsServiceTagsList = + Array; +export const SearchSLOResponseDataAttributesFacetsServiceTagsList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Facet */ +export interface SearchSLOResponseDataAttributesFacetsObjectInt { + /** Count */ + count?: number; + /** Facet */ + name?: number; +} +export const SearchSLOResponseDataAttributesFacetsObjectInt = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + count: S.optional(S.Number), + name: S.optional(S.Number), + }), + ).annotate({ + identifier: "SearchSLOResponseDataAttributesFacetsObjectInt", + }) as any as S.Schema; + +/** Type of SLO. */ +export type SearchSLOResponseDataAttributesFacetsSloTypeList = + Array; +export const SearchSLOResponseDataAttributesFacetsSloTypeList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectInt, + ) as any as S.Schema; + +/** SLO Target */ +export type SearchSLOResponseDataAttributesFacetsTargetList = + Array; +export const SearchSLOResponseDataAttributesFacetsTargetList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectInt, + ) as any as S.Schema; + +/** Tags with the `team` tag key. */ +export type SearchSLOResponseDataAttributesFacetsTeamTagsList = + Array; +export const SearchSLOResponseDataAttributesFacetsTeamTagsList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Timeframes of SLOs. */ +export type SearchSLOResponseDataAttributesFacetsTimeframeList = + Array; +export const SearchSLOResponseDataAttributesFacetsTimeframeList = + /*@__PURE__*/ S.Array( + SearchSLOResponseDataAttributesFacetsObjectString, + ) as any as S.Schema; + +/** Facets */ +export interface SearchSLOResponseDataAttributesFacets { + /** All tags associated with an SLO. */ + all_tags?: SearchSLOResponseDataAttributesFacetsAllTagsList; + /** Creator of an SLO. */ + creator_name?: SearchSLOResponseDataAttributesFacetsCreatorNameList; + /** Tags with the `env` tag key. */ + env_tags?: SearchSLOResponseDataAttributesFacetsEnvTagsList; + /** Tags with the `service` tag key. */ + service_tags?: SearchSLOResponseDataAttributesFacetsServiceTagsList; + /** Type of SLO. */ + slo_type?: SearchSLOResponseDataAttributesFacetsSloTypeList; + /** SLO Target */ + target?: SearchSLOResponseDataAttributesFacetsTargetList; + /** Tags with the `team` tag key. */ + team_tags?: SearchSLOResponseDataAttributesFacetsTeamTagsList; + /** Timeframes of SLOs. */ + timeframe?: SearchSLOResponseDataAttributesFacetsTimeframeList; +} +export const SearchSLOResponseDataAttributesFacets = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + all_tags: S.optional(SearchSLOResponseDataAttributesFacetsAllTagsList), + creator_name: S.optional( + SearchSLOResponseDataAttributesFacetsCreatorNameList, + ), + env_tags: S.optional(SearchSLOResponseDataAttributesFacetsEnvTagsList), + service_tags: S.optional( + SearchSLOResponseDataAttributesFacetsServiceTagsList, + ), + slo_type: S.optional(SearchSLOResponseDataAttributesFacetsSloTypeList), + target: S.optional(SearchSLOResponseDataAttributesFacetsTargetList), + team_tags: S.optional(SearchSLOResponseDataAttributesFacetsTeamTagsList), + timeframe: S.optional(SearchSLOResponseDataAttributesFacetsTimeframeList), + }), +).annotate({ + identifier: "SearchSLOResponseDataAttributesFacets", +}) as any as S.Schema; + +/** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). */ +export type SearchServiceLevelObjectiveAttributesAllTagsList = Array; +export const SearchServiceLevelObjectiveAttributesAllTagsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** The creator of the SLO */ +export interface SLOCreator { + /** Email of the creator. */ + email?: string; + /** User ID of the creator. */ + id?: number; + /** Name of the creator. */ + name?: string | null; +} +export const SLOCreator = /*@__PURE__*/ S.suspend(() => + S.Struct({ + email: S.optional(S.String), + id: S.optional(S.Number), + name: S.optional(S.NullOr(S.String)), + }), +).annotate({ identifier: "SLOCreator" }) as any as S.Schema; + +/** Tags with the `env` tag key. */ +export type SearchServiceLevelObjectiveAttributesEnvTagsList = Array; +export const SearchServiceLevelObjectiveAttributesEnvTagsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. */ +export type SearchServiceLevelObjectiveAttributesGroupsList = Array; +export const SearchServiceLevelObjectiveAttributesGroupsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** A list of monitor ids that defines the scope of a monitor service level objective. */ +export type SearchServiceLevelObjectiveAttributesMonitorIdsList = Array; +export const SearchServiceLevelObjectiveAttributesMonitorIdsList = + /*@__PURE__*/ S.Array( + S.Number, + ) as any as S.Schema; + +/** Error budget remaining for an SLO. */ +export interface SLORawErrorBudgetRemaining { + /** Error budget remaining unit. */ + unit?: string; + /** Error budget remaining value. */ + value?: number; +} +export const SLORawErrorBudgetRemaining = /*@__PURE__*/ S.suspend(() => + S.Struct({ + unit: S.optional(S.String), + value: S.optional(S.Number), + }), +).annotate({ + identifier: "SLORawErrorBudgetRemaining", +}) as any as S.Schema; + +/** State of the SLO. */ +export type SLOState = "breached" | "warning" | "ok" | "no_data"; +export const SLOState = /*@__PURE__*/ S.String; + +/** Overall status of the SLO by timeframes. */ +export interface SLOOverallStatuses { + /** Error message if SLO status or error budget could not be calculated. */ + error?: string | null; + /** Remaining error budget of the SLO in percentage. */ + error_budget_remaining?: number | null; + /** timestamp (UNIX time in seconds) of when the SLO status and error budget were calculated. */ + indexed_at?: number; + raw_error_budget_remaining?: SLORawErrorBudgetRemaining | null; + /** The amount of decimal places the SLI value is accurate to. */ + span_precision?: number | null; + state?: SLOState; + /** The status of the SLO. */ + status?: number | null; + /** The target of the SLO. */ + target?: number; + timeframe?: SLOTimeframe; +} +export const SLOOverallStatuses = /*@__PURE__*/ S.suspend(() => + S.Struct({ + error: S.optional(S.NullOr(S.String)), + error_budget_remaining: S.optional(S.NullOr(S.Number)), + indexed_at: S.optional(S.Number), + raw_error_budget_remaining: S.optional( + S.NullOr(SLORawErrorBudgetRemaining), + ), + span_precision: S.optional(S.NullOr(S.Number)), + state: S.optional(SLOState), + status: S.optional(S.NullOr(S.Number)), + target: S.optional(S.Number), + timeframe: S.optional(SLOTimeframe), + }), +).annotate({ + identifier: "SLOOverallStatuses", +}) as any as S.Schema; + +/** calculated status and error budget remaining. */ +export type SearchServiceLevelObjectiveAttributesOverallStatusList = + Array; +export const SearchServiceLevelObjectiveAttributesOverallStatusList = + /*@__PURE__*/ S.Array( + SLOOverallStatuses, + ) as any as S.Schema; + +/** Metric names used in the query's numerator and denominator. This field will return null and will be implemented in the next version of this endpoint. */ +export type SearchSLOQueryMetricsList = Array; +export const SearchSLOQueryMetricsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. */ +export interface SearchSLOQuery { + /** A Datadog metric query for total (valid) events. */ + denominator?: string; + /** Metric names used in the query's numerator and denominator. This field will return null and will be implemented in the next version of this endpoint. */ + metrics?: SearchSLOQueryMetricsList | null; + /** A Datadog metric query for good events. */ + numerator?: string; +} +export const SearchSLOQuery = /*@__PURE__*/ S.suspend(() => + S.Struct({ + denominator: S.optional(S.String), + metrics: S.optional(S.NullOr(SearchSLOQueryMetricsList)), + numerator: S.optional(S.String), + }), +).annotate({ identifier: "SearchSLOQuery" }) as any as S.Schema; + +/** Tags with the `service` tag key. */ +export type SearchServiceLevelObjectiveAttributesServiceTagsList = + Array; +export const SearchServiceLevelObjectiveAttributesServiceTagsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Status of the SLO's primary timeframe. */ +export interface SLOStatus { + /** Error message if SLO status or error budget could not be calculated. */ + calculation_error?: string | null; + /** Remaining error budget of the SLO in percentage. */ + error_budget_remaining?: number | null; + /** timestamp (UNIX time in seconds) of when the SLO status and error budget were calculated. */ + indexed_at?: number; + raw_error_budget_remaining?: SLORawErrorBudgetRemaining | null; + /** The current service level indicator (SLI) of the SLO, also known as 'status'. This is a percentage value from 0-100 (inclusive). */ + sli?: number | null; + /** The number of decimal places the SLI value is accurate to. */ + span_precision?: number | null; + state?: SLOState; +} +export const SLOStatus = /*@__PURE__*/ S.suspend(() => + S.Struct({ + calculation_error: S.optional(S.NullOr(S.String)), + error_budget_remaining: S.optional(S.NullOr(S.Number)), + indexed_at: S.optional(S.Number), + raw_error_budget_remaining: S.optional( + S.NullOr(SLORawErrorBudgetRemaining), + ), + sli: S.optional(S.NullOr(S.Number)), + span_precision: S.optional(S.NullOr(S.Number)), + state: S.optional(SLOState), + }), +).annotate({ identifier: "SLOStatus" }) as any as S.Schema; + +/** Tags with the `team` tag key. */ +export type SearchServiceLevelObjectiveAttributesTeamTagsList = Array; +export const SearchServiceLevelObjectiveAttributesTeamTagsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** The SLO time window options. */ +export type SearchSLOTimeframe = "7d" | "30d" | "90d"; +export const SearchSLOTimeframe = /*@__PURE__*/ S.String; + +/** SLO thresholds (target and optionally warning) for a single time window. */ +export interface SearchSLOThreshold { + /** The target value for the service level indicator within the corresponding timeframe. */ + target: number; + /** A string representation of the target that indicates its precision. It uses trailing zeros to show significant decimal places (for example `98.00`). Always included in service level objective responses. Ignored in create/update requests. */ + target_display?: string; + timeframe: SearchSLOTimeframe; + /** The warning value for the service level objective. */ + warning?: number | null; + /** A string representation of the warning target (see the description of the `target_display` field for details). Included in service level objective responses if a warning target exists. Ignored in create/update requests. */ + warning_display?: string | null; +} +export const SearchSLOThreshold = /*@__PURE__*/ S.suspend(() => + S.Struct({ + target: S.Number, + target_display: S.optional(S.String), + timeframe: SearchSLOTimeframe, + warning: S.optional(S.NullOr(S.Number)), + warning_display: S.optional(S.NullOr(S.String)), + }), +).annotate({ + identifier: "SearchSLOThreshold", +}) as any as S.Schema; + +/** The thresholds (timeframes and associated targets) for this service level objective object. */ +export type SearchServiceLevelObjectiveAttributesThresholdsList = + Array; +export const SearchServiceLevelObjectiveAttributesThresholdsList = + /*@__PURE__*/ S.Array( + SearchSLOThreshold, + ) as any as S.Schema; + +/** A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (`name`, `description`, and `tags`). */ +export interface SearchServiceLevelObjectiveAttributes { + /** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). */ + all_tags?: SearchServiceLevelObjectiveAttributesAllTagsList; + /** Creation timestamp (UNIX time in seconds) Always included in service level objective responses. */ + created_at?: number; + creator?: SLOCreator | null; + /** A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. */ + description?: string | null; + /** Tags with the `env` tag key. */ + env_tags?: SearchServiceLevelObjectiveAttributesEnvTagsList; + /** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. */ + groups?: SearchServiceLevelObjectiveAttributesGroupsList | null; + /** Modification timestamp (UNIX time in seconds) Always included in service level objective responses. */ + modified_at?: number; + /** A list of monitor ids that defines the scope of a monitor service level objective. */ + monitor_ids?: SearchServiceLevelObjectiveAttributesMonitorIdsList | null; + /** The name of the service level objective object. */ + name?: string; + /** calculated status and error budget remaining. */ + overall_status?: SearchServiceLevelObjectiveAttributesOverallStatusList; + query?: SearchSLOQuery | null; + /** Tags with the `service` tag key. */ + service_tags?: SearchServiceLevelObjectiveAttributesServiceTagsList; + slo_type?: SLOType; + status?: SLOStatus; + /** Tags with the `team` tag key. */ + team_tags?: SearchServiceLevelObjectiveAttributesTeamTagsList; + /** The thresholds (timeframes and associated targets) for this service level objective object. */ + thresholds?: SearchServiceLevelObjectiveAttributesThresholdsList; +} +export const SearchServiceLevelObjectiveAttributes = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + all_tags: S.optional(SearchServiceLevelObjectiveAttributesAllTagsList), + created_at: S.optional(S.Number), + creator: S.optional(S.NullOr(SLOCreator)), + description: S.optional(S.NullOr(S.String)), + env_tags: S.optional(SearchServiceLevelObjectiveAttributesEnvTagsList), + groups: S.optional( + S.NullOr(SearchServiceLevelObjectiveAttributesGroupsList), + ), + modified_at: S.optional(S.Number), + monitor_ids: S.optional( + S.NullOr(SearchServiceLevelObjectiveAttributesMonitorIdsList), + ), + name: S.optional(S.String), + overall_status: S.optional( + SearchServiceLevelObjectiveAttributesOverallStatusList, + ), + query: S.optional(S.NullOr(SearchSLOQuery)), + service_tags: S.optional( + SearchServiceLevelObjectiveAttributesServiceTagsList, + ), + slo_type: S.optional(SLOType), + status: S.optional(SLOStatus), + team_tags: S.optional(SearchServiceLevelObjectiveAttributesTeamTagsList), + thresholds: S.optional( + SearchServiceLevelObjectiveAttributesThresholdsList, + ), + }), +).annotate({ + identifier: "SearchServiceLevelObjectiveAttributes", +}) as any as S.Schema; + +/** A service level objective ID and attributes. */ +export interface SearchServiceLevelObjectiveData { + attributes?: SearchServiceLevelObjectiveAttributes; + /** A unique identifier for the service level objective object. Always included in service level objective responses. */ + id?: string; + /** The type of the object, must be `slo`. */ + type?: string; +} +export const SearchServiceLevelObjectiveData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(SearchServiceLevelObjectiveAttributes), + id: S.optional(S.String), + type: S.optional(S.String), + }), +).annotate({ + identifier: "SearchServiceLevelObjectiveData", +}) as any as S.Schema; + +/** A service level objective data container. */ +export interface SearchServiceLevelObjective { + data?: SearchServiceLevelObjectiveData; +} +export const SearchServiceLevelObjective = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SearchServiceLevelObjectiveData), + }), +).annotate({ + identifier: "SearchServiceLevelObjective", +}) as any as S.Schema; + +/** SLOs */ +export type SearchSLOResponseDataAttributesSlosList = + Array; +export const SearchSLOResponseDataAttributesSlosList = /*@__PURE__*/ S.Array( + SearchServiceLevelObjective, +) as any as S.Schema; + +/** Attributes */ +export interface SearchSLOResponseDataAttributes { + facets?: SearchSLOResponseDataAttributesFacets; + /** SLOs */ + slos?: SearchSLOResponseDataAttributesSlosList; +} +export const SearchSLOResponseDataAttributes = /*@__PURE__*/ S.suspend(() => + S.Struct({ + facets: S.optional(SearchSLOResponseDataAttributesFacets), + slos: S.optional(SearchSLOResponseDataAttributesSlosList), + }), +).annotate({ + identifier: "SearchSLOResponseDataAttributes", +}) as any as S.Schema; + +/** Data from search SLO response. */ +export interface SearchSLOResponseData { + attributes?: SearchSLOResponseDataAttributes; + /** Type of service level objective result. */ + type?: string; +} +export const SearchSLOResponseData = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(SearchSLOResponseDataAttributes), + type: S.optional(S.String), + }), +).annotate({ + identifier: "SearchSLOResponseData", +}) as any as S.Schema; + +/** Pagination links. */ +export interface SearchSLOResponseLinks { + /** Link to last page. */ + first?: string; + /** Link to first page. */ + last?: string | null; + /** Link to the next page. */ + next?: string; + /** Link to previous page. */ + prev?: string | null; + /** Link to current page. */ + self?: string; +} +export const SearchSLOResponseLinks = /*@__PURE__*/ S.suspend(() => + S.Struct({ + first: S.optional(S.String), + last: S.optional(S.NullOr(S.String)), + next: S.optional(S.String), + prev: S.optional(S.NullOr(S.String)), + self: S.optional(S.String), + }), +).annotate({ + identifier: "SearchSLOResponseLinks", +}) as any as S.Schema; + +/** Pagination metadata returned by the API. */ +export interface SearchSLOResponseMetaPage { + /** The first number. */ + first_number?: number; + /** The last number. */ + last_number?: number; + /** The next number. */ + next_number?: number; + /** The page number. */ + number?: number; + /** The previous page number. */ + prev_number?: number; + /** The size of the response. */ + size?: number; + /** The total number of SLOs in the response. */ + total?: number; + /** Type of pagination. */ + type?: string; +} +export const SearchSLOResponseMetaPage = /*@__PURE__*/ S.suspend(() => + S.Struct({ + first_number: S.optional(S.Number), + last_number: S.optional(S.Number), + next_number: S.optional(S.Number), + number: S.optional(S.Number), + prev_number: S.optional(S.Number), + size: S.optional(S.Number), + total: S.optional(S.Number), + type: S.optional(S.String), + }), +).annotate({ + identifier: "SearchSLOResponseMetaPage", +}) as any as S.Schema; + +/** Searches metadata returned by the API. */ +export interface SearchSLOResponseMeta { + pagination?: SearchSLOResponseMetaPage; +} +export const SearchSLOResponseMeta = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pagination: S.optional(SearchSLOResponseMetaPage), + }), +).annotate({ + identifier: "SearchSLOResponseMeta", +}) as any as S.Schema; + +/** A search SLO response containing results from the search query. */ +export interface SearchSLOResponse { + data?: SearchSLOResponseData; + links?: SearchSLOResponseLinks; + meta?: SearchSLOResponseMeta; +} +export const SearchSLOResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + data: S.optional(SearchSLOResponseData), + links: S.optional(SearchSLOResponseLinks), + meta: S.optional(SearchSLOResponseMeta), + }), +).annotate({ + identifier: "SearchSLOResponse", +}) as any as S.Schema; + +/** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ +export type UpdateSLORequestGroupsList = Array; +export const UpdateSLORequestGroupsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ +export type UpdateSLORequestMonitorIdsList = Array; +export const UpdateSLORequestMonitorIdsList = /*@__PURE__*/ S.Array( + S.Number, +) as any as S.Schema; + +/** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor-based service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ +export type UpdateSLORequestMonitorTagsList = Array; +export const UpdateSLORequestMonitorTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ +export type UpdateSLORequestTagsList = Array; +export const UpdateSLORequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** The thresholds (timeframes and associated targets) for this service level objective object. */ +export type UpdateSLORequestThresholdsList = Array; +export const UpdateSLORequestThresholdsList = /*@__PURE__*/ S.Array( + SLOThreshold, +) as any as S.Schema; + +export interface UpdateSLORequest { + /** The ID of the service level objective object. */ + slo_id: string; + /** A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. */ + description?: string | null; + /** A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. */ + groups?: UpdateSLORequestGroupsList; + /** A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. */ + monitor_ids?: UpdateSLORequestMonitorIdsList; + /** The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor-based service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). */ + monitor_tags?: UpdateSLORequestMonitorTagsList; + /** The name of the service level objective object. */ + name: string; + query?: ServiceLevelObjectiveQuery; + sli_specification?: SLOSliSpec; + /** A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. */ + tags?: UpdateSLORequestTagsList; + /** The target threshold such that when the service level indicator is above this threshold over the given timeframe, the objective is being met. */ + target_threshold?: number; + /** The thresholds (timeframes and associated targets) for this service level objective object. */ + thresholds: UpdateSLORequestThresholdsList; + timeframe?: SLOTimeframe | (string & {}); + type: SLOType | (string & {}); + /** The optional warning threshold such that when the service level indicator is below this value for the given threshold, but above the target threshold, the objective appears in a "warning" state. This value must be greater than the target threshold. */ + warning_threshold?: number; +} +export const UpdateSLORequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + slo_id: S.String.pipe(T.Label()), + description: S.optional(S.NullOr(S.String)), + groups: S.optional(UpdateSLORequestGroupsList), + monitor_ids: S.optional(UpdateSLORequestMonitorIdsList), + monitor_tags: S.optional(UpdateSLORequestMonitorTagsList), + name: S.String, + query: S.optional(ServiceLevelObjectiveQuery), + sli_specification: S.optional(SLOSliSpec), + tags: S.optional(UpdateSLORequestTagsList), + target_threshold: S.optional(S.Number), + thresholds: UpdateSLORequestThresholdsList, + timeframe: S.optional(SLOTimeframe), + type: SLOType, + warning_threshold: S.optional(S.Number), + }).pipe(T.Http({ method: "PUT", uri: "/api/v1/slo/{slo_id}", code: 200 })), +).annotate({ + identifier: "UpdateSLORequest", +}) as any as S.Schema; + +export type CheckCanDeleteSLOError = + | BadRequest + | Forbidden + | Conflict + | DatadogOpError; +/** Check if SLOs can be safely deleted Check if an SLO can be safely deleted. For example, assure an SLO can be deleted without disrupting a dashboard. */ +export const checkCanDeleteSLO: API.OperationMethod< + CheckCanDeleteSLORequest, + CheckCanDeleteSLOResponse, + CheckCanDeleteSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CheckCanDeleteSLORequest, + output: CheckCanDeleteSLOResponse, + errors: [BadRequest, Forbidden, Conflict], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type CreateSLOError = BadRequest | Forbidden | DatadogOpError; +/** Create an SLO object Create a service level objective object. */ +export const createSLO: API.OperationMethod< + CreateSLORequest, + SLOListResponse, + CreateSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateSLORequest, + output: SLOListResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type DeleteSLOError = Forbidden | NotFound | Conflict | DatadogOpError; +/** Delete an SLO Permanently delete the specified service level objective object. If an SLO is used in a dashboard, the `DELETE /v1/slo/` endpoint returns a 409 conflict error because the SLO is referenced in a dashboard. */ +export const deleteSLO: API.OperationMethod< + DeleteSLORequest, + SLODeleteResponse, + DeleteSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteSLORequest, + output: SLODeleteResponse, + errors: [Forbidden, NotFound, Conflict], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type DeleteSLOTimeframeInBulkError = + | BadRequest + | Forbidden + | DatadogOpError; +/** Bulk Delete SLO Timeframes Delete (or partially delete) multiple service level objective objects. This endpoint facilitates deletion of one or more thresholds for one or more service level objective objects. If all thresholds are deleted, the service level objective object is deleted as well. */ +export const deleteSLOTimeframeInBulk: API.OperationMethod< + DeleteSLOTimeframeInBulkRequest, + SLOBulkDeleteResponse, + DeleteSLOTimeframeInBulkError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteSLOTimeframeInBulkRequest, + output: SLOBulkDeleteResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type GetSLOError = Forbidden | NotFound | DatadogOpError; +/** Get an SLO's details Get a service level objective object. */ +export const getSLO: API.OperationMethod< + GetSLORequest, + SLOResponse, + GetSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSLORequest, + output: SLOResponse, + errors: [Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type GetSLOCorrectionsError = + | BadRequest + | Forbidden + | NotFound + | DatadogOpError; +/** Get Corrections For an SLO Get corrections applied to an SLO */ +export const getSLOCorrections: API.OperationMethod< + GetSLOCorrectionsRequest, + SLOCorrectionListResponse, + GetSLOCorrectionsError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSLOCorrectionsRequest, + output: SLOCorrectionListResponse, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type GetSLOHistoryError = + | BadRequest + | Forbidden + | NotFound + | DatadogOpError; +/** Get an SLO's history Get a specific SLO’s history, regardless of its SLO type. The detailed history data is structured according to the source data type. For example, metric data is included for event SLOs that use the metric source, and monitor SLO types include the monitor transition history. **Note:** There are different response formats for event based and time based SLOs. Examples of both are shown. */ +export const getSLOHistory: API.OperationMethod< + GetSLOHistoryRequest, + SLOHistoryResponse, + GetSLOHistoryError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSLOHistoryRequest, + output: SLOHistoryResponse, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type ListSLOsError = BadRequest | Forbidden | NotFound | DatadogOpError; +/** Get all SLOs Get a list of service level objective objects for your organization. */ +export const listSLOs: API.OperationMethod< + ListSLOsRequest, + SLOListResponse, + ListSLOsError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: ListSLOsRequest, + output: SLOListResponse, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type SearchSLOError = BadRequest | Forbidden | DatadogOpError; +/** Search for SLOs Get a list of service level objective objects for your organization. */ +export const searchSLO: API.OperationMethod< + SearchSLORequest, + SearchSLOResponse, + SearchSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: SearchSLORequest, + output: SearchSLOResponse, + errors: [BadRequest, Forbidden], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); + +export type UpdateSLOError = BadRequest | Forbidden | NotFound | DatadogOpError; +/** Update an SLO Update the specified service level objective object. */ +export const updateSLO: API.OperationMethod< + UpdateSLORequest, + SLOListResponse, + UpdateSLOError, + DatadogOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateSLORequest, + output: SLOListResponse, + errors: [BadRequest, Forbidden, NotFound], + protocol: DatadogProtocol, + retry: Retry.Retry, +})); diff --git a/packages/datadog/src/traits.ts b/packages/datadog/src/traits.ts new file mode 100644 index 0000000000..2523930ed2 --- /dev/null +++ b/packages/datadog/src/traits.ts @@ -0,0 +1,44 @@ +/** + * Datadog SDK trait surface — hand-written. + * + * Re-exports the generic protocol traits from core (so generated operations + * import everything from one place). Datadog has no envelope of its own; the + * REST-protocol traits (SensitiveValue / RawResponse) come from + * `core/protocol-rest`. + */ +export { + Body, + Header, + Query, + Label, + Http, + ResponseCode, + HttpBody, + FormDataFile, + KeyDictionary, + UnionCases, + applyErrorMatchers, + getErrorMatchers, + type HttpTrait, + type ErrorMatcher, + bodySymbol, + headerSymbol, + querySymbol, + labelSymbol, + httpSymbol, + responseCodeSymbol, + httpBodySymbol, + formDataFileSymbol, + keyDictionarySymbol, + unionCasesSymbol, + errorMatchersSymbol, +} from "@distilled.cloud/core/trait"; + +export { + SensitiveValue, + RawResponse, + RawResponseRoot, + sensitiveValueSymbol, + rawResponseSymbol, + rawResponseRootSymbol, +} from "@distilled.cloud/core/protocol-rest"; diff --git a/packages/datadog/tsconfig.json b/packages/datadog/tsconfig.json new file mode 100644 index 0000000000..56b16e575f --- /dev/null +++ b/packages/datadog/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["src/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "outDir": "./lib", + "rootDir": "./src", + "paths": { + "@distilled.cloud/core/*": ["../core/src/*"] + } + }, + "references": [{ "path": "../core" }] +} diff --git a/packages/datadog/tsconfig.scripts.json b/packages/datadog/tsconfig.scripts.json new file mode 100644 index 0000000000..be37c34749 --- /dev/null +++ b/packages/datadog/tsconfig.scripts.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["scripts/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "./.scripts-types", + "rootDir": "./scripts", + "tsBuildInfoFile": "./.scripts-types/tsconfig.scripts.tsbuildinfo", + // Resolve @distilled.cloud/core/* to src (the bun condition), matching + // how the scripts actually run under bun. + "rewriteRelativeImportExtensions": false, + "customConditions": ["bun"] + }, + "references": [{ "path": "../core" }] +} diff --git a/tsconfig.json b/tsconfig.json index f317a2422d..f81772bfc7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,8 @@ { "path": "./packages/azure/tsconfig.scripts.json" }, { "path": "./packages/coinbase/tsconfig.json" }, { "path": "./packages/coinbase/tsconfig.scripts.json" }, + { "path": "./packages/datadog/tsconfig.json" }, + { "path": "./packages/datadog/tsconfig.scripts.json" }, { "path": "./packages/discord/tsconfig.json" }, { "path": "./packages/discord/tsconfig.scripts.json" }, { "path": "./packages/expo-eas/tsconfig.json" }, From 8e4aaf1c49c1c6fa6481d38e3e133c500616794a Mon Sep 17 00:00:00 2001 From: Gavin Kline Date: Thu, 13 Aug 2026 21:12:57 -0400 Subject: [PATCH 2/2] fix(datadog): type unknown API failures Co-authored-by: Cursor --- .gitmodules | 2 ++ packages/datadog/src/protocol.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 533ec729ea..bc2625bb46 100644 --- a/.gitmodules +++ b/.gitmodules @@ -87,3 +87,5 @@ [submodule "packages/datadog/specs/datadog-api-client-typescript"] path = packages/datadog/specs/datadog-api-client-typescript url = https://github.com/DataDog/datadog-api-client-typescript.git + shallow = true + ignore = dirty diff --git a/packages/datadog/src/protocol.ts b/packages/datadog/src/protocol.ts index 77845e1bd2..4a476f9d37 100644 --- a/packages/datadog/src/protocol.ts +++ b/packages/datadog/src/protocol.ts @@ -41,6 +41,7 @@ import { UnknownDatadogError, type DefaultErrors } from "./errors.ts"; export type DatadogOpError = | DefaultErrors | ConfigError + | UnknownDatadogError | HttpClientError.HttpClientError; /** Context (requirements) shared by every generated Datadog operation. */