Skip to content

Commit dfa4242

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 925bdeb of spec repo
1 parent 9346373 commit dfa4242

File tree

10 files changed

+310
-1
lines changed

10 files changed

+310
-1
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7255,6 +7255,13 @@ components:
72557255
Monitor:
72567256
description: Object describing a monitor.
72577257
properties:
7258+
assets:
7259+
description: The list of monitor assets tied to a monitor which represents
7260+
key links for users to help take actions on monitor alerts (for example,
7261+
runbooks)
7262+
items:
7263+
$ref: '#/components/schemas/MonitorAsset'
7264+
type: array
72587265
created:
72597266
description: Timestamp of the monitor creation.
72607267
format: date-time
@@ -7338,6 +7345,64 @@ components:
73387345
- type
73397346
- query
73407347
type: object
7348+
MonitorAsset:
7349+
description: 'Represents key links tied to a monitor to help users take action
7350+
on alerts (Runbooks, Dashboards, Workflows)
7351+
7352+
This feature is in Preview and only available to users with the feature enabled.'
7353+
properties:
7354+
category:
7355+
$ref: '#/components/schemas/MonitorAssetCategory'
7356+
name:
7357+
description: Name for the monitor asset
7358+
example: Monitor Runbook
7359+
type: string
7360+
options:
7361+
description: Additional options that you can set on a monitor asset.
7362+
example:
7363+
hide_in_monitor_message: true
7364+
type: object
7365+
resource_key:
7366+
description: Represents the identifier of the internal datadog resource
7367+
that this asset represents. IDs in this field should be passed in as strings.
7368+
example: '12345'
7369+
type: string
7370+
resource_type:
7371+
$ref: '#/components/schemas/MonitorAssetResourceType'
7372+
template_variables:
7373+
description: Allows you to parameterize the url for the monitor asset.
7374+
example:
7375+
env: prod
7376+
region: us-east-1
7377+
type: object
7378+
url:
7379+
description: Url link for the asset
7380+
example: https://app.datadoghq.com
7381+
type: string
7382+
required:
7383+
- name
7384+
- url
7385+
- category
7386+
type: object
7387+
MonitorAssetCategory:
7388+
description: Indicates the type of asset this entity represents on a monitor
7389+
enum:
7390+
- dashboard
7391+
- workflow
7392+
- runbook
7393+
example: dashboard
7394+
type: string
7395+
x-enum-varnames:
7396+
- DASHBOARD
7397+
- WORKFLOW
7398+
- RUNBOOK
7399+
MonitorAssetResourceType:
7400+
description: Type of internal datadog resource associated with a monitor asset
7401+
enum:
7402+
- notebook
7403+
type: string
7404+
x-enum-varnames:
7405+
- NOTEBOOK
73417406
MonitorDeviceID:
73427407
description: ID of the device the Synthetics monitor is running on. Same as
73437408
`SyntheticsDeviceID`.
@@ -8452,6 +8517,14 @@ components:
84528517
MonitorUpdateRequest:
84538518
description: Object describing a monitor update request.
84548519
properties:
8520+
assets:
8521+
description: The list of monitor assets tied to a monitor, which represents
8522+
key links for users to help take actions on monitor alerts (for example,
8523+
runbooks)
8524+
items:
8525+
$ref: '#/components/schemas/MonitorAsset'
8526+
nullable: true
8527+
type: array
84558528
created:
84568529
description: Timestamp of the monitor creation.
84578530
format: date-time
@@ -31529,6 +31602,13 @@ paths:
3152931602
required: false
3153031603
schema:
3153131604
type: boolean
31605+
- description: If this argument is set to `true`, then the returned data includes
31606+
all assets tied to this monitor.
31607+
in: query
31608+
name: with_assets
31609+
required: false
31610+
schema:
31611+
type: boolean
3153231612
responses:
3153331613
'200':
3153431614
content:

docs/datadog_api_client.v1.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,27 @@ datadog\_api\_client.v1.model.monitor module
22232223
:members:
22242224
:show-inheritance:
22252225

2226+
datadog\_api\_client.v1.model.monitor\_asset module
2227+
---------------------------------------------------
2228+
2229+
.. automodule:: datadog_api_client.v1.model.monitor_asset
2230+
:members:
2231+
:show-inheritance:
2232+
2233+
datadog\_api\_client.v1.model.monitor\_asset\_category module
2234+
-------------------------------------------------------------
2235+
2236+
.. automodule:: datadog_api_client.v1.model.monitor_asset_category
2237+
:members:
2238+
:show-inheritance:
2239+
2240+
datadog\_api\_client.v1.model.monitor\_asset\_resource\_type module
2241+
-------------------------------------------------------------------
2242+
2243+
.. automodule:: datadog_api_client.v1.model.monitor_asset_resource_type
2244+
:members:
2245+
:show-inheritance:
2246+
22262247
datadog\_api\_client.v1.model.monitor\_device\_id module
22272248
--------------------------------------------------------
22282249

src/datadog_api_client/v1/api/monitors_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ def __init__(self, api_client=None):
135135
"attribute": "with_downtimes",
136136
"location": "query",
137137
},
138+
"with_assets": {
139+
"openapi_types": (bool,),
140+
"attribute": "with_assets",
141+
"location": "query",
142+
},
138143
},
139144
headers_map={
140145
"accept": ["application/json"],
@@ -640,6 +645,7 @@ def get_monitor(
640645
*,
641646
group_states: Union[str, UnsetType] = unset,
642647
with_downtimes: Union[bool, UnsetType] = unset,
648+
with_assets: Union[bool, UnsetType] = unset,
643649
) -> Monitor:
644650
"""Get a monitor's details.
645651
@@ -651,6 +657,8 @@ def get_monitor(
651657
:type group_states: str, optional
652658
:param with_downtimes: If this argument is set to true, then the returned data includes all current active downtimes for the monitor.
653659
:type with_downtimes: bool, optional
660+
:param with_assets: If this argument is set to ``true`` , then the returned data includes all assets tied to this monitor.
661+
:type with_assets: bool, optional
654662
:rtype: Monitor
655663
"""
656664
kwargs: Dict[str, Any] = {}
@@ -662,6 +670,9 @@ def get_monitor(
662670
if with_downtimes is not unset:
663671
kwargs["with_downtimes"] = with_downtimes
664672

673+
if with_assets is not unset:
674+
kwargs["with_assets"] = with_assets
675+
665676
return self._get_monitor_endpoint.call_with_http_info(**kwargs)
666677

667678
def list_monitors(

src/datadog_api_client/v1/model/monitor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
if TYPE_CHECKING:
19+
from datadog_api_client.v1.model.monitor_asset import MonitorAsset
1920
from datadog_api_client.v1.model.creator import Creator
2021
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
2122
from datadog_api_client.v1.model.matching_downtime import MatchingDowntime
@@ -28,6 +29,7 @@
2829
class Monitor(ModelNormal):
2930
@cached_property
3031
def openapi_types(_):
32+
from datadog_api_client.v1.model.monitor_asset import MonitorAsset
3133
from datadog_api_client.v1.model.creator import Creator
3234
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
3335
from datadog_api_client.v1.model.matching_downtime import MatchingDowntime
@@ -37,6 +39,7 @@ def openapi_types(_):
3739
from datadog_api_client.v1.model.monitor_type import MonitorType
3840

3941
return {
42+
"assets": ([MonitorAsset],),
4043
"created": (datetime,),
4144
"creator": (Creator,),
4245
"deleted": (datetime, none_type),
@@ -58,6 +61,7 @@ def openapi_types(_):
5861
}
5962

6063
attribute_map = {
64+
"assets": "assets",
6165
"created": "created",
6266
"creator": "creator",
6367
"deleted": "deleted",
@@ -92,6 +96,7 @@ def __init__(
9296
self_,
9397
query: str,
9498
type: MonitorType,
99+
assets: Union[List[MonitorAsset], UnsetType] = unset,
95100
created: Union[datetime, UnsetType] = unset,
96101
creator: Union[Creator, UnsetType] = unset,
97102
deleted: Union[datetime, none_type, UnsetType] = unset,
@@ -113,6 +118,9 @@ def __init__(
113118
"""
114119
Object describing a monitor.
115120
121+
:param assets: The list of monitor assets tied to a monitor which represents key links for users to help take actions on monitor alerts (for example, runbooks)
122+
:type assets: [MonitorAsset], optional
123+
116124
:param created: Timestamp of the monitor creation.
117125
:type created: datetime, optional
118126
@@ -172,6 +180,8 @@ def __init__(
172180
:param type: The type of the monitor. For more information about ``type`` , see the `monitor options <https://docs.datadoghq.com/monitors/guide/monitor_api_options/>`_ docs.
173181
:type type: MonitorType
174182
"""
183+
if assets is not unset:
184+
kwargs["assets"] = assets
175185
if created is not unset:
176186
kwargs["created"] = created
177187
if creator is not unset:
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v1.model.monitor_asset_category import MonitorAssetCategory
18+
from datadog_api_client.v1.model.monitor_asset_resource_type import MonitorAssetResourceType
19+
20+
21+
class MonitorAsset(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v1.model.monitor_asset_category import MonitorAssetCategory
25+
from datadog_api_client.v1.model.monitor_asset_resource_type import MonitorAssetResourceType
26+
27+
return {
28+
"category": (MonitorAssetCategory,),
29+
"name": (str,),
30+
"options": (dict,),
31+
"resource_key": (str,),
32+
"resource_type": (MonitorAssetResourceType,),
33+
"template_variables": (dict,),
34+
"url": (str,),
35+
}
36+
37+
attribute_map = {
38+
"category": "category",
39+
"name": "name",
40+
"options": "options",
41+
"resource_key": "resource_key",
42+
"resource_type": "resource_type",
43+
"template_variables": "template_variables",
44+
"url": "url",
45+
}
46+
47+
def __init__(
48+
self_,
49+
category: MonitorAssetCategory,
50+
name: str,
51+
url: str,
52+
options: Union[dict, UnsetType] = unset,
53+
resource_key: Union[str, UnsetType] = unset,
54+
resource_type: Union[MonitorAssetResourceType, UnsetType] = unset,
55+
template_variables: Union[dict, UnsetType] = unset,
56+
**kwargs,
57+
):
58+
"""
59+
Represents key links tied to a monitor to help users take action on alerts (Runbooks, Dashboards, Workflows)
60+
This feature is in Preview and only available to users with the feature enabled.
61+
62+
:param category: Indicates the type of asset this entity represents on a monitor
63+
:type category: MonitorAssetCategory
64+
65+
:param name: Name for the monitor asset
66+
:type name: str
67+
68+
:param options: Additional options that you can set on a monitor asset.
69+
:type options: dict, optional
70+
71+
:param resource_key: Represents the identifier of the internal datadog resource that this asset represents. IDs in this field should be passed in as strings.
72+
:type resource_key: str, optional
73+
74+
:param resource_type: Type of internal datadog resource associated with a monitor asset
75+
:type resource_type: MonitorAssetResourceType, optional
76+
77+
:param template_variables: Allows you to parameterize the url for the monitor asset.
78+
:type template_variables: dict, optional
79+
80+
:param url: Url link for the asset
81+
:type url: str
82+
"""
83+
if options is not unset:
84+
kwargs["options"] = options
85+
if resource_key is not unset:
86+
kwargs["resource_key"] = resource_key
87+
if resource_type is not unset:
88+
kwargs["resource_type"] = resource_type
89+
if template_variables is not unset:
90+
kwargs["template_variables"] = template_variables
91+
super().__init__(kwargs)
92+
93+
self_.category = category
94+
self_.name = name
95+
self_.url = url
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class MonitorAssetCategory(ModelSimple):
16+
"""
17+
Indicates the type of asset this entity represents on a monitor
18+
19+
:param value: Must be one of ["dashboard", "workflow", "runbook"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"dashboard",
25+
"workflow",
26+
"runbook",
27+
}
28+
DASHBOARD: ClassVar["MonitorAssetCategory"]
29+
WORKFLOW: ClassVar["MonitorAssetCategory"]
30+
RUNBOOK: ClassVar["MonitorAssetCategory"]
31+
32+
@cached_property
33+
def openapi_types(_):
34+
return {
35+
"value": (str,),
36+
}
37+
38+
39+
MonitorAssetCategory.DASHBOARD = MonitorAssetCategory("dashboard")
40+
MonitorAssetCategory.WORKFLOW = MonitorAssetCategory("workflow")
41+
MonitorAssetCategory.RUNBOOK = MonitorAssetCategory("runbook")

0 commit comments

Comments
 (0)