Skip to content
Open
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
40 changes: 40 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29582,6 +29582,19 @@ components:
type: string
x-enum-varnames:
- INCIDENT_ATTACHMENTS
IncidentCondition:
description: A condition evaluated against incident tags.
properties:
tags:
description: Tags that must match for the condition to pass.
example:
- ''
items:
type: string
type: array
required:
- tags
type: object
IncidentCreateAttributes:
description: The incident's attributes for a create request.
properties:
Expand Down Expand Up @@ -31416,6 +31429,32 @@ components:
user_defined_fields:
$ref: '#/components/schemas/RelationshipToIncidentUserDefinedFields'
type: object
IncidentScheduleTrigger:
description: Trigger a workflow from an Incident Schedule. The workflow must
be published.
properties:
incidentType:
description: Incident type filter for the schedule.
type: string
rrule:
description: Recurrence rule expression for scheduling.
example: ''
type: string
tagCondition:
$ref: '#/components/schemas/IncidentCondition'
required:
- rrule
type: object
IncidentScheduleTriggerWrapper:
description: Schema for an Incident Schedule-based trigger.
properties:
incidentScheduleTrigger:
$ref: '#/components/schemas/IncidentScheduleTrigger'
startStepNames:
$ref: '#/components/schemas/StartStepNames'
required:
- incidentScheduleTrigger
type: object
IncidentSearchResponse:
description: Response with incidents and facets.
properties:
Expand Down Expand Up @@ -67073,6 +67112,7 @@ components:
- $ref: '#/components/schemas/FormTriggerWrapper'
- $ref: '#/components/schemas/GithubWebhookTriggerWrapper'
- $ref: '#/components/schemas/IncidentTriggerWrapper'
- $ref: '#/components/schemas/IncidentScheduleTriggerWrapper'
- $ref: '#/components/schemas/MonitorTriggerWrapper'
- $ref: '#/components/schemas/NotebookTriggerWrapper'
- $ref: '#/components/schemas/OnCallTriggerWrapper'
Expand Down
21 changes: 21 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12513,6 +12513,13 @@ datadog\_api\_client.v2.model.incident\_attachment\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_condition module
--------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_condition
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_create\_attributes module
-----------------------------------------------------------------

Expand Down Expand Up @@ -13255,6 +13262,20 @@ datadog\_api\_client.v2.model.incident\_response\_relationships module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_schedule\_trigger module
----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_schedule_trigger
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_schedule\_trigger\_wrapper module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_schedule_trigger_wrapper
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_search\_response module
---------------------------------------------------------------

Expand Down
34 changes: 34 additions & 0 deletions src/datadog_api_client/v2/model/incident_condition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


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

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

def __init__(self_, tags: List[str], **kwargs):
"""
A condition evaluated against incident tags.

:param tags: Tags that must match for the condition to pass.
:type tags: [str]
"""
super().__init__(kwargs)

self_.tags = tags
62 changes: 62 additions & 0 deletions src/datadog_api_client/v2/model/incident_schedule_trigger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 Union, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.incident_condition import IncidentCondition


class IncidentScheduleTrigger(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.incident_condition import IncidentCondition

return {
"incident_type": (str,),
"rrule": (str,),
"tag_condition": (IncidentCondition,),
}

attribute_map = {
"incident_type": "incidentType",
"rrule": "rrule",
"tag_condition": "tagCondition",
}

def __init__(
self_,
rrule: str,
incident_type: Union[str, UnsetType] = unset,
tag_condition: Union[IncidentCondition, UnsetType] = unset,
**kwargs,
):
"""
Trigger a workflow from an Incident Schedule. The workflow must be published.

:param incident_type: Incident type filter for the schedule.
:type incident_type: str, optional

:param rrule: Recurrence rule expression for scheduling.
:type rrule: str

:param tag_condition: A condition evaluated against incident tags.
:type tag_condition: IncidentCondition, optional
"""
if incident_type is not unset:
kwargs["incident_type"] = incident_type
if tag_condition is not unset:
kwargs["tag_condition"] = tag_condition
super().__init__(kwargs)

self_.rrule = rrule
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger


class IncidentScheduleTriggerWrapper(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger

return {
"incident_schedule_trigger": (IncidentScheduleTrigger,),
"start_step_names": ([str],),
}

attribute_map = {
"incident_schedule_trigger": "incidentScheduleTrigger",
"start_step_names": "startStepNames",
}

def __init__(
self_,
incident_schedule_trigger: IncidentScheduleTrigger,
start_step_names: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Schema for an Incident Schedule-based trigger.

:param incident_schedule_trigger: Trigger a workflow from an Incident Schedule. The workflow must be published.
:type incident_schedule_trigger: IncidentScheduleTrigger

:param start_step_names: A list of steps that run first after a trigger fires.
:type start_step_names: [str], optional
"""
if start_step_names is not unset:
kwargs["start_step_names"] = start_step_names
super().__init__(kwargs)

self_.incident_schedule_trigger = incident_schedule_trigger
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/model/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from datadog_api_client.v2.model.form_trigger_wrapper import FormTriggerWrapper
from datadog_api_client.v2.model.github_webhook_trigger_wrapper import GithubWebhookTriggerWrapper
from datadog_api_client.v2.model.incident_trigger_wrapper import IncidentTriggerWrapper
from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper
from datadog_api_client.v2.model.monitor_trigger_wrapper import MonitorTriggerWrapper
from datadog_api_client.v2.model.notebook_trigger_wrapper import NotebookTriggerWrapper
from datadog_api_client.v2.model.on_call_trigger_wrapper import OnCallTriggerWrapper
Expand Down Expand Up @@ -93,6 +94,7 @@ def __init__(
FormTriggerWrapper,
GithubWebhookTriggerWrapper,
IncidentTriggerWrapper,
IncidentScheduleTriggerWrapper,
MonitorTriggerWrapper,
NotebookTriggerWrapper,
OnCallTriggerWrapper,
Expand Down
5 changes: 5 additions & 0 deletions src/datadog_api_client/v2/model/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def __init__(self, **kwargs):
:param incident_trigger: Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published.
:type incident_trigger: IncidentTrigger

:param incident_schedule_trigger: Trigger a workflow from an Incident Schedule. The workflow must be published.
:type incident_schedule_trigger: IncidentScheduleTrigger

:param monitor_trigger: Trigger a workflow from a Monitor. For automatic triggering a handle must be configured and the workflow must be published.
:type monitor_trigger: MonitorTrigger

Expand Down Expand Up @@ -96,6 +99,7 @@ def _composed_schemas(_):
from datadog_api_client.v2.model.form_trigger_wrapper import FormTriggerWrapper
from datadog_api_client.v2.model.github_webhook_trigger_wrapper import GithubWebhookTriggerWrapper
from datadog_api_client.v2.model.incident_trigger_wrapper import IncidentTriggerWrapper
from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper
from datadog_api_client.v2.model.monitor_trigger_wrapper import MonitorTriggerWrapper
from datadog_api_client.v2.model.notebook_trigger_wrapper import NotebookTriggerWrapper
from datadog_api_client.v2.model.on_call_trigger_wrapper import OnCallTriggerWrapper
Expand All @@ -118,6 +122,7 @@ def _composed_schemas(_):
FormTriggerWrapper,
GithubWebhookTriggerWrapper,
IncidentTriggerWrapper,
IncidentScheduleTriggerWrapper,
MonitorTriggerWrapper,
NotebookTriggerWrapper,
OnCallTriggerWrapper,
Expand Down
6 changes: 6 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,7 @@
from datadog_api_client.v2.model.ip_allowlist_update_request import IPAllowlistUpdateRequest
from datadog_api_client.v2.model.idp_metadata_form_data import IdPMetadataFormData
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType
from datadog_api_client.v2.model.incident_condition import IncidentCondition
from datadog_api_client.v2.model.incident_create_attributes import IncidentCreateAttributes
from datadog_api_client.v2.model.incident_create_data import IncidentCreateData
from datadog_api_client.v2.model.incident_create_relationships import IncidentCreateRelationships
Expand Down Expand Up @@ -2555,6 +2556,8 @@
from datadog_api_client.v2.model.incident_response_meta import IncidentResponseMeta
from datadog_api_client.v2.model.incident_response_meta_pagination import IncidentResponseMetaPagination
from datadog_api_client.v2.model.incident_response_relationships import IncidentResponseRelationships
from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger
from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper
from datadog_api_client.v2.model.incident_search_response import IncidentSearchResponse
from datadog_api_client.v2.model.incident_search_response_attributes import IncidentSearchResponseAttributes
from datadog_api_client.v2.model.incident_search_response_data import IncidentSearchResponseData
Expand Down Expand Up @@ -8024,6 +8027,7 @@
"IPAllowlistUpdateRequest",
"IdPMetadataFormData",
"IncidentAttachmentType",
"IncidentCondition",
"IncidentCreateAttributes",
"IncidentCreateData",
"IncidentCreateRelationships",
Expand Down Expand Up @@ -8130,6 +8134,8 @@
"IncidentResponseMeta",
"IncidentResponseMetaPagination",
"IncidentResponseRelationships",
"IncidentScheduleTrigger",
"IncidentScheduleTriggerWrapper",
"IncidentSearchResponse",
"IncidentSearchResponseAttributes",
"IncidentSearchResponseData",
Expand Down
Loading