thousandeyes-sdk-instant-tests 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- thousandeyes_sdk/instant_tests/__init__.py +117 -0
- thousandeyes_sdk/instant_tests/api/__init__.py +17 -0
- thousandeyes_sdk/instant_tests/api/agent_to_agent_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/agent_to_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/api_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_security_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_trace_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/ftp_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/http_page_load_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/http_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/run_api.py +338 -0
- thousandeyes_sdk/instant_tests/api/sip_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/voice_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/web_transaction_api.py +376 -0
- thousandeyes_sdk/instant_tests/models/__init__.py +100 -0
- thousandeyes_sdk/instant_tests/models/agent.py +125 -0
- thousandeyes_sdk/instant_tests/models/agent_base.py +98 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py +198 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_request.py +176 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_properties.py +123 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_test_protocol.py +37 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py +203 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_request.py +181 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_properties.py +128 -0
- thousandeyes_sdk/instant_tests/models/api_instant_test.py +214 -0
- thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +192 -0
- thousandeyes_sdk/instant_tests/models/api_predefined_variable.py +90 -0
- thousandeyes_sdk/instant_tests/models/api_properties.py +137 -0
- thousandeyes_sdk/instant_tests/models/api_request.py +138 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion.py +94 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion_name.py +37 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion_operator.py +39 -0
- thousandeyes_sdk/instant_tests/models/api_request_auth_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/api_request_header.py +90 -0
- thousandeyes_sdk/instant_tests/models/api_request_method.py +40 -0
- thousandeyes_sdk/instant_tests/models/api_request_variable.py +90 -0
- thousandeyes_sdk/instant_tests/models/cloud_enterprise_agent_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/dns_query_class.py +37 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py +170 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_request.py +148 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_properties.py +95 -0
- thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py +208 -0
- thousandeyes_sdk/instant_tests/models/dns_server_instant_test_request.py +178 -0
- thousandeyes_sdk/instant_tests/models/dns_server_properties.py +133 -0
- thousandeyes_sdk/instant_tests/models/dns_servers_request.py +88 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py +173 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_request.py +151 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_properties.py +98 -0
- thousandeyes_sdk/instant_tests/models/error.py +96 -0
- thousandeyes_sdk/instant_tests/models/expand.py +38 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +207 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_properties.py +132 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_request_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/http_server_instant_test.py +246 -0
- thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +224 -0
- thousandeyes_sdk/instant_tests/models/http_server_properties.py +171 -0
- thousandeyes_sdk/instant_tests/models/instant_test.py +152 -0
- thousandeyes_sdk/instant_tests/models/instant_test_request.py +100 -0
- thousandeyes_sdk/instant_tests/models/link.py +102 -0
- thousandeyes_sdk/instant_tests/models/page_load_instant_test.py +254 -0
- thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +232 -0
- thousandeyes_sdk/instant_tests/models/page_load_properties.py +179 -0
- thousandeyes_sdk/instant_tests/models/server_instant_test_request.py +185 -0
- thousandeyes_sdk/instant_tests/models/shared_with_account.py +90 -0
- thousandeyes_sdk/instant_tests/models/simple_agent.py +122 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py +191 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request.py +175 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request1.py +197 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py +204 -0
- thousandeyes_sdk/instant_tests/models/sip_server_properties.py +116 -0
- thousandeyes_sdk/instant_tests/models/sip_test_protocol.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_agent.py +90 -0
- thousandeyes_sdk/instant_tests/models/test_auth_type.py +40 -0
- thousandeyes_sdk/instant_tests/models/test_custom_headers.py +92 -0
- thousandeyes_sdk/instant_tests/models/test_direction.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_dns_server.py +90 -0
- thousandeyes_sdk/instant_tests/models/test_dns_transport_protocol.py +37 -0
- thousandeyes_sdk/instant_tests/models/test_dscp_id.py +57 -0
- thousandeyes_sdk/instant_tests/models/test_ipv6_policy.py +39 -0
- thousandeyes_sdk/instant_tests/models/test_label.py +92 -0
- thousandeyes_sdk/instant_tests/models/test_links.py +102 -0
- thousandeyes_sdk/instant_tests/models/test_page_loading_strategy.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_path_trace_mode.py +37 -0
- thousandeyes_sdk/instant_tests/models/test_probe_mode.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_protocol.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_self_link.py +102 -0
- thousandeyes_sdk/instant_tests/models/test_sip_credentials.py +100 -0
- thousandeyes_sdk/instant_tests/models/test_ssl_version_id.py +40 -0
- thousandeyes_sdk/instant_tests/models/test_type.py +48 -0
- thousandeyes_sdk/instant_tests/models/unauthorized_error.py +90 -0
- thousandeyes_sdk/instant_tests/models/unexpanded_instant_test.py +128 -0
- thousandeyes_sdk/instant_tests/models/validation_error.py +111 -0
- thousandeyes_sdk/instant_tests/models/validation_error_item.py +92 -0
- thousandeyes_sdk/instant_tests/models/voice_instant_test.py +189 -0
- thousandeyes_sdk/instant_tests/models/voice_instant_test_request.py +167 -0
- thousandeyes_sdk/instant_tests/models/voice_properties.py +114 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py +258 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +236 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_properties.py +181 -0
- thousandeyes_sdk/instant_tests/py.typed +0 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/LICENSE +176 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/METADATA +423 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/NOTICE +7 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/RECORD +107 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/WHEEL +5 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,203 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from thousandeyes_sdk.instant_tests.models.agent import Agent
|
25
|
+
from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
|
29
|
+
from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
|
30
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
31
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
32
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
33
|
+
from typing import Optional, Set
|
34
|
+
from typing_extensions import Self
|
35
|
+
|
36
|
+
class AgentToServerInstantTest(BaseModel):
|
37
|
+
"""
|
38
|
+
AgentToServerInstantTest
|
39
|
+
""" # noqa: E501
|
40
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
41
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
42
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
43
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
44
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
45
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
46
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
47
|
+
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
|
48
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
49
|
+
type: Optional[StrictStr] = None
|
50
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
51
|
+
labels: Optional[List[TestLabel]] = None
|
52
|
+
shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
|
53
|
+
bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements")
|
54
|
+
continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode")
|
55
|
+
fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate")
|
56
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
57
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
58
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
59
|
+
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
|
60
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
61
|
+
protocol: Optional[TestProtocol] = None
|
62
|
+
server: StrictStr = Field(description="Target name or IP address.")
|
63
|
+
dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
|
64
|
+
dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
|
65
|
+
ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
|
66
|
+
ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize")
|
67
|
+
network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements")
|
68
|
+
agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
|
69
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents"]
|
70
|
+
|
71
|
+
model_config = ConfigDict(
|
72
|
+
populate_by_name=True,
|
73
|
+
validate_assignment=True,
|
74
|
+
protected_namespaces=(),
|
75
|
+
extra="allow",
|
76
|
+
)
|
77
|
+
|
78
|
+
|
79
|
+
def to_str(self) -> str:
|
80
|
+
"""Returns the string representation of the model using alias"""
|
81
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
82
|
+
|
83
|
+
def to_json(self) -> str:
|
84
|
+
"""Returns the JSON representation of the model using alias"""
|
85
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
86
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
90
|
+
"""Create an instance of AgentToServerInstantTest from a JSON string"""
|
91
|
+
return cls.from_dict(json.loads(json_str))
|
92
|
+
|
93
|
+
def to_dict(self) -> Dict[str, Any]:
|
94
|
+
"""Return the dictionary representation of the model using alias.
|
95
|
+
|
96
|
+
This has the following differences from calling pydantic's
|
97
|
+
`self.model_dump(by_alias=True)`:
|
98
|
+
|
99
|
+
* `None` is only added to the output dict for nullable fields that
|
100
|
+
were set at model initialization. Other fields with value `None`
|
101
|
+
are ignored.
|
102
|
+
* OpenAPI `readOnly` fields are excluded.
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
105
|
+
* OpenAPI `readOnly` fields are excluded.
|
106
|
+
* OpenAPI `readOnly` fields are excluded.
|
107
|
+
* OpenAPI `readOnly` fields are excluded.
|
108
|
+
* OpenAPI `readOnly` fields are excluded.
|
109
|
+
* OpenAPI `readOnly` fields are excluded.
|
110
|
+
* OpenAPI `readOnly` fields are excluded.
|
111
|
+
* OpenAPI `readOnly` fields are excluded.
|
112
|
+
* OpenAPI `readOnly` fields are excluded.
|
113
|
+
* OpenAPI `readOnly` fields are excluded.
|
114
|
+
"""
|
115
|
+
excluded_fields: Set[str] = set([
|
116
|
+
"created_by",
|
117
|
+
"created_date",
|
118
|
+
"live_share",
|
119
|
+
"modified_by",
|
120
|
+
"modified_date",
|
121
|
+
"saved_event",
|
122
|
+
"test_id",
|
123
|
+
"type",
|
124
|
+
"labels",
|
125
|
+
"shared_with_accounts",
|
126
|
+
"dscp",
|
127
|
+
"agents",
|
128
|
+
])
|
129
|
+
|
130
|
+
_dict = self.model_dump(
|
131
|
+
by_alias=True,
|
132
|
+
exclude=excluded_fields,
|
133
|
+
exclude_none=True,
|
134
|
+
)
|
135
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
136
|
+
if self.links:
|
137
|
+
_dict['_links'] = self.links.to_dict()
|
138
|
+
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
|
139
|
+
_items = []
|
140
|
+
if self.labels:
|
141
|
+
for _item in self.labels:
|
142
|
+
if _item:
|
143
|
+
_items.append(_item.to_dict())
|
144
|
+
_dict['labels'] = _items
|
145
|
+
# override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
|
146
|
+
_items = []
|
147
|
+
if self.shared_with_accounts:
|
148
|
+
for _item in self.shared_with_accounts:
|
149
|
+
if _item:
|
150
|
+
_items.append(_item.to_dict())
|
151
|
+
_dict['sharedWithAccounts'] = _items
|
152
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
153
|
+
_items = []
|
154
|
+
if self.agents:
|
155
|
+
for _item in self.agents:
|
156
|
+
if _item:
|
157
|
+
_items.append(_item.to_dict())
|
158
|
+
_dict['agents'] = _items
|
159
|
+
return _dict
|
160
|
+
|
161
|
+
@classmethod
|
162
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
163
|
+
"""Create an instance of AgentToServerInstantTest from a dict"""
|
164
|
+
if obj is None:
|
165
|
+
return None
|
166
|
+
|
167
|
+
if not isinstance(obj, dict):
|
168
|
+
return cls.model_validate(obj)
|
169
|
+
|
170
|
+
_obj = cls.model_validate({
|
171
|
+
"createdBy": obj.get("createdBy"),
|
172
|
+
"createdDate": obj.get("createdDate"),
|
173
|
+
"description": obj.get("description"),
|
174
|
+
"liveShare": obj.get("liveShare"),
|
175
|
+
"modifiedBy": obj.get("modifiedBy"),
|
176
|
+
"modifiedDate": obj.get("modifiedDate"),
|
177
|
+
"savedEvent": obj.get("savedEvent"),
|
178
|
+
"testId": obj.get("testId"),
|
179
|
+
"testName": obj.get("testName"),
|
180
|
+
"type": obj.get("type"),
|
181
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
182
|
+
"labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
|
183
|
+
"sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None,
|
184
|
+
"bandwidthMeasurements": obj.get("bandwidthMeasurements"),
|
185
|
+
"continuousMode": obj.get("continuousMode"),
|
186
|
+
"fixedPacketRate": obj.get("fixedPacketRate"),
|
187
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
188
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
189
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
190
|
+
"port": obj.get("port") if obj.get("port") is not None else 49153,
|
191
|
+
"probeMode": obj.get("probeMode"),
|
192
|
+
"protocol": obj.get("protocol"),
|
193
|
+
"server": obj.get("server"),
|
194
|
+
"dscp": obj.get("dscp"),
|
195
|
+
"dscpId": obj.get("dscpId"),
|
196
|
+
"ipv6Policy": obj.get("ipv6Policy"),
|
197
|
+
"pingPayloadSize": obj.get("pingPayloadSize"),
|
198
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False,
|
199
|
+
"agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
|
200
|
+
})
|
201
|
+
return _obj
|
202
|
+
|
203
|
+
|
@@ -0,0 +1,181 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from thousandeyes_sdk.instant_tests.models.test_agent import TestAgent
|
25
|
+
from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
29
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
30
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
31
|
+
from typing import Optional, Set
|
32
|
+
from typing_extensions import Self
|
33
|
+
|
34
|
+
class AgentToServerInstantTestRequest(BaseModel):
|
35
|
+
"""
|
36
|
+
AgentToServerInstantTestRequest
|
37
|
+
""" # noqa: E501
|
38
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
39
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
40
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
41
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
42
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
43
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
44
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
45
|
+
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
|
46
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
47
|
+
type: Optional[StrictStr] = None
|
48
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
49
|
+
labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
|
50
|
+
shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts")
|
51
|
+
bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements")
|
52
|
+
continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode")
|
53
|
+
fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate")
|
54
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
55
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
56
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
57
|
+
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
|
58
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
59
|
+
protocol: Optional[TestProtocol] = None
|
60
|
+
server: StrictStr = Field(description="Target name or IP address.")
|
61
|
+
dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
|
62
|
+
dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
|
63
|
+
ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
|
64
|
+
ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize")
|
65
|
+
network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements")
|
66
|
+
agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
|
67
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents"]
|
68
|
+
|
69
|
+
model_config = ConfigDict(
|
70
|
+
populate_by_name=True,
|
71
|
+
validate_assignment=True,
|
72
|
+
protected_namespaces=(),
|
73
|
+
extra="allow",
|
74
|
+
)
|
75
|
+
|
76
|
+
|
77
|
+
def to_str(self) -> str:
|
78
|
+
"""Returns the string representation of the model using alias"""
|
79
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
80
|
+
|
81
|
+
def to_json(self) -> str:
|
82
|
+
"""Returns the JSON representation of the model using alias"""
|
83
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
84
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
85
|
+
|
86
|
+
@classmethod
|
87
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
88
|
+
"""Create an instance of AgentToServerInstantTestRequest from a JSON string"""
|
89
|
+
return cls.from_dict(json.loads(json_str))
|
90
|
+
|
91
|
+
def to_dict(self) -> Dict[str, Any]:
|
92
|
+
"""Return the dictionary representation of the model using alias.
|
93
|
+
|
94
|
+
This has the following differences from calling pydantic's
|
95
|
+
`self.model_dump(by_alias=True)`:
|
96
|
+
|
97
|
+
* `None` is only added to the output dict for nullable fields that
|
98
|
+
were set at model initialization. Other fields with value `None`
|
99
|
+
are ignored.
|
100
|
+
* OpenAPI `readOnly` fields are excluded.
|
101
|
+
* OpenAPI `readOnly` fields are excluded.
|
102
|
+
* OpenAPI `readOnly` fields are excluded.
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
105
|
+
* OpenAPI `readOnly` fields are excluded.
|
106
|
+
* OpenAPI `readOnly` fields are excluded.
|
107
|
+
* OpenAPI `readOnly` fields are excluded.
|
108
|
+
* OpenAPI `readOnly` fields are excluded.
|
109
|
+
"""
|
110
|
+
excluded_fields: Set[str] = set([
|
111
|
+
"created_by",
|
112
|
+
"created_date",
|
113
|
+
"live_share",
|
114
|
+
"modified_by",
|
115
|
+
"modified_date",
|
116
|
+
"saved_event",
|
117
|
+
"test_id",
|
118
|
+
"type",
|
119
|
+
"dscp",
|
120
|
+
])
|
121
|
+
|
122
|
+
_dict = self.model_dump(
|
123
|
+
by_alias=True,
|
124
|
+
exclude=excluded_fields,
|
125
|
+
exclude_none=True,
|
126
|
+
)
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
128
|
+
if self.links:
|
129
|
+
_dict['_links'] = self.links.to_dict()
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
131
|
+
_items = []
|
132
|
+
if self.agents:
|
133
|
+
for _item in self.agents:
|
134
|
+
if _item:
|
135
|
+
_items.append(_item.to_dict())
|
136
|
+
_dict['agents'] = _items
|
137
|
+
return _dict
|
138
|
+
|
139
|
+
@classmethod
|
140
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
141
|
+
"""Create an instance of AgentToServerInstantTestRequest from a dict"""
|
142
|
+
if obj is None:
|
143
|
+
return None
|
144
|
+
|
145
|
+
if not isinstance(obj, dict):
|
146
|
+
return cls.model_validate(obj)
|
147
|
+
|
148
|
+
_obj = cls.model_validate({
|
149
|
+
"createdBy": obj.get("createdBy"),
|
150
|
+
"createdDate": obj.get("createdDate"),
|
151
|
+
"description": obj.get("description"),
|
152
|
+
"liveShare": obj.get("liveShare"),
|
153
|
+
"modifiedBy": obj.get("modifiedBy"),
|
154
|
+
"modifiedDate": obj.get("modifiedDate"),
|
155
|
+
"savedEvent": obj.get("savedEvent"),
|
156
|
+
"testId": obj.get("testId"),
|
157
|
+
"testName": obj.get("testName"),
|
158
|
+
"type": obj.get("type"),
|
159
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
160
|
+
"labels": obj.get("labels"),
|
161
|
+
"sharedWithAccounts": obj.get("sharedWithAccounts"),
|
162
|
+
"bandwidthMeasurements": obj.get("bandwidthMeasurements"),
|
163
|
+
"continuousMode": obj.get("continuousMode"),
|
164
|
+
"fixedPacketRate": obj.get("fixedPacketRate"),
|
165
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
166
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
167
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
168
|
+
"port": obj.get("port") if obj.get("port") is not None else 49153,
|
169
|
+
"probeMode": obj.get("probeMode"),
|
170
|
+
"protocol": obj.get("protocol"),
|
171
|
+
"server": obj.get("server"),
|
172
|
+
"dscp": obj.get("dscp"),
|
173
|
+
"dscpId": obj.get("dscpId"),
|
174
|
+
"ipv6Policy": obj.get("ipv6Policy"),
|
175
|
+
"pingPayloadSize": obj.get("pingPayloadSize"),
|
176
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False,
|
177
|
+
"agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
|
178
|
+
})
|
179
|
+
return _obj
|
180
|
+
|
181
|
+
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing_extensions import Annotated
|
23
|
+
from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
|
24
|
+
from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy
|
25
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
28
|
+
from typing import Optional, Set
|
29
|
+
from typing_extensions import Self
|
30
|
+
|
31
|
+
class AgentToServerProperties(BaseModel):
|
32
|
+
"""
|
33
|
+
AgentToServerProperties
|
34
|
+
""" # noqa: E501
|
35
|
+
bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements")
|
36
|
+
continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode")
|
37
|
+
fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate")
|
38
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
39
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
40
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
41
|
+
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
|
42
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
43
|
+
protocol: Optional[TestProtocol] = None
|
44
|
+
server: StrictStr = Field(description="Target name or IP address.")
|
45
|
+
dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
|
46
|
+
dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
|
47
|
+
ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
|
48
|
+
ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize")
|
49
|
+
network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements")
|
50
|
+
type: Optional[StrictStr] = None
|
51
|
+
__properties: ClassVar[List[str]] = ["bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "type"]
|
52
|
+
|
53
|
+
model_config = ConfigDict(
|
54
|
+
populate_by_name=True,
|
55
|
+
validate_assignment=True,
|
56
|
+
protected_namespaces=(),
|
57
|
+
extra="allow",
|
58
|
+
)
|
59
|
+
|
60
|
+
|
61
|
+
def to_str(self) -> str:
|
62
|
+
"""Returns the string representation of the model using alias"""
|
63
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
64
|
+
|
65
|
+
def to_json(self) -> str:
|
66
|
+
"""Returns the JSON representation of the model using alias"""
|
67
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
68
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
69
|
+
|
70
|
+
@classmethod
|
71
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
72
|
+
"""Create an instance of AgentToServerProperties from a JSON string"""
|
73
|
+
return cls.from_dict(json.loads(json_str))
|
74
|
+
|
75
|
+
def to_dict(self) -> Dict[str, Any]:
|
76
|
+
"""Return the dictionary representation of the model using alias.
|
77
|
+
|
78
|
+
This has the following differences from calling pydantic's
|
79
|
+
`self.model_dump(by_alias=True)`:
|
80
|
+
|
81
|
+
* `None` is only added to the output dict for nullable fields that
|
82
|
+
were set at model initialization. Other fields with value `None`
|
83
|
+
are ignored.
|
84
|
+
* OpenAPI `readOnly` fields are excluded.
|
85
|
+
* OpenAPI `readOnly` fields are excluded.
|
86
|
+
"""
|
87
|
+
excluded_fields: Set[str] = set([
|
88
|
+
"dscp",
|
89
|
+
"type",
|
90
|
+
])
|
91
|
+
|
92
|
+
_dict = self.model_dump(
|
93
|
+
by_alias=True,
|
94
|
+
exclude=excluded_fields,
|
95
|
+
exclude_none=True,
|
96
|
+
)
|
97
|
+
return _dict
|
98
|
+
|
99
|
+
@classmethod
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
101
|
+
"""Create an instance of AgentToServerProperties from a dict"""
|
102
|
+
if obj is None:
|
103
|
+
return None
|
104
|
+
|
105
|
+
if not isinstance(obj, dict):
|
106
|
+
return cls.model_validate(obj)
|
107
|
+
|
108
|
+
_obj = cls.model_validate({
|
109
|
+
"bandwidthMeasurements": obj.get("bandwidthMeasurements"),
|
110
|
+
"continuousMode": obj.get("continuousMode"),
|
111
|
+
"fixedPacketRate": obj.get("fixedPacketRate"),
|
112
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
113
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
114
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
115
|
+
"port": obj.get("port") if obj.get("port") is not None else 49153,
|
116
|
+
"probeMode": obj.get("probeMode"),
|
117
|
+
"protocol": obj.get("protocol"),
|
118
|
+
"server": obj.get("server"),
|
119
|
+
"dscp": obj.get("dscp"),
|
120
|
+
"dscpId": obj.get("dscpId"),
|
121
|
+
"ipv6Policy": obj.get("ipv6Policy"),
|
122
|
+
"pingPayloadSize": obj.get("pingPayloadSize"),
|
123
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False,
|
124
|
+
"type": obj.get("type")
|
125
|
+
})
|
126
|
+
return _obj
|
127
|
+
|
128
|
+
|