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.
Files changed (107) hide show
  1. thousandeyes_sdk/instant_tests/__init__.py +117 -0
  2. thousandeyes_sdk/instant_tests/api/__init__.py +17 -0
  3. thousandeyes_sdk/instant_tests/api/agent_to_agent_api.py +376 -0
  4. thousandeyes_sdk/instant_tests/api/agent_to_server_api.py +376 -0
  5. thousandeyes_sdk/instant_tests/api/api_api.py +376 -0
  6. thousandeyes_sdk/instant_tests/api/dns_security_api.py +376 -0
  7. thousandeyes_sdk/instant_tests/api/dns_server_api.py +376 -0
  8. thousandeyes_sdk/instant_tests/api/dns_trace_api.py +376 -0
  9. thousandeyes_sdk/instant_tests/api/ftp_server_api.py +376 -0
  10. thousandeyes_sdk/instant_tests/api/http_page_load_api.py +376 -0
  11. thousandeyes_sdk/instant_tests/api/http_server_api.py +376 -0
  12. thousandeyes_sdk/instant_tests/api/run_api.py +338 -0
  13. thousandeyes_sdk/instant_tests/api/sip_server_api.py +376 -0
  14. thousandeyes_sdk/instant_tests/api/voice_api.py +376 -0
  15. thousandeyes_sdk/instant_tests/api/web_transaction_api.py +376 -0
  16. thousandeyes_sdk/instant_tests/models/__init__.py +100 -0
  17. thousandeyes_sdk/instant_tests/models/agent.py +125 -0
  18. thousandeyes_sdk/instant_tests/models/agent_base.py +98 -0
  19. thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py +198 -0
  20. thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_request.py +176 -0
  21. thousandeyes_sdk/instant_tests/models/agent_to_agent_properties.py +123 -0
  22. thousandeyes_sdk/instant_tests/models/agent_to_agent_test_protocol.py +37 -0
  23. thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py +203 -0
  24. thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_request.py +181 -0
  25. thousandeyes_sdk/instant_tests/models/agent_to_server_properties.py +128 -0
  26. thousandeyes_sdk/instant_tests/models/api_instant_test.py +214 -0
  27. thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +192 -0
  28. thousandeyes_sdk/instant_tests/models/api_predefined_variable.py +90 -0
  29. thousandeyes_sdk/instant_tests/models/api_properties.py +137 -0
  30. thousandeyes_sdk/instant_tests/models/api_request.py +138 -0
  31. thousandeyes_sdk/instant_tests/models/api_request_assertion.py +94 -0
  32. thousandeyes_sdk/instant_tests/models/api_request_assertion_name.py +37 -0
  33. thousandeyes_sdk/instant_tests/models/api_request_assertion_operator.py +39 -0
  34. thousandeyes_sdk/instant_tests/models/api_request_auth_type.py +38 -0
  35. thousandeyes_sdk/instant_tests/models/api_request_header.py +90 -0
  36. thousandeyes_sdk/instant_tests/models/api_request_method.py +40 -0
  37. thousandeyes_sdk/instant_tests/models/api_request_variable.py +90 -0
  38. thousandeyes_sdk/instant_tests/models/cloud_enterprise_agent_type.py +38 -0
  39. thousandeyes_sdk/instant_tests/models/dns_query_class.py +37 -0
  40. thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py +170 -0
  41. thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_request.py +148 -0
  42. thousandeyes_sdk/instant_tests/models/dns_sec_properties.py +95 -0
  43. thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py +208 -0
  44. thousandeyes_sdk/instant_tests/models/dns_server_instant_test_request.py +178 -0
  45. thousandeyes_sdk/instant_tests/models/dns_server_properties.py +133 -0
  46. thousandeyes_sdk/instant_tests/models/dns_servers_request.py +88 -0
  47. thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py +173 -0
  48. thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_request.py +151 -0
  49. thousandeyes_sdk/instant_tests/models/dns_trace_properties.py +98 -0
  50. thousandeyes_sdk/instant_tests/models/error.py +96 -0
  51. thousandeyes_sdk/instant_tests/models/expand.py +38 -0
  52. thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +207 -0
  53. thousandeyes_sdk/instant_tests/models/ftp_server_properties.py +132 -0
  54. thousandeyes_sdk/instant_tests/models/ftp_server_request_type.py +38 -0
  55. thousandeyes_sdk/instant_tests/models/http_server_instant_test.py +246 -0
  56. thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +224 -0
  57. thousandeyes_sdk/instant_tests/models/http_server_properties.py +171 -0
  58. thousandeyes_sdk/instant_tests/models/instant_test.py +152 -0
  59. thousandeyes_sdk/instant_tests/models/instant_test_request.py +100 -0
  60. thousandeyes_sdk/instant_tests/models/link.py +102 -0
  61. thousandeyes_sdk/instant_tests/models/page_load_instant_test.py +254 -0
  62. thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +232 -0
  63. thousandeyes_sdk/instant_tests/models/page_load_properties.py +179 -0
  64. thousandeyes_sdk/instant_tests/models/server_instant_test_request.py +185 -0
  65. thousandeyes_sdk/instant_tests/models/shared_with_account.py +90 -0
  66. thousandeyes_sdk/instant_tests/models/simple_agent.py +122 -0
  67. thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py +191 -0
  68. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request.py +175 -0
  69. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request1.py +197 -0
  70. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py +204 -0
  71. thousandeyes_sdk/instant_tests/models/sip_server_properties.py +116 -0
  72. thousandeyes_sdk/instant_tests/models/sip_test_protocol.py +38 -0
  73. thousandeyes_sdk/instant_tests/models/test_agent.py +90 -0
  74. thousandeyes_sdk/instant_tests/models/test_auth_type.py +40 -0
  75. thousandeyes_sdk/instant_tests/models/test_custom_headers.py +92 -0
  76. thousandeyes_sdk/instant_tests/models/test_direction.py +38 -0
  77. thousandeyes_sdk/instant_tests/models/test_dns_server.py +90 -0
  78. thousandeyes_sdk/instant_tests/models/test_dns_transport_protocol.py +37 -0
  79. thousandeyes_sdk/instant_tests/models/test_dscp_id.py +57 -0
  80. thousandeyes_sdk/instant_tests/models/test_ipv6_policy.py +39 -0
  81. thousandeyes_sdk/instant_tests/models/test_label.py +92 -0
  82. thousandeyes_sdk/instant_tests/models/test_links.py +102 -0
  83. thousandeyes_sdk/instant_tests/models/test_page_loading_strategy.py +38 -0
  84. thousandeyes_sdk/instant_tests/models/test_path_trace_mode.py +37 -0
  85. thousandeyes_sdk/instant_tests/models/test_probe_mode.py +38 -0
  86. thousandeyes_sdk/instant_tests/models/test_protocol.py +38 -0
  87. thousandeyes_sdk/instant_tests/models/test_self_link.py +102 -0
  88. thousandeyes_sdk/instant_tests/models/test_sip_credentials.py +100 -0
  89. thousandeyes_sdk/instant_tests/models/test_ssl_version_id.py +40 -0
  90. thousandeyes_sdk/instant_tests/models/test_type.py +48 -0
  91. thousandeyes_sdk/instant_tests/models/unauthorized_error.py +90 -0
  92. thousandeyes_sdk/instant_tests/models/unexpanded_instant_test.py +128 -0
  93. thousandeyes_sdk/instant_tests/models/validation_error.py +111 -0
  94. thousandeyes_sdk/instant_tests/models/validation_error_item.py +92 -0
  95. thousandeyes_sdk/instant_tests/models/voice_instant_test.py +189 -0
  96. thousandeyes_sdk/instant_tests/models/voice_instant_test_request.py +167 -0
  97. thousandeyes_sdk/instant_tests/models/voice_properties.py +114 -0
  98. thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py +258 -0
  99. thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +236 -0
  100. thousandeyes_sdk/instant_tests/models/web_transaction_properties.py +181 -0
  101. thousandeyes_sdk/instant_tests/py.typed +0 -0
  102. thousandeyes_sdk_instant_tests-1.0.0.dist-info/LICENSE +176 -0
  103. thousandeyes_sdk_instant_tests-1.0.0.dist-info/METADATA +423 -0
  104. thousandeyes_sdk_instant_tests-1.0.0.dist-info/NOTICE +7 -0
  105. thousandeyes_sdk_instant_tests-1.0.0.dist-info/RECORD +107 -0
  106. thousandeyes_sdk_instant_tests-1.0.0.dist-info/WHEEL +5 -0
  107. thousandeyes_sdk_instant_tests-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,98 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class AgentBase(BaseModel):
26
+ """
27
+ AgentBase
28
+ """ # noqa: E501
29
+ ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
30
+ public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
31
+ network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
32
+ __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ extra="allow",
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of AgentBase from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * OpenAPI `readOnly` fields are excluded.
66
+ * OpenAPI `readOnly` fields are excluded.
67
+ * OpenAPI `readOnly` fields are excluded.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "ip_addresses",
71
+ "public_ip_addresses",
72
+ "network",
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of AgentBase from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "ipAddresses": obj.get("ipAddresses"),
93
+ "publicIpAddresses": obj.get("publicIpAddresses"),
94
+ "network": obj.get("network")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,198 @@
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.agent_to_agent_test_protocol import AgentToAgentTestProtocol
26
+ from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount
27
+ from thousandeyes_sdk.instant_tests.models.test_direction import TestDirection
28
+ from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
29
+ from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
30
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
31
+ from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
32
+ from typing import Optional, Set
33
+ from typing_extensions import Self
34
+
35
+ class AgentToAgentInstantTest(BaseModel):
36
+ """
37
+ AgentToAgentInstantTest
38
+ """ # noqa: E501
39
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
40
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
41
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
42
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
43
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
44
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
45
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
46
+ 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")
47
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
48
+ type: Optional[StrictStr] = None
49
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
50
+ labels: Optional[List[TestLabel]] = None
51
+ shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
52
+ direction: Optional[TestDirection] = None
53
+ dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
54
+ dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
55
+ mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.")
56
+ 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")
57
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
58
+ port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
59
+ protocol: Optional[AgentToAgentTestProtocol] = None
60
+ target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId")
61
+ throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements")
62
+ throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration")
63
+ throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate")
64
+ fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate")
65
+ agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
66
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents"]
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ extra="allow",
73
+ )
74
+
75
+
76
+ def to_str(self) -> str:
77
+ """Returns the string representation of the model using alias"""
78
+ return pprint.pformat(self.model_dump(by_alias=True))
79
+
80
+ def to_json(self) -> str:
81
+ """Returns the JSON representation of the model using alias"""
82
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
83
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
84
+
85
+ @classmethod
86
+ def from_json(cls, json_str: str) -> Optional[Self]:
87
+ """Create an instance of AgentToAgentInstantTest from a JSON string"""
88
+ return cls.from_dict(json.loads(json_str))
89
+
90
+ def to_dict(self) -> Dict[str, Any]:
91
+ """Return the dictionary representation of the model using alias.
92
+
93
+ This has the following differences from calling pydantic's
94
+ `self.model_dump(by_alias=True)`:
95
+
96
+ * `None` is only added to the output dict for nullable fields that
97
+ were set at model initialization. Other fields with value `None`
98
+ are ignored.
99
+ * OpenAPI `readOnly` fields are excluded.
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
+ * OpenAPI `readOnly` fields are excluded.
110
+ * OpenAPI `readOnly` fields are excluded.
111
+ """
112
+ excluded_fields: Set[str] = set([
113
+ "created_by",
114
+ "created_date",
115
+ "live_share",
116
+ "modified_by",
117
+ "modified_date",
118
+ "saved_event",
119
+ "test_id",
120
+ "type",
121
+ "labels",
122
+ "shared_with_accounts",
123
+ "dscp",
124
+ "agents",
125
+ ])
126
+
127
+ _dict = self.model_dump(
128
+ by_alias=True,
129
+ exclude=excluded_fields,
130
+ exclude_none=True,
131
+ )
132
+ # override the default output from pydantic by calling `to_dict()` of links
133
+ if self.links:
134
+ _dict['_links'] = self.links.to_dict()
135
+ # override the default output from pydantic by calling `to_dict()` of each item in labels (list)
136
+ _items = []
137
+ if self.labels:
138
+ for _item in self.labels:
139
+ if _item:
140
+ _items.append(_item.to_dict())
141
+ _dict['labels'] = _items
142
+ # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
143
+ _items = []
144
+ if self.shared_with_accounts:
145
+ for _item in self.shared_with_accounts:
146
+ if _item:
147
+ _items.append(_item.to_dict())
148
+ _dict['sharedWithAccounts'] = _items
149
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
150
+ _items = []
151
+ if self.agents:
152
+ for _item in self.agents:
153
+ if _item:
154
+ _items.append(_item.to_dict())
155
+ _dict['agents'] = _items
156
+ return _dict
157
+
158
+ @classmethod
159
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
160
+ """Create an instance of AgentToAgentInstantTest from a dict"""
161
+ if obj is None:
162
+ return None
163
+
164
+ if not isinstance(obj, dict):
165
+ return cls.model_validate(obj)
166
+
167
+ _obj = cls.model_validate({
168
+ "createdBy": obj.get("createdBy"),
169
+ "createdDate": obj.get("createdDate"),
170
+ "description": obj.get("description"),
171
+ "liveShare": obj.get("liveShare"),
172
+ "modifiedBy": obj.get("modifiedBy"),
173
+ "modifiedDate": obj.get("modifiedDate"),
174
+ "savedEvent": obj.get("savedEvent"),
175
+ "testId": obj.get("testId"),
176
+ "testName": obj.get("testName"),
177
+ "type": obj.get("type"),
178
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
179
+ "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
180
+ "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None,
181
+ "direction": obj.get("direction"),
182
+ "dscp": obj.get("dscp"),
183
+ "dscpId": obj.get("dscpId"),
184
+ "mss": obj.get("mss"),
185
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
186
+ "pathTraceMode": obj.get("pathTraceMode"),
187
+ "port": obj.get("port") if obj.get("port") is not None else 49153,
188
+ "protocol": obj.get("protocol"),
189
+ "targetAgentId": obj.get("targetAgentId"),
190
+ "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False,
191
+ "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000,
192
+ "throughputRate": obj.get("throughputRate"),
193
+ "fixedPacketRate": obj.get("fixedPacketRate"),
194
+ "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
195
+ })
196
+ return _obj
197
+
198
+
@@ -0,0 +1,176 @@
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_to_agent_test_protocol import AgentToAgentTestProtocol
25
+ from thousandeyes_sdk.instant_tests.models.test_agent import TestAgent
26
+ from thousandeyes_sdk.instant_tests.models.test_direction import TestDirection
27
+ from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
28
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
29
+ from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class AgentToAgentInstantTestRequest(BaseModel):
34
+ """
35
+ AgentToAgentInstantTestRequest
36
+ """ # noqa: E501
37
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
38
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
39
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
40
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
41
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
42
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
43
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
44
+ 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")
45
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
46
+ type: Optional[StrictStr] = None
47
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
48
+ labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
49
+ 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")
50
+ direction: Optional[TestDirection] = None
51
+ dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
52
+ dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
53
+ mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.")
54
+ 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")
55
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
56
+ port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
57
+ protocol: Optional[AgentToAgentTestProtocol] = None
58
+ target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId")
59
+ throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements")
60
+ throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration")
61
+ throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate")
62
+ fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate")
63
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
64
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents"]
65
+
66
+ model_config = ConfigDict(
67
+ populate_by_name=True,
68
+ validate_assignment=True,
69
+ protected_namespaces=(),
70
+ extra="allow",
71
+ )
72
+
73
+
74
+ def to_str(self) -> str:
75
+ """Returns the string representation of the model using alias"""
76
+ return pprint.pformat(self.model_dump(by_alias=True))
77
+
78
+ def to_json(self) -> str:
79
+ """Returns the JSON representation of the model using alias"""
80
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
82
+
83
+ @classmethod
84
+ def from_json(cls, json_str: str) -> Optional[Self]:
85
+ """Create an instance of AgentToAgentInstantTestRequest from a JSON string"""
86
+ return cls.from_dict(json.loads(json_str))
87
+
88
+ def to_dict(self) -> Dict[str, Any]:
89
+ """Return the dictionary representation of the model using alias.
90
+
91
+ This has the following differences from calling pydantic's
92
+ `self.model_dump(by_alias=True)`:
93
+
94
+ * `None` is only added to the output dict for nullable fields that
95
+ were set at model initialization. Other fields with value `None`
96
+ are ignored.
97
+ * OpenAPI `readOnly` fields are excluded.
98
+ * OpenAPI `readOnly` fields are excluded.
99
+ * OpenAPI `readOnly` fields are excluded.
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
+ """
107
+ excluded_fields: Set[str] = set([
108
+ "created_by",
109
+ "created_date",
110
+ "live_share",
111
+ "modified_by",
112
+ "modified_date",
113
+ "saved_event",
114
+ "test_id",
115
+ "type",
116
+ "dscp",
117
+ ])
118
+
119
+ _dict = self.model_dump(
120
+ by_alias=True,
121
+ exclude=excluded_fields,
122
+ exclude_none=True,
123
+ )
124
+ # override the default output from pydantic by calling `to_dict()` of links
125
+ if self.links:
126
+ _dict['_links'] = self.links.to_dict()
127
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
128
+ _items = []
129
+ if self.agents:
130
+ for _item in self.agents:
131
+ if _item:
132
+ _items.append(_item.to_dict())
133
+ _dict['agents'] = _items
134
+ return _dict
135
+
136
+ @classmethod
137
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
138
+ """Create an instance of AgentToAgentInstantTestRequest from a dict"""
139
+ if obj is None:
140
+ return None
141
+
142
+ if not isinstance(obj, dict):
143
+ return cls.model_validate(obj)
144
+
145
+ _obj = cls.model_validate({
146
+ "createdBy": obj.get("createdBy"),
147
+ "createdDate": obj.get("createdDate"),
148
+ "description": obj.get("description"),
149
+ "liveShare": obj.get("liveShare"),
150
+ "modifiedBy": obj.get("modifiedBy"),
151
+ "modifiedDate": obj.get("modifiedDate"),
152
+ "savedEvent": obj.get("savedEvent"),
153
+ "testId": obj.get("testId"),
154
+ "testName": obj.get("testName"),
155
+ "type": obj.get("type"),
156
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
157
+ "labels": obj.get("labels"),
158
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
159
+ "direction": obj.get("direction"),
160
+ "dscp": obj.get("dscp"),
161
+ "dscpId": obj.get("dscpId"),
162
+ "mss": obj.get("mss"),
163
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
164
+ "pathTraceMode": obj.get("pathTraceMode"),
165
+ "port": obj.get("port") if obj.get("port") is not None else 49153,
166
+ "protocol": obj.get("protocol"),
167
+ "targetAgentId": obj.get("targetAgentId"),
168
+ "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False,
169
+ "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000,
170
+ "throughputRate": obj.get("throughputRate"),
171
+ "fixedPacketRate": obj.get("fixedPacketRate"),
172
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
173
+ })
174
+ return _obj
175
+
176
+
@@ -0,0 +1,123 @@
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.agent_to_agent_test_protocol import AgentToAgentTestProtocol
24
+ from thousandeyes_sdk.instant_tests.models.test_direction import TestDirection
25
+ from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
26
+ from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class AgentToAgentProperties(BaseModel):
31
+ """
32
+ AgentToAgentProperties
33
+ """ # noqa: E501
34
+ direction: Optional[TestDirection] = None
35
+ dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
36
+ dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
37
+ mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.")
38
+ 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")
39
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
40
+ port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.")
41
+ protocol: Optional[AgentToAgentTestProtocol] = None
42
+ target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId")
43
+ throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements")
44
+ throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration")
45
+ throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate")
46
+ fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate")
47
+ type: Optional[StrictStr] = None
48
+ __properties: ClassVar[List[str]] = ["direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "type"]
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ extra="allow",
55
+ )
56
+
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.model_dump(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Optional[Self]:
69
+ """Create an instance of AgentToAgentProperties from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ * OpenAPI `readOnly` fields are excluded.
82
+ * OpenAPI `readOnly` fields are excluded.
83
+ """
84
+ excluded_fields: Set[str] = set([
85
+ "dscp",
86
+ "type",
87
+ ])
88
+
89
+ _dict = self.model_dump(
90
+ by_alias=True,
91
+ exclude=excluded_fields,
92
+ exclude_none=True,
93
+ )
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of AgentToAgentProperties from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "direction": obj.get("direction"),
107
+ "dscp": obj.get("dscp"),
108
+ "dscpId": obj.get("dscpId"),
109
+ "mss": obj.get("mss"),
110
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
111
+ "pathTraceMode": obj.get("pathTraceMode"),
112
+ "port": obj.get("port") if obj.get("port") is not None else 49153,
113
+ "protocol": obj.get("protocol"),
114
+ "targetAgentId": obj.get("targetAgentId"),
115
+ "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False,
116
+ "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000,
117
+ "throughputRate": obj.get("throughputRate"),
118
+ "fixedPacketRate": obj.get("fixedPacketRate"),
119
+ "type": obj.get("type")
120
+ })
121
+ return _obj
122
+
123
+
@@ -0,0 +1,37 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class AgentToAgentTestProtocol(str, Enum):
22
+ """
23
+ AgentToAgentTestProtocol
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ TCP = 'tcp'
30
+ UDP = 'udp'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of AgentToAgentTestProtocol from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+