-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathsynthetics_test_request.py
More file actions
336 lines (294 loc) · 15.4 KB
/
synthetics_test_request.py
File metadata and controls
336 lines (294 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# 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.v1.model.synthetics_basic_auth import SyntheticsBasicAuth
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
from datadog_api_client.v1.model.synthetics_test_request_port import SyntheticsTestRequestPort
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
from datadog_api_client.v1.model.synthetics_basic_auth_web import SyntheticsBasicAuthWeb
from datadog_api_client.v1.model.synthetics_basic_auth_sigv4 import SyntheticsBasicAuthSigv4
from datadog_api_client.v1.model.synthetics_basic_auth_ntlm import SyntheticsBasicAuthNTLM
from datadog_api_client.v1.model.synthetics_basic_auth_digest import SyntheticsBasicAuthDigest
from datadog_api_client.v1.model.synthetics_basic_auth_oauth_client import SyntheticsBasicAuthOauthClient
from datadog_api_client.v1.model.synthetics_basic_auth_oauth_rop import SyntheticsBasicAuthOauthROP
class SyntheticsTestRequest(ModelNormal):
validations = {
"number_of_packets": {
"inclusive_maximum": 10,
"inclusive_minimum": 0,
},
}
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.synthetics_basic_auth import SyntheticsBasicAuth
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
from datadog_api_client.v1.model.synthetics_test_request_port import SyntheticsTestRequestPort
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
return {
"allow_insecure": (bool,),
"basic_auth": (SyntheticsBasicAuth,),
"body": (str,),
"body_type": (SyntheticsTestRequestBodyType,),
"call_type": (SyntheticsTestCallType,),
"certificate": (SyntheticsTestRequestCertificate,),
"certificate_domains": ([str],),
"check_certificate_revocation": (bool,),
"compressed_json_descriptor": (str,),
"compressed_proto_file": (str,),
"dns_server": (str,),
"dns_server_port": (str,),
"files": ([SyntheticsTestRequestBodyFile],),
"follow_redirects": (bool,),
"headers": (SyntheticsTestHeaders,),
"host": (str,),
"http_version": (SyntheticsTestOptionsHTTPVersion,),
"is_message_base64_encoded": (bool,),
"message": (str,),
"metadata": (SyntheticsTestMetadata,),
"method": (str,),
"no_saving_response_body": (bool,),
"number_of_packets": (int,),
"persist_cookies": (bool,),
"port": (SyntheticsTestRequestPort,),
"proxy": (SyntheticsTestRequestProxy,),
"query": (dict,),
"servername": (str,),
"service": (str,),
"should_track_hops": (bool,),
"timeout": (float,),
"url": (str,),
}
attribute_map = {
"allow_insecure": "allow_insecure",
"basic_auth": "basicAuth",
"body": "body",
"body_type": "bodyType",
"call_type": "callType",
"certificate": "certificate",
"certificate_domains": "certificateDomains",
"check_certificate_revocation": "checkCertificateRevocation",
"compressed_json_descriptor": "compressedJsonDescriptor",
"compressed_proto_file": "compressedProtoFile",
"dns_server": "dnsServer",
"dns_server_port": "dnsServerPort",
"files": "files",
"follow_redirects": "follow_redirects",
"headers": "headers",
"host": "host",
"http_version": "httpVersion",
"is_message_base64_encoded": "isMessageBase64Encoded",
"message": "message",
"metadata": "metadata",
"method": "method",
"no_saving_response_body": "noSavingResponseBody",
"number_of_packets": "numberOfPackets",
"persist_cookies": "persistCookies",
"port": "port",
"proxy": "proxy",
"query": "query",
"servername": "servername",
"service": "service",
"should_track_hops": "shouldTrackHops",
"timeout": "timeout",
"url": "url",
}
def __init__(
self_,
allow_insecure: Union[bool, UnsetType] = unset,
basic_auth: Union[
SyntheticsBasicAuth,
SyntheticsBasicAuthWeb,
SyntheticsBasicAuthSigv4,
SyntheticsBasicAuthNTLM,
SyntheticsBasicAuthDigest,
SyntheticsBasicAuthOauthClient,
SyntheticsBasicAuthOauthROP,
UnsetType,
] = unset,
body: Union[str, UnsetType] = unset,
body_type: Union[SyntheticsTestRequestBodyType, UnsetType] = unset,
call_type: Union[SyntheticsTestCallType, UnsetType] = unset,
certificate: Union[SyntheticsTestRequestCertificate, UnsetType] = unset,
certificate_domains: Union[List[str], UnsetType] = unset,
check_certificate_revocation: Union[bool, UnsetType] = unset,
compressed_json_descriptor: Union[str, UnsetType] = unset,
compressed_proto_file: Union[str, UnsetType] = unset,
dns_server: Union[str, UnsetType] = unset,
dns_server_port: Union[str, UnsetType] = unset,
files: Union[List[SyntheticsTestRequestBodyFile], UnsetType] = unset,
follow_redirects: Union[bool, UnsetType] = unset,
headers: Union[SyntheticsTestHeaders, UnsetType] = unset,
host: Union[str, UnsetType] = unset,
http_version: Union[SyntheticsTestOptionsHTTPVersion, UnsetType] = unset,
is_message_base64_encoded: Union[bool, UnsetType] = unset,
message: Union[str, UnsetType] = unset,
metadata: Union[SyntheticsTestMetadata, UnsetType] = unset,
method: Union[str, UnsetType] = unset,
no_saving_response_body: Union[bool, UnsetType] = unset,
number_of_packets: Union[int, UnsetType] = unset,
persist_cookies: Union[bool, UnsetType] = unset,
port: Union[SyntheticsTestRequestPort, int, str, UnsetType] = unset,
proxy: Union[SyntheticsTestRequestProxy, UnsetType] = unset,
query: Union[dict, UnsetType] = unset,
servername: Union[str, UnsetType] = unset,
service: Union[str, UnsetType] = unset,
should_track_hops: Union[bool, UnsetType] = unset,
timeout: Union[float, UnsetType] = unset,
url: Union[str, UnsetType] = unset,
**kwargs,
):
"""
Object describing the Synthetic test request.
:param allow_insecure: Allows loading insecure content for an HTTP request in a multistep test step.
:type allow_insecure: bool, optional
:param basic_auth: Object to handle basic authentication when performing the test.
:type basic_auth: SyntheticsBasicAuth, optional
:param body: Body to include in the test.
:type body: str, optional
:param body_type: Type of the request body.
:type body_type: SyntheticsTestRequestBodyType, optional
:param call_type: The type of gRPC call to perform.
:type call_type: SyntheticsTestCallType, optional
:param certificate: Client certificate to use when performing the test request.
:type certificate: SyntheticsTestRequestCertificate, optional
:param certificate_domains: By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in ``certificateDomains``.
:type certificate_domains: [str], optional
:param check_certificate_revocation: Check for certificate revocation.
:type check_certificate_revocation: bool, optional
:param compressed_json_descriptor: A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
:type compressed_json_descriptor: str, optional
:param compressed_proto_file: A protobuf file that needs to be gzipped first then base64 encoded.
:type compressed_proto_file: str, optional
:param dns_server: DNS server to use for DNS tests.
:type dns_server: str, optional
:param dns_server_port: DNS server port to use for DNS tests.
:type dns_server_port: str, optional
:param files: Files to be used as part of the request in the test.
:type files: [SyntheticsTestRequestBodyFile], optional
:param follow_redirects: Specifies whether or not the request follows redirects.
:type follow_redirects: bool, optional
:param headers: Headers to include when performing the test.
:type headers: SyntheticsTestHeaders, optional
:param host: Host name to perform the test with.
:type host: str, optional
:param http_version: HTTP version to use for a Synthetic test.
:type http_version: SyntheticsTestOptionsHTTPVersion, optional
:param is_message_base64_encoded: Whether the message is base64 encoded.
:type is_message_base64_encoded: bool, optional
:param message: Message to send for UDP or WebSocket tests.
:type message: str, optional
:param metadata: Metadata to include when performing the gRPC test.
:type metadata: SyntheticsTestMetadata, optional
:param method: Either the HTTP method/verb to use or a gRPC method available on the service set in the ``service`` field. Required if ``subtype`` is ``HTTP`` or if ``subtype`` is ``grpc`` and ``callType`` is ``unary``.
:type method: str, optional
:param no_saving_response_body: Determines whether or not to save the response body.
:type no_saving_response_body: bool, optional
:param number_of_packets: Number of pings to use per test.
:type number_of_packets: int, optional
:param persist_cookies: Persist cookies across redirects.
:type persist_cookies: bool, optional
:param port: Port to use when performing the test.
:type port: SyntheticsTestRequestPort, optional
:param proxy: The proxy to perform the test.
:type proxy: SyntheticsTestRequestProxy, optional
:param query: Query to use for the test.
:type query: dict, optional
:param servername: For SSL tests, it specifies on which server you want to initiate the TLS handshake,
allowing the server to present one of multiple possible certificates on
the same IP address and TCP port number.
:type servername: str, optional
:param service: The gRPC service on which you want to perform the gRPC call.
:type service: str, optional
:param should_track_hops: Turns on a traceroute probe to discover all gateways along the path to the host destination.
:type should_track_hops: bool, optional
:param timeout: Timeout in seconds for the test.
:type timeout: float, optional
:param url: URL to perform the test with.
:type url: str, optional
"""
if allow_insecure is not unset:
kwargs["allow_insecure"] = allow_insecure
if basic_auth is not unset:
kwargs["basic_auth"] = basic_auth
if body is not unset:
kwargs["body"] = body
if body_type is not unset:
kwargs["body_type"] = body_type
if call_type is not unset:
kwargs["call_type"] = call_type
if certificate is not unset:
kwargs["certificate"] = certificate
if certificate_domains is not unset:
kwargs["certificate_domains"] = certificate_domains
if check_certificate_revocation is not unset:
kwargs["check_certificate_revocation"] = check_certificate_revocation
if compressed_json_descriptor is not unset:
kwargs["compressed_json_descriptor"] = compressed_json_descriptor
if compressed_proto_file is not unset:
kwargs["compressed_proto_file"] = compressed_proto_file
if dns_server is not unset:
kwargs["dns_server"] = dns_server
if dns_server_port is not unset:
kwargs["dns_server_port"] = dns_server_port
if files is not unset:
kwargs["files"] = files
if follow_redirects is not unset:
kwargs["follow_redirects"] = follow_redirects
if headers is not unset:
kwargs["headers"] = headers
if host is not unset:
kwargs["host"] = host
if http_version is not unset:
kwargs["http_version"] = http_version
if is_message_base64_encoded is not unset:
kwargs["is_message_base64_encoded"] = is_message_base64_encoded
if message is not unset:
kwargs["message"] = message
if metadata is not unset:
kwargs["metadata"] = metadata
if method is not unset:
kwargs["method"] = method
if no_saving_response_body is not unset:
kwargs["no_saving_response_body"] = no_saving_response_body
if number_of_packets is not unset:
kwargs["number_of_packets"] = number_of_packets
if persist_cookies is not unset:
kwargs["persist_cookies"] = persist_cookies
if port is not unset:
kwargs["port"] = port
if proxy is not unset:
kwargs["proxy"] = proxy
if query is not unset:
kwargs["query"] = query
if servername is not unset:
kwargs["servername"] = servername
if service is not unset:
kwargs["service"] = service
if should_track_hops is not unset:
kwargs["should_track_hops"] = should_track_hops
if timeout is not unset:
kwargs["timeout"] = timeout
if url is not unset:
kwargs["url"] = url
super().__init__(kwargs)