cribl-control-plane 0.2.0rc1__py3-none-any.whl → 0.3.0b1__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.

Files changed (144) hide show
  1. cribl_control_plane/_version.py +3 -5
  2. cribl_control_plane/groups_sdk.py +8 -8
  3. cribl_control_plane/models/__init__.py +65 -27
  4. cribl_control_plane/models/authtoken.py +8 -1
  5. cribl_control_plane/models/configgroup.py +30 -2
  6. cribl_control_plane/models/createversionundoop.py +3 -3
  7. cribl_control_plane/models/distributedsummary.py +6 -0
  8. cribl_control_plane/models/hbcriblinfo.py +14 -3
  9. cribl_control_plane/models/heartbeatmetadata.py +3 -0
  10. cribl_control_plane/models/input.py +65 -63
  11. cribl_control_plane/models/inputappscope.py +4 -0
  12. cribl_control_plane/models/inputazureblob.py +4 -0
  13. cribl_control_plane/models/inputcollection.py +4 -0
  14. cribl_control_plane/models/inputconfluentcloud.py +8 -18
  15. cribl_control_plane/models/inputcribl.py +4 -0
  16. cribl_control_plane/models/inputcriblhttp.py +4 -0
  17. cribl_control_plane/models/inputcribllakehttp.py +4 -0
  18. cribl_control_plane/models/inputcriblmetrics.py +4 -0
  19. cribl_control_plane/models/inputcribltcp.py +4 -0
  20. cribl_control_plane/models/inputcrowdstrike.py +7 -0
  21. cribl_control_plane/models/inputdatadogagent.py +4 -0
  22. cribl_control_plane/models/inputdatagen.py +4 -0
  23. cribl_control_plane/models/inputedgeprometheus.py +12 -0
  24. cribl_control_plane/models/inputelastic.py +11 -0
  25. cribl_control_plane/models/inputeventhub.py +6 -0
  26. cribl_control_plane/models/inputexec.py +4 -0
  27. cribl_control_plane/models/inputfile.py +6 -0
  28. cribl_control_plane/models/inputfirehose.py +4 -0
  29. cribl_control_plane/models/inputgooglepubsub.py +7 -0
  30. cribl_control_plane/models/inputgrafana.py +8 -0
  31. cribl_control_plane/models/inputhttp.py +4 -0
  32. cribl_control_plane/models/inputhttpraw.py +4 -0
  33. cribl_control_plane/models/inputjournalfiles.py +4 -0
  34. cribl_control_plane/models/inputkafka.py +8 -17
  35. cribl_control_plane/models/inputkinesis.py +15 -0
  36. cribl_control_plane/models/inputkubeevents.py +4 -0
  37. cribl_control_plane/models/inputkubelogs.py +4 -0
  38. cribl_control_plane/models/inputkubemetrics.py +4 -0
  39. cribl_control_plane/models/inputloki.py +4 -0
  40. cribl_control_plane/models/inputmetrics.py +4 -0
  41. cribl_control_plane/models/inputmodeldriventelemetry.py +4 -0
  42. cribl_control_plane/models/inputmsk.py +7 -17
  43. cribl_control_plane/models/inputnetflow.py +4 -0
  44. cribl_control_plane/models/inputoffice365mgmt.py +11 -0
  45. cribl_control_plane/models/inputoffice365msgtrace.py +11 -0
  46. cribl_control_plane/models/inputoffice365service.py +11 -0
  47. cribl_control_plane/models/inputopentelemetry.py +8 -0
  48. cribl_control_plane/models/inputprometheus.py +10 -0
  49. cribl_control_plane/models/inputprometheusrw.py +4 -0
  50. cribl_control_plane/models/inputrawudp.py +4 -0
  51. cribl_control_plane/models/inputs3.py +7 -0
  52. cribl_control_plane/models/inputs3inventory.py +7 -0
  53. cribl_control_plane/models/inputsecuritylake.py +7 -0
  54. cribl_control_plane/models/inputsnmp.py +11 -0
  55. cribl_control_plane/models/inputsplunk.py +9 -0
  56. cribl_control_plane/models/inputsplunkhec.py +4 -0
  57. cribl_control_plane/models/inputsplunksearch.py +7 -0
  58. cribl_control_plane/models/inputsqs.py +9 -0
  59. cribl_control_plane/models/inputsyslog.py +8 -0
  60. cribl_control_plane/models/inputsystemmetrics.py +32 -0
  61. cribl_control_plane/models/inputsystemstate.py +4 -0
  62. cribl_control_plane/models/inputtcp.py +4 -0
  63. cribl_control_plane/models/inputtcpjson.py +4 -0
  64. cribl_control_plane/models/inputwef.py +6 -0
  65. cribl_control_plane/models/inputwindowsmetrics.py +28 -0
  66. cribl_control_plane/models/inputwineventlogs.py +8 -0
  67. cribl_control_plane/models/inputwiz.py +7 -0
  68. cribl_control_plane/models/inputwizwebhook.py +4 -0
  69. cribl_control_plane/models/inputzscalerhec.py +4 -0
  70. cribl_control_plane/models/jobinfo.py +4 -1
  71. cribl_control_plane/models/nodeprovidedinfo.py +11 -1
  72. cribl_control_plane/models/outpostnodeinfo.py +16 -0
  73. cribl_control_plane/models/output.py +77 -72
  74. cribl_control_plane/models/outputazureblob.py +20 -0
  75. cribl_control_plane/models/outputazuredataexplorer.py +28 -0
  76. cribl_control_plane/models/outputazureeventhub.py +17 -0
  77. cribl_control_plane/models/outputazurelogs.py +13 -0
  78. cribl_control_plane/models/outputchronicle.py +13 -0
  79. cribl_control_plane/models/outputclickhouse.py +17 -0
  80. cribl_control_plane/models/outputcloudwatch.py +13 -0
  81. cribl_control_plane/models/outputconfluentcloud.py +24 -18
  82. cribl_control_plane/models/outputcriblhttp.py +15 -0
  83. cribl_control_plane/models/outputcribllake.py +21 -0
  84. cribl_control_plane/models/outputcribltcp.py +12 -0
  85. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +15 -0
  86. cribl_control_plane/models/outputdatabricks.py +411 -0
  87. cribl_control_plane/models/outputdatadog.py +30 -0
  88. cribl_control_plane/models/outputdataset.py +23 -0
  89. cribl_control_plane/models/outputdls3.py +35 -0
  90. cribl_control_plane/models/outputdynatracehttp.py +22 -0
  91. cribl_control_plane/models/outputdynatraceotlp.py +22 -0
  92. cribl_control_plane/models/outputelastic.py +18 -0
  93. cribl_control_plane/models/outputelasticcloud.py +13 -0
  94. cribl_control_plane/models/outputexabeam.py +14 -0
  95. cribl_control_plane/models/outputfilesystem.py +15 -0
  96. cribl_control_plane/models/outputgooglechronicle.py +21 -0
  97. cribl_control_plane/models/outputgooglecloudlogging.py +19 -0
  98. cribl_control_plane/models/outputgooglecloudstorage.py +28 -0
  99. cribl_control_plane/models/outputgooglepubsub.py +13 -0
  100. cribl_control_plane/models/outputgrafanacloud.py +50 -0
  101. cribl_control_plane/models/outputgraphite.py +12 -0
  102. cribl_control_plane/models/outputhoneycomb.py +13 -0
  103. cribl_control_plane/models/outputhumiohec.py +15 -0
  104. cribl_control_plane/models/outputinfluxdb.py +19 -0
  105. cribl_control_plane/models/outputkafka.py +24 -17
  106. cribl_control_plane/models/outputkinesis.py +15 -0
  107. cribl_control_plane/models/outputloki.py +20 -0
  108. cribl_control_plane/models/outputminio.py +28 -0
  109. cribl_control_plane/models/outputmsk.py +23 -17
  110. cribl_control_plane/models/outputnewrelic.py +16 -0
  111. cribl_control_plane/models/outputnewrelicevents.py +16 -0
  112. cribl_control_plane/models/outputopentelemetry.py +22 -0
  113. cribl_control_plane/models/outputprometheus.py +13 -0
  114. cribl_control_plane/models/outputring.py +2 -0
  115. cribl_control_plane/models/outputs3.py +35 -0
  116. cribl_control_plane/models/outputsecuritylake.py +29 -0
  117. cribl_control_plane/models/outputsentinel.py +15 -0
  118. cribl_control_plane/models/outputsentineloneaisiem.py +13 -0
  119. cribl_control_plane/models/outputservicenow.py +21 -0
  120. cribl_control_plane/models/outputsignalfx.py +13 -0
  121. cribl_control_plane/models/outputsns.py +13 -0
  122. cribl_control_plane/models/outputsplunk.py +15 -0
  123. cribl_control_plane/models/outputsplunkhec.py +13 -0
  124. cribl_control_plane/models/outputsplunklb.py +15 -0
  125. cribl_control_plane/models/outputsqs.py +15 -0
  126. cribl_control_plane/models/outputstatsd.py +12 -0
  127. cribl_control_plane/models/outputstatsdext.py +12 -0
  128. cribl_control_plane/models/outputsumologic.py +15 -0
  129. cribl_control_plane/models/outputsyslog.py +24 -0
  130. cribl_control_plane/models/outputtcpjson.py +12 -0
  131. cribl_control_plane/models/outputwavefront.py +13 -0
  132. cribl_control_plane/models/outputwebhook.py +23 -0
  133. cribl_control_plane/models/outputxsiam.py +13 -0
  134. cribl_control_plane/models/packinfo.py +8 -5
  135. cribl_control_plane/models/packinstallinfo.py +8 -5
  136. cribl_control_plane/models/routeconf.py +3 -4
  137. cribl_control_plane/models/runnablejobcollection.py +4 -0
  138. cribl_control_plane/models/updatepacksop.py +25 -0
  139. cribl_control_plane/models/{routecloneconf.py → uploadpackresponse.py} +4 -4
  140. cribl_control_plane/packs.py +202 -7
  141. {cribl_control_plane-0.2.0rc1.dist-info → cribl_control_plane-0.3.0b1.dist-info}/METADATA +39 -16
  142. {cribl_control_plane-0.2.0rc1.dist-info → cribl_control_plane-0.3.0b1.dist-info}/RECORD +143 -141
  143. cribl_control_plane/models/appmode.py +0 -14
  144. {cribl_control_plane-0.2.0rc1.dist-info → cribl_control_plane-0.3.0b1.dist-info}/WHEEL +0 -0
@@ -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
 
@@ -8,26 +8,27 @@ from typing_extensions import Annotated, NotRequired, TypedDict
8
8
 
9
9
 
10
10
  class PackInfoTagsTypedDict(TypedDict):
11
- data_type: List[str]
12
- technology: List[str]
11
+ data_type: NotRequired[List[str]]
13
12
  domain: NotRequired[List[str]]
14
13
  streamtags: NotRequired[List[str]]
14
+ technology: NotRequired[List[str]]
15
15
 
16
16
 
17
17
  class PackInfoTags(BaseModel):
18
- data_type: Annotated[List[str], pydantic.Field(alias="dataType")]
19
-
20
- technology: List[str]
18
+ data_type: Annotated[Optional[List[str]], pydantic.Field(alias="dataType")] = None
21
19
 
22
20
  domain: Optional[List[str]] = None
23
21
 
24
22
  streamtags: Optional[List[str]] = None
25
23
 
24
+ technology: Optional[List[str]] = None
25
+
26
26
 
27
27
  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
@@ -8,26 +8,27 @@ from typing_extensions import Annotated, NotRequired, TypedDict
8
8
 
9
9
 
10
10
  class PackInstallInfoTagsTypedDict(TypedDict):
11
- data_type: List[str]
12
- technology: List[str]
11
+ data_type: NotRequired[List[str]]
13
12
  domain: NotRequired[List[str]]
14
13
  streamtags: NotRequired[List[str]]
14
+ technology: NotRequired[List[str]]
15
15
 
16
16
 
17
17
  class PackInstallInfoTags(BaseModel):
18
- data_type: Annotated[List[str], pydantic.Field(alias="dataType")]
19
-
20
- technology: List[str]
18
+ data_type: Annotated[Optional[List[str]], pydantic.Field(alias="dataType")] = None
21
19
 
22
20
  domain: Optional[List[str]] = None
23
21
 
24
22
  streamtags: Optional[List[str]] = None
25
23
 
24
+ technology: Optional[List[str]] = None
25
+
26
26
 
27
27
  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
@@ -1,10 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .routecloneconf import RouteCloneConf, RouteCloneConfTypedDict
5
4
  from cribl_control_plane.types import BaseModel
6
5
  import pydantic
7
- from typing import List, Optional
6
+ from typing import Dict, List, Optional
8
7
  from typing_extensions import Annotated, NotRequired, TypedDict
9
8
 
10
9
 
@@ -13,7 +12,7 @@ class RouteConfTypedDict(TypedDict):
13
12
  id: str
14
13
  name: str
15
14
  pipeline: str
16
- clones: NotRequired[List[RouteCloneConfTypedDict]]
15
+ clones: NotRequired[List[Dict[str, str]]]
17
16
  context: NotRequired[str]
18
17
  description: NotRequired[str]
19
18
  disabled: NotRequired[bool]
@@ -33,7 +32,7 @@ class RouteConf(BaseModel):
33
32
 
34
33
  pipeline: str
35
34
 
36
- clones: Optional[List[RouteCloneConf]] = None
35
+ clones: Optional[List[Dict[str, str]]] = None
37
36
 
38
37
  context: Optional[str] = None
39
38
 
@@ -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
 
@@ -0,0 +1,25 @@
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
+
16
+
17
+ class UpdatePacksRequest(BaseModel):
18
+ filename: Annotated[
19
+ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
20
+ ]
21
+ r"""Filename of the Pack file to upload."""
22
+
23
+ request_body: Annotated[
24
+ Union[bytes, IO[bytes], io.BufferedReader], FieldMetadata(request=True)
25
+ ]
@@ -5,9 +5,9 @@ from cribl_control_plane.types import BaseModel
5
5
  from typing_extensions import TypedDict
6
6
 
7
7
 
8
- class RouteCloneConfTypedDict(TypedDict):
9
- pass
8
+ class UploadPackResponseTypedDict(TypedDict):
9
+ source: str
10
10
 
11
11
 
12
- class RouteCloneConf(BaseModel):
13
- pass
12
+ class UploadPackResponse(BaseModel):
13
+ source: str
@@ -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
- from typing import Any, Mapping, Optional, Union, cast
9
+ import io
10
+ from typing import Any, IO, Mapping, Optional, Union, cast
10
11
 
11
12
 
12
13
  class Packs(BaseSDK):
@@ -23,9 +24,9 @@ class Packs(BaseSDK):
23
24
  timeout_ms: Optional[int] = None,
24
25
  http_headers: Optional[Mapping[str, str]] = None,
25
26
  ) -> models.CreatePacksResponse:
26
- r"""Create or install a Pack
27
+ r"""Install a Pack
27
28
 
28
- Create or install a Pack.
29
+ Install a Pack.<br><br>To install an uploaded Pack, provide the <code>source</code> value from the <code>PUT /packs</code> response as the <code>source</code> parameter in the request body.<br><br>To install a Pack by importing from a URL, provide the direct URL location of the <code>.crbl</code> file for the Pack as the <code>source</code> parameter in the request body.<br><br>To install a Pack by importing from a Git repository, provide <code>git+<repo-url></code> as the <code>source</code> parameter in the request body.<br><br>If you do not include the <code>source</code> parameter in the request body, an empty Pack is created.
29
30
 
30
31
  :param request: The request object to send.
31
32
  :param retries: Override the default retry configuration for this method
@@ -115,9 +116,9 @@ class Packs(BaseSDK):
115
116
  timeout_ms: Optional[int] = None,
116
117
  http_headers: Optional[Mapping[str, str]] = None,
117
118
  ) -> models.CreatePacksResponse:
118
- r"""Create or install a Pack
119
+ r"""Install a Pack
119
120
 
120
- Create or install a Pack.
121
+ Install a Pack.<br><br>To install an uploaded Pack, provide the <code>source</code> value from the <code>PUT /packs</code> response as the <code>source</code> parameter in the request body.<br><br>To install a Pack by importing from a URL, provide the direct URL location of the <code>.crbl</code> file for the Pack as the <code>source</code> parameter in the request body.<br><br>To install a Pack by importing from a Git repository, provide <code>git+<repo-url></code> as the <code>source</code> parameter in the request body.<br><br>If you do not include the <code>source</code> parameter in the request body, an empty Pack is created.
121
122
 
122
123
  :param request: The request object to send.
123
124
  :param retries: Override the default retry configuration for this method
@@ -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. Returns the <code>source</code> ID needed to install the Pack with <code>POST /packs source</code>, which you must call separately.
387
+
388
+ :param filename: Filename of the Pack file to upload.
389
+ :param request_body:
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. Returns the <code>source</code> ID needed to install the Pack with <code>POST /packs source</code>, which you must call separately.
484
+
485
+ :param filename: Filename of the Pack file to upload.
486
+ :param request_body:
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
  *,
@@ -733,7 +928,7 @@ class Packs(BaseSDK):
733
928
  ) -> models.UpdatePacksByIDResponse:
734
929
  r"""Upgrade a Pack
735
930
 
736
- Upgrade the specified Pack.</br></br>If the Pack includes any user–modified versions of default Cribl Knowledge resources such as lookups, copy the modified files locally for safekeeping before upgrading the Pack. Copy the modified files back to the upgraded Pack after you install it with <code>POST /packs</code> to overwrite the default versions in the Pack.</br></br>After you upgrade the Pack, update any Routes, Pipelines, Sources, and Destinations that use the previous Pack version so that they reference the upgraded Pack.
931
+ Upgrade the specified Pack.</br></br>If the Pack includes any user–modified versions of default Cribl Knowledge resources such as lookups, copy the modified files locally for safekeeping before upgrading the Pack.Copy the modified files back to the upgraded Pack after you install it with <code>POST /packs</code> to overwrite the default versions in the Pack.</br></br>After you upgrade the Pack, update any Routes, Pipelines, Sources, and Destinations that use the previous Pack version so that they reference the upgraded Pack.
737
932
 
738
933
  :param id: The <code>id</code> of the Pack to upgrade.
739
934
  :param source:
@@ -841,7 +1036,7 @@ class Packs(BaseSDK):
841
1036
  ) -> models.UpdatePacksByIDResponse:
842
1037
  r"""Upgrade a Pack
843
1038
 
844
- Upgrade the specified Pack.</br></br>If the Pack includes any user–modified versions of default Cribl Knowledge resources such as lookups, copy the modified files locally for safekeeping before upgrading the Pack. Copy the modified files back to the upgraded Pack after you install it with <code>POST /packs</code> to overwrite the default versions in the Pack.</br></br>After you upgrade the Pack, update any Routes, Pipelines, Sources, and Destinations that use the previous Pack version so that they reference the upgraded Pack.
1039
+ Upgrade the specified Pack.</br></br>If the Pack includes any user–modified versions of default Cribl Knowledge resources such as lookups, copy the modified files locally for safekeeping before upgrading the Pack.Copy the modified files back to the upgraded Pack after you install it with <code>POST /packs</code> to overwrite the default versions in the Pack.</br></br>After you upgrade the Pack, update any Routes, Pipelines, Sources, and Destinations that use the previous Pack version so that they reference the upgraded Pack.
845
1040
 
846
1041
  :param id: The <code>id</code> of the Pack to upgrade.
847
1042
  :param source:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cribl-control-plane
3
- Version: 0.2.0rc1
3
+ Version: 0.3.0b1
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -17,20 +17,11 @@ 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
20
22
 
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] -->
23
+ Cribl API Reference: This API Reference lists available REST endpoints, along with their supported operations for accessing, creating, updating, or deleting resources. See our complementary product documentation at [docs.cribl.io](http://docs.cribl.io).
24
+ <!-- End Summary [summary] -->
34
25
 
35
26
  <!-- Start Table of Contents [toc] -->
36
27
  ## Table of Contents
@@ -41,6 +32,7 @@ Complementary API reference documentation is available at https://docs.cribl.io/
41
32
  * [SDK Example Usage](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#sdk-example-usage)
42
33
  * [Authentication](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#authentication)
43
34
  * [Available Resources and Operations](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#available-resources-and-operations)
35
+ * [File uploads](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#file-uploads)
44
36
  * [Retries](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#retries)
45
37
  * [Error Handling](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#error-handling)
46
38
  * [Custom HTTP Client](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#custom-http-client)
@@ -381,8 +373,9 @@ with CriblControlPlane(
381
373
 
382
374
  ### [packs](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md)
383
375
 
384
- * [install](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#install) - Create or install a Pack
376
+ * [install](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#install) - Install a Pack
385
377
  * [list](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#list) - List all Packs
378
+ * [upload](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#upload) - Upload a Pack file
386
379
  * [delete](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#delete) - Uninstall a Pack
387
380
  * [get](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#get) - Get a Pack
388
381
  * [update](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/packs/README.md#update) - Upgrade a Pack
@@ -446,6 +439,36 @@ with CriblControlPlane(
446
439
  </details>
447
440
  <!-- End Available Resources and Operations [operations] -->
448
441
 
442
+ <!-- Start File uploads [file-upload] -->
443
+ ## File uploads
444
+
445
+ 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.
446
+
447
+ > [!TIP]
448
+ >
449
+ > For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
450
+ >
451
+
452
+ ```python
453
+ from cribl_control_plane import CriblControlPlane, models
454
+ import os
455
+
456
+
457
+ with CriblControlPlane(
458
+ server_url="https://api.example.com",
459
+ security=models.Security(
460
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
461
+ ),
462
+ ) as ccp_client:
463
+
464
+ res = ccp_client.packs.upload(filename="example.file", request_body=open("example.file", "rb"))
465
+
466
+ # Handle response
467
+ print(res)
468
+
469
+ ```
470
+ <!-- End File uploads [file-upload] -->
471
+
449
472
  <!-- Start Retries [retries] -->
450
473
  ## Retries
451
474
 
@@ -659,7 +682,7 @@ with CriblControlPlane(
659
682
 
660
683
 
661
684
  **Inherit from [`CriblControlPlaneError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/criblcontrolplaneerror.py)**:
662
- * [`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 62 methods.*
685
+ * [`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.*
663
686
  * [`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.
664
687
 
665
688
  </details>