cribl-control-plane 0.0.13__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 (197) hide show
  1. cribl_control_plane/__init__.py +17 -0
  2. cribl_control_plane/_hooks/__init__.py +5 -0
  3. cribl_control_plane/_hooks/clientcredentials.py +211 -0
  4. cribl_control_plane/_hooks/registration.py +13 -0
  5. cribl_control_plane/_hooks/sdkhooks.py +81 -0
  6. cribl_control_plane/_hooks/types.py +112 -0
  7. cribl_control_plane/_version.py +15 -0
  8. cribl_control_plane/auth_sdk.py +184 -0
  9. cribl_control_plane/basesdk.py +358 -0
  10. cribl_control_plane/errors/__init__.py +60 -0
  11. cribl_control_plane/errors/apierror.py +38 -0
  12. cribl_control_plane/errors/criblcontrolplaneerror.py +26 -0
  13. cribl_control_plane/errors/error.py +24 -0
  14. cribl_control_plane/errors/healthstatus_error.py +38 -0
  15. cribl_control_plane/errors/no_response_error.py +13 -0
  16. cribl_control_plane/errors/responsevalidationerror.py +25 -0
  17. cribl_control_plane/health.py +166 -0
  18. cribl_control_plane/httpclient.py +126 -0
  19. cribl_control_plane/models/__init__.py +7305 -0
  20. cribl_control_plane/models/addhectokenrequest.py +34 -0
  21. cribl_control_plane/models/authtoken.py +13 -0
  22. cribl_control_plane/models/createinputhectokenbyidop.py +45 -0
  23. cribl_control_plane/models/createinputop.py +24 -0
  24. cribl_control_plane/models/createoutputop.py +24 -0
  25. cribl_control_plane/models/createoutputtestbyidop.py +46 -0
  26. cribl_control_plane/models/criblevent.py +14 -0
  27. cribl_control_plane/models/deleteinputbyidop.py +37 -0
  28. cribl_control_plane/models/deleteoutputbyidop.py +37 -0
  29. cribl_control_plane/models/deleteoutputpqbyidop.py +36 -0
  30. cribl_control_plane/models/getinputbyidop.py +37 -0
  31. cribl_control_plane/models/getoutputbyidop.py +37 -0
  32. cribl_control_plane/models/getoutputpqbyidop.py +36 -0
  33. cribl_control_plane/models/getoutputsamplesbyidop.py +37 -0
  34. cribl_control_plane/models/healthstatus.py +36 -0
  35. cribl_control_plane/models/input.py +199 -0
  36. cribl_control_plane/models/inputappscope.py +448 -0
  37. cribl_control_plane/models/inputazureblob.py +308 -0
  38. cribl_control_plane/models/inputcollection.py +208 -0
  39. cribl_control_plane/models/inputconfluentcloud.py +585 -0
  40. cribl_control_plane/models/inputcribl.py +165 -0
  41. cribl_control_plane/models/inputcriblhttp.py +341 -0
  42. cribl_control_plane/models/inputcribllakehttp.py +342 -0
  43. cribl_control_plane/models/inputcriblmetrics.py +175 -0
  44. cribl_control_plane/models/inputcribltcp.py +299 -0
  45. cribl_control_plane/models/inputcrowdstrike.py +410 -0
  46. cribl_control_plane/models/inputdatadogagent.py +364 -0
  47. cribl_control_plane/models/inputdatagen.py +180 -0
  48. cribl_control_plane/models/inputedgeprometheus.py +551 -0
  49. cribl_control_plane/models/inputelastic.py +494 -0
  50. cribl_control_plane/models/inputeventhub.py +360 -0
  51. cribl_control_plane/models/inputexec.py +213 -0
  52. cribl_control_plane/models/inputfile.py +259 -0
  53. cribl_control_plane/models/inputfirehose.py +341 -0
  54. cribl_control_plane/models/inputgooglepubsub.py +247 -0
  55. cribl_control_plane/models/inputgrafana_union.py +1247 -0
  56. cribl_control_plane/models/inputhttp.py +403 -0
  57. cribl_control_plane/models/inputhttpraw.py +407 -0
  58. cribl_control_plane/models/inputjournalfiles.py +208 -0
  59. cribl_control_plane/models/inputkafka.py +581 -0
  60. cribl_control_plane/models/inputkinesis.py +363 -0
  61. cribl_control_plane/models/inputkubeevents.py +182 -0
  62. cribl_control_plane/models/inputkubelogs.py +256 -0
  63. cribl_control_plane/models/inputkubemetrics.py +233 -0
  64. cribl_control_plane/models/inputloki.py +468 -0
  65. cribl_control_plane/models/inputmetrics.py +290 -0
  66. cribl_control_plane/models/inputmodeldriventelemetry.py +274 -0
  67. cribl_control_plane/models/inputmsk.py +654 -0
  68. cribl_control_plane/models/inputnetflow.py +224 -0
  69. cribl_control_plane/models/inputoffice365mgmt.py +384 -0
  70. cribl_control_plane/models/inputoffice365msgtrace.py +449 -0
  71. cribl_control_plane/models/inputoffice365service.py +377 -0
  72. cribl_control_plane/models/inputopentelemetry.py +516 -0
  73. cribl_control_plane/models/inputprometheus.py +464 -0
  74. cribl_control_plane/models/inputprometheusrw.py +470 -0
  75. cribl_control_plane/models/inputrawudp.py +207 -0
  76. cribl_control_plane/models/inputs3.py +416 -0
  77. cribl_control_plane/models/inputs3inventory.py +440 -0
  78. cribl_control_plane/models/inputsecuritylake.py +425 -0
  79. cribl_control_plane/models/inputsnmp.py +274 -0
  80. cribl_control_plane/models/inputsplunk.py +387 -0
  81. cribl_control_plane/models/inputsplunkhec.py +478 -0
  82. cribl_control_plane/models/inputsplunksearch.py +537 -0
  83. cribl_control_plane/models/inputsqs.py +320 -0
  84. cribl_control_plane/models/inputsyslog_union.py +759 -0
  85. cribl_control_plane/models/inputsystemmetrics.py +533 -0
  86. cribl_control_plane/models/inputsystemstate.py +417 -0
  87. cribl_control_plane/models/inputtcp.py +359 -0
  88. cribl_control_plane/models/inputtcpjson.py +334 -0
  89. cribl_control_plane/models/inputwef.py +498 -0
  90. cribl_control_plane/models/inputwindowsmetrics.py +457 -0
  91. cribl_control_plane/models/inputwineventlogs.py +222 -0
  92. cribl_control_plane/models/inputwiz.py +334 -0
  93. cribl_control_plane/models/inputzscalerhec.py +439 -0
  94. cribl_control_plane/models/listinputop.py +24 -0
  95. cribl_control_plane/models/listoutputop.py +24 -0
  96. cribl_control_plane/models/logininfo.py +16 -0
  97. cribl_control_plane/models/output.py +229 -0
  98. cribl_control_plane/models/outputazureblob.py +471 -0
  99. cribl_control_plane/models/outputazuredataexplorer.py +660 -0
  100. cribl_control_plane/models/outputazureeventhub.py +321 -0
  101. cribl_control_plane/models/outputazurelogs.py +386 -0
  102. cribl_control_plane/models/outputclickhouse.py +650 -0
  103. cribl_control_plane/models/outputcloudwatch.py +273 -0
  104. cribl_control_plane/models/outputconfluentcloud.py +591 -0
  105. cribl_control_plane/models/outputcriblhttp.py +494 -0
  106. cribl_control_plane/models/outputcribllake.py +396 -0
  107. cribl_control_plane/models/outputcribltcp.py +387 -0
  108. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +410 -0
  109. cribl_control_plane/models/outputdatadog.py +472 -0
  110. cribl_control_plane/models/outputdataset.py +437 -0
  111. cribl_control_plane/models/outputdefault.py +55 -0
  112. cribl_control_plane/models/outputdevnull.py +50 -0
  113. cribl_control_plane/models/outputdiskspool.py +89 -0
  114. cribl_control_plane/models/outputdls3.py +560 -0
  115. cribl_control_plane/models/outputdynatracehttp.py +454 -0
  116. cribl_control_plane/models/outputdynatraceotlp.py +486 -0
  117. cribl_control_plane/models/outputelastic.py +494 -0
  118. cribl_control_plane/models/outputelasticcloud.py +407 -0
  119. cribl_control_plane/models/outputexabeam.py +297 -0
  120. cribl_control_plane/models/outputfilesystem.py +357 -0
  121. cribl_control_plane/models/outputgooglechronicle.py +486 -0
  122. cribl_control_plane/models/outputgooglecloudlogging.py +557 -0
  123. cribl_control_plane/models/outputgooglecloudstorage.py +499 -0
  124. cribl_control_plane/models/outputgooglepubsub.py +274 -0
  125. cribl_control_plane/models/outputgrafanacloud_union.py +1024 -0
  126. cribl_control_plane/models/outputgraphite.py +225 -0
  127. cribl_control_plane/models/outputhoneycomb.py +369 -0
  128. cribl_control_plane/models/outputhumiohec.py +389 -0
  129. cribl_control_plane/models/outputinfluxdb.py +523 -0
  130. cribl_control_plane/models/outputkafka.py +581 -0
  131. cribl_control_plane/models/outputkinesis.py +312 -0
  132. cribl_control_plane/models/outputloki.py +425 -0
  133. cribl_control_plane/models/outputminio.py +512 -0
  134. cribl_control_plane/models/outputmsk.py +654 -0
  135. cribl_control_plane/models/outputnetflow.py +80 -0
  136. cribl_control_plane/models/outputnewrelic.py +424 -0
  137. cribl_control_plane/models/outputnewrelicevents.py +401 -0
  138. cribl_control_plane/models/outputopentelemetry.py +669 -0
  139. cribl_control_plane/models/outputprometheus.py +485 -0
  140. cribl_control_plane/models/outputring.py +121 -0
  141. cribl_control_plane/models/outputrouter.py +83 -0
  142. cribl_control_plane/models/outputs3.py +556 -0
  143. cribl_control_plane/models/outputsamplesresponse.py +14 -0
  144. cribl_control_plane/models/outputsecuritylake.py +505 -0
  145. cribl_control_plane/models/outputsentinel.py +488 -0
  146. cribl_control_plane/models/outputsentineloneaisiem.py +505 -0
  147. cribl_control_plane/models/outputservicenow.py +543 -0
  148. cribl_control_plane/models/outputsignalfx.py +369 -0
  149. cribl_control_plane/models/outputsnmp.py +80 -0
  150. cribl_control_plane/models/outputsns.py +274 -0
  151. cribl_control_plane/models/outputsplunk.py +383 -0
  152. cribl_control_plane/models/outputsplunkhec.py +434 -0
  153. cribl_control_plane/models/outputsplunklb.py +558 -0
  154. cribl_control_plane/models/outputsqs.py +328 -0
  155. cribl_control_plane/models/outputstatsd.py +224 -0
  156. cribl_control_plane/models/outputstatsdext.py +225 -0
  157. cribl_control_plane/models/outputsumologic.py +378 -0
  158. cribl_control_plane/models/outputsyslog.py +415 -0
  159. cribl_control_plane/models/outputtcpjson.py +413 -0
  160. cribl_control_plane/models/outputtestrequest.py +15 -0
  161. cribl_control_plane/models/outputtestresponse.py +29 -0
  162. cribl_control_plane/models/outputwavefront.py +369 -0
  163. cribl_control_plane/models/outputwebhook.py +689 -0
  164. cribl_control_plane/models/outputxsiam.py +415 -0
  165. cribl_control_plane/models/schemeclientoauth.py +24 -0
  166. cribl_control_plane/models/security.py +36 -0
  167. cribl_control_plane/models/updatehectokenrequest.py +31 -0
  168. cribl_control_plane/models/updateinputbyidop.py +44 -0
  169. cribl_control_plane/models/updateinputhectokenbyidandtokenop.py +52 -0
  170. cribl_control_plane/models/updateoutputbyidop.py +44 -0
  171. cribl_control_plane/outputs.py +1615 -0
  172. cribl_control_plane/py.typed +1 -0
  173. cribl_control_plane/sdk.py +164 -0
  174. cribl_control_plane/sdkconfiguration.py +36 -0
  175. cribl_control_plane/sources.py +1355 -0
  176. cribl_control_plane/types/__init__.py +21 -0
  177. cribl_control_plane/types/basemodel.py +39 -0
  178. cribl_control_plane/utils/__init__.py +187 -0
  179. cribl_control_plane/utils/annotations.py +55 -0
  180. cribl_control_plane/utils/datetimes.py +23 -0
  181. cribl_control_plane/utils/enums.py +74 -0
  182. cribl_control_plane/utils/eventstreaming.py +238 -0
  183. cribl_control_plane/utils/forms.py +223 -0
  184. cribl_control_plane/utils/headers.py +136 -0
  185. cribl_control_plane/utils/logger.py +27 -0
  186. cribl_control_plane/utils/metadata.py +118 -0
  187. cribl_control_plane/utils/queryparams.py +205 -0
  188. cribl_control_plane/utils/requestbodies.py +66 -0
  189. cribl_control_plane/utils/retries.py +217 -0
  190. cribl_control_plane/utils/security.py +207 -0
  191. cribl_control_plane/utils/serializers.py +249 -0
  192. cribl_control_plane/utils/unmarshal_json_response.py +24 -0
  193. cribl_control_plane/utils/url.py +155 -0
  194. cribl_control_plane/utils/values.py +137 -0
  195. cribl_control_plane-0.0.13.dist-info/METADATA +489 -0
  196. cribl_control_plane-0.0.13.dist-info/RECORD +197 -0
  197. cribl_control_plane-0.0.13.dist-info/WHEEL +4 -0
@@ -0,0 +1,489 @@
1
+ Metadata-Version: 2.3
2
+ Name: cribl-control-plane
3
+ Version: 0.0.13
4
+ Summary: Python Client SDK Generated by Speakeasy.
5
+ Author: Speakeasy
6
+ Requires-Python: >=3.9.2
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Requires-Dist: httpcore (>=1.0.9)
13
+ Requires-Dist: httpx (>=0.28.1)
14
+ Requires-Dist: pydantic (>=2.11.2)
15
+ Project-URL: Repository, https://github.com/criblio/cribl_control_plane_sdk_python.git
16
+ Description-Content-Type: text/markdown
17
+
18
+ # cribl_control_plane_sdk_python
19
+ <!-- Start Summary [summary] -->
20
+ ## Summary
21
+
22
+ 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).
23
+ <!-- End Summary [summary] -->
24
+
25
+ <!-- Start Table of Contents [toc] -->
26
+ ## Table of Contents
27
+ <!-- $toc-max-depth=2 -->
28
+ * [cribl_control_plane_sdk_python](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#criblcontrolplanesdkpython)
29
+ * [SDK Installation](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#sdk-installation)
30
+ * [IDE Support](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#ide-support)
31
+ * [SDK Example Usage](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#sdk-example-usage)
32
+ * [Authentication](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#authentication)
33
+ * [Available Resources and Operations](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#available-resources-and-operations)
34
+ * [Retries](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#retries)
35
+ * [Error Handling](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#error-handling)
36
+ * [Custom HTTP Client](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#custom-http-client)
37
+ * [Resource Management](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#resource-management)
38
+ * [Debugging](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#debugging)
39
+
40
+ <!-- End Table of Contents [toc] -->
41
+
42
+ <!-- Start SDK Installation [installation] -->
43
+ ## SDK Installation
44
+
45
+ > [!NOTE]
46
+ > **Python version upgrade policy**
47
+ >
48
+ > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
49
+
50
+ The SDK can be installed with either *pip* or *poetry* package managers.
51
+
52
+ ### PIP
53
+
54
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
55
+
56
+ ```bash
57
+ pip install cribl-control-plane
58
+ ```
59
+
60
+ ### Poetry
61
+
62
+ *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
63
+
64
+ ```bash
65
+ poetry add cribl-control-plane
66
+ ```
67
+
68
+ ### Shell and script usage with `uv`
69
+
70
+ You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
71
+
72
+ ```shell
73
+ uvx --from cribl-control-plane python
74
+ ```
75
+
76
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
77
+
78
+ ```python
79
+ #!/usr/bin/env -S uv run --script
80
+ # /// script
81
+ # requires-python = ">=3.9"
82
+ # dependencies = [
83
+ # "cribl-control-plane",
84
+ # ]
85
+ # ///
86
+
87
+ from cribl_control_plane import CriblControlPlane
88
+
89
+ sdk = CriblControlPlane(
90
+ # SDK arguments
91
+ )
92
+
93
+ # Rest of script here...
94
+ ```
95
+
96
+ Once that is saved to a file, you can run it with `uv run script.py` where
97
+ `script.py` can be replaced with the actual file name.
98
+ <!-- End SDK Installation [installation] -->
99
+
100
+ <!-- Start IDE Support [idesupport] -->
101
+ ## IDE Support
102
+
103
+ ### PyCharm
104
+
105
+ Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
106
+
107
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
108
+ <!-- End IDE Support [idesupport] -->
109
+
110
+ <!-- Start SDK Example Usage [usage] -->
111
+ ## SDK Example Usage
112
+
113
+ ### Example
114
+
115
+ ```python
116
+ # Synchronous Example
117
+ from cribl_control_plane import CriblControlPlane, models
118
+ import os
119
+
120
+
121
+ with CriblControlPlane(
122
+ server_url="https://api.example.com",
123
+ security=models.Security(
124
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
125
+ ),
126
+ ) as ccp_client:
127
+
128
+ res = ccp_client.sources.list_source()
129
+
130
+ # Handle response
131
+ print(res)
132
+ ```
133
+
134
+ </br>
135
+
136
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
137
+ ```python
138
+ # Asynchronous Example
139
+ import asyncio
140
+ from cribl_control_plane import CriblControlPlane, models
141
+ import os
142
+
143
+ async def main():
144
+
145
+ async with CriblControlPlane(
146
+ server_url="https://api.example.com",
147
+ security=models.Security(
148
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
149
+ ),
150
+ ) as ccp_client:
151
+
152
+ res = await ccp_client.sources.list_source_async()
153
+
154
+ # Handle response
155
+ print(res)
156
+
157
+ asyncio.run(main())
158
+ ```
159
+ <!-- End SDK Example Usage [usage] -->
160
+
161
+ <!-- Start Authentication [security] -->
162
+ ## Authentication
163
+
164
+ ### Per-Client Security Schemes
165
+
166
+ This SDK supports the following security schemes globally:
167
+
168
+ | Name | Type | Scheme | Environment Variable |
169
+ | -------------- | ------ | ------------ | -------------------------------- |
170
+ | `bearer_auth` | http | HTTP Bearer | `CRIBLCONTROLPLANE_BEARER_AUTH` |
171
+ | `client_oauth` | oauth2 | OAuth2 token | `CRIBLCONTROLPLANE_CLIENT_OAUTH` |
172
+
173
+ You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
174
+ ```python
175
+ from cribl_control_plane import CriblControlPlane, models
176
+ import os
177
+
178
+
179
+ with CriblControlPlane(
180
+ server_url="https://api.example.com",
181
+ security=models.Security(
182
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
183
+ ),
184
+ ) as ccp_client:
185
+
186
+ res = ccp_client.sources.list_source()
187
+
188
+ # Handle response
189
+ print(res)
190
+
191
+ ```
192
+ <!-- End Authentication [security] -->
193
+
194
+ <!-- Start Available Resources and Operations [operations] -->
195
+ ## Available Resources and Operations
196
+
197
+ <details open>
198
+ <summary>Available methods</summary>
199
+
200
+ ### [auth](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/authsdk/README.md)
201
+
202
+ * [login](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/authsdk/README.md#login) - Log in and obtain Auth token
203
+
204
+
205
+ ### [health](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/health/README.md)
206
+
207
+ * [get_health_info](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/health/README.md#get_health_info) - Provides health info for REST server
208
+
209
+ ### [outputs](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md)
210
+
211
+ * [list_output](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#list_output) - Get a list of Output objects
212
+ * [create_output](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#create_output) - Create Output
213
+ * [get_output_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#get_output_by_id) - Get Output by ID
214
+ * [update_output_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#update_output_by_id) - Update Output
215
+ * [delete_output_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#delete_output_by_id) - Delete Output
216
+ * [delete_output_pq_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#delete_output_pq_by_id) - Clears destination persistent queue
217
+ * [get_output_pq_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#get_output_pq_by_id) - Retrieves status of latest clear PQ job for an output
218
+ * [get_output_samples_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#get_output_samples_by_id) - Retrieve samples data for the specified output. Used to get sample data for the test action.
219
+ * [create_output_test_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/outputs/README.md#create_output_test_by_id) - Send sample data to an output to validate configuration or test connectivity
220
+
221
+ ### [sources](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md)
222
+
223
+ * [list_source](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#list_source) - Get a list of Source objects
224
+ * [create_source](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#create_source) - Create Source
225
+ * [get_source_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#get_source_by_id) - Get Source by ID
226
+ * [update_source_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#update_source_by_id) - Update Source
227
+ * [delete_source_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#delete_source_by_id) - Delete Source
228
+ * [create_source_hec_token_by_id](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#create_source_hec_token_by_id) - Add token and optional metadata to an existing HEC Source
229
+ * [update_source_hec_token_by_id_and_token](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/docs/sdks/sources/README.md#update_source_hec_token_by_id_and_token) - Update token metadata on existing HEC Source
230
+
231
+ </details>
232
+ <!-- End Available Resources and Operations [operations] -->
233
+
234
+ <!-- Start Retries [retries] -->
235
+ ## Retries
236
+
237
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
238
+
239
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
240
+ ```python
241
+ from cribl_control_plane import CriblControlPlane, models
242
+ from cribl_control_plane.utils import BackoffStrategy, RetryConfig
243
+ import os
244
+
245
+
246
+ with CriblControlPlane(
247
+ server_url="https://api.example.com",
248
+ security=models.Security(
249
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
250
+ ),
251
+ ) as ccp_client:
252
+
253
+ res = ccp_client.sources.list_source(,
254
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
255
+
256
+ # Handle response
257
+ print(res)
258
+
259
+ ```
260
+
261
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
262
+ ```python
263
+ from cribl_control_plane import CriblControlPlane, models
264
+ from cribl_control_plane.utils import BackoffStrategy, RetryConfig
265
+ import os
266
+
267
+
268
+ with CriblControlPlane(
269
+ server_url="https://api.example.com",
270
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
271
+ security=models.Security(
272
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
273
+ ),
274
+ ) as ccp_client:
275
+
276
+ res = ccp_client.sources.list_source()
277
+
278
+ # Handle response
279
+ print(res)
280
+
281
+ ```
282
+ <!-- End Retries [retries] -->
283
+
284
+ <!-- Start Error Handling [errors] -->
285
+ ## Error Handling
286
+
287
+ [`CriblControlPlaneError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/criblcontrolplaneerror.py) is the base class for all HTTP error responses. It has the following properties:
288
+
289
+ | Property | Type | Description |
290
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
291
+ | `err.message` | `str` | Error message |
292
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
293
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
294
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
295
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
296
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#error-classes). |
297
+
298
+ ### Example
299
+ ```python
300
+ from cribl_control_plane import CriblControlPlane, errors, models
301
+ import os
302
+
303
+
304
+ with CriblControlPlane(
305
+ server_url="https://api.example.com",
306
+ security=models.Security(
307
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
308
+ ),
309
+ ) as ccp_client:
310
+ res = None
311
+ try:
312
+
313
+ res = ccp_client.sources.list_source()
314
+
315
+ # Handle response
316
+ print(res)
317
+
318
+
319
+ except errors.CriblControlPlaneError as e:
320
+ # The base class for HTTP error responses
321
+ print(e.message)
322
+ print(e.status_code)
323
+ print(e.body)
324
+ print(e.headers)
325
+ print(e.raw_response)
326
+
327
+ # Depending on the method different errors may be thrown
328
+ if isinstance(e, errors.Error):
329
+ print(e.data.message) # Optional[str]
330
+ ```
331
+
332
+ ### Error Classes
333
+ **Primary errors:**
334
+ * [`CriblControlPlaneError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/criblcontrolplaneerror.py): The base class for HTTP error responses.
335
+ * [`Error`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/error.py): Unexpected error. Status code `500`. *
336
+
337
+ <details><summary>Less common errors (6)</summary>
338
+
339
+ <br />
340
+
341
+ **Network errors:**
342
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
343
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
344
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
345
+
346
+
347
+ **Inherit from [`CriblControlPlaneError`](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/./src/cribl_control_plane/errors/criblcontrolplaneerror.py)**:
348
+ * [`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 18 methods.*
349
+ * [`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.
350
+
351
+ </details>
352
+
353
+ \* Check [the method documentation](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#available-resources-and-operations) to see if the error is applicable.
354
+ <!-- End Error Handling [errors] -->
355
+
356
+ <!-- Start Custom HTTP Client [http-client] -->
357
+ ## Custom HTTP Client
358
+
359
+ The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
360
+ Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
361
+ This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
362
+
363
+ For example, you could specify a header for every request that this sdk makes as follows:
364
+ ```python
365
+ from cribl_control_plane import CriblControlPlane
366
+ import httpx
367
+
368
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
369
+ s = CriblControlPlane(client=http_client)
370
+ ```
371
+
372
+ or you could wrap the client with your own custom logic:
373
+ ```python
374
+ from cribl_control_plane import CriblControlPlane
375
+ from cribl_control_plane.httpclient import AsyncHttpClient
376
+ import httpx
377
+
378
+ class CustomClient(AsyncHttpClient):
379
+ client: AsyncHttpClient
380
+
381
+ def __init__(self, client: AsyncHttpClient):
382
+ self.client = client
383
+
384
+ async def send(
385
+ self,
386
+ request: httpx.Request,
387
+ *,
388
+ stream: bool = False,
389
+ auth: Union[
390
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
391
+ ] = httpx.USE_CLIENT_DEFAULT,
392
+ follow_redirects: Union[
393
+ bool, httpx._client.UseClientDefault
394
+ ] = httpx.USE_CLIENT_DEFAULT,
395
+ ) -> httpx.Response:
396
+ request.headers["Client-Level-Header"] = "added by client"
397
+
398
+ return await self.client.send(
399
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
400
+ )
401
+
402
+ def build_request(
403
+ self,
404
+ method: str,
405
+ url: httpx._types.URLTypes,
406
+ *,
407
+ content: Optional[httpx._types.RequestContent] = None,
408
+ data: Optional[httpx._types.RequestData] = None,
409
+ files: Optional[httpx._types.RequestFiles] = None,
410
+ json: Optional[Any] = None,
411
+ params: Optional[httpx._types.QueryParamTypes] = None,
412
+ headers: Optional[httpx._types.HeaderTypes] = None,
413
+ cookies: Optional[httpx._types.CookieTypes] = None,
414
+ timeout: Union[
415
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
416
+ ] = httpx.USE_CLIENT_DEFAULT,
417
+ extensions: Optional[httpx._types.RequestExtensions] = None,
418
+ ) -> httpx.Request:
419
+ return self.client.build_request(
420
+ method,
421
+ url,
422
+ content=content,
423
+ data=data,
424
+ files=files,
425
+ json=json,
426
+ params=params,
427
+ headers=headers,
428
+ cookies=cookies,
429
+ timeout=timeout,
430
+ extensions=extensions,
431
+ )
432
+
433
+ s = CriblControlPlane(async_client=CustomClient(httpx.AsyncClient()))
434
+ ```
435
+ <!-- End Custom HTTP Client [http-client] -->
436
+
437
+ <!-- Start Resource Management [resource-management] -->
438
+ ## Resource Management
439
+
440
+ The `CriblControlPlane` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
441
+
442
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
443
+
444
+ ```python
445
+ from cribl_control_plane import CriblControlPlane, models
446
+ import os
447
+ def main():
448
+
449
+ with CriblControlPlane(
450
+ server_url="https://api.example.com",
451
+ security=models.Security(
452
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
453
+ ),
454
+ ) as ccp_client:
455
+ # Rest of application here...
456
+
457
+
458
+ # Or when using async:
459
+ async def amain():
460
+
461
+ async with CriblControlPlane(
462
+ server_url="https://api.example.com",
463
+ security=models.Security(
464
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
465
+ ),
466
+ ) as ccp_client:
467
+ # Rest of application here...
468
+ ```
469
+ <!-- End Resource Management [resource-management] -->
470
+
471
+ <!-- Start Debugging [debug] -->
472
+ ## Debugging
473
+
474
+ You can setup your SDK to emit debug logs for SDK requests and responses.
475
+
476
+ You can pass your own logger class directly into your SDK.
477
+ ```python
478
+ from cribl_control_plane import CriblControlPlane
479
+ import logging
480
+
481
+ logging.basicConfig(level=logging.DEBUG)
482
+ s = CriblControlPlane(server_url="https://example.com", debug_logger=logging.getLogger("cribl_control_plane"))
483
+ ```
484
+
485
+ You can also enable a default debug logger by setting an environment variable `CRIBLCONTROLPLANE_DEBUG` to true.
486
+ <!-- End Debugging [debug] -->
487
+
488
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
489
+