cribl-control-plane 0.0.26a1__py3-none-any.whl → 0.0.27__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.
Potentially problematic release.
This version of cribl-control-plane might be problematic. Click here for more details.
- cribl_control_plane/_version.py +3 -3
- cribl_control_plane/acl.py +203 -0
- cribl_control_plane/auth_sdk.py +9 -176
- cribl_control_plane/branches.py +335 -0
- cribl_control_plane/commits.py +1141 -0
- cribl_control_plane/commits_files.py +371 -0
- cribl_control_plane/configs_versions.py +189 -0
- cribl_control_plane/destinations.py +18 -729
- cribl_control_plane/destinations_pq.py +359 -0
- cribl_control_plane/errors/healthstatus_error.py +1 -1
- cribl_control_plane/groups_configs.py +17 -0
- cribl_control_plane/groups_sdk.py +18 -551
- cribl_control_plane/{healthinfo.py → health.py} +3 -1
- cribl_control_plane/hectokens.py +479 -0
- cribl_control_plane/models/__init__.py +3 -35
- cribl_control_plane/models/healthstatus.py +3 -3
- cribl_control_plane/models/inputappscope.py +5 -5
- cribl_control_plane/models/inputcollection.py +2 -2
- cribl_control_plane/models/inputconfluentcloud.py +3 -3
- cribl_control_plane/models/inputcribl.py +5 -5
- cribl_control_plane/models/inputcriblhttp.py +3 -3
- cribl_control_plane/models/inputcribllakehttp.py +3 -3
- cribl_control_plane/models/inputcriblmetrics.py +5 -5
- cribl_control_plane/models/inputcribltcp.py +3 -3
- cribl_control_plane/models/inputdatadogagent.py +3 -3
- cribl_control_plane/models/inputedgeprometheus.py +3 -3
- cribl_control_plane/models/inputelastic.py +3 -3
- cribl_control_plane/models/inputeventhub.py +3 -3
- cribl_control_plane/models/inputfile.py +5 -5
- cribl_control_plane/models/inputfirehose.py +3 -3
- cribl_control_plane/models/inputgooglepubsub.py +3 -3
- cribl_control_plane/models/inputgrafana.py +6 -6
- cribl_control_plane/models/inputhttp.py +3 -3
- cribl_control_plane/models/inputhttpraw.py +3 -3
- cribl_control_plane/models/inputjournalfiles.py +3 -3
- cribl_control_plane/models/inputkafka.py +3 -3
- cribl_control_plane/models/inputkinesis.py +3 -3
- cribl_control_plane/models/inputkubeevents.py +5 -5
- cribl_control_plane/models/inputkubelogs.py +5 -5
- cribl_control_plane/models/inputkubemetrics.py +5 -5
- cribl_control_plane/models/inputloki.py +3 -3
- cribl_control_plane/models/inputmodeldriventelemetry.py +3 -3
- cribl_control_plane/models/inputmsk.py +3 -3
- cribl_control_plane/models/inputnetflow.py +3 -3
- cribl_control_plane/models/inputoffice365mgmt.py +3 -3
- cribl_control_plane/models/inputoffice365msgtrace.py +3 -3
- cribl_control_plane/models/inputoffice365service.py +3 -3
- cribl_control_plane/models/inputopentelemetry.py +3 -3
- cribl_control_plane/models/inputprometheus.py +3 -3
- cribl_control_plane/models/inputprometheusrw.py +3 -3
- cribl_control_plane/models/inputrawudp.py +3 -3
- cribl_control_plane/models/inputsnmp.py +3 -3
- cribl_control_plane/models/inputsplunk.py +3 -3
- cribl_control_plane/models/inputsplunkhec.py +3 -3
- cribl_control_plane/models/inputsplunksearch.py +3 -3
- cribl_control_plane/models/inputsqs.py +3 -3
- cribl_control_plane/models/inputsystemmetrics.py +5 -5
- cribl_control_plane/models/inputsystemstate.py +5 -5
- cribl_control_plane/models/inputtcp.py +3 -3
- cribl_control_plane/models/inputtcpjson.py +3 -3
- cribl_control_plane/models/inputwef.py +3 -3
- cribl_control_plane/models/inputwindowsmetrics.py +5 -5
- cribl_control_plane/models/inputwiz.py +3 -3
- cribl_control_plane/models/inputzscalerhec.py +3 -3
- cribl_control_plane/models/outputazureblob.py +3 -3
- cribl_control_plane/models/outputazuredataexplorer.py +3 -3
- cribl_control_plane/models/outputazureeventhub.py +3 -3
- cribl_control_plane/models/outputclickhouse.py +3 -3
- cribl_control_plane/models/outputcloudwatch.py +3 -3
- cribl_control_plane/models/outputconfluentcloud.py +3 -3
- cribl_control_plane/models/outputcriblhttp.py +5 -5
- cribl_control_plane/models/outputcribllake.py +5 -5
- cribl_control_plane/models/outputcribltcp.py +5 -5
- cribl_control_plane/models/outputcrowdstrikenextgensiem.py +3 -3
- cribl_control_plane/models/outputdatadog.py +5 -5
- cribl_control_plane/models/outputdataset.py +5 -5
- cribl_control_plane/models/outputdevnull.py +5 -5
- cribl_control_plane/models/outputdiskspool.py +5 -5
- cribl_control_plane/models/outputdls3.py +3 -3
- cribl_control_plane/models/outputdynatracehttp.py +3 -3
- cribl_control_plane/models/outputdynatraceotlp.py +3 -3
- cribl_control_plane/models/outputelasticcloud.py +3 -3
- cribl_control_plane/models/outputexabeam.py +3 -3
- cribl_control_plane/models/outputgooglecloudlogging.py +3 -3
- cribl_control_plane/models/outputgooglecloudstorage.py +3 -3
- cribl_control_plane/models/outputgrafanacloud.py +10 -10
- cribl_control_plane/models/outputgraphite.py +3 -3
- cribl_control_plane/models/outputhumiohec.py +3 -3
- cribl_control_plane/models/outputkafka.py +3 -3
- cribl_control_plane/models/outputkinesis.py +3 -3
- cribl_control_plane/models/outputminio.py +3 -3
- cribl_control_plane/models/outputmsk.py +3 -3
- cribl_control_plane/models/outputnewrelic.py +5 -5
- cribl_control_plane/models/outputnewrelicevents.py +3 -3
- cribl_control_plane/models/outputring.py +5 -5
- cribl_control_plane/models/outputs3.py +3 -3
- cribl_control_plane/models/outputsecuritylake.py +3 -3
- cribl_control_plane/models/outputsentinel.py +3 -3
- cribl_control_plane/models/outputsentineloneaisiem.py +3 -3
- cribl_control_plane/models/outputservicenow.py +3 -3
- cribl_control_plane/models/outputsns.py +3 -3
- cribl_control_plane/models/outputsplunk.py +3 -3
- cribl_control_plane/models/outputsplunkhec.py +5 -5
- cribl_control_plane/models/outputsqs.py +3 -3
- cribl_control_plane/models/outputstatsd.py +3 -3
- cribl_control_plane/models/outputstatsdext.py +3 -3
- cribl_control_plane/models/outputsyslog.py +5 -5
- cribl_control_plane/models/outputtcpjson.py +5 -5
- cribl_control_plane/models/outputwebhook.py +5 -5
- cribl_control_plane/models/outputxsiam.py +5 -5
- cribl_control_plane/nodes.py +90 -68
- cribl_control_plane/samples.py +391 -0
- cribl_control_plane/sdk.py +11 -17
- cribl_control_plane/sources.py +15 -469
- cribl_control_plane/{workers_sdk.py → statuses.py} +23 -25
- cribl_control_plane/{deployments.py → summaries.py} +3 -3
- cribl_control_plane/teams.py +201 -0
- cribl_control_plane/tokens.py +182 -0
- cribl_control_plane/versions.py +26 -0
- cribl_control_plane/versions_configs.py +171 -0
- {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/METADATA +67 -36
- {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/RECORD +123 -114
- cribl_control_plane/models/createversionsyncop.py +0 -23
- cribl_control_plane/models/restartresponse.py +0 -26
- cribl_control_plane/models/updateworkersrestartop.py +0 -24
- cribl_control_plane/versioning.py +0 -2309
- {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from cribl_control_plane import errors, models, utils
|
|
5
|
+
from cribl_control_plane._hooks import HookContext
|
|
6
|
+
from cribl_control_plane.types import OptionalNullable, UNSET
|
|
7
|
+
from cribl_control_plane.utils import get_security_from_env
|
|
8
|
+
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, List, Mapping, Optional, Union
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Samples(BaseSDK):
|
|
13
|
+
def get(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
id: str,
|
|
17
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
18
|
+
server_url: Optional[str] = None,
|
|
19
|
+
timeout_ms: Optional[int] = None,
|
|
20
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
21
|
+
) -> models.GetOutputSamplesByIDResponse:
|
|
22
|
+
r"""Retrieve sample event data for a Destination
|
|
23
|
+
|
|
24
|
+
Retrieve samples data for the specified destination. Used to get sample data for the test action.
|
|
25
|
+
|
|
26
|
+
:param id: Destination Id
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if server_url is not None:
|
|
38
|
+
base_url = server_url
|
|
39
|
+
else:
|
|
40
|
+
base_url = self._get_url(base_url, url_variables)
|
|
41
|
+
|
|
42
|
+
request = models.GetOutputSamplesByIDRequest(
|
|
43
|
+
id=id,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
req = self._build_request(
|
|
47
|
+
method="GET",
|
|
48
|
+
path="/system/outputs/{id}/samples",
|
|
49
|
+
base_url=base_url,
|
|
50
|
+
url_variables=url_variables,
|
|
51
|
+
request=request,
|
|
52
|
+
request_body_required=False,
|
|
53
|
+
request_has_path_params=True,
|
|
54
|
+
request_has_query_params=True,
|
|
55
|
+
user_agent_header="user-agent",
|
|
56
|
+
accept_header_value="application/json",
|
|
57
|
+
http_headers=http_headers,
|
|
58
|
+
security=self.sdk_configuration.security,
|
|
59
|
+
timeout_ms=timeout_ms,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if retries == UNSET:
|
|
63
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
64
|
+
retries = self.sdk_configuration.retry_config
|
|
65
|
+
|
|
66
|
+
retry_config = None
|
|
67
|
+
if isinstance(retries, utils.RetryConfig):
|
|
68
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
69
|
+
|
|
70
|
+
http_res = self.do_request(
|
|
71
|
+
hook_ctx=HookContext(
|
|
72
|
+
config=self.sdk_configuration,
|
|
73
|
+
base_url=base_url or "",
|
|
74
|
+
operation_id="getOutputSamplesById",
|
|
75
|
+
oauth2_scopes=[],
|
|
76
|
+
security_source=get_security_from_env(
|
|
77
|
+
self.sdk_configuration.security, models.Security
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
request=req,
|
|
81
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
82
|
+
retry_config=retry_config,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
response_data: Any = None
|
|
86
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
87
|
+
return unmarshal_json_response(
|
|
88
|
+
models.GetOutputSamplesByIDResponse, http_res
|
|
89
|
+
)
|
|
90
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
91
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
92
|
+
raise errors.Error(response_data, http_res)
|
|
93
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
94
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
95
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
96
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
97
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
98
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
99
|
+
|
|
100
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
101
|
+
|
|
102
|
+
async def get_async(
|
|
103
|
+
self,
|
|
104
|
+
*,
|
|
105
|
+
id: str,
|
|
106
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
107
|
+
server_url: Optional[str] = None,
|
|
108
|
+
timeout_ms: Optional[int] = None,
|
|
109
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
110
|
+
) -> models.GetOutputSamplesByIDResponse:
|
|
111
|
+
r"""Retrieve sample event data for a Destination
|
|
112
|
+
|
|
113
|
+
Retrieve samples data for the specified destination. Used to get sample data for the test action.
|
|
114
|
+
|
|
115
|
+
:param id: Destination Id
|
|
116
|
+
:param retries: Override the default retry configuration for this method
|
|
117
|
+
:param server_url: Override the default server URL for this method
|
|
118
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
119
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
120
|
+
"""
|
|
121
|
+
base_url = None
|
|
122
|
+
url_variables = None
|
|
123
|
+
if timeout_ms is None:
|
|
124
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
125
|
+
|
|
126
|
+
if server_url is not None:
|
|
127
|
+
base_url = server_url
|
|
128
|
+
else:
|
|
129
|
+
base_url = self._get_url(base_url, url_variables)
|
|
130
|
+
|
|
131
|
+
request = models.GetOutputSamplesByIDRequest(
|
|
132
|
+
id=id,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
req = self._build_request_async(
|
|
136
|
+
method="GET",
|
|
137
|
+
path="/system/outputs/{id}/samples",
|
|
138
|
+
base_url=base_url,
|
|
139
|
+
url_variables=url_variables,
|
|
140
|
+
request=request,
|
|
141
|
+
request_body_required=False,
|
|
142
|
+
request_has_path_params=True,
|
|
143
|
+
request_has_query_params=True,
|
|
144
|
+
user_agent_header="user-agent",
|
|
145
|
+
accept_header_value="application/json",
|
|
146
|
+
http_headers=http_headers,
|
|
147
|
+
security=self.sdk_configuration.security,
|
|
148
|
+
timeout_ms=timeout_ms,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
if retries == UNSET:
|
|
152
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
153
|
+
retries = self.sdk_configuration.retry_config
|
|
154
|
+
|
|
155
|
+
retry_config = None
|
|
156
|
+
if isinstance(retries, utils.RetryConfig):
|
|
157
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
158
|
+
|
|
159
|
+
http_res = await self.do_request_async(
|
|
160
|
+
hook_ctx=HookContext(
|
|
161
|
+
config=self.sdk_configuration,
|
|
162
|
+
base_url=base_url or "",
|
|
163
|
+
operation_id="getOutputSamplesById",
|
|
164
|
+
oauth2_scopes=[],
|
|
165
|
+
security_source=get_security_from_env(
|
|
166
|
+
self.sdk_configuration.security, models.Security
|
|
167
|
+
),
|
|
168
|
+
),
|
|
169
|
+
request=req,
|
|
170
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
171
|
+
retry_config=retry_config,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
response_data: Any = None
|
|
175
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
176
|
+
return unmarshal_json_response(
|
|
177
|
+
models.GetOutputSamplesByIDResponse, http_res
|
|
178
|
+
)
|
|
179
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
180
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
181
|
+
raise errors.Error(response_data, http_res)
|
|
182
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
183
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
184
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
185
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
186
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
187
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
188
|
+
|
|
189
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
190
|
+
|
|
191
|
+
def create(
|
|
192
|
+
self,
|
|
193
|
+
*,
|
|
194
|
+
id: str,
|
|
195
|
+
events: Union[List[models.CriblEvent], List[models.CriblEventTypedDict]],
|
|
196
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
197
|
+
server_url: Optional[str] = None,
|
|
198
|
+
timeout_ms: Optional[int] = None,
|
|
199
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
200
|
+
) -> models.CreateOutputTestByIDResponse:
|
|
201
|
+
r"""Send sample event data to a Destination
|
|
202
|
+
|
|
203
|
+
Send sample data to a destination to validate configuration or test connectivity
|
|
204
|
+
|
|
205
|
+
:param id: Destination Id
|
|
206
|
+
:param events:
|
|
207
|
+
:param retries: Override the default retry configuration for this method
|
|
208
|
+
:param server_url: Override the default server URL for this method
|
|
209
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
210
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
211
|
+
"""
|
|
212
|
+
base_url = None
|
|
213
|
+
url_variables = None
|
|
214
|
+
if timeout_ms is None:
|
|
215
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
216
|
+
|
|
217
|
+
if server_url is not None:
|
|
218
|
+
base_url = server_url
|
|
219
|
+
else:
|
|
220
|
+
base_url = self._get_url(base_url, url_variables)
|
|
221
|
+
|
|
222
|
+
request = models.CreateOutputTestByIDRequest(
|
|
223
|
+
id=id,
|
|
224
|
+
output_test_request=models.OutputTestRequest(
|
|
225
|
+
events=utils.get_pydantic_model(events, List[models.CriblEvent]),
|
|
226
|
+
),
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
req = self._build_request(
|
|
230
|
+
method="POST",
|
|
231
|
+
path="/system/outputs/{id}/test",
|
|
232
|
+
base_url=base_url,
|
|
233
|
+
url_variables=url_variables,
|
|
234
|
+
request=request,
|
|
235
|
+
request_body_required=True,
|
|
236
|
+
request_has_path_params=True,
|
|
237
|
+
request_has_query_params=True,
|
|
238
|
+
user_agent_header="user-agent",
|
|
239
|
+
accept_header_value="application/json",
|
|
240
|
+
http_headers=http_headers,
|
|
241
|
+
security=self.sdk_configuration.security,
|
|
242
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
243
|
+
request.output_test_request,
|
|
244
|
+
False,
|
|
245
|
+
False,
|
|
246
|
+
"json",
|
|
247
|
+
models.OutputTestRequest,
|
|
248
|
+
),
|
|
249
|
+
timeout_ms=timeout_ms,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
if retries == UNSET:
|
|
253
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
254
|
+
retries = self.sdk_configuration.retry_config
|
|
255
|
+
|
|
256
|
+
retry_config = None
|
|
257
|
+
if isinstance(retries, utils.RetryConfig):
|
|
258
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
259
|
+
|
|
260
|
+
http_res = self.do_request(
|
|
261
|
+
hook_ctx=HookContext(
|
|
262
|
+
config=self.sdk_configuration,
|
|
263
|
+
base_url=base_url or "",
|
|
264
|
+
operation_id="createOutputTestById",
|
|
265
|
+
oauth2_scopes=[],
|
|
266
|
+
security_source=get_security_from_env(
|
|
267
|
+
self.sdk_configuration.security, models.Security
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
request=req,
|
|
271
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
272
|
+
retry_config=retry_config,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
response_data: Any = None
|
|
276
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
277
|
+
return unmarshal_json_response(
|
|
278
|
+
models.CreateOutputTestByIDResponse, http_res
|
|
279
|
+
)
|
|
280
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
281
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
282
|
+
raise errors.Error(response_data, http_res)
|
|
283
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
284
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
285
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
286
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
287
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
288
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
289
|
+
|
|
290
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
291
|
+
|
|
292
|
+
async def create_async(
|
|
293
|
+
self,
|
|
294
|
+
*,
|
|
295
|
+
id: str,
|
|
296
|
+
events: Union[List[models.CriblEvent], List[models.CriblEventTypedDict]],
|
|
297
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
298
|
+
server_url: Optional[str] = None,
|
|
299
|
+
timeout_ms: Optional[int] = None,
|
|
300
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
301
|
+
) -> models.CreateOutputTestByIDResponse:
|
|
302
|
+
r"""Send sample event data to a Destination
|
|
303
|
+
|
|
304
|
+
Send sample data to a destination to validate configuration or test connectivity
|
|
305
|
+
|
|
306
|
+
:param id: Destination Id
|
|
307
|
+
:param events:
|
|
308
|
+
:param retries: Override the default retry configuration for this method
|
|
309
|
+
:param server_url: Override the default server URL for this method
|
|
310
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
311
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
312
|
+
"""
|
|
313
|
+
base_url = None
|
|
314
|
+
url_variables = None
|
|
315
|
+
if timeout_ms is None:
|
|
316
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
317
|
+
|
|
318
|
+
if server_url is not None:
|
|
319
|
+
base_url = server_url
|
|
320
|
+
else:
|
|
321
|
+
base_url = self._get_url(base_url, url_variables)
|
|
322
|
+
|
|
323
|
+
request = models.CreateOutputTestByIDRequest(
|
|
324
|
+
id=id,
|
|
325
|
+
output_test_request=models.OutputTestRequest(
|
|
326
|
+
events=utils.get_pydantic_model(events, List[models.CriblEvent]),
|
|
327
|
+
),
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
req = self._build_request_async(
|
|
331
|
+
method="POST",
|
|
332
|
+
path="/system/outputs/{id}/test",
|
|
333
|
+
base_url=base_url,
|
|
334
|
+
url_variables=url_variables,
|
|
335
|
+
request=request,
|
|
336
|
+
request_body_required=True,
|
|
337
|
+
request_has_path_params=True,
|
|
338
|
+
request_has_query_params=True,
|
|
339
|
+
user_agent_header="user-agent",
|
|
340
|
+
accept_header_value="application/json",
|
|
341
|
+
http_headers=http_headers,
|
|
342
|
+
security=self.sdk_configuration.security,
|
|
343
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
344
|
+
request.output_test_request,
|
|
345
|
+
False,
|
|
346
|
+
False,
|
|
347
|
+
"json",
|
|
348
|
+
models.OutputTestRequest,
|
|
349
|
+
),
|
|
350
|
+
timeout_ms=timeout_ms,
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
if retries == UNSET:
|
|
354
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
355
|
+
retries = self.sdk_configuration.retry_config
|
|
356
|
+
|
|
357
|
+
retry_config = None
|
|
358
|
+
if isinstance(retries, utils.RetryConfig):
|
|
359
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
360
|
+
|
|
361
|
+
http_res = await self.do_request_async(
|
|
362
|
+
hook_ctx=HookContext(
|
|
363
|
+
config=self.sdk_configuration,
|
|
364
|
+
base_url=base_url or "",
|
|
365
|
+
operation_id="createOutputTestById",
|
|
366
|
+
oauth2_scopes=[],
|
|
367
|
+
security_source=get_security_from_env(
|
|
368
|
+
self.sdk_configuration.security, models.Security
|
|
369
|
+
),
|
|
370
|
+
),
|
|
371
|
+
request=req,
|
|
372
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
373
|
+
retry_config=retry_config,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
response_data: Any = None
|
|
377
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
378
|
+
return unmarshal_json_response(
|
|
379
|
+
models.CreateOutputTestByIDResponse, http_res
|
|
380
|
+
)
|
|
381
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
382
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
383
|
+
raise errors.Error(response_data, http_res)
|
|
384
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
385
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
386
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
387
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
388
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
389
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
390
|
+
|
|
391
|
+
raise errors.APIError("Unexpected response received", http_res)
|
cribl_control_plane/sdk.py
CHANGED
|
@@ -15,18 +15,16 @@ import weakref
|
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
17
|
from cribl_control_plane.auth_sdk import AuthSDK
|
|
18
|
-
from cribl_control_plane.deployments import Deployments
|
|
19
18
|
from cribl_control_plane.destinations import Destinations
|
|
20
19
|
from cribl_control_plane.groups_sdk import GroupsSDK
|
|
21
|
-
from cribl_control_plane.
|
|
20
|
+
from cribl_control_plane.health import Health
|
|
22
21
|
from cribl_control_plane.lakedatasets import LakeDatasets
|
|
23
22
|
from cribl_control_plane.nodes import Nodes
|
|
24
23
|
from cribl_control_plane.packs import Packs
|
|
25
24
|
from cribl_control_plane.pipelines import Pipelines
|
|
26
25
|
from cribl_control_plane.routes_sdk import RoutesSDK
|
|
27
26
|
from cribl_control_plane.sources import Sources
|
|
28
|
-
from cribl_control_plane.
|
|
29
|
-
from cribl_control_plane.workers_sdk import WorkersSDK
|
|
27
|
+
from cribl_control_plane.versions import Versions
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
class CriblControlPlane(BaseSDK):
|
|
@@ -34,22 +32,20 @@ class CriblControlPlane(BaseSDK):
|
|
|
34
32
|
|
|
35
33
|
lake_datasets: "LakeDatasets"
|
|
36
34
|
sources: "Sources"
|
|
35
|
+
r"""Actions related to Sources"""
|
|
37
36
|
destinations: "Destinations"
|
|
37
|
+
r"""Actions related to Destinations"""
|
|
38
38
|
pipelines: "Pipelines"
|
|
39
39
|
r"""Actions related to Pipelines"""
|
|
40
40
|
routes: "RoutesSDK"
|
|
41
41
|
r"""Actions related to Routes"""
|
|
42
42
|
auth: "AuthSDK"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
nodes: "Nodes"
|
|
44
|
+
health: "Health"
|
|
45
|
+
r"""Actions related to REST server health"""
|
|
46
46
|
packs: "Packs"
|
|
47
47
|
r"""Actions related to Packs"""
|
|
48
|
-
|
|
49
|
-
r"""Actions related to Versioning"""
|
|
50
|
-
workers: "WorkersSDK"
|
|
51
|
-
r"""Actions related to Workers"""
|
|
52
|
-
nodes: "Nodes"
|
|
48
|
+
versions: "Versions"
|
|
53
49
|
groups: "GroupsSDK"
|
|
54
50
|
r"""Actions related to Groups"""
|
|
55
51
|
_sub_sdk_map = {
|
|
@@ -59,12 +55,10 @@ class CriblControlPlane(BaseSDK):
|
|
|
59
55
|
"pipelines": ("cribl_control_plane.pipelines", "Pipelines"),
|
|
60
56
|
"routes": ("cribl_control_plane.routes_sdk", "RoutesSDK"),
|
|
61
57
|
"auth": ("cribl_control_plane.auth_sdk", "AuthSDK"),
|
|
62
|
-
"deployments": ("cribl_control_plane.deployments", "Deployments"),
|
|
63
|
-
"health_info": ("cribl_control_plane.healthinfo", "HealthInfo"),
|
|
64
|
-
"packs": ("cribl_control_plane.packs", "Packs"),
|
|
65
|
-
"versioning": ("cribl_control_plane.versioning", "Versioning"),
|
|
66
|
-
"workers": ("cribl_control_plane.workers_sdk", "WorkersSDK"),
|
|
67
58
|
"nodes": ("cribl_control_plane.nodes", "Nodes"),
|
|
59
|
+
"health": ("cribl_control_plane.health", "Health"),
|
|
60
|
+
"packs": ("cribl_control_plane.packs", "Packs"),
|
|
61
|
+
"versions": ("cribl_control_plane.versions", "Versions"),
|
|
68
62
|
"groups": ("cribl_control_plane.groups_sdk", "GroupsSDK"),
|
|
69
63
|
}
|
|
70
64
|
|