cribl-control-plane 0.1.0b2__py3-none-any.whl → 0.1.1rc1__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 +91 -41
- cribl_control_plane/_version.py +4 -4
- cribl_control_plane/errors/apierror.py +1 -1
- cribl_control_plane/errors/criblcontrolplaneerror.py +1 -1
- cribl_control_plane/errors/error.py +1 -1
- cribl_control_plane/errors/healthstatus_error.py +1 -1
- cribl_control_plane/errors/no_response_error.py +1 -1
- cribl_control_plane/errors/responsevalidationerror.py +1 -1
- cribl_control_plane/httpclient.py +0 -1
- cribl_control_plane/lakedatasets.py +12 -12
- cribl_control_plane/models/__init__.py +89 -7
- cribl_control_plane/models/createversionundoop.py +3 -3
- cribl_control_plane/models/cribllakedatasetupdate.py +81 -0
- cribl_control_plane/models/distributedsummary.py +6 -0
- cribl_control_plane/models/gitinfo.py +14 -3
- cribl_control_plane/models/input.py +65 -63
- cribl_control_plane/models/inputappscope.py +4 -0
- cribl_control_plane/models/inputazureblob.py +4 -0
- cribl_control_plane/models/inputcollection.py +4 -0
- cribl_control_plane/models/inputconfluentcloud.py +8 -0
- cribl_control_plane/models/inputcribl.py +4 -0
- cribl_control_plane/models/inputcriblhttp.py +4 -0
- cribl_control_plane/models/inputcribllakehttp.py +4 -0
- cribl_control_plane/models/inputcriblmetrics.py +4 -0
- cribl_control_plane/models/inputcribltcp.py +4 -0
- cribl_control_plane/models/inputcrowdstrike.py +7 -0
- cribl_control_plane/models/inputdatadogagent.py +4 -0
- cribl_control_plane/models/inputdatagen.py +4 -0
- cribl_control_plane/models/inputedgeprometheus.py +12 -0
- cribl_control_plane/models/inputelastic.py +11 -0
- cribl_control_plane/models/inputeventhub.py +6 -0
- cribl_control_plane/models/inputexec.py +4 -0
- cribl_control_plane/models/inputfile.py +6 -0
- cribl_control_plane/models/inputfirehose.py +4 -0
- cribl_control_plane/models/inputgooglepubsub.py +7 -0
- cribl_control_plane/models/inputgrafana.py +8 -0
- cribl_control_plane/models/inputhttp.py +4 -0
- cribl_control_plane/models/inputhttpraw.py +4 -0
- cribl_control_plane/models/inputjournalfiles.py +4 -0
- cribl_control_plane/models/inputkafka.py +8 -0
- cribl_control_plane/models/inputkinesis.py +15 -0
- cribl_control_plane/models/inputkubeevents.py +4 -0
- cribl_control_plane/models/inputkubelogs.py +4 -0
- cribl_control_plane/models/inputkubemetrics.py +4 -0
- cribl_control_plane/models/inputloki.py +4 -0
- cribl_control_plane/models/inputmetrics.py +4 -0
- cribl_control_plane/models/inputmodeldriventelemetry.py +4 -0
- cribl_control_plane/models/inputmsk.py +7 -0
- cribl_control_plane/models/inputnetflow.py +4 -0
- cribl_control_plane/models/inputoffice365mgmt.py +11 -0
- cribl_control_plane/models/inputoffice365msgtrace.py +11 -0
- cribl_control_plane/models/inputoffice365service.py +11 -0
- cribl_control_plane/models/inputopentelemetry.py +8 -0
- cribl_control_plane/models/inputprometheus.py +10 -0
- cribl_control_plane/models/inputprometheusrw.py +4 -0
- cribl_control_plane/models/inputrawudp.py +4 -0
- cribl_control_plane/models/inputs3.py +7 -0
- cribl_control_plane/models/inputs3inventory.py +7 -0
- cribl_control_plane/models/inputsecuritylake.py +7 -0
- cribl_control_plane/models/inputsnmp.py +11 -0
- cribl_control_plane/models/inputsplunk.py +9 -0
- cribl_control_plane/models/inputsplunkhec.py +4 -0
- cribl_control_plane/models/inputsplunksearch.py +7 -0
- cribl_control_plane/models/inputsqs.py +17 -10
- cribl_control_plane/models/inputsyslog.py +8 -0
- cribl_control_plane/models/inputsystemmetrics.py +32 -0
- cribl_control_plane/models/inputsystemstate.py +4 -0
- cribl_control_plane/models/inputtcp.py +4 -0
- cribl_control_plane/models/inputtcpjson.py +4 -0
- cribl_control_plane/models/inputwef.py +6 -0
- cribl_control_plane/models/inputwindowsmetrics.py +28 -0
- cribl_control_plane/models/inputwineventlogs.py +8 -0
- cribl_control_plane/models/inputwiz.py +7 -0
- cribl_control_plane/models/inputwizwebhook.py +4 -0
- cribl_control_plane/models/inputzscalerhec.py +4 -0
- cribl_control_plane/models/jobinfo.py +4 -1
- cribl_control_plane/models/nodeprovidedinfo.py +4 -1
- cribl_control_plane/models/output.py +74 -69
- cribl_control_plane/models/outputazureblob.py +20 -0
- cribl_control_plane/models/outputazuredataexplorer.py +28 -0
- cribl_control_plane/models/outputazureeventhub.py +17 -0
- cribl_control_plane/models/outputazurelogs.py +13 -0
- cribl_control_plane/models/outputchronicle.py +444 -0
- cribl_control_plane/models/outputclickhouse.py +17 -0
- cribl_control_plane/models/outputcloudwatch.py +13 -0
- cribl_control_plane/models/outputconfluentcloud.py +24 -0
- cribl_control_plane/models/outputcriblhttp.py +15 -0
- cribl_control_plane/models/outputcribllake.py +21 -0
- cribl_control_plane/models/outputcribltcp.py +12 -0
- cribl_control_plane/models/outputcrowdstrikenextgensiem.py +15 -0
- cribl_control_plane/models/outputdatabricks.py +9 -0
- cribl_control_plane/models/outputdatadog.py +30 -0
- cribl_control_plane/models/outputdataset.py +23 -0
- cribl_control_plane/models/outputdls3.py +35 -0
- cribl_control_plane/models/outputdynatracehttp.py +22 -0
- cribl_control_plane/models/outputdynatraceotlp.py +22 -0
- cribl_control_plane/models/outputelastic.py +18 -0
- cribl_control_plane/models/outputelasticcloud.py +13 -0
- cribl_control_plane/models/outputexabeam.py +14 -0
- cribl_control_plane/models/outputfilesystem.py +15 -0
- cribl_control_plane/models/outputgooglechronicle.py +26 -4
- cribl_control_plane/models/outputgooglecloudlogging.py +28 -4
- cribl_control_plane/models/outputgooglecloudstorage.py +28 -0
- cribl_control_plane/models/outputgooglepubsub.py +13 -0
- cribl_control_plane/models/outputgrafanacloud.py +50 -0
- cribl_control_plane/models/outputgraphite.py +12 -0
- cribl_control_plane/models/outputhoneycomb.py +13 -0
- cribl_control_plane/models/outputhumiohec.py +15 -0
- cribl_control_plane/models/outputinfluxdb.py +19 -0
- cribl_control_plane/models/outputkafka.py +24 -0
- cribl_control_plane/models/outputkinesis.py +15 -0
- cribl_control_plane/models/outputloki.py +20 -0
- cribl_control_plane/models/outputminio.py +28 -0
- cribl_control_plane/models/outputmsk.py +23 -0
- cribl_control_plane/models/outputnewrelic.py +16 -0
- cribl_control_plane/models/outputnewrelicevents.py +16 -0
- cribl_control_plane/models/outputopentelemetry.py +22 -0
- cribl_control_plane/models/outputprometheus.py +13 -0
- cribl_control_plane/models/outputring.py +2 -0
- cribl_control_plane/models/outputs3.py +35 -0
- cribl_control_plane/models/outputsecuritylake.py +29 -0
- cribl_control_plane/models/outputsentinel.py +15 -0
- cribl_control_plane/models/outputsentineloneaisiem.py +13 -0
- cribl_control_plane/models/outputservicenow.py +21 -0
- cribl_control_plane/models/outputsignalfx.py +13 -0
- cribl_control_plane/models/outputsns.py +13 -0
- cribl_control_plane/models/outputsplunk.py +15 -0
- cribl_control_plane/models/outputsplunkhec.py +13 -0
- cribl_control_plane/models/outputsplunklb.py +15 -0
- cribl_control_plane/models/outputsqs.py +23 -10
- cribl_control_plane/models/outputstatsd.py +12 -0
- cribl_control_plane/models/outputstatsdext.py +12 -0
- cribl_control_plane/models/outputsumologic.py +15 -0
- cribl_control_plane/models/outputsyslog.py +24 -0
- cribl_control_plane/models/outputtcpjson.py +12 -0
- cribl_control_plane/models/outputwavefront.py +13 -0
- cribl_control_plane/models/outputwebhook.py +23 -0
- cribl_control_plane/models/outputxsiam.py +13 -0
- cribl_control_plane/models/packinfo.py +3 -0
- cribl_control_plane/models/packinstallinfo.py +3 -0
- cribl_control_plane/models/runnablejobcollection.py +4 -0
- cribl_control_plane/models/updatecribllakedatasetbylakeidandidop.py +9 -5
- cribl_control_plane/models/updatepacksop.py +27 -0
- cribl_control_plane/models/uploadpackresponse.py +13 -0
- cribl_control_plane/packs.py +196 -1
- {cribl_control_plane-0.1.0b2.dist-info → cribl_control_plane-0.1.1rc1.dist-info}/METADATA +47 -13
- {cribl_control_plane-0.1.0b2.dist-info → cribl_control_plane-0.1.1rc1.dist-info}/RECORD +148 -144
- {cribl_control_plane-0.1.0b2.dist-info → cribl_control_plane-0.1.1rc1.dist-info}/WHEEL +0 -0
|
@@ -26,9 +26,13 @@ class OutputWebhookMethod(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
|
26
26
|
class OutputWebhookFormat(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
27
27
|
r"""How to format events before sending out"""
|
|
28
28
|
|
|
29
|
+
# NDJSON (Newline Delimited JSON)
|
|
29
30
|
NDJSON = "ndjson"
|
|
31
|
+
# JSON Array
|
|
30
32
|
JSON_ARRAY = "json_array"
|
|
33
|
+
# Custom
|
|
31
34
|
CUSTOM = "custom"
|
|
35
|
+
# Advanced
|
|
32
36
|
ADVANCED = "advanced"
|
|
33
37
|
|
|
34
38
|
|
|
@@ -46,8 +50,11 @@ class OutputWebhookExtraHTTPHeader(BaseModel):
|
|
|
46
50
|
class OutputWebhookFailedRequestLoggingMode(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
47
51
|
r"""Data to log when a request fails. All headers are redacted by default, unless listed as safe headers below."""
|
|
48
52
|
|
|
53
|
+
# Payload
|
|
49
54
|
PAYLOAD = "payload"
|
|
55
|
+
# Payload + Headers
|
|
50
56
|
PAYLOAD_AND_HEADERS = "payloadAndHeaders"
|
|
57
|
+
# None
|
|
51
58
|
NONE = "none"
|
|
52
59
|
|
|
53
60
|
|
|
@@ -108,19 +115,28 @@ class OutputWebhookTimeoutRetrySettings(BaseModel):
|
|
|
108
115
|
class OutputWebhookBackpressureBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
109
116
|
r"""How to handle events when all receivers are exerting backpressure"""
|
|
110
117
|
|
|
118
|
+
# Block
|
|
111
119
|
BLOCK = "block"
|
|
120
|
+
# Drop
|
|
112
121
|
DROP = "drop"
|
|
122
|
+
# Persistent Queue
|
|
113
123
|
QUEUE = "queue"
|
|
114
124
|
|
|
115
125
|
|
|
116
126
|
class OutputWebhookAuthenticationType(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
117
127
|
r"""Authentication method to use for the HTTP request"""
|
|
118
128
|
|
|
129
|
+
# None
|
|
119
130
|
NONE = "none"
|
|
131
|
+
# Basic
|
|
120
132
|
BASIC = "basic"
|
|
133
|
+
# Basic (credentials secret)
|
|
121
134
|
CREDENTIALS_SECRET = "credentialsSecret"
|
|
135
|
+
# Token
|
|
122
136
|
TOKEN = "token"
|
|
137
|
+
# Token (text secret)
|
|
123
138
|
TEXT_SECRET = "textSecret"
|
|
139
|
+
# OAuth
|
|
124
140
|
OAUTH = "oauth"
|
|
125
141
|
|
|
126
142
|
|
|
@@ -199,22 +215,29 @@ class OutputWebhookTLSSettingsClientSide(BaseModel):
|
|
|
199
215
|
class OutputWebhookCompression(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
200
216
|
r"""Codec to use to compress the persisted data"""
|
|
201
217
|
|
|
218
|
+
# None
|
|
202
219
|
NONE = "none"
|
|
220
|
+
# Gzip
|
|
203
221
|
GZIP = "gzip"
|
|
204
222
|
|
|
205
223
|
|
|
206
224
|
class OutputWebhookQueueFullBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
207
225
|
r"""How to handle events when the queue is exerting backpressure (full capacity or low disk). 'Block' is the same behavior as non-PQ blocking. 'Drop new data' throws away incoming data, while leaving the contents of the PQ unchanged."""
|
|
208
226
|
|
|
227
|
+
# Block
|
|
209
228
|
BLOCK = "block"
|
|
229
|
+
# Drop new data
|
|
210
230
|
DROP = "drop"
|
|
211
231
|
|
|
212
232
|
|
|
213
233
|
class OutputWebhookMode(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
214
234
|
r"""In Error mode, PQ writes events to the filesystem if the Destination is unavailable. In Backpressure mode, PQ writes events to the filesystem when it detects backpressure from the Destination. In Always On mode, PQ always writes events to the filesystem."""
|
|
215
235
|
|
|
236
|
+
# Error
|
|
216
237
|
ERROR = "error"
|
|
238
|
+
# Backpressure
|
|
217
239
|
BACKPRESSURE = "backpressure"
|
|
240
|
+
# Always On
|
|
218
241
|
ALWAYS = "always"
|
|
219
242
|
|
|
220
243
|
|
|
@@ -29,8 +29,11 @@ class OutputXsiamExtraHTTPHeader(BaseModel):
|
|
|
29
29
|
class OutputXsiamFailedRequestLoggingMode(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
30
30
|
r"""Data to log when a request fails. All headers are redacted by default, unless listed as safe headers below."""
|
|
31
31
|
|
|
32
|
+
# Payload
|
|
32
33
|
PAYLOAD = "payload"
|
|
34
|
+
# Payload + Headers
|
|
33
35
|
PAYLOAD_AND_HEADERS = "payloadAndHeaders"
|
|
36
|
+
# None
|
|
34
37
|
NONE = "none"
|
|
35
38
|
|
|
36
39
|
|
|
@@ -98,8 +101,11 @@ class OutputXsiamTimeoutRetrySettings(BaseModel):
|
|
|
98
101
|
class OutputXsiamBackpressureBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
99
102
|
r"""How to handle events when all receivers are exerting backpressure"""
|
|
100
103
|
|
|
104
|
+
# Block
|
|
101
105
|
BLOCK = "block"
|
|
106
|
+
# Drop
|
|
102
107
|
DROP = "drop"
|
|
108
|
+
# Persistent Queue
|
|
103
109
|
QUEUE = "queue"
|
|
104
110
|
|
|
105
111
|
|
|
@@ -119,22 +125,29 @@ class OutputXsiamURL(BaseModel):
|
|
|
119
125
|
class OutputXsiamCompression(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
120
126
|
r"""Codec to use to compress the persisted data"""
|
|
121
127
|
|
|
128
|
+
# None
|
|
122
129
|
NONE = "none"
|
|
130
|
+
# Gzip
|
|
123
131
|
GZIP = "gzip"
|
|
124
132
|
|
|
125
133
|
|
|
126
134
|
class OutputXsiamQueueFullBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
127
135
|
r"""How to handle events when the queue is exerting backpressure (full capacity or low disk). 'Block' is the same behavior as non-PQ blocking. 'Drop new data' throws away incoming data, while leaving the contents of the PQ unchanged."""
|
|
128
136
|
|
|
137
|
+
# Block
|
|
129
138
|
BLOCK = "block"
|
|
139
|
+
# Drop new data
|
|
130
140
|
DROP = "drop"
|
|
131
141
|
|
|
132
142
|
|
|
133
143
|
class OutputXsiamMode(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
134
144
|
r"""In Error mode, PQ writes events to the filesystem if the Destination is unavailable. In Backpressure mode, PQ writes events to the filesystem when it detects backpressure from the Destination. In Always On mode, PQ always writes events to the filesystem."""
|
|
135
145
|
|
|
146
|
+
# Error
|
|
136
147
|
ERROR = "error"
|
|
148
|
+
# Backpressure
|
|
137
149
|
BACKPRESSURE = "backpressure"
|
|
150
|
+
# Always On
|
|
138
151
|
ALWAYS = "always"
|
|
139
152
|
|
|
140
153
|
|
|
@@ -28,6 +28,7 @@ class PackInfoTypedDict(TypedDict):
|
|
|
28
28
|
id: str
|
|
29
29
|
source: str
|
|
30
30
|
author: NotRequired[str]
|
|
31
|
+
dependencies: NotRequired[Dict[str, str]]
|
|
31
32
|
description: NotRequired[str]
|
|
32
33
|
display_name: NotRequired[str]
|
|
33
34
|
exports: NotRequired[List[str]]
|
|
@@ -48,6 +49,8 @@ class PackInfo(BaseModel):
|
|
|
48
49
|
|
|
49
50
|
author: Optional[str] = None
|
|
50
51
|
|
|
52
|
+
dependencies: Optional[Dict[str, str]] = None
|
|
53
|
+
|
|
51
54
|
description: Optional[str] = None
|
|
52
55
|
|
|
53
56
|
display_name: Annotated[Optional[str], pydantic.Field(alias="displayName")] = None
|
|
@@ -28,6 +28,7 @@ class PackInstallInfoTypedDict(TypedDict):
|
|
|
28
28
|
id: str
|
|
29
29
|
source: str
|
|
30
30
|
author: NotRequired[str]
|
|
31
|
+
dependencies: NotRequired[Dict[str, str]]
|
|
31
32
|
description: NotRequired[str]
|
|
32
33
|
display_name: NotRequired[str]
|
|
33
34
|
exports: NotRequired[List[str]]
|
|
@@ -49,6 +50,8 @@ class PackInstallInfo(BaseModel):
|
|
|
49
50
|
|
|
50
51
|
author: Optional[str] = None
|
|
51
52
|
|
|
53
|
+
dependencies: Optional[Dict[str, str]] = None
|
|
54
|
+
|
|
52
55
|
description: Optional[str] = None
|
|
53
56
|
|
|
54
57
|
display_name: Annotated[Optional[str], pydantic.Field(alias="displayName")] = None
|
|
@@ -363,9 +363,13 @@ class RunnableJobCollectionTimeWarning(BaseModel):
|
|
|
363
363
|
|
|
364
364
|
|
|
365
365
|
class WhereToCapture(int, Enum, metaclass=utils.OpenEnumMeta):
|
|
366
|
+
# 1. Before pre-processing Pipeline
|
|
366
367
|
ZERO = 0
|
|
368
|
+
# 2. Before the Routes
|
|
367
369
|
ONE = 1
|
|
370
|
+
# 3. Before post-processing Pipeline
|
|
368
371
|
TWO = 2
|
|
372
|
+
# 4. Before the Destination
|
|
369
373
|
THREE = 3
|
|
370
374
|
|
|
371
375
|
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .cribllakedataset import CriblLakeDataset, CriblLakeDatasetTypedDict
|
|
5
|
+
from .cribllakedatasetupdate import (
|
|
6
|
+
CriblLakeDatasetUpdate,
|
|
7
|
+
CriblLakeDatasetUpdateTypedDict,
|
|
8
|
+
)
|
|
5
9
|
from cribl_control_plane.types import BaseModel
|
|
6
10
|
from cribl_control_plane.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
7
11
|
import pydantic
|
|
@@ -14,8 +18,8 @@ class UpdateCriblLakeDatasetByLakeIDAndIDRequestTypedDict(TypedDict):
|
|
|
14
18
|
r"""The <code>id</code> of the Lake that contains the Lake Dataset to update."""
|
|
15
19
|
id_param: str
|
|
16
20
|
r"""The <code>id</code> of the Lake Dataset to update."""
|
|
17
|
-
|
|
18
|
-
r"""
|
|
21
|
+
cribl_lake_dataset_update: CriblLakeDatasetUpdateTypedDict
|
|
22
|
+
r"""CriblLakeDatasetUpdate object"""
|
|
19
23
|
|
|
20
24
|
|
|
21
25
|
class UpdateCriblLakeDatasetByLakeIDAndIDRequest(BaseModel):
|
|
@@ -33,11 +37,11 @@ class UpdateCriblLakeDatasetByLakeIDAndIDRequest(BaseModel):
|
|
|
33
37
|
]
|
|
34
38
|
r"""The <code>id</code> of the Lake Dataset to update."""
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
cribl_lake_dataset_update: Annotated[
|
|
41
|
+
CriblLakeDatasetUpdate,
|
|
38
42
|
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
39
43
|
]
|
|
40
|
-
r"""
|
|
44
|
+
r"""CriblLakeDatasetUpdate object"""
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
class UpdateCriblLakeDatasetByLakeIDAndIDResponseTypedDict(TypedDict):
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from cribl_control_plane.types import BaseModel
|
|
5
|
+
from cribl_control_plane.utils import FieldMetadata, QueryParamMetadata
|
|
6
|
+
import io
|
|
7
|
+
from typing import IO, Union
|
|
8
|
+
from typing_extensions import Annotated, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UpdatePacksRequestTypedDict(TypedDict):
|
|
12
|
+
filename: str
|
|
13
|
+
r"""Filename of the pack file to upload"""
|
|
14
|
+
request_body: Union[bytes, IO[bytes], io.BufferedReader]
|
|
15
|
+
r"""Binary file content"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class UpdatePacksRequest(BaseModel):
|
|
19
|
+
filename: Annotated[
|
|
20
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
21
|
+
]
|
|
22
|
+
r"""Filename of the pack file to upload"""
|
|
23
|
+
|
|
24
|
+
request_body: Annotated[
|
|
25
|
+
Union[bytes, IO[bytes], io.BufferedReader], FieldMetadata(request=True)
|
|
26
|
+
]
|
|
27
|
+
r"""Binary file content"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from cribl_control_plane.types import BaseModel
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UploadPackResponseTypedDict(TypedDict):
|
|
9
|
+
source: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class UploadPackResponse(BaseModel):
|
|
13
|
+
source: str
|
cribl_control_plane/packs.py
CHANGED
|
@@ -6,7 +6,8 @@ from cribl_control_plane._hooks import HookContext
|
|
|
6
6
|
from cribl_control_plane.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from cribl_control_plane.utils import get_security_from_env
|
|
8
8
|
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
-
|
|
9
|
+
import io
|
|
10
|
+
from typing import Any, IO, Mapping, Optional, Union, cast
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class Packs(BaseSDK):
|
|
@@ -370,6 +371,200 @@ class Packs(BaseSDK):
|
|
|
370
371
|
|
|
371
372
|
raise errors.APIError("Unexpected response received", http_res)
|
|
372
373
|
|
|
374
|
+
def upload(
|
|
375
|
+
self,
|
|
376
|
+
*,
|
|
377
|
+
filename: str,
|
|
378
|
+
request_body: Union[bytes, IO[bytes], io.BufferedReader],
|
|
379
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
380
|
+
server_url: Optional[str] = None,
|
|
381
|
+
timeout_ms: Optional[int] = None,
|
|
382
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
383
|
+
) -> models.UploadPackResponse:
|
|
384
|
+
r"""Upload a Pack file
|
|
385
|
+
|
|
386
|
+
Upload a Pack file for import. Returns a source identifier that must be used in the subsequent import POST request to complete the pack installation.
|
|
387
|
+
|
|
388
|
+
:param filename: Filename of the pack file to upload
|
|
389
|
+
:param request_body: Binary file content
|
|
390
|
+
:param retries: Override the default retry configuration for this method
|
|
391
|
+
:param server_url: Override the default server URL for this method
|
|
392
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
393
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
394
|
+
"""
|
|
395
|
+
base_url = None
|
|
396
|
+
url_variables = None
|
|
397
|
+
if timeout_ms is None:
|
|
398
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
399
|
+
|
|
400
|
+
if server_url is not None:
|
|
401
|
+
base_url = server_url
|
|
402
|
+
else:
|
|
403
|
+
base_url = self._get_url(base_url, url_variables)
|
|
404
|
+
|
|
405
|
+
request = models.UpdatePacksRequest(
|
|
406
|
+
filename=filename,
|
|
407
|
+
request_body=request_body,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
req = self._build_request(
|
|
411
|
+
method="PUT",
|
|
412
|
+
path="/packs",
|
|
413
|
+
base_url=base_url,
|
|
414
|
+
url_variables=url_variables,
|
|
415
|
+
request=request,
|
|
416
|
+
request_body_required=True,
|
|
417
|
+
request_has_path_params=False,
|
|
418
|
+
request_has_query_params=True,
|
|
419
|
+
user_agent_header="user-agent",
|
|
420
|
+
accept_header_value="application/json",
|
|
421
|
+
http_headers=http_headers,
|
|
422
|
+
security=self.sdk_configuration.security,
|
|
423
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
424
|
+
request.request_body,
|
|
425
|
+
False,
|
|
426
|
+
False,
|
|
427
|
+
"raw",
|
|
428
|
+
Union[bytes, IO[bytes], io.BufferedReader],
|
|
429
|
+
),
|
|
430
|
+
timeout_ms=timeout_ms,
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
if retries == UNSET:
|
|
434
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
435
|
+
retries = self.sdk_configuration.retry_config
|
|
436
|
+
|
|
437
|
+
retry_config = None
|
|
438
|
+
if isinstance(retries, utils.RetryConfig):
|
|
439
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
440
|
+
|
|
441
|
+
http_res = self.do_request(
|
|
442
|
+
hook_ctx=HookContext(
|
|
443
|
+
config=self.sdk_configuration,
|
|
444
|
+
base_url=base_url or "",
|
|
445
|
+
operation_id="updatePacks",
|
|
446
|
+
oauth2_scopes=[],
|
|
447
|
+
security_source=get_security_from_env(
|
|
448
|
+
self.sdk_configuration.security, models.Security
|
|
449
|
+
),
|
|
450
|
+
),
|
|
451
|
+
request=req,
|
|
452
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
453
|
+
retry_config=retry_config,
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
response_data: Any = None
|
|
457
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
458
|
+
return unmarshal_json_response(models.UploadPackResponse, http_res)
|
|
459
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
460
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
461
|
+
raise errors.Error(response_data, http_res)
|
|
462
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
463
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
464
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
465
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
466
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
467
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
468
|
+
|
|
469
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
470
|
+
|
|
471
|
+
async def upload_async(
|
|
472
|
+
self,
|
|
473
|
+
*,
|
|
474
|
+
filename: str,
|
|
475
|
+
request_body: Union[bytes, IO[bytes], io.BufferedReader],
|
|
476
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
477
|
+
server_url: Optional[str] = None,
|
|
478
|
+
timeout_ms: Optional[int] = None,
|
|
479
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
480
|
+
) -> models.UploadPackResponse:
|
|
481
|
+
r"""Upload a Pack file
|
|
482
|
+
|
|
483
|
+
Upload a Pack file for import. Returns a source identifier that must be used in the subsequent import POST request to complete the pack installation.
|
|
484
|
+
|
|
485
|
+
:param filename: Filename of the pack file to upload
|
|
486
|
+
:param request_body: Binary file content
|
|
487
|
+
:param retries: Override the default retry configuration for this method
|
|
488
|
+
:param server_url: Override the default server URL for this method
|
|
489
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
490
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
491
|
+
"""
|
|
492
|
+
base_url = None
|
|
493
|
+
url_variables = None
|
|
494
|
+
if timeout_ms is None:
|
|
495
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
496
|
+
|
|
497
|
+
if server_url is not None:
|
|
498
|
+
base_url = server_url
|
|
499
|
+
else:
|
|
500
|
+
base_url = self._get_url(base_url, url_variables)
|
|
501
|
+
|
|
502
|
+
request = models.UpdatePacksRequest(
|
|
503
|
+
filename=filename,
|
|
504
|
+
request_body=request_body,
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
req = self._build_request_async(
|
|
508
|
+
method="PUT",
|
|
509
|
+
path="/packs",
|
|
510
|
+
base_url=base_url,
|
|
511
|
+
url_variables=url_variables,
|
|
512
|
+
request=request,
|
|
513
|
+
request_body_required=True,
|
|
514
|
+
request_has_path_params=False,
|
|
515
|
+
request_has_query_params=True,
|
|
516
|
+
user_agent_header="user-agent",
|
|
517
|
+
accept_header_value="application/json",
|
|
518
|
+
http_headers=http_headers,
|
|
519
|
+
security=self.sdk_configuration.security,
|
|
520
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
521
|
+
request.request_body,
|
|
522
|
+
False,
|
|
523
|
+
False,
|
|
524
|
+
"raw",
|
|
525
|
+
Union[bytes, IO[bytes], io.BufferedReader],
|
|
526
|
+
),
|
|
527
|
+
timeout_ms=timeout_ms,
|
|
528
|
+
)
|
|
529
|
+
|
|
530
|
+
if retries == UNSET:
|
|
531
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
532
|
+
retries = self.sdk_configuration.retry_config
|
|
533
|
+
|
|
534
|
+
retry_config = None
|
|
535
|
+
if isinstance(retries, utils.RetryConfig):
|
|
536
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
537
|
+
|
|
538
|
+
http_res = await self.do_request_async(
|
|
539
|
+
hook_ctx=HookContext(
|
|
540
|
+
config=self.sdk_configuration,
|
|
541
|
+
base_url=base_url or "",
|
|
542
|
+
operation_id="updatePacks",
|
|
543
|
+
oauth2_scopes=[],
|
|
544
|
+
security_source=get_security_from_env(
|
|
545
|
+
self.sdk_configuration.security, models.Security
|
|
546
|
+
),
|
|
547
|
+
),
|
|
548
|
+
request=req,
|
|
549
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
550
|
+
retry_config=retry_config,
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
response_data: Any = None
|
|
554
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
555
|
+
return unmarshal_json_response(models.UploadPackResponse, http_res)
|
|
556
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
557
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
558
|
+
raise errors.Error(response_data, http_res)
|
|
559
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
560
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
561
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
562
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
563
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
564
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
565
|
+
|
|
566
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
567
|
+
|
|
373
568
|
def delete(
|
|
374
569
|
self,
|
|
375
570
|
*,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cribl-control-plane
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1rc1
|
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
|
5
5
|
Author: Speakeasy
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -17,11 +17,20 @@ Project-URL: Repository, https://github.com/criblio/cribl_control_plane_sdk_pyth
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
19
19
|
# cribl_control_plane_sdk_python
|
|
20
|
-
<!-- Start Summary [summary] -->
|
|
21
|
-
## Summary
|
|
22
20
|
|
|
23
|
-
Cribl
|
|
24
|
-
|
|
21
|
+
The Cribl Python SDK for the control plane provides operational control over Cribl resources and helps streamline the process of integrating with Cribl.
|
|
22
|
+
|
|
23
|
+
In addition to the usage examples in this repository, the Cribl documentation includes [code examples for common use cases](https://docs.cribl.io/cribl-as-code/code-examples).
|
|
24
|
+
|
|
25
|
+
Complementary API reference documentation is available at https://docs.cribl.io/cribl-as-code/api-reference. Product documentation is available at https://docs.cribl.io.
|
|
26
|
+
|
|
27
|
+
> [!IMPORTANT]
|
|
28
|
+
> **Preview Feature**
|
|
29
|
+
> The Cribl SDKs are Preview features that are still being developed. We do not recommend using them in a production environment, because the features might not be fully tested or optimized for performance, and related documentation could be incomplete.
|
|
30
|
+
>
|
|
31
|
+
> Please continue to submit feedback through normal Cribl support channels, but assistance might be limited while the features remain in Preview.
|
|
32
|
+
|
|
33
|
+
<!-- No Summary [summary] -->
|
|
25
34
|
|
|
26
35
|
<!-- Start Table of Contents [toc] -->
|
|
27
36
|
## Table of Contents
|
|
@@ -32,6 +41,7 @@ Cribl API Reference: This API Reference lists available REST endpoints, along wi
|
|
|
32
41
|
* [SDK Example Usage](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#sdk-example-usage)
|
|
33
42
|
* [Authentication](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#authentication)
|
|
34
43
|
* [Available Resources and Operations](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#available-resources-and-operations)
|
|
44
|
+
* [File uploads](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#file-uploads)
|
|
35
45
|
* [Retries](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#retries)
|
|
36
46
|
* [Error Handling](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#error-handling)
|
|
37
47
|
* [Custom HTTP Client](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#custom-http-client)
|
|
@@ -306,14 +316,10 @@ with CriblControlPlane(
|
|
|
306
316
|
<details open>
|
|
307
317
|
<summary>Available methods</summary>
|
|
308
318
|
|
|
309
|
-
### [auth](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/authsdk/README.md)
|
|
310
|
-
|
|
311
|
-
|
|
312
319
|
#### [auth.tokens](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/tokens/README.md)
|
|
313
320
|
|
|
314
321
|
* [get](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/tokens/README.md#get) - Log in and fetch an authentication token
|
|
315
322
|
|
|
316
|
-
|
|
317
323
|
### [destinations](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/destinations/README.md)
|
|
318
324
|
|
|
319
325
|
* [list](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/destinations/README.md#list) - List all Destinations
|
|
@@ -378,6 +384,7 @@ with CriblControlPlane(
|
|
|
378
384
|
|
|
379
385
|
* [install](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#install) - Create or install a Pack
|
|
380
386
|
* [list](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#list) - List all Packs
|
|
387
|
+
* [upload](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#upload) - Upload a Pack file
|
|
381
388
|
* [delete](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#delete) - Uninstall a Pack
|
|
382
389
|
* [get](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#get) - Get a Pack
|
|
383
390
|
* [update](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#update) - Upgrade a Pack
|
|
@@ -410,9 +417,6 @@ with CriblControlPlane(
|
|
|
410
417
|
* [create](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/hectokens/README.md#create) - Add an HEC token and optional metadata to a Splunk HEC Source
|
|
411
418
|
* [update](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/hectokens/README.md#update) - Update metadata for an HEC token for a Splunk HEC Source
|
|
412
419
|
|
|
413
|
-
### [versions](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/versions/README.md)
|
|
414
|
-
|
|
415
|
-
|
|
416
420
|
#### [versions.branches](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/branches/README.md)
|
|
417
421
|
|
|
418
422
|
* [list](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/branches/README.md#list) - List all branches in the Git repository used for Cribl configuration
|
|
@@ -444,6 +448,36 @@ with CriblControlPlane(
|
|
|
444
448
|
</details>
|
|
445
449
|
<!-- End Available Resources and Operations [operations] -->
|
|
446
450
|
|
|
451
|
+
<!-- Start File uploads [file-upload] -->
|
|
452
|
+
## File uploads
|
|
453
|
+
|
|
454
|
+
Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
|
455
|
+
|
|
456
|
+
> [!TIP]
|
|
457
|
+
>
|
|
458
|
+
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
|
|
459
|
+
>
|
|
460
|
+
|
|
461
|
+
```python
|
|
462
|
+
from cribl_control_plane import CriblControlPlane, models
|
|
463
|
+
import os
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
with CriblControlPlane(
|
|
467
|
+
server_url="https://api.example.com",
|
|
468
|
+
security=models.Security(
|
|
469
|
+
bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
|
|
470
|
+
),
|
|
471
|
+
) as ccp_client:
|
|
472
|
+
|
|
473
|
+
res = ccp_client.packs.upload(filename="example.file", request_body=open("example.file", "rb"))
|
|
474
|
+
|
|
475
|
+
# Handle response
|
|
476
|
+
print(res)
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
<!-- End File uploads [file-upload] -->
|
|
480
|
+
|
|
447
481
|
<!-- Start Retries [retries] -->
|
|
448
482
|
## Retries
|
|
449
483
|
|
|
@@ -657,7 +691,7 @@ with CriblControlPlane(
|
|
|
657
691
|
|
|
658
692
|
|
|
659
693
|
**Inherit from [`CriblControlPlaneError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/criblcontrolplaneerror.py)**:
|
|
660
|
-
* [`HealthStatusError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/healthstatuserror.py): Healthy status. Status code `420`. Applicable to 1 of
|
|
694
|
+
* [`HealthStatusError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/healthstatuserror.py): Healthy status. Status code `420`. Applicable to 1 of 63 methods.*
|
|
661
695
|
* [`ResponseValidationError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
|
|
662
696
|
|
|
663
697
|
</details>
|