cribl-control-plane 0.0.26a1__py3-none-any.whl → 0.0.28__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/_hooks/clientcredentials.py +22 -7
- cribl_control_plane/_version.py +4 -4
- 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/__init__.py +3 -2
- 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 +6 -37
- 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/models/schemeclientoauth.py +5 -0
- 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/utils/__init__.py +3 -2
- cribl_control_plane/utils/security.py +5 -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.28.dist-info}/METADATA +77 -38
- {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.28.dist-info}/RECORD +128 -119
- 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.28.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
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, Mapping, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Teams(BaseSDK):
|
|
13
|
+
def get(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
product: models.GetProductsGroupsACLTeamsByProductAndIDProduct,
|
|
17
|
+
id: str,
|
|
18
|
+
type_: Optional[models.GetProductsGroupsACLTeamsByProductAndIDType] = None,
|
|
19
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
20
|
+
server_url: Optional[str] = None,
|
|
21
|
+
timeout_ms: Optional[int] = None,
|
|
22
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
23
|
+
) -> models.GetProductsGroupsACLTeamsByProductAndIDResponse:
|
|
24
|
+
r"""Retrieve the Access Control List (ACL) for teams with permissions on a Worker Group or Edge Fleet for the specified Cribl product
|
|
25
|
+
|
|
26
|
+
ACL of team with permissions for resources in this Group
|
|
27
|
+
|
|
28
|
+
:param product: Cribl Product
|
|
29
|
+
:param id: Group ID
|
|
30
|
+
:param type: resource type by which to filter access levels
|
|
31
|
+
:param retries: Override the default retry configuration for this method
|
|
32
|
+
:param server_url: Override the default server URL for this method
|
|
33
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
34
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
35
|
+
"""
|
|
36
|
+
base_url = None
|
|
37
|
+
url_variables = None
|
|
38
|
+
if timeout_ms is None:
|
|
39
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
40
|
+
|
|
41
|
+
if server_url is not None:
|
|
42
|
+
base_url = server_url
|
|
43
|
+
else:
|
|
44
|
+
base_url = self._get_url(base_url, url_variables)
|
|
45
|
+
|
|
46
|
+
request = models.GetProductsGroupsACLTeamsByProductAndIDRequest(
|
|
47
|
+
product=product,
|
|
48
|
+
id=id,
|
|
49
|
+
type=type_,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
req = self._build_request(
|
|
53
|
+
method="GET",
|
|
54
|
+
path="/products/{product}/groups/{id}/acl/teams",
|
|
55
|
+
base_url=base_url,
|
|
56
|
+
url_variables=url_variables,
|
|
57
|
+
request=request,
|
|
58
|
+
request_body_required=False,
|
|
59
|
+
request_has_path_params=True,
|
|
60
|
+
request_has_query_params=True,
|
|
61
|
+
user_agent_header="user-agent",
|
|
62
|
+
accept_header_value="application/json",
|
|
63
|
+
http_headers=http_headers,
|
|
64
|
+
security=self.sdk_configuration.security,
|
|
65
|
+
timeout_ms=timeout_ms,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
if retries == UNSET:
|
|
69
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
70
|
+
retries = self.sdk_configuration.retry_config
|
|
71
|
+
|
|
72
|
+
retry_config = None
|
|
73
|
+
if isinstance(retries, utils.RetryConfig):
|
|
74
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
75
|
+
|
|
76
|
+
http_res = self.do_request(
|
|
77
|
+
hook_ctx=HookContext(
|
|
78
|
+
config=self.sdk_configuration,
|
|
79
|
+
base_url=base_url or "",
|
|
80
|
+
operation_id="getProductsGroupsAclTeamsByProductAndId",
|
|
81
|
+
oauth2_scopes=[],
|
|
82
|
+
security_source=get_security_from_env(
|
|
83
|
+
self.sdk_configuration.security, models.Security
|
|
84
|
+
),
|
|
85
|
+
),
|
|
86
|
+
request=req,
|
|
87
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
88
|
+
retry_config=retry_config,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response_data: Any = None
|
|
92
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
93
|
+
return unmarshal_json_response(
|
|
94
|
+
models.GetProductsGroupsACLTeamsByProductAndIDResponse, http_res
|
|
95
|
+
)
|
|
96
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
97
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
98
|
+
raise errors.Error(response_data, http_res)
|
|
99
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
100
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
101
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
103
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
104
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
105
|
+
|
|
106
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
107
|
+
|
|
108
|
+
async def get_async(
|
|
109
|
+
self,
|
|
110
|
+
*,
|
|
111
|
+
product: models.GetProductsGroupsACLTeamsByProductAndIDProduct,
|
|
112
|
+
id: str,
|
|
113
|
+
type_: Optional[models.GetProductsGroupsACLTeamsByProductAndIDType] = None,
|
|
114
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
115
|
+
server_url: Optional[str] = None,
|
|
116
|
+
timeout_ms: Optional[int] = None,
|
|
117
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
118
|
+
) -> models.GetProductsGroupsACLTeamsByProductAndIDResponse:
|
|
119
|
+
r"""Retrieve the Access Control List (ACL) for teams with permissions on a Worker Group or Edge Fleet for the specified Cribl product
|
|
120
|
+
|
|
121
|
+
ACL of team with permissions for resources in this Group
|
|
122
|
+
|
|
123
|
+
:param product: Cribl Product
|
|
124
|
+
:param id: Group ID
|
|
125
|
+
:param type: resource type by which to filter access levels
|
|
126
|
+
:param retries: Override the default retry configuration for this method
|
|
127
|
+
:param server_url: Override the default server URL for this method
|
|
128
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
129
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
130
|
+
"""
|
|
131
|
+
base_url = None
|
|
132
|
+
url_variables = None
|
|
133
|
+
if timeout_ms is None:
|
|
134
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
135
|
+
|
|
136
|
+
if server_url is not None:
|
|
137
|
+
base_url = server_url
|
|
138
|
+
else:
|
|
139
|
+
base_url = self._get_url(base_url, url_variables)
|
|
140
|
+
|
|
141
|
+
request = models.GetProductsGroupsACLTeamsByProductAndIDRequest(
|
|
142
|
+
product=product,
|
|
143
|
+
id=id,
|
|
144
|
+
type=type_,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
req = self._build_request_async(
|
|
148
|
+
method="GET",
|
|
149
|
+
path="/products/{product}/groups/{id}/acl/teams",
|
|
150
|
+
base_url=base_url,
|
|
151
|
+
url_variables=url_variables,
|
|
152
|
+
request=request,
|
|
153
|
+
request_body_required=False,
|
|
154
|
+
request_has_path_params=True,
|
|
155
|
+
request_has_query_params=True,
|
|
156
|
+
user_agent_header="user-agent",
|
|
157
|
+
accept_header_value="application/json",
|
|
158
|
+
http_headers=http_headers,
|
|
159
|
+
security=self.sdk_configuration.security,
|
|
160
|
+
timeout_ms=timeout_ms,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
if retries == UNSET:
|
|
164
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
165
|
+
retries = self.sdk_configuration.retry_config
|
|
166
|
+
|
|
167
|
+
retry_config = None
|
|
168
|
+
if isinstance(retries, utils.RetryConfig):
|
|
169
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
170
|
+
|
|
171
|
+
http_res = await self.do_request_async(
|
|
172
|
+
hook_ctx=HookContext(
|
|
173
|
+
config=self.sdk_configuration,
|
|
174
|
+
base_url=base_url or "",
|
|
175
|
+
operation_id="getProductsGroupsAclTeamsByProductAndId",
|
|
176
|
+
oauth2_scopes=[],
|
|
177
|
+
security_source=get_security_from_env(
|
|
178
|
+
self.sdk_configuration.security, models.Security
|
|
179
|
+
),
|
|
180
|
+
),
|
|
181
|
+
request=req,
|
|
182
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
183
|
+
retry_config=retry_config,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
response_data: Any = None
|
|
187
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
188
|
+
return unmarshal_json_response(
|
|
189
|
+
models.GetProductsGroupsACLTeamsByProductAndIDResponse, http_res
|
|
190
|
+
)
|
|
191
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
192
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
193
|
+
raise errors.Error(response_data, http_res)
|
|
194
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
195
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
196
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
197
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
198
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
199
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
200
|
+
|
|
201
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
@@ -0,0 +1,182 @@
|
|
|
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.unmarshal_json_response import unmarshal_json_response
|
|
8
|
+
from typing import Mapping, Optional
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Tokens(BaseSDK):
|
|
12
|
+
def get(
|
|
13
|
+
self,
|
|
14
|
+
*,
|
|
15
|
+
username: str,
|
|
16
|
+
password: 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.AuthToken:
|
|
22
|
+
r"""Log in and fetch an authentication token
|
|
23
|
+
|
|
24
|
+
This endpoint is unavailable on Cribl.Cloud. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
|
|
25
|
+
|
|
26
|
+
:param username:
|
|
27
|
+
:param password:
|
|
28
|
+
:param retries: Override the default retry configuration for this method
|
|
29
|
+
:param server_url: Override the default server URL for this method
|
|
30
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
31
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
32
|
+
"""
|
|
33
|
+
base_url = None
|
|
34
|
+
url_variables = None
|
|
35
|
+
if timeout_ms is None:
|
|
36
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
37
|
+
|
|
38
|
+
if server_url is not None:
|
|
39
|
+
base_url = server_url
|
|
40
|
+
else:
|
|
41
|
+
base_url = self._get_url(base_url, url_variables)
|
|
42
|
+
|
|
43
|
+
request = models.LoginInfo(
|
|
44
|
+
username=username,
|
|
45
|
+
password=password,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
req = self._build_request(
|
|
49
|
+
method="POST",
|
|
50
|
+
path="/auth/login",
|
|
51
|
+
base_url=base_url,
|
|
52
|
+
url_variables=url_variables,
|
|
53
|
+
request=request,
|
|
54
|
+
request_body_required=True,
|
|
55
|
+
request_has_path_params=False,
|
|
56
|
+
request_has_query_params=False,
|
|
57
|
+
user_agent_header="user-agent",
|
|
58
|
+
accept_header_value="application/json",
|
|
59
|
+
http_headers=http_headers,
|
|
60
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
61
|
+
request, False, False, "json", models.LoginInfo
|
|
62
|
+
),
|
|
63
|
+
timeout_ms=timeout_ms,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if retries == UNSET:
|
|
67
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
68
|
+
retries = self.sdk_configuration.retry_config
|
|
69
|
+
|
|
70
|
+
retry_config = None
|
|
71
|
+
if isinstance(retries, utils.RetryConfig):
|
|
72
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
73
|
+
|
|
74
|
+
http_res = self.do_request(
|
|
75
|
+
hook_ctx=HookContext(
|
|
76
|
+
config=self.sdk_configuration,
|
|
77
|
+
base_url=base_url or "",
|
|
78
|
+
operation_id="login",
|
|
79
|
+
oauth2_scopes=[],
|
|
80
|
+
security_source=None,
|
|
81
|
+
),
|
|
82
|
+
request=req,
|
|
83
|
+
error_status_codes=["401", "403", "429", "4XX", "5XX"],
|
|
84
|
+
retry_config=retry_config,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
88
|
+
return unmarshal_json_response(models.AuthToken, http_res)
|
|
89
|
+
if utils.match_response(http_res, ["401", "403", "429", "4XX"], "*"):
|
|
90
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
91
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
92
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
93
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
95
|
+
|
|
96
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
97
|
+
|
|
98
|
+
async def get_async(
|
|
99
|
+
self,
|
|
100
|
+
*,
|
|
101
|
+
username: str,
|
|
102
|
+
password: str,
|
|
103
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
104
|
+
server_url: Optional[str] = None,
|
|
105
|
+
timeout_ms: Optional[int] = None,
|
|
106
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
107
|
+
) -> models.AuthToken:
|
|
108
|
+
r"""Log in and fetch an authentication token
|
|
109
|
+
|
|
110
|
+
This endpoint is unavailable on Cribl.Cloud. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
|
|
111
|
+
|
|
112
|
+
:param username:
|
|
113
|
+
:param password:
|
|
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.LoginInfo(
|
|
130
|
+
username=username,
|
|
131
|
+
password=password,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
req = self._build_request_async(
|
|
135
|
+
method="POST",
|
|
136
|
+
path="/auth/login",
|
|
137
|
+
base_url=base_url,
|
|
138
|
+
url_variables=url_variables,
|
|
139
|
+
request=request,
|
|
140
|
+
request_body_required=True,
|
|
141
|
+
request_has_path_params=False,
|
|
142
|
+
request_has_query_params=False,
|
|
143
|
+
user_agent_header="user-agent",
|
|
144
|
+
accept_header_value="application/json",
|
|
145
|
+
http_headers=http_headers,
|
|
146
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
147
|
+
request, False, False, "json", models.LoginInfo
|
|
148
|
+
),
|
|
149
|
+
timeout_ms=timeout_ms,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
if retries == UNSET:
|
|
153
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
154
|
+
retries = self.sdk_configuration.retry_config
|
|
155
|
+
|
|
156
|
+
retry_config = None
|
|
157
|
+
if isinstance(retries, utils.RetryConfig):
|
|
158
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
159
|
+
|
|
160
|
+
http_res = await self.do_request_async(
|
|
161
|
+
hook_ctx=HookContext(
|
|
162
|
+
config=self.sdk_configuration,
|
|
163
|
+
base_url=base_url or "",
|
|
164
|
+
operation_id="login",
|
|
165
|
+
oauth2_scopes=[],
|
|
166
|
+
security_source=None,
|
|
167
|
+
),
|
|
168
|
+
request=req,
|
|
169
|
+
error_status_codes=["401", "403", "429", "4XX", "5XX"],
|
|
170
|
+
retry_config=retry_config,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
174
|
+
return unmarshal_json_response(models.AuthToken, http_res)
|
|
175
|
+
if utils.match_response(http_res, ["401", "403", "429", "4XX"], "*"):
|
|
176
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
177
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
178
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
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
|
+
|
|
182
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
from importlib import import_module
|
|
5
|
+
import builtins
|
|
5
6
|
|
|
6
7
|
if TYPE_CHECKING:
|
|
7
8
|
from .annotations import get_discriminator
|
|
@@ -183,5 +184,5 @@ def __getattr__(attr_name: str) -> object:
|
|
|
183
184
|
|
|
184
185
|
|
|
185
186
|
def __dir__():
|
|
186
|
-
lazy_attrs = list(_dynamic_imports.keys())
|
|
187
|
-
return sorted(lazy_attrs)
|
|
187
|
+
lazy_attrs = builtins.list(_dynamic_imports.keys())
|
|
188
|
+
return builtins.sorted(lazy_attrs)
|
|
@@ -82,6 +82,11 @@ def get_security_from_env(security: Any, security_class: Any) -> Optional[BaseMo
|
|
|
82
82
|
"CRIBLCONTROLPLANE_TOKEN_URL"
|
|
83
83
|
)
|
|
84
84
|
|
|
85
|
+
if os.getenv("CRIBLCONTROLPLANE_AUDIENCE"):
|
|
86
|
+
security_dict.setdefault("client_oauth", {})["audience"] = os.getenv(
|
|
87
|
+
"CRIBLCONTROLPLANE_AUDIENCE"
|
|
88
|
+
)
|
|
89
|
+
|
|
85
90
|
return security_class(**security_dict) if security_dict else None
|
|
86
91
|
|
|
87
92
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from .sdkconfiguration import SDKConfiguration
|
|
5
|
+
from cribl_control_plane.branches import Branches
|
|
6
|
+
from cribl_control_plane.commits import Commits
|
|
7
|
+
from cribl_control_plane.statuses import Statuses
|
|
8
|
+
from cribl_control_plane.versions_configs import VersionsConfigs
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Versions(BaseSDK):
|
|
12
|
+
branches: Branches
|
|
13
|
+
commits: Commits
|
|
14
|
+
configs: VersionsConfigs
|
|
15
|
+
statuses: Statuses
|
|
16
|
+
|
|
17
|
+
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
18
|
+
BaseSDK.__init__(self, sdk_config)
|
|
19
|
+
self.sdk_configuration = sdk_config
|
|
20
|
+
self._init_sdks()
|
|
21
|
+
|
|
22
|
+
def _init_sdks(self):
|
|
23
|
+
self.branches = Branches(self.sdk_configuration)
|
|
24
|
+
self.commits = Commits(self.sdk_configuration)
|
|
25
|
+
self.configs = VersionsConfigs(self.sdk_configuration)
|
|
26
|
+
self.statuses = Statuses(self.sdk_configuration)
|
|
@@ -0,0 +1,171 @@
|
|
|
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, Mapping, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VersionsConfigs(BaseSDK):
|
|
13
|
+
def get(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
|
+
server_url: Optional[str] = None,
|
|
18
|
+
timeout_ms: Optional[int] = None,
|
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
+
) -> models.GetVersionInfoResponse:
|
|
21
|
+
r"""Retrieve the configuration and status for the Git integration
|
|
22
|
+
|
|
23
|
+
Get info about versioning availability
|
|
24
|
+
|
|
25
|
+
:param retries: Override the default retry configuration for this method
|
|
26
|
+
:param server_url: Override the default server URL for this method
|
|
27
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
28
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
29
|
+
"""
|
|
30
|
+
base_url = None
|
|
31
|
+
url_variables = None
|
|
32
|
+
if timeout_ms is None:
|
|
33
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
34
|
+
|
|
35
|
+
if server_url is not None:
|
|
36
|
+
base_url = server_url
|
|
37
|
+
else:
|
|
38
|
+
base_url = self._get_url(base_url, url_variables)
|
|
39
|
+
req = self._build_request(
|
|
40
|
+
method="GET",
|
|
41
|
+
path="/version/info",
|
|
42
|
+
base_url=base_url,
|
|
43
|
+
url_variables=url_variables,
|
|
44
|
+
request=None,
|
|
45
|
+
request_body_required=False,
|
|
46
|
+
request_has_path_params=False,
|
|
47
|
+
request_has_query_params=True,
|
|
48
|
+
user_agent_header="user-agent",
|
|
49
|
+
accept_header_value="application/json",
|
|
50
|
+
http_headers=http_headers,
|
|
51
|
+
security=self.sdk_configuration.security,
|
|
52
|
+
timeout_ms=timeout_ms,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
if retries == UNSET:
|
|
56
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
57
|
+
retries = self.sdk_configuration.retry_config
|
|
58
|
+
|
|
59
|
+
retry_config = None
|
|
60
|
+
if isinstance(retries, utils.RetryConfig):
|
|
61
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
62
|
+
|
|
63
|
+
http_res = self.do_request(
|
|
64
|
+
hook_ctx=HookContext(
|
|
65
|
+
config=self.sdk_configuration,
|
|
66
|
+
base_url=base_url or "",
|
|
67
|
+
operation_id="getVersionInfo",
|
|
68
|
+
oauth2_scopes=[],
|
|
69
|
+
security_source=get_security_from_env(
|
|
70
|
+
self.sdk_configuration.security, models.Security
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
request=req,
|
|
74
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
75
|
+
retry_config=retry_config,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
response_data: Any = None
|
|
79
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
80
|
+
return unmarshal_json_response(models.GetVersionInfoResponse, http_res)
|
|
81
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
82
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
83
|
+
raise errors.Error(response_data, http_res)
|
|
84
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
85
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
86
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
87
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
88
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
89
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
90
|
+
|
|
91
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
92
|
+
|
|
93
|
+
async def get_async(
|
|
94
|
+
self,
|
|
95
|
+
*,
|
|
96
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
97
|
+
server_url: Optional[str] = None,
|
|
98
|
+
timeout_ms: Optional[int] = None,
|
|
99
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
100
|
+
) -> models.GetVersionInfoResponse:
|
|
101
|
+
r"""Retrieve the configuration and status for the Git integration
|
|
102
|
+
|
|
103
|
+
Get info about versioning availability
|
|
104
|
+
|
|
105
|
+
:param retries: Override the default retry configuration for this method
|
|
106
|
+
:param server_url: Override the default server URL for this method
|
|
107
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
108
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
109
|
+
"""
|
|
110
|
+
base_url = None
|
|
111
|
+
url_variables = None
|
|
112
|
+
if timeout_ms is None:
|
|
113
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
114
|
+
|
|
115
|
+
if server_url is not None:
|
|
116
|
+
base_url = server_url
|
|
117
|
+
else:
|
|
118
|
+
base_url = self._get_url(base_url, url_variables)
|
|
119
|
+
req = self._build_request_async(
|
|
120
|
+
method="GET",
|
|
121
|
+
path="/version/info",
|
|
122
|
+
base_url=base_url,
|
|
123
|
+
url_variables=url_variables,
|
|
124
|
+
request=None,
|
|
125
|
+
request_body_required=False,
|
|
126
|
+
request_has_path_params=False,
|
|
127
|
+
request_has_query_params=True,
|
|
128
|
+
user_agent_header="user-agent",
|
|
129
|
+
accept_header_value="application/json",
|
|
130
|
+
http_headers=http_headers,
|
|
131
|
+
security=self.sdk_configuration.security,
|
|
132
|
+
timeout_ms=timeout_ms,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
if retries == UNSET:
|
|
136
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
137
|
+
retries = self.sdk_configuration.retry_config
|
|
138
|
+
|
|
139
|
+
retry_config = None
|
|
140
|
+
if isinstance(retries, utils.RetryConfig):
|
|
141
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
142
|
+
|
|
143
|
+
http_res = await self.do_request_async(
|
|
144
|
+
hook_ctx=HookContext(
|
|
145
|
+
config=self.sdk_configuration,
|
|
146
|
+
base_url=base_url or "",
|
|
147
|
+
operation_id="getVersionInfo",
|
|
148
|
+
oauth2_scopes=[],
|
|
149
|
+
security_source=get_security_from_env(
|
|
150
|
+
self.sdk_configuration.security, models.Security
|
|
151
|
+
),
|
|
152
|
+
),
|
|
153
|
+
request=req,
|
|
154
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
155
|
+
retry_config=retry_config,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response_data: Any = None
|
|
159
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
160
|
+
return unmarshal_json_response(models.GetVersionInfoResponse, http_res)
|
|
161
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
162
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
163
|
+
raise errors.Error(response_data, http_res)
|
|
164
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
165
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
166
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
167
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
168
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
169
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
170
|
+
|
|
171
|
+
raise errors.APIError("Unexpected response received", http_res)
|