Skip to content

Commit b50d648

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add endpoint to get and set on demand concurrency cap for Synthetics (#1341)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent a8245d2 commit b50d648

20 files changed

+475
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2023-02-16 09:01:15.697580",
8-
"spec_repo_commit": "4982e03d"
7+
"regenerated": "2023-02-17 16:19:14.693597",
8+
"spec_repo_commit": "a05a9d36"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-02-16 09:01:15.714720",
13-
"spec_repo_commit": "4982e03d"
12+
"regenerated": "2023-02-17 16:19:14.705186",
13+
"spec_repo_commit": "a05a9d36"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7542,6 +7542,26 @@ components:
75427542
- id
75437543
- type
75447544
type: object
7545+
OnDemandConcurrencyCap:
7546+
description: On-demand concurrency cap.
7547+
properties:
7548+
attributes:
7549+
$ref: '#/components/schemas/OnDemandConcurrencyCapAttributes'
7550+
type: object
7551+
OnDemandConcurrencyCapAttributes:
7552+
description: On-demand concurrency cap attributes.
7553+
properties:
7554+
on_demand_concurrency_cap:
7555+
description: Value of the on-demand concurrency cap.
7556+
format: double
7557+
type: number
7558+
type: object
7559+
OnDemandConcurrencyCapResponse:
7560+
description: On-demand concurrency cap response.
7561+
properties:
7562+
data:
7563+
$ref: '#/components/schemas/OnDemandConcurrencyCap'
7564+
type: object
75457565
OpsgenieServiceCreateAttributes:
75467566
description: The Opsgenie service attributes for a create request.
75477567
properties:
@@ -19685,6 +19705,45 @@ paths:
1968519705
x-unstable: '**Note**: This endpoint is in public beta.
1968619706

1968719707
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
19708+
/api/v2/synthetics/settings/on_demand_concurrency_cap:
19709+
get:
19710+
description: Get the on-demand concurrency cap.
19711+
operationId: GetOnDemandConcurrencyCap
19712+
responses:
19713+
'200':
19714+
content:
19715+
application/json:
19716+
schema:
19717+
$ref: '#/components/schemas/OnDemandConcurrencyCapResponse'
19718+
description: OK
19719+
'429':
19720+
$ref: '#/components/responses/TooManyRequestsResponse'
19721+
summary: Get the on-demand concurrency cap
19722+
tags:
19723+
- Synthetics
19724+
post:
19725+
description: Save new value for on-demand concurrency cap.
19726+
operationId: SetOnDemandConcurrencyCap
19727+
requestBody:
19728+
content:
19729+
application/json:
19730+
schema:
19731+
$ref: '#/components/schemas/OnDemandConcurrencyCapAttributes'
19732+
description: .
19733+
required: true
19734+
responses:
19735+
'200':
19736+
content:
19737+
application/json:
19738+
schema:
19739+
$ref: '#/components/schemas/OnDemandConcurrencyCapResponse'
19740+
description: OK
19741+
'429':
19742+
$ref: '#/components/responses/TooManyRequestsResponse'
19743+
summary: Save new value for on-demand concurrency cap
19744+
tags:
19745+
- Synthetics
19746+
x-codegen-request-body-name: body
1968819747
/api/v2/teams:
1968919748
get:
1969019749
description: Get all incident teams for the requesting user's organization.
@@ -20963,6 +21022,13 @@ tags:
2096321022
externalDocs:
2096421023
url: https://docs.datadoghq.com/tracing/service_catalog/
2096521024
name: Service Definition
21025+
- description: "Datadog Synthetics uses simulated user requests and browser rendering
21026+
to help you ensure uptime,\nidentify regional issues, and track your application
21027+
performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand
21028+
[browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You can
21029+
use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more
21030+
information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)."
21031+
name: Synthetics
2096621032
- description: 'The usage metering API allows you to get hourly, daily, and
2096721033

2096821034
monthly usage across multiple facets of Datadog.

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ service\_definition\_api
204204
:members:
205205
:show-inheritance:
206206

207+
synthetics\_api
208+
---------------
209+
210+
.. automodule:: datadog_api_client.v2.api.synthetics_api
211+
:members:
212+
:show-inheritance:
213+
207214
usage\_metering\_api
208215
--------------------
209216

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3347,6 +3347,27 @@ nullable\_relationship\_to\_user\_data
33473347
:members:
33483348
:show-inheritance:
33493349

3350+
on\_demand\_concurrency\_cap
3351+
----------------------------
3352+
3353+
.. automodule:: datadog_api_client.v2.model.on_demand_concurrency_cap
3354+
:members:
3355+
:show-inheritance:
3356+
3357+
on\_demand\_concurrency\_cap\_attributes
3358+
----------------------------------------
3359+
3360+
.. automodule:: datadog_api_client.v2.model.on_demand_concurrency_cap_attributes
3361+
:members:
3362+
:show-inheritance:
3363+
3364+
on\_demand\_concurrency\_cap\_response
3365+
--------------------------------------
3366+
3367+
.. automodule:: datadog_api_client.v2.model.on_demand_concurrency_cap_response
3368+
:members:
3369+
:show-inheritance:
3370+
33503371
opsgenie\_service\_create\_attributes
33513372
-------------------------------------
33523373

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get the on-demand concurrency cap returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = SyntheticsApi(api_client)
11+
response = api_instance.get_on_demand_concurrency_cap()
12+
13+
print(response)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get on demand concurrency cap
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = SyntheticsApi(api_client)
11+
response = api_instance.get_on_demand_concurrency_cap()
12+
13+
print(response)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Save new value for on-demand concurrency cap returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
7+
from datadog_api_client.v2.model.on_demand_concurrency_cap_attributes import OnDemandConcurrencyCapAttributes
8+
9+
body = OnDemandConcurrencyCapAttributes()
10+
11+
configuration = Configuration()
12+
with ApiClient(configuration) as api_client:
13+
api_instance = SyntheticsApi(api_client)
14+
response = api_instance.set_on_demand_concurrency_cap(body=body)
15+
16+
print(response)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Save on demand concurrency cap
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
7+
from datadog_api_client.v2.model.on_demand_concurrency_cap_attributes import OnDemandConcurrencyCapAttributes
8+
9+
body = OnDemandConcurrencyCapAttributes(
10+
on_demand_concurrency_cap=20.0,
11+
)
12+
13+
configuration = Configuration()
14+
with ApiClient(configuration) as api_client:
15+
api_instance = SyntheticsApi(api_client)
16+
response = api_instance.set_on_demand_concurrency_cap(body=body)
17+
18+
print(response)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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 Any, Dict
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.v2.model.on_demand_concurrency_cap_response import OnDemandConcurrencyCapResponse
11+
from datadog_api_client.v2.model.on_demand_concurrency_cap_attributes import OnDemandConcurrencyCapAttributes
12+
13+
14+
class SyntheticsApi:
15+
"""
16+
Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime,
17+
identify regional issues, and track your application performance. Datadog Synthetics tests come in
18+
two different flavors, `API tests <https://docs.datadoghq.com/synthetics/api_tests/>`_
19+
and `browser tests <https://docs.datadoghq.com/synthetics/browser_tests>`_. You can use Datadog’s API to
20+
manage both test types programmatically.
21+
22+
For more information about Synthetics, see the `Synthetics overview <https://docs.datadoghq.com/synthetics/>`_.
23+
"""
24+
25+
def __init__(self, api_client=None):
26+
if api_client is None:
27+
api_client = ApiClient(Configuration())
28+
self.api_client = api_client
29+
30+
self._get_on_demand_concurrency_cap_endpoint = _Endpoint(
31+
settings={
32+
"response_type": (OnDemandConcurrencyCapResponse,),
33+
"auth": ["apiKeyAuth", "appKeyAuth"],
34+
"endpoint_path": "/api/v2/synthetics/settings/on_demand_concurrency_cap",
35+
"operation_id": "get_on_demand_concurrency_cap",
36+
"http_method": "GET",
37+
"version": "v2",
38+
"servers": None,
39+
},
40+
params_map={},
41+
headers_map={
42+
"accept": ["application/json"],
43+
"content_type": [],
44+
},
45+
api_client=api_client,
46+
)
47+
48+
self._set_on_demand_concurrency_cap_endpoint = _Endpoint(
49+
settings={
50+
"response_type": (OnDemandConcurrencyCapResponse,),
51+
"auth": ["apiKeyAuth", "appKeyAuth"],
52+
"endpoint_path": "/api/v2/synthetics/settings/on_demand_concurrency_cap",
53+
"operation_id": "set_on_demand_concurrency_cap",
54+
"http_method": "POST",
55+
"version": "v2",
56+
"servers": None,
57+
},
58+
params_map={
59+
"body": {
60+
"required": True,
61+
"openapi_types": (OnDemandConcurrencyCapAttributes,),
62+
"location": "body",
63+
},
64+
},
65+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
66+
api_client=api_client,
67+
)
68+
69+
def get_on_demand_concurrency_cap(
70+
self,
71+
) -> OnDemandConcurrencyCapResponse:
72+
"""Get the on-demand concurrency cap.
73+
74+
Get the on-demand concurrency cap.
75+
76+
:rtype: OnDemandConcurrencyCapResponse
77+
"""
78+
kwargs: Dict[str, Any] = {}
79+
return self._get_on_demand_concurrency_cap_endpoint.call_with_http_info(**kwargs)
80+
81+
def set_on_demand_concurrency_cap(
82+
self,
83+
body: OnDemandConcurrencyCapAttributes,
84+
) -> OnDemandConcurrencyCapResponse:
85+
"""Save new value for on-demand concurrency cap.
86+
87+
Save new value for on-demand concurrency cap.
88+
89+
:param body: .
90+
:type body: OnDemandConcurrencyCapAttributes
91+
:rtype: OnDemandConcurrencyCapResponse
92+
"""
93+
kwargs: Dict[str, Any] = {}
94+
kwargs["body"] = body
95+
96+
return self._set_on_demand_concurrency_cap_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
from datadog_api_client.v2.api.sensitive_data_scanner_api import SensitiveDataScannerApi
2828
from datadog_api_client.v2.api.service_accounts_api import ServiceAccountsApi
2929
from datadog_api_client.v2.api.service_definition_api import ServiceDefinitionApi
30+
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
3031
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi
3132
from datadog_api_client.v2.api.users_api import UsersApi

0 commit comments

Comments
 (0)