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
90 changes: 29 additions & 61 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59622,6 +59622,7 @@ components:
oneOf:
- $ref: "#/components/schemas/SendSlackMessageAction"
- $ref: "#/components/schemas/SendTeamsMessageAction"
- $ref: "#/components/schemas/TriggerWorkflowAutomationAction"
RoutingRuleAttributes:
description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
properties:
Expand Down Expand Up @@ -79418,6 +79419,28 @@ components:
type: string
x-enum-varnames:
- MONITOR_ALERT_TRIGGER
TriggerWorkflowAutomationAction:
description: "Triggers a Workflow Automation."
properties:
handle:
description: "The handle of the Workflow Automation to trigger."
example: my-workflow-handle
type: string
type:
$ref: "#/components/schemas/TriggerWorkflowAutomationActionType"
required:
- type
- handle
type: object
TriggerWorkflowAutomationActionType:
default: workflow
description: "Indicates that the action triggers a Workflow Automation."
enum:
- workflow
example: workflow
type: string
x-enum-varnames:
- TRIGGER_WORKFLOW_AUTOMATION
UCConfigPair:
description: The definition of `UCConfigPair` object.
example:
Expand Down Expand Up @@ -134695,45 +134718,16 @@ paths:
application/json:
examples:
default:
summary: CCM cost summary widget
value:
data:
attributes:
definition:
graph_options:
- type: query_value
view: total
- type: query_value
view: change
- display_type: bars
type: timeseries
- type: cloud_cost_table
view: summary
requests:
- formulas:
- formula: query1
queries:
- data_source: cloud_cost
name: query1
query: sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, daily)
response_format: timeseries
time:
type: live
unit: day
value: 30
title: AWS spend by service (last 30 days)
type: cloud_cost_summary
tags: ["finops", "aws"]
title: My Widget
type: bar_chart
type: widgets
schema:
$ref: "#/components/schemas/CreateOrUpdateWidgetRequest"
description: |-
Widget request body. The `definition` object's required fields vary
by `widget.definition.type`: every type requires `requests`, and
some types require additional fields (e.g. `cloud_cost_summary`
requires `graph_options`, `geomap` requires `style` and `view`).
The example below shows a complete `cloud_cost_summary` payload
for the `ccm_reports` experience type.
description: Widget request body.
required: true
responses:
"200":
Expand Down Expand Up @@ -134903,42 +134897,16 @@ paths:
application/json:
examples:
default:
summary: CCM cost summary widget
value:
data:
attributes:
definition:
graph_options:
- type: query_value
view: total
- type: query_value
view: change
- display_type: bars
type: timeseries
- type: cloud_cost_table
view: summary
requests:
- formulas:
- formula: query1
queries:
- data_source: cloud_cost
name: query1
query: sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, daily)
response_format: timeseries
time:
type: live
unit: day
value: 30
title: AWS spend by service (last 30 days)
type: cloud_cost_summary
tags: ["finops", "aws"]
title: My Widget
type: bar_chart
type: widgets
schema:
$ref: "#/components/schemas/CreateOrUpdateWidgetRequest"
description: |-
Widget request body. The `definition` object's required fields vary
by `widget.definition.type`; see `CreateWidget` above for a complete
worked payload. Update is a full replacement of the widget definition.
description: Widget request body.
required: true
responses:
"200":
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35116,6 +35116,20 @@ datadog\_api\_client.v2.model.trigger\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.trigger\_workflow\_automation\_action module
--------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.trigger\_workflow\_automation\_action\_type module
--------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.uc\_config\_pair module
-----------------------------------------------------

Expand Down
11 changes: 2 additions & 9 deletions src/datadog_api_client/v2/api/widgets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,7 @@ def create_widget(

:param experience_type: The experience type for the widget.
:type experience_type: WidgetExperienceType
:param body: Widget request body. The ``definition`` object's required fields vary
by ``widget.definition.type`` : every type requires ``requests`` , and
some types require additional fields (e.g. ``cloud_cost_summary``
requires ``graph_options`` , ``geomap`` requires ``style`` and ``view`` ).
The example below shows a complete ``cloud_cost_summary`` payload
for the ``ccm_reports`` experience type.
:param body: Widget request body.
:type body: CreateOrUpdateWidgetRequest
:rtype: WidgetResponse
"""
Expand Down Expand Up @@ -368,9 +363,7 @@ def update_widget(
:type experience_type: WidgetExperienceType
:param uuid: The UUID of the widget.
:type uuid: UUID
:param body: Widget request body. The ``definition`` object's required fields vary
by ``widget.definition.type`` ; see ``CreateWidget`` above for a complete
worked payload. Update is a full replacement of the widget definition.
:param body: Widget request body.
:type body: CreateOrUpdateWidgetRequest
:rtype: WidgetResponse
"""
Expand Down
5 changes: 5 additions & 0 deletions src/datadog_api_client/v2/model/routing_rule_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def __init__(self, **kwargs):

:param tenant: The tenant ID.
:type tenant: str

:param handle: The handle of the Workflow Automation to trigger.
:type handle: str
"""
super().__init__(kwargs)

Expand All @@ -43,10 +46,12 @@ def _composed_schemas(_):
# loading
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction

return {
"oneOf": [
SendSlackMessageAction,
SendTeamsMessageAction,
TriggerWorkflowAutomationAction,
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datadog_api_client.v2.model.urgency import Urgency
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction


class RoutingRuleAttributes(ModelNormal):
Expand All @@ -45,7 +46,12 @@ def openapi_types(_):
def __init__(
self_,
actions: Union[
List[Union[RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction]], UnsetType
List[
Union[
RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction, TriggerWorkflowAutomationAction
]
],
UnsetType,
] = unset,
query: Union[str, UnsetType] = unset,
time_restriction: Union[TimeRestrictions, UnsetType] = unset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datadog_api_client.v2.model.urgency import Urgency
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction


class TeamRoutingRulesRequestRule(ModelNormal):
Expand Down Expand Up @@ -47,7 +48,12 @@ def openapi_types(_):
def __init__(
self_,
actions: Union[
List[Union[RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction]], UnsetType
List[
Union[
RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction, TriggerWorkflowAutomationAction
]
],
UnsetType,
] = unset,
policy_id: Union[str, UnsetType] = unset,
query: Union[str, UnsetType] = unset,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.trigger_workflow_automation_action_type import TriggerWorkflowAutomationActionType


class TriggerWorkflowAutomationAction(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.trigger_workflow_automation_action_type import (
TriggerWorkflowAutomationActionType,
)

return {
"handle": (str,),
"type": (TriggerWorkflowAutomationActionType,),
}

attribute_map = {
"handle": "handle",
"type": "type",
}

def __init__(self_, handle: str, type: TriggerWorkflowAutomationActionType, **kwargs):
"""
Triggers a Workflow Automation.

:param handle: The handle of the Workflow Automation to trigger.
:type handle: str

:param type: Indicates that the action triggers a Workflow Automation.
:type type: TriggerWorkflowAutomationActionType
"""
super().__init__(kwargs)

self_.handle = handle
self_.type = type
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 (
ModelSimple,
cached_property,
)

from typing import ClassVar


class TriggerWorkflowAutomationActionType(ModelSimple):
"""
Indicates that the action triggers a Workflow Automation.

:param value: If omitted defaults to "workflow". Must be one of ["workflow"].
:type value: str
"""

allowed_values = {
"workflow",
}
TRIGGER_WORKFLOW_AUTOMATION: ClassVar["TriggerWorkflowAutomationActionType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


TriggerWorkflowAutomationActionType.TRIGGER_WORKFLOW_AUTOMATION = TriggerWorkflowAutomationActionType("workflow")
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7175,6 +7175,8 @@
from datadog_api_client.v2.model.trigger_rate_limit import TriggerRateLimit
from datadog_api_client.v2.model.trigger_source import TriggerSource
from datadog_api_client.v2.model.trigger_type import TriggerType
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction
from datadog_api_client.v2.model.trigger_workflow_automation_action_type import TriggerWorkflowAutomationActionType
from datadog_api_client.v2.model.uc_config_pair import UCConfigPair
from datadog_api_client.v2.model.uc_config_pair_data import UCConfigPairData
from datadog_api_client.v2.model.uc_config_pair_data_attributes import UCConfigPairDataAttributes
Expand Down Expand Up @@ -12522,6 +12524,8 @@
"TriggerRateLimit",
"TriggerSource",
"TriggerType",
"TriggerWorkflowAutomationAction",
"TriggerWorkflowAutomationActionType",
"UCConfigPair",
"UCConfigPairData",
"UCConfigPairDataAttributes",
Expand Down
Loading