cribl-control-plane 0.0.26__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 +16 -729
- cribl_control_plane/destinations_pq.py +359 -0
- cribl_control_plane/groups_configs.py +17 -0
- cribl_control_plane/groups_sdk.py +12 -545
- cribl_control_plane/hectokens.py +479 -0
- cribl_control_plane/models/__init__.py +0 -8
- cribl_control_plane/nodes.py +9 -171
- cribl_control_plane/samples.py +391 -0
- cribl_control_plane/sdk.py +3 -5
- cribl_control_plane/sources.py +13 -469
- cribl_control_plane/statuses.py +185 -0
- cribl_control_plane/summaries.py +185 -0
- 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.26.dist-info → cribl_control_plane-0.0.27.dist-info}/METADATA +67 -29
- {cribl_control_plane-0.0.26.dist-info → cribl_control_plane-0.0.27.dist-info}/RECORD +26 -13
- cribl_control_plane/models/createversionsyncop.py +0 -23
- cribl_control_plane/versioning.py +0 -2309
- {cribl_control_plane-0.0.26.dist-info → cribl_control_plane-0.0.27.dist-info}/WHEEL +0 -0
cribl_control_plane/nodes.py
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
+
from .sdkconfiguration import SDKConfiguration
|
|
4
5
|
from cribl_control_plane import errors, models, utils
|
|
5
6
|
from cribl_control_plane._hooks import HookContext
|
|
7
|
+
from cribl_control_plane.summaries import Summaries
|
|
6
8
|
from cribl_control_plane.types import OptionalNullable, UNSET
|
|
7
9
|
from cribl_control_plane.utils import get_security_from_env
|
|
8
10
|
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
@@ -10,179 +12,15 @@ from typing import Any, Mapping, Optional
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class Nodes(BaseSDK):
|
|
13
|
-
|
|
14
|
-
self,
|
|
15
|
-
*,
|
|
16
|
-
mode: Optional[models.GetSummaryMode] = None,
|
|
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.GetSummaryResponse:
|
|
22
|
-
r"""Retrieve a summary of the Distributed deployment
|
|
23
|
-
|
|
24
|
-
Get summary of Distributed deployment
|
|
25
|
-
|
|
26
|
-
:param mode: product filter
|
|
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.GetSummaryRequest(
|
|
43
|
-
mode=mode,
|
|
44
|
-
)
|
|
15
|
+
summaries: Summaries
|
|
45
16
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
url_variables=url_variables,
|
|
51
|
-
request=request,
|
|
52
|
-
request_body_required=False,
|
|
53
|
-
request_has_path_params=False,
|
|
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
|
-
)
|
|
17
|
+
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
18
|
+
BaseSDK.__init__(self, sdk_config)
|
|
19
|
+
self.sdk_configuration = sdk_config
|
|
20
|
+
self._init_sdks()
|
|
61
21
|
|
|
62
|
-
|
|
63
|
-
|
|
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="getSummary",
|
|
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(models.GetSummaryResponse, http_res)
|
|
88
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
89
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
90
|
-
raise errors.Error(response_data, http_res)
|
|
91
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
92
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
93
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
94
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
95
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
96
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
97
|
-
|
|
98
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
99
|
-
|
|
100
|
-
async def get_summary_async(
|
|
101
|
-
self,
|
|
102
|
-
*,
|
|
103
|
-
mode: Optional[models.GetSummaryMode] = None,
|
|
104
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
105
|
-
server_url: Optional[str] = None,
|
|
106
|
-
timeout_ms: Optional[int] = None,
|
|
107
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
108
|
-
) -> models.GetSummaryResponse:
|
|
109
|
-
r"""Retrieve a summary of the Distributed deployment
|
|
110
|
-
|
|
111
|
-
Get summary of Distributed deployment
|
|
112
|
-
|
|
113
|
-
:param mode: product filter
|
|
114
|
-
:param retries: Override the default retry configuration for this method
|
|
115
|
-
:param server_url: Override the default server URL for this method
|
|
116
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
117
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
118
|
-
"""
|
|
119
|
-
base_url = None
|
|
120
|
-
url_variables = None
|
|
121
|
-
if timeout_ms is None:
|
|
122
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
123
|
-
|
|
124
|
-
if server_url is not None:
|
|
125
|
-
base_url = server_url
|
|
126
|
-
else:
|
|
127
|
-
base_url = self._get_url(base_url, url_variables)
|
|
128
|
-
|
|
129
|
-
request = models.GetSummaryRequest(
|
|
130
|
-
mode=mode,
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
req = self._build_request_async(
|
|
134
|
-
method="GET",
|
|
135
|
-
path="/master/summary",
|
|
136
|
-
base_url=base_url,
|
|
137
|
-
url_variables=url_variables,
|
|
138
|
-
request=request,
|
|
139
|
-
request_body_required=False,
|
|
140
|
-
request_has_path_params=False,
|
|
141
|
-
request_has_query_params=True,
|
|
142
|
-
user_agent_header="user-agent",
|
|
143
|
-
accept_header_value="application/json",
|
|
144
|
-
http_headers=http_headers,
|
|
145
|
-
security=self.sdk_configuration.security,
|
|
146
|
-
timeout_ms=timeout_ms,
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
if retries == UNSET:
|
|
150
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
151
|
-
retries = self.sdk_configuration.retry_config
|
|
152
|
-
|
|
153
|
-
retry_config = None
|
|
154
|
-
if isinstance(retries, utils.RetryConfig):
|
|
155
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
156
|
-
|
|
157
|
-
http_res = await self.do_request_async(
|
|
158
|
-
hook_ctx=HookContext(
|
|
159
|
-
config=self.sdk_configuration,
|
|
160
|
-
base_url=base_url or "",
|
|
161
|
-
operation_id="getSummary",
|
|
162
|
-
oauth2_scopes=[],
|
|
163
|
-
security_source=get_security_from_env(
|
|
164
|
-
self.sdk_configuration.security, models.Security
|
|
165
|
-
),
|
|
166
|
-
),
|
|
167
|
-
request=req,
|
|
168
|
-
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
169
|
-
retry_config=retry_config,
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
response_data: Any = None
|
|
173
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
174
|
-
return unmarshal_json_response(models.GetSummaryResponse, http_res)
|
|
175
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
176
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
177
|
-
raise errors.Error(response_data, http_res)
|
|
178
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
179
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
180
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
181
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
182
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
183
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
184
|
-
|
|
185
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
22
|
+
def _init_sdks(self):
|
|
23
|
+
self.summaries = Summaries(self.sdk_configuration)
|
|
186
24
|
|
|
187
25
|
def count(
|
|
188
26
|
self,
|
|
@@ -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
|
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
|
|
|
24
24
|
from cribl_control_plane.pipelines import Pipelines
|
|
25
25
|
from cribl_control_plane.routes_sdk import RoutesSDK
|
|
26
26
|
from cribl_control_plane.sources import Sources
|
|
27
|
-
from cribl_control_plane.
|
|
27
|
+
from cribl_control_plane.versions import Versions
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class CriblControlPlane(BaseSDK):
|
|
@@ -40,14 +40,12 @@ class CriblControlPlane(BaseSDK):
|
|
|
40
40
|
routes: "RoutesSDK"
|
|
41
41
|
r"""Actions related to Routes"""
|
|
42
42
|
auth: "AuthSDK"
|
|
43
|
-
r"""Actions related to authentication. Do not use the /auth endpoints in Cribl.Cloud deployments. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to authenticate for Cribl.Cloud."""
|
|
44
43
|
nodes: "Nodes"
|
|
45
44
|
health: "Health"
|
|
46
45
|
r"""Actions related to REST server health"""
|
|
47
46
|
packs: "Packs"
|
|
48
47
|
r"""Actions related to Packs"""
|
|
49
|
-
|
|
50
|
-
r"""Actions related to Versioning"""
|
|
48
|
+
versions: "Versions"
|
|
51
49
|
groups: "GroupsSDK"
|
|
52
50
|
r"""Actions related to Groups"""
|
|
53
51
|
_sub_sdk_map = {
|
|
@@ -60,7 +58,7 @@ class CriblControlPlane(BaseSDK):
|
|
|
60
58
|
"nodes": ("cribl_control_plane.nodes", "Nodes"),
|
|
61
59
|
"health": ("cribl_control_plane.health", "Health"),
|
|
62
60
|
"packs": ("cribl_control_plane.packs", "Packs"),
|
|
63
|
-
"
|
|
61
|
+
"versions": ("cribl_control_plane.versions", "Versions"),
|
|
64
62
|
"groups": ("cribl_control_plane.groups_sdk", "GroupsSDK"),
|
|
65
63
|
}
|
|
66
64
|
|