Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 120 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46574,6 +46574,81 @@ components:
required:
- type
type: object
GeneralInvestigationAttributes:
description: Attributes for a general investigation, not tied to a specific monitor alert.
oneOf:
- $ref: "#/components/schemas/GeneralInvestigationAttributesWithoutTimeBounds"
- $ref: "#/components/schemas/GeneralInvestigationAttributesWithTimeBounds"
GeneralInvestigationAttributesWithTimeBounds:
additionalProperties: false
description: Attributes for a general investigation with an explicit time window.
properties:
description:
description: A free-form description of what to investigate, up to 4,096 characters.
example: "Checkout latency has been elevated for the past hour."
maxLength: 4096
type: string
end_time:
description: The end of the investigation window, in Unix milliseconds.
example: 1700003600000
format: int64
type: integer
start_time:
description: The start of the investigation window, in Unix milliseconds.
example: 1700000000000
format: int64
type: integer
tags:
description: Tags that scope the investigation.
example:
- "service:checkout"
items:
type: string
type: array
required:
- description
- start_time
- end_time
type: object
GeneralInvestigationAttributesWithoutTimeBounds:
additionalProperties: false
description: Attributes for a general investigation without an explicit time window.
properties:
description:
description: A free-form description of what to investigate, up to 4,096 characters.
example: "Checkout latency has been elevated for the past hour."
maxLength: 4096
type: string
tags:
description: Tags that scope the investigation.
example:
- "service:checkout"
items:
type: string
type: array
required:
- description
type: object
GeneralInvestigationTrigger:
additionalProperties: false
description: A trigger created from a general investigation request.
properties:
general_investigation:
$ref: "#/components/schemas/GeneralInvestigationAttributes"
type:
$ref: "#/components/schemas/GeneralInvestigationTriggerType"
required:
- type
- general_investigation
type: object
GeneralInvestigationTriggerType:
description: The type of general investigation trigger.
enum:
- general_investigation
example: general_investigation
type: string
x-enum-varnames:
- GENERAL_INVESTIGATION
GenerateCostTagDescriptionResponse:
description: Response wrapping an AI-generated Cloud Cost Management tag key description.
example:
Expand Down Expand Up @@ -72350,6 +72425,18 @@ components:
- key
- value
type: object
MonitorAlertTrigger:
additionalProperties: false
description: A trigger created from a monitor alert.
properties:
monitor_alert_trigger:
$ref: "#/components/schemas/MonitorAlertTriggerAttributes"
type:
$ref: "#/components/schemas/MonitorAlertTriggerType"
required:
- type
- monitor_alert_trigger
type: object
MonitorAlertTriggerAttributes:
description: Attributes for a monitor alert trigger.
properties:
Expand All @@ -72372,6 +72459,14 @@ components:
- event_id
- event_ts
type: object
MonitorAlertTriggerType:
description: The type of monitor alert trigger.
enum:
- monitor_alert_trigger
example: monitor_alert_trigger
type: string
x-enum-varnames:
- MONITOR_ALERT_TRIGGER
MonitorConfigPolicyAttributeCreateRequest:
description: Policy and policy type for a monitor configuration policy.
properties:
Expand Down Expand Up @@ -124722,15 +124817,23 @@ components:
- $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper"
- $ref: "#/components/schemas/WorkflowTriggerWrapper"
TriggerAttributes:
anyOf:
- $ref: "#/components/schemas/MonitorAlertTrigger"
- $ref: "#/components/schemas/GeneralInvestigationTrigger"
description: The trigger definition for starting an investigation.
example:
monitor_alert_trigger:
event_id: "1234567890123456789"
event_ts: 1700000000000
monitor_id: 12345678
type: monitor_alert_trigger
properties:
general_investigation:
$ref: "#/components/schemas/GeneralInvestigationAttributes"
monitor_alert_trigger:
$ref: "#/components/schemas/MonitorAlertTriggerAttributes"
type:
$ref: "#/components/schemas/TriggerType"
required:
- type
- monitor_alert_trigger
type: object
TriggerInvestigationRequest:
description: Request to trigger a new investigation.
Expand Down Expand Up @@ -124836,10 +124939,12 @@ components:
description: The type of trigger for the investigation.
enum:
- monitor_alert_trigger
- general_investigation
example: monitor_alert_trigger
type: string
x-enum-varnames:
- MONITOR_ALERT_TRIGGER
- GENERAL_INVESTIGATION
TriggerWorkflowAutomationAction:
description: "Triggers a Workflow Automation."
properties:
Expand Down Expand Up @@ -137627,7 +137732,7 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: |-
Trigger a new Bits AI investigation based on a monitor alert.
Trigger a Bits AI investigation from a monitor alert or a general investigation.
The `monitors_read` permission is required when the trigger type is `monitor_alert_trigger`.
operationId: TriggerInvestigation
requestBody:
Expand All @@ -137645,6 +137750,17 @@ paths:
monitor_id: 12345678
type: monitor_alert_trigger
type: trigger_investigation_request
general_investigation:
value:
data:
attributes:
trigger:
general_investigation:
description: "Checkout latency has been elevated for the past hour."
tags:
- "service:checkout"
type: general_investigation
type: trigger_investigation_request
schema:
$ref: "#/components/schemas/TriggerInvestigationRequest"
description: Trigger investigation request body.
Expand Down
2 changes: 1 addition & 1 deletion src/datadog_api_client/v2/api/bits_ai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def trigger_investigation(
) -> TriggerInvestigationResponse:
"""Trigger a Bits AI investigation.

Trigger a new Bits AI investigation based on a monitor alert.
Trigger a Bits AI investigation from a monitor alert or a general investigation.
The ``monitors_read`` permission is required when the trigger type is ``monitor_alert_trigger``.

:param body: Trigger investigation request body.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelComposed,
cached_property,
)


class GeneralInvestigationAttributes(ModelComposed):
def __init__(self, **kwargs):
"""
Attributes for a general investigation, not tied to a specific monitor alert.

:param description: A free-form description of what to investigate, up to 4,096 characters.
:type description: str

:param tags: Tags that scope the investigation.
:type tags: [str], optional

:param end_time: The end of the investigation window, in Unix milliseconds.
:type end_time: int

:param start_time: The start of the investigation window, in Unix milliseconds.
:type start_time: int
"""
super().__init__(kwargs)

@cached_property
def _composed_schemas(_):
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error because the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
from datadog_api_client.v2.model.general_investigation_attributes_without_time_bounds import (
GeneralInvestigationAttributesWithoutTimeBounds,
)
from datadog_api_client.v2.model.general_investigation_attributes_with_time_bounds import (
GeneralInvestigationAttributesWithTimeBounds,
)

return {
"oneOf": [
GeneralInvestigationAttributesWithoutTimeBounds,
GeneralInvestigationAttributesWithTimeBounds,
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class GeneralInvestigationAttributesWithTimeBounds(ModelNormal):
validations = {
"description": {
"max_length": 4096,
},
}

@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
return {
"description": (str,),
"end_time": (int,),
"start_time": (int,),
"tags": ([str],),
}

attribute_map = {
"description": "description",
"end_time": "end_time",
"start_time": "start_time",
"tags": "tags",
}

def __init__(
self_, description: str, end_time: int, start_time: int, tags: Union[List[str], UnsetType] = unset, **kwargs
):
"""
Attributes for a general investigation with an explicit time window.

:param description: A free-form description of what to investigate, up to 4,096 characters.
:type description: str

:param end_time: The end of the investigation window, in Unix milliseconds.
:type end_time: int

:param start_time: The start of the investigation window, in Unix milliseconds.
:type start_time: int

:param tags: Tags that scope the investigation.
:type tags: [str], optional
"""
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)

self_.description = description
self_.end_time = end_time
self_.start_time = start_time
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class GeneralInvestigationAttributesWithoutTimeBounds(ModelNormal):
validations = {
"description": {
"max_length": 4096,
},
}

@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
return {
"description": (str,),
"tags": ([str],),
}

attribute_map = {
"description": "description",
"tags": "tags",
}

def __init__(self_, description: str, tags: Union[List[str], UnsetType] = unset, **kwargs):
"""
Attributes for a general investigation without an explicit time window.

:param description: A free-form description of what to investigate, up to 4,096 characters.
:type description: str

:param tags: Tags that scope the investigation.
:type tags: [str], optional
"""
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)

self_.description = description
Loading
Loading