Skip to content

Commit 51e61d6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 71c00e7 of spec repo
1 parent 27f9b78 commit 51e61d6

File tree

12 files changed

+284
-12
lines changed

12 files changed

+284
-12
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 65 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,49 @@ 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+
resource_key:
7361+
description: Represents the identifier of the internal datadog resource
7362+
that this asset represents. IDs in this field should be passed in as strings.
7363+
example: '12345'
7364+
type: string
7365+
resource_type:
7366+
$ref: '#/components/schemas/MonitorAssetResourceType'
7367+
url:
7368+
description: Url link for the asset
7369+
example: https://app.datadoghq.com
7370+
type: string
7371+
required:
7372+
- name
7373+
- url
7374+
- category
7375+
type: object
7376+
MonitorAssetCategory:
7377+
description: Indicates the type of asset this entity represents on a monitor.
7378+
enum:
7379+
- runbook
7380+
example: dashboard
7381+
type: string
7382+
x-enum-varnames:
7383+
- RUNBOOK
7384+
MonitorAssetResourceType:
7385+
description: Type of internal datadog resource associated with a monitor asset.
7386+
enum:
7387+
- notebook
7388+
type: string
7389+
x-enum-varnames:
7390+
- NOTEBOOK
73417391
MonitorDeviceID:
73427392
description: ID of the device the Synthetics monitor is running on. Same as
73437393
`SyntheticsDeviceID`.
@@ -8452,6 +8502,14 @@ components:
84528502
MonitorUpdateRequest:
84538503
description: Object describing a monitor update request.
84548504
properties:
8505+
assets:
8506+
description: The list of monitor assets tied to a monitor, which represents
8507+
key links for users to help take actions on monitor alerts (for example,
8508+
runbooks).
8509+
items:
8510+
$ref: '#/components/schemas/MonitorAsset'
8511+
nullable: true
8512+
type: array
84558513
created:
84568514
description: Timestamp of the monitor creation.
84578515
format: date-time
@@ -31584,6 +31642,13 @@ paths:
3158431642
required: false
3158531643
schema:
3158631644
type: boolean
31645+
- description: If this argument is set to `true`, then the returned data includes
31646+
all assets tied to this monitor.
31647+
in: query
31648+
name: with_assets
31649+
required: false
31650+
schema:
31651+
type: boolean
3158731652
responses:
3158831653
'200':
3158931654
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: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
"resource_key": (str,),
31+
"resource_type": (MonitorAssetResourceType,),
32+
"url": (str,),
33+
}
34+
35+
attribute_map = {
36+
"category": "category",
37+
"name": "name",
38+
"resource_key": "resource_key",
39+
"resource_type": "resource_type",
40+
"url": "url",
41+
}
42+
43+
def __init__(
44+
self_,
45+
category: MonitorAssetCategory,
46+
name: str,
47+
url: str,
48+
resource_key: Union[str, UnsetType] = unset,
49+
resource_type: Union[MonitorAssetResourceType, UnsetType] = unset,
50+
**kwargs,
51+
):
52+
"""
53+
Represents key links tied to a monitor to help users take action on alerts (runbooks, dashboards, Workflows).
54+
This feature is in Preview and only available to users with the feature enabled.
55+
56+
:param category: Indicates the type of asset this entity represents on a monitor.
57+
:type category: MonitorAssetCategory
58+
59+
:param name: Name for the monitor asset
60+
:type name: str
61+
62+
: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.
63+
:type resource_key: str, optional
64+
65+
:param resource_type: Type of internal datadog resource associated with a monitor asset.
66+
:type resource_type: MonitorAssetResourceType, optional
67+
68+
:param url: Url link for the asset
69+
:type url: str
70+
"""
71+
if resource_key is not unset:
72+
kwargs["resource_key"] = resource_key
73+
if resource_type is not unset:
74+
kwargs["resource_type"] = resource_type
75+
super().__init__(kwargs)
76+
77+
self_.category = category
78+
self_.name = name
79+
self_.url = url
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: If omitted defaults to "runbook". Must be one of ["runbook"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"runbook",
25+
}
26+
RUNBOOK: ClassVar["MonitorAssetCategory"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
MonitorAssetCategory.RUNBOOK = MonitorAssetCategory("runbook")
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 MonitorAssetResourceType(ModelSimple):
16+
"""
17+
Type of internal datadog resource associated with a monitor asset.
18+
19+
:param value: If omitted defaults to "notebook". Must be one of ["notebook"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"notebook",
25+
}
26+
NOTEBOOK: ClassVar["MonitorAssetResourceType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
MonitorAssetResourceType.NOTEBOOK = MonitorAssetResourceType("notebook")

0 commit comments

Comments
 (0)