cribl-control-plane 0.0.38__py3-none-any.whl → 0.4.0a6__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 (241) hide show
  1. cribl_control_plane/_hooks/clientcredentials.py +92 -42
  2. cribl_control_plane/_version.py +4 -4
  3. cribl_control_plane/acl.py +5 -3
  4. cribl_control_plane/auth_sdk.py +6 -3
  5. cribl_control_plane/basesdk.py +11 -1
  6. cribl_control_plane/commits.py +7 -5
  7. cribl_control_plane/destinations.py +6 -4
  8. cribl_control_plane/destinations_pq.py +2 -2
  9. cribl_control_plane/errors/__init__.py +23 -8
  10. cribl_control_plane/errors/apierror.py +2 -0
  11. cribl_control_plane/errors/criblcontrolplaneerror.py +11 -7
  12. cribl_control_plane/errors/error.py +4 -2
  13. cribl_control_plane/errors/healthserverstatus_error.py +41 -0
  14. cribl_control_plane/errors/no_response_error.py +5 -1
  15. cribl_control_plane/errors/responsevalidationerror.py +2 -0
  16. cribl_control_plane/groups_configs.py +8 -3
  17. cribl_control_plane/groups_sdk.py +64 -38
  18. cribl_control_plane/health.py +22 -12
  19. cribl_control_plane/httpclient.py +0 -1
  20. cribl_control_plane/lakedatasets.py +40 -12
  21. cribl_control_plane/models/__init__.py +1180 -54
  22. cribl_control_plane/models/authtoken.py +5 -1
  23. cribl_control_plane/models/{routecloneconf.py → branchinfo.py} +4 -4
  24. cribl_control_plane/models/cacheconnection.py +30 -2
  25. cribl_control_plane/models/cacheconnectionbackfillstatus.py +2 -1
  26. cribl_control_plane/models/cloudprovider.py +2 -1
  27. cribl_control_plane/models/configgroup.py +66 -11
  28. cribl_control_plane/models/configgroupcloud.py +17 -3
  29. cribl_control_plane/models/createconfiggroupbyproductop.py +27 -9
  30. cribl_control_plane/models/createinputhectokenbyidop.py +6 -5
  31. cribl_control_plane/models/createroutesappendbyidop.py +2 -2
  32. cribl_control_plane/models/createversionpushop.py +5 -5
  33. cribl_control_plane/models/createversionrevertop.py +2 -2
  34. cribl_control_plane/models/createversionundoop.py +3 -3
  35. cribl_control_plane/models/cribllakedataset.py +22 -2
  36. cribl_control_plane/models/cribllakedatasetupdate.py +95 -0
  37. cribl_control_plane/models/datasetmetadata.py +18 -2
  38. cribl_control_plane/models/deleteconfiggroupbyproductandidop.py +18 -2
  39. cribl_control_plane/models/deleteoutputpqbyidop.py +5 -5
  40. cribl_control_plane/models/deletepipelinebyidop.py +2 -2
  41. cribl_control_plane/models/difffiles.py +171 -0
  42. cribl_control_plane/models/distributedsummary.py +6 -0
  43. cribl_control_plane/models/getconfiggroupaclbyproductandidop.py +24 -2
  44. cribl_control_plane/models/getconfiggroupaclteamsbyproductandidop.py +24 -2
  45. cribl_control_plane/models/getconfiggroupbyproductandidop.py +14 -1
  46. cribl_control_plane/models/getconfiggroupconfigversionbyproductandidop.py +18 -2
  47. cribl_control_plane/models/getoutputpqbyidop.py +6 -5
  48. cribl_control_plane/models/getpipelinebyidop.py +2 -2
  49. cribl_control_plane/models/getroutesbyidop.py +2 -2
  50. cribl_control_plane/models/getsummaryop.py +18 -2
  51. cribl_control_plane/models/getversionbranchop.py +6 -5
  52. cribl_control_plane/models/getversioncountop.py +6 -5
  53. cribl_control_plane/models/getversiondiffop.py +6 -5
  54. cribl_control_plane/models/getversionshowop.py +6 -5
  55. cribl_control_plane/models/gitcountresult.py +13 -0
  56. cribl_control_plane/models/gitdiffresult.py +16 -0
  57. cribl_control_plane/models/gitinfo.py +14 -3
  58. cribl_control_plane/models/gitshowresult.py +19 -0
  59. cribl_control_plane/models/groupcreaterequest.py +171 -0
  60. cribl_control_plane/models/hbcriblinfo.py +39 -3
  61. cribl_control_plane/models/healthserverstatus.py +55 -0
  62. cribl_control_plane/models/heartbeatmetadata.py +3 -0
  63. cribl_control_plane/models/input.py +83 -78
  64. cribl_control_plane/models/inputappscope.py +126 -30
  65. cribl_control_plane/models/inputazureblob.py +62 -6
  66. cribl_control_plane/models/inputcloudflarehec.py +513 -0
  67. cribl_control_plane/models/inputcollection.py +47 -4
  68. cribl_control_plane/models/inputconfluentcloud.py +254 -30
  69. cribl_control_plane/models/inputcribl.py +47 -4
  70. cribl_control_plane/models/inputcriblhttp.py +121 -30
  71. cribl_control_plane/models/inputcribllakehttp.py +122 -30
  72. cribl_control_plane/models/inputcriblmetrics.py +48 -4
  73. cribl_control_plane/models/inputcribltcp.py +122 -24
  74. cribl_control_plane/models/inputcrowdstrike.py +92 -10
  75. cribl_control_plane/models/inputdatadogagent.py +98 -24
  76. cribl_control_plane/models/inputdatagen.py +47 -4
  77. cribl_control_plane/models/inputedgeprometheus.py +210 -50
  78. cribl_control_plane/models/inputelastic.py +167 -36
  79. cribl_control_plane/models/inputeventhub.py +209 -6
  80. cribl_control_plane/models/inputexec.py +59 -6
  81. cribl_control_plane/models/inputfile.py +78 -10
  82. cribl_control_plane/models/inputfirehose.py +97 -24
  83. cribl_control_plane/models/inputgooglepubsub.py +67 -6
  84. cribl_control_plane/models/inputgrafana.py +251 -71
  85. cribl_control_plane/models/inputhttp.py +97 -24
  86. cribl_control_plane/models/inputhttpraw.py +97 -24
  87. cribl_control_plane/models/inputjournalfiles.py +48 -4
  88. cribl_control_plane/models/inputkafka.py +248 -26
  89. cribl_control_plane/models/inputkinesis.py +130 -14
  90. cribl_control_plane/models/inputkubeevents.py +47 -4
  91. cribl_control_plane/models/inputkubelogs.py +61 -8
  92. cribl_control_plane/models/inputkubemetrics.py +61 -8
  93. cribl_control_plane/models/inputloki.py +113 -34
  94. cribl_control_plane/models/inputmetrics.py +97 -24
  95. cribl_control_plane/models/inputmodeldriventelemetry.py +107 -26
  96. cribl_control_plane/models/inputmsk.py +141 -30
  97. cribl_control_plane/models/inputnetflow.py +47 -4
  98. cribl_control_plane/models/inputoffice365mgmt.py +112 -14
  99. cribl_control_plane/models/inputoffice365msgtrace.py +114 -16
  100. cribl_control_plane/models/inputoffice365service.py +114 -16
  101. cribl_control_plane/models/inputopentelemetry.py +143 -32
  102. cribl_control_plane/models/inputprometheus.py +193 -44
  103. cribl_control_plane/models/inputprometheusrw.py +114 -27
  104. cribl_control_plane/models/inputrawudp.py +47 -4
  105. cribl_control_plane/models/inputs3.py +78 -8
  106. cribl_control_plane/models/inputs3inventory.py +92 -10
  107. cribl_control_plane/models/inputsecuritylake.py +93 -10
  108. cribl_control_plane/models/inputsnmp.py +68 -6
  109. cribl_control_plane/models/inputsplunk.py +130 -28
  110. cribl_control_plane/models/inputsplunkhec.py +111 -25
  111. cribl_control_plane/models/inputsplunksearch.py +108 -14
  112. cribl_control_plane/models/inputsqs.py +99 -16
  113. cribl_control_plane/models/inputsyslog.py +189 -47
  114. cribl_control_plane/models/inputsystemmetrics.py +202 -32
  115. cribl_control_plane/models/inputsystemstate.py +61 -8
  116. cribl_control_plane/models/inputtcp.py +122 -26
  117. cribl_control_plane/models/inputtcpjson.py +112 -26
  118. cribl_control_plane/models/inputwef.py +121 -15
  119. cribl_control_plane/models/inputwindowsmetrics.py +186 -33
  120. cribl_control_plane/models/inputwineventlogs.py +93 -11
  121. cribl_control_plane/models/inputwiz.py +78 -8
  122. cribl_control_plane/models/inputwizwebhook.py +97 -24
  123. cribl_control_plane/models/inputzscalerhec.py +111 -25
  124. cribl_control_plane/models/jobinfo.py +34 -0
  125. cribl_control_plane/models/jobstatus.py +48 -0
  126. cribl_control_plane/models/lakedatasetmetrics.py +17 -0
  127. cribl_control_plane/models/lakehouseconnectiontype.py +2 -1
  128. cribl_control_plane/models/listconfiggroupbyproductop.py +14 -1
  129. cribl_control_plane/models/logininfo.py +3 -3
  130. cribl_control_plane/models/masterworkerentry.py +17 -2
  131. cribl_control_plane/models/nodeactiveupgradestatus.py +2 -1
  132. cribl_control_plane/models/nodefailedupgradestatus.py +2 -1
  133. cribl_control_plane/models/nodeprovidedinfo.py +11 -1
  134. cribl_control_plane/models/nodeskippedupgradestatus.py +2 -1
  135. cribl_control_plane/models/nodeupgradestate.py +2 -1
  136. cribl_control_plane/models/nodeupgradestatus.py +51 -5
  137. cribl_control_plane/models/outpostnodeinfo.py +16 -0
  138. cribl_control_plane/models/output.py +104 -90
  139. cribl_control_plane/models/outputazureblob.py +171 -18
  140. cribl_control_plane/models/outputazuredataexplorer.py +514 -90
  141. cribl_control_plane/models/outputazureeventhub.py +315 -31
  142. cribl_control_plane/models/outputazurelogs.py +145 -26
  143. cribl_control_plane/models/outputchronicle.py +532 -0
  144. cribl_control_plane/models/outputclickhouse.py +205 -34
  145. cribl_control_plane/models/outputcloudflarer2.py +632 -0
  146. cribl_control_plane/models/outputcloudwatch.py +129 -23
  147. cribl_control_plane/models/outputconfluentcloud.py +384 -57
  148. cribl_control_plane/models/outputcriblhttp.py +199 -32
  149. cribl_control_plane/models/outputcribllake.py +156 -16
  150. cribl_control_plane/models/outputcribltcp.py +194 -29
  151. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +172 -28
  152. cribl_control_plane/models/outputdatabricks.py +501 -0
  153. cribl_control_plane/models/outputdatadog.py +199 -31
  154. cribl_control_plane/models/outputdataset.py +181 -29
  155. cribl_control_plane/models/outputdiskspool.py +17 -2
  156. cribl_control_plane/models/outputdls3.py +233 -24
  157. cribl_control_plane/models/outputdynatracehttp.py +208 -34
  158. cribl_control_plane/models/outputdynatraceotlp.py +210 -36
  159. cribl_control_plane/models/outputelastic.py +199 -30
  160. cribl_control_plane/models/outputelasticcloud.py +171 -26
  161. cribl_control_plane/models/outputexabeam.py +96 -10
  162. cribl_control_plane/models/outputfilesystem.py +139 -14
  163. cribl_control_plane/models/outputgooglechronicle.py +216 -35
  164. cribl_control_plane/models/outputgooglecloudlogging.py +174 -31
  165. cribl_control_plane/models/outputgooglecloudstorage.py +215 -24
  166. cribl_control_plane/models/outputgooglepubsub.py +131 -23
  167. cribl_control_plane/models/outputgrafanacloud.py +376 -74
  168. cribl_control_plane/models/outputgraphite.py +128 -25
  169. cribl_control_plane/models/outputhoneycomb.py +145 -26
  170. cribl_control_plane/models/outputhumiohec.py +162 -28
  171. cribl_control_plane/models/outputinfluxdb.py +165 -28
  172. cribl_control_plane/models/outputkafka.py +375 -52
  173. cribl_control_plane/models/outputkinesis.py +165 -27
  174. cribl_control_plane/models/outputloki.py +164 -34
  175. cribl_control_plane/models/outputmicrosoftfabric.py +540 -0
  176. cribl_control_plane/models/outputminio.py +225 -25
  177. cribl_control_plane/models/outputmsk.py +267 -54
  178. cribl_control_plane/models/outputnewrelic.py +171 -29
  179. cribl_control_plane/models/outputnewrelicevents.py +163 -28
  180. cribl_control_plane/models/outputopentelemetry.py +240 -40
  181. cribl_control_plane/models/outputprometheus.py +145 -26
  182. cribl_control_plane/models/outputring.py +49 -8
  183. cribl_control_plane/models/outputs3.py +233 -26
  184. cribl_control_plane/models/outputsecuritylake.py +179 -18
  185. cribl_control_plane/models/outputsentinel.py +172 -29
  186. cribl_control_plane/models/outputsentineloneaisiem.py +181 -35
  187. cribl_control_plane/models/outputservicenow.py +223 -38
  188. cribl_control_plane/models/outputsignalfx.py +145 -26
  189. cribl_control_plane/models/outputsns.py +143 -25
  190. cribl_control_plane/models/outputsplunk.py +206 -36
  191. cribl_control_plane/models/outputsplunkhec.py +238 -26
  192. cribl_control_plane/models/outputsplunklb.py +253 -43
  193. cribl_control_plane/models/outputsqs.py +163 -33
  194. cribl_control_plane/models/outputstatsd.py +127 -25
  195. cribl_control_plane/models/outputstatsdext.py +128 -25
  196. cribl_control_plane/models/outputsumologic.py +146 -25
  197. cribl_control_plane/models/outputsyslog.py +318 -46
  198. cribl_control_plane/models/outputtcpjson.py +186 -32
  199. cribl_control_plane/models/outputwavefront.py +145 -26
  200. cribl_control_plane/models/outputwebhook.py +211 -33
  201. cribl_control_plane/models/outputxsiam.py +143 -26
  202. cribl_control_plane/models/packinfo.py +8 -5
  203. cribl_control_plane/models/packinstallinfo.py +11 -8
  204. cribl_control_plane/models/productscore.py +2 -1
  205. cribl_control_plane/models/rbacresource.py +2 -1
  206. cribl_control_plane/models/resourcepolicy.py +15 -2
  207. cribl_control_plane/models/routeconf.py +3 -4
  208. cribl_control_plane/models/runnablejob.py +27 -0
  209. cribl_control_plane/models/runnablejobcollection.py +669 -0
  210. cribl_control_plane/models/runnablejobexecutor.py +368 -0
  211. cribl_control_plane/models/runnablejobscheduledsearch.py +286 -0
  212. cribl_control_plane/models/updateconfiggroupbyproductandidop.py +19 -2
  213. cribl_control_plane/models/updateconfiggroupdeploybyproductandidop.py +19 -2
  214. cribl_control_plane/models/updatecribllakedatasetbylakeidandidop.py +9 -5
  215. cribl_control_plane/models/updateinputhectokenbyidandtokenop.py +6 -5
  216. cribl_control_plane/models/updatepacksop.py +25 -0
  217. cribl_control_plane/models/updatepipelinebyidop.py +6 -6
  218. cribl_control_plane/models/updateroutesbyidop.py +2 -2
  219. cribl_control_plane/models/uploadpackresponse.py +13 -0
  220. cribl_control_plane/models/workertypes.py +2 -1
  221. cribl_control_plane/nodes.py +5 -3
  222. cribl_control_plane/packs.py +202 -7
  223. cribl_control_plane/pipelines.py +18 -18
  224. cribl_control_plane/routes_sdk.py +22 -22
  225. cribl_control_plane/sdk.py +19 -6
  226. cribl_control_plane/sources.py +5 -3
  227. cribl_control_plane/tokens.py +23 -15
  228. cribl_control_plane/utils/__init__.py +15 -3
  229. cribl_control_plane/utils/annotations.py +32 -8
  230. cribl_control_plane/utils/eventstreaming.py +10 -0
  231. cribl_control_plane/utils/retries.py +69 -5
  232. cribl_control_plane/utils/unmarshal_json_response.py +15 -1
  233. cribl_control_plane/versions.py +11 -6
  234. {cribl_control_plane-0.0.38.dist-info → cribl_control_plane-0.4.0a6.dist-info}/METADATA +69 -23
  235. cribl_control_plane-0.4.0a6.dist-info/RECORD +336 -0
  236. {cribl_control_plane-0.0.38.dist-info → cribl_control_plane-0.4.0a6.dist-info}/WHEEL +1 -1
  237. cribl_control_plane-0.4.0a6.dist-info/licenses/LICENSE +201 -0
  238. cribl_control_plane/errors/healthstatus_error.py +0 -32
  239. cribl_control_plane/models/appmode.py +0 -13
  240. cribl_control_plane/models/healthstatus.py +0 -33
  241. cribl_control_plane-0.0.38.dist-info/RECORD +0 -315
@@ -20,9 +20,9 @@ class RoutesSDK(BaseSDK):
20
20
  timeout_ms: Optional[int] = None,
21
21
  http_headers: Optional[Mapping[str, str]] = None,
22
22
  ) -> models.ListRoutesResponse:
23
- r"""Get a list of Routes objects
23
+ r"""List all Routes
24
24
 
25
- Get a list of Routes objects
25
+ Get a list of all Routes.
26
26
 
27
27
  :param retries: Override the default retry configuration for this method
28
28
  :param server_url: Override the default server URL for this method
@@ -100,9 +100,9 @@ class RoutesSDK(BaseSDK):
100
100
  timeout_ms: Optional[int] = None,
101
101
  http_headers: Optional[Mapping[str, str]] = None,
102
102
  ) -> models.ListRoutesResponse:
103
- r"""Get a list of Routes objects
103
+ r"""List all Routes
104
104
 
105
- Get a list of Routes objects
105
+ Get a list of all Routes.
106
106
 
107
107
  :param retries: Override the default retry configuration for this method
108
108
  :param server_url: Override the default server URL for this method
@@ -181,11 +181,11 @@ class RoutesSDK(BaseSDK):
181
181
  timeout_ms: Optional[int] = None,
182
182
  http_headers: Optional[Mapping[str, str]] = None,
183
183
  ) -> models.GetRoutesByIDResponse:
184
- r"""Get Routes by ID
184
+ r"""Get a Routing table
185
185
 
186
- Get Routes by ID
186
+ Get the specified Routing table.
187
187
 
188
- :param id: Unique ID to GET
188
+ :param id: The <code>id</code> of the Routing table to get. The supported value is <code>default</code>.
189
189
  :param retries: Override the default retry configuration for this method
190
190
  :param server_url: Override the default server URL for this method
191
191
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -268,11 +268,11 @@ class RoutesSDK(BaseSDK):
268
268
  timeout_ms: Optional[int] = None,
269
269
  http_headers: Optional[Mapping[str, str]] = None,
270
270
  ) -> models.GetRoutesByIDResponse:
271
- r"""Get Routes by ID
271
+ r"""Get a Routing table
272
272
 
273
- Get Routes by ID
273
+ Get the specified Routing table.
274
274
 
275
- :param id: Unique ID to GET
275
+ :param id: The <code>id</code> of the Routing table to get. The supported value is <code>default</code>.
276
276
  :param retries: Override the default retry configuration for this method
277
277
  :param server_url: Override the default server URL for this method
278
278
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -365,11 +365,11 @@ class RoutesSDK(BaseSDK):
365
365
  timeout_ms: Optional[int] = None,
366
366
  http_headers: Optional[Mapping[str, str]] = None,
367
367
  ) -> models.UpdateRoutesByIDResponse:
368
- r"""Update Routes
368
+ r"""Update a Route
369
369
 
370
- Update Routes
370
+ Update a Route in the specified Routing table.</br></br>Provide a complete representation of the Routing table, including the Route that you want to update, in the request body. This endpoint does not support partial updates. Cribl removes any omitted Routes and fields when updating.</br></br>Confirm that the configuration in your request body is correct before sending the request. If the configuration is incorrect, the Routing table might not function as expected.
371
371
 
372
- :param id_param: Unique ID to PATCH
372
+ :param id_param: The <code>id</code> of the Routing table that contains the Route to update. The supported value is <code>default</code>.
373
373
  :param routes: Pipeline routing rules
374
374
  :param id: Routes ID
375
375
  :param groups:
@@ -479,11 +479,11 @@ class RoutesSDK(BaseSDK):
479
479
  timeout_ms: Optional[int] = None,
480
480
  http_headers: Optional[Mapping[str, str]] = None,
481
481
  ) -> models.UpdateRoutesByIDResponse:
482
- r"""Update Routes
482
+ r"""Update a Route
483
483
 
484
- Update Routes
484
+ Update a Route in the specified Routing table.</br></br>Provide a complete representation of the Routing table, including the Route that you want to update, in the request body. This endpoint does not support partial updates. Cribl removes any omitted Routes and fields when updating.</br></br>Confirm that the configuration in your request body is correct before sending the request. If the configuration is incorrect, the Routing table might not function as expected.
485
485
 
486
- :param id_param: Unique ID to PATCH
486
+ :param id_param: The <code>id</code> of the Routing table that contains the Route to update. The supported value is <code>default</code>.
487
487
  :param routes: Pipeline routing rules
488
488
  :param id: Routes ID
489
489
  :param groups:
@@ -584,11 +584,11 @@ class RoutesSDK(BaseSDK):
584
584
  timeout_ms: Optional[int] = None,
585
585
  http_headers: Optional[Mapping[str, str]] = None,
586
586
  ) -> models.CreateRoutesAppendByIDResponse:
587
- r"""Append Routes to the end of the Routing table
587
+ r"""Add a Route to the end of the Routing table
588
588
 
589
- Appends routes to the end of the routing table
589
+ Add a Route to the end of the specified Routing table.
590
590
 
591
- :param id: the route table to be appended to - currently default is the only supported value
591
+ :param id: The <code>id</code> of the Routing table to add the Route to. The supported value is <code>default</code>.
592
592
  :param request_body: RouteDefinitions object
593
593
  :param retries: Override the default retry configuration for this method
594
594
  :param server_url: Override the default server URL for this method
@@ -679,11 +679,11 @@ class RoutesSDK(BaseSDK):
679
679
  timeout_ms: Optional[int] = None,
680
680
  http_headers: Optional[Mapping[str, str]] = None,
681
681
  ) -> models.CreateRoutesAppendByIDResponse:
682
- r"""Append Routes to the end of the Routing table
682
+ r"""Add a Route to the end of the Routing table
683
683
 
684
- Appends routes to the end of the routing table
684
+ Add a Route to the end of the specified Routing table.
685
685
 
686
- :param id: the route table to be appended to - currently default is the only supported value
686
+ :param id: The <code>id</code> of the Routing table to add the Route to. The supported value is <code>default</code>.
687
687
  :param request_body: RouteDefinitions object
688
688
  :param retries: Override the default retry configuration for this method
689
689
  :param server_url: Override the default server URL for this method
@@ -10,6 +10,7 @@ from cribl_control_plane._hooks import SDKHooks
10
10
  from cribl_control_plane.types import OptionalNullable, UNSET
11
11
  import httpx
12
12
  import importlib
13
+ import sys
13
14
  from typing import Callable, Optional, TYPE_CHECKING, Union, cast
14
15
  import weakref
15
16
 
@@ -40,12 +41,12 @@ class CriblControlPlane(BaseSDK):
40
41
  routes: "RoutesSDK"
41
42
  r"""Actions related to Routes"""
42
43
  auth: "AuthSDK"
43
- nodes: "Nodes"
44
44
  health: "Health"
45
45
  r"""Actions related to REST server health"""
46
46
  packs: "Packs"
47
47
  r"""Actions related to Packs"""
48
48
  versions: "Versions"
49
+ nodes: "Nodes"
49
50
  groups: "GroupsSDK"
50
51
  r"""Actions related to Groups"""
51
52
  _sub_sdk_map = {
@@ -55,10 +56,10 @@ class CriblControlPlane(BaseSDK):
55
56
  "pipelines": ("cribl_control_plane.pipelines", "Pipelines"),
56
57
  "routes": ("cribl_control_plane.routes_sdk", "RoutesSDK"),
57
58
  "auth": ("cribl_control_plane.auth_sdk", "AuthSDK"),
58
- "nodes": ("cribl_control_plane.nodes", "Nodes"),
59
59
  "health": ("cribl_control_plane.health", "Health"),
60
60
  "packs": ("cribl_control_plane.packs", "Packs"),
61
61
  "versions": ("cribl_control_plane.versions", "Versions"),
62
+ "nodes": ("cribl_control_plane.nodes", "Nodes"),
62
63
  "groups": ("cribl_control_plane.groups_sdk", "GroupsSDK"),
63
64
  }
64
65
 
@@ -87,7 +88,7 @@ class CriblControlPlane(BaseSDK):
87
88
  """
88
89
  client_supplied = True
89
90
  if client is None:
90
- client = httpx.Client()
91
+ client = httpx.Client(follow_redirects=True)
91
92
  client_supplied = False
92
93
 
93
94
  assert issubclass(
@@ -96,7 +97,7 @@ class CriblControlPlane(BaseSDK):
96
97
 
97
98
  async_client_supplied = True
98
99
  if async_client is None:
99
- async_client = httpx.AsyncClient()
100
+ async_client = httpx.AsyncClient(follow_redirects=True)
100
101
  async_client_supplied = False
101
102
 
102
103
  if debug_logger is None:
@@ -119,6 +120,7 @@ class CriblControlPlane(BaseSDK):
119
120
  timeout_ms=timeout_ms,
120
121
  debug_logger=debug_logger,
121
122
  ),
123
+ parent_ref=self,
122
124
  )
123
125
 
124
126
  hooks = SDKHooks()
@@ -138,13 +140,24 @@ class CriblControlPlane(BaseSDK):
138
140
  self.sdk_configuration.async_client_supplied,
139
141
  )
140
142
 
143
+ def dynamic_import(self, modname, retries=3):
144
+ for attempt in range(retries):
145
+ try:
146
+ return importlib.import_module(modname)
147
+ except KeyError:
148
+ # Clear any half-initialized module and retry
149
+ sys.modules.pop(modname, None)
150
+ if attempt == retries - 1:
151
+ break
152
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
153
+
141
154
  def __getattr__(self, name: str):
142
155
  if name in self._sub_sdk_map:
143
156
  module_path, class_name = self._sub_sdk_map[name]
144
157
  try:
145
- module = importlib.import_module(module_path)
158
+ module = self.dynamic_import(module_path)
146
159
  klass = getattr(module, class_name)
147
- instance = klass(self.sdk_configuration)
160
+ instance = klass(self.sdk_configuration, parent_ref=self)
148
161
  setattr(self, name, instance)
149
162
  return instance
150
163
  except ImportError as e:
@@ -16,13 +16,15 @@ class Sources(BaseSDK):
16
16
 
17
17
  hec_tokens: HecTokens
18
18
 
19
- def __init__(self, sdk_config: SDKConfiguration) -> None:
20
- BaseSDK.__init__(self, sdk_config)
19
+ def __init__(
20
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
21
+ ) -> None:
22
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
21
23
  self.sdk_configuration = sdk_config
22
24
  self._init_sdks()
23
25
 
24
26
  def _init_sdks(self):
25
- self.hec_tokens = HecTokens(self.sdk_configuration)
27
+ self.hec_tokens = HecTokens(self.sdk_configuration, parent_ref=self.parent_ref)
26
28
 
27
29
  def list(
28
30
  self,
@@ -5,15 +5,15 @@ from cribl_control_plane import errors, models, utils
5
5
  from cribl_control_plane._hooks import HookContext
6
6
  from cribl_control_plane.types import OptionalNullable, UNSET
7
7
  from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
8
- from typing import Mapping, Optional
8
+ from typing import Any, Mapping, Optional
9
9
 
10
10
 
11
11
  class Tokens(BaseSDK):
12
12
  def get(
13
13
  self,
14
14
  *,
15
- username: str,
16
15
  password: str,
16
+ username: str,
17
17
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
18
18
  server_url: Optional[str] = None,
19
19
  timeout_ms: Optional[int] = None,
@@ -21,10 +21,10 @@ class Tokens(BaseSDK):
21
21
  ) -> models.AuthToken:
22
22
  r"""Log in and fetch an authentication token
23
23
 
24
- This endpoint is unavailable on Cribl.Cloud. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
24
+ This endpoint is unavailable on Cribl.Cloud.Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
25
25
 
26
- :param username:
27
26
  :param password:
27
+ :param username:
28
28
  :param retries: Override the default retry configuration for this method
29
29
  :param server_url: Override the default server URL for this method
30
30
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -41,8 +41,8 @@ class Tokens(BaseSDK):
41
41
  base_url = self._get_url(base_url, url_variables)
42
42
 
43
43
  request = models.LoginInfo(
44
- username=username,
45
44
  password=password,
45
+ username=username,
46
46
  )
47
47
 
48
48
  req = self._build_request(
@@ -75,18 +75,22 @@ class Tokens(BaseSDK):
75
75
  hook_ctx=HookContext(
76
76
  config=self.sdk_configuration,
77
77
  base_url=base_url or "",
78
- operation_id="login",
78
+ operation_id="createAuthLogin",
79
79
  oauth2_scopes=[],
80
80
  security_source=None,
81
81
  ),
82
82
  request=req,
83
- error_status_codes=["401", "403", "429", "4XX", "5XX"],
83
+ error_status_codes=["401", "429", "4XX", "500", "5XX"],
84
84
  retry_config=retry_config,
85
85
  )
86
86
 
87
+ response_data: Any = None
87
88
  if utils.match_response(http_res, "200", "application/json"):
88
89
  return unmarshal_json_response(models.AuthToken, http_res)
89
- if utils.match_response(http_res, ["401", "403", "429", "4XX"], "*"):
90
+ if utils.match_response(http_res, "500", "application/json"):
91
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
92
+ raise errors.Error(response_data, http_res)
93
+ if utils.match_response(http_res, ["401", "429", "4XX"], "*"):
90
94
  http_res_text = utils.stream_to_text(http_res)
91
95
  raise errors.APIError("API error occurred", http_res, http_res_text)
92
96
  if utils.match_response(http_res, "5XX", "*"):
@@ -98,8 +102,8 @@ class Tokens(BaseSDK):
98
102
  async def get_async(
99
103
  self,
100
104
  *,
101
- username: str,
102
105
  password: str,
106
+ username: str,
103
107
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
104
108
  server_url: Optional[str] = None,
105
109
  timeout_ms: Optional[int] = None,
@@ -107,10 +111,10 @@ class Tokens(BaseSDK):
107
111
  ) -> models.AuthToken:
108
112
  r"""Log in and fetch an authentication token
109
113
 
110
- This endpoint is unavailable on Cribl.Cloud. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
114
+ This endpoint is unavailable on Cribl.Cloud.Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.
111
115
 
112
- :param username:
113
116
  :param password:
117
+ :param username:
114
118
  :param retries: Override the default retry configuration for this method
115
119
  :param server_url: Override the default server URL for this method
116
120
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -127,8 +131,8 @@ class Tokens(BaseSDK):
127
131
  base_url = self._get_url(base_url, url_variables)
128
132
 
129
133
  request = models.LoginInfo(
130
- username=username,
131
134
  password=password,
135
+ username=username,
132
136
  )
133
137
 
134
138
  req = self._build_request_async(
@@ -161,18 +165,22 @@ class Tokens(BaseSDK):
161
165
  hook_ctx=HookContext(
162
166
  config=self.sdk_configuration,
163
167
  base_url=base_url or "",
164
- operation_id="login",
168
+ operation_id="createAuthLogin",
165
169
  oauth2_scopes=[],
166
170
  security_source=None,
167
171
  ),
168
172
  request=req,
169
- error_status_codes=["401", "403", "429", "4XX", "5XX"],
173
+ error_status_codes=["401", "429", "4XX", "500", "5XX"],
170
174
  retry_config=retry_config,
171
175
  )
172
176
 
177
+ response_data: Any = None
173
178
  if utils.match_response(http_res, "200", "application/json"):
174
179
  return unmarshal_json_response(models.AuthToken, http_res)
175
- if utils.match_response(http_res, ["401", "403", "429", "4XX"], "*"):
180
+ if utils.match_response(http_res, "500", "application/json"):
181
+ response_data = unmarshal_json_response(errors.ErrorData, http_res)
182
+ raise errors.Error(response_data, http_res)
183
+ if utils.match_response(http_res, ["401", "429", "4XX"], "*"):
176
184
  http_res_text = await utils.stream_to_text_async(http_res)
177
185
  raise errors.APIError("API error occurred", http_res, http_res_text)
178
186
  if utils.match_response(http_res, "5XX", "*"):
@@ -3,6 +3,7 @@
3
3
  from typing import TYPE_CHECKING
4
4
  from importlib import import_module
5
5
  import builtins
6
+ import sys
6
7
 
7
8
  if TYPE_CHECKING:
8
9
  from .annotations import get_discriminator
@@ -162,6 +163,18 @@ _dynamic_imports: dict[str, str] = {
162
163
  }
163
164
 
164
165
 
166
+ def dynamic_import(modname, retries=3):
167
+ for attempt in range(retries):
168
+ try:
169
+ return import_module(modname, __package__)
170
+ except KeyError:
171
+ # Clear any half-initialized module and retry
172
+ sys.modules.pop(modname, None)
173
+ if attempt == retries - 1:
174
+ break
175
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
176
+
177
+
165
178
  def __getattr__(attr_name: str) -> object:
166
179
  module_name = _dynamic_imports.get(attr_name)
167
180
  if module_name is None:
@@ -170,9 +183,8 @@ def __getattr__(attr_name: str) -> object:
170
183
  )
171
184
 
172
185
  try:
173
- module = import_module(module_name, __package__)
174
- result = getattr(module, attr_name)
175
- return result
186
+ module = dynamic_import(module_name)
187
+ return getattr(module, attr_name)
176
188
  except ImportError as e:
177
189
  raise ImportError(
178
190
  f"Failed to import {attr_name} from {module_name}: {e}"
@@ -3,6 +3,7 @@
3
3
  from enum import Enum
4
4
  from typing import Any, Optional
5
5
 
6
+
6
7
  def get_discriminator(model: Any, fieldname: str, key: str) -> str:
7
8
  """
8
9
  Recursively search for the discriminator attribute in a model.
@@ -25,31 +26,54 @@ def get_discriminator(model: Any, fieldname: str, key: str) -> str:
25
26
 
26
27
  if isinstance(field, dict):
27
28
  if key in field:
28
- return f'{field[key]}'
29
+ return f"{field[key]}"
29
30
 
30
31
  if hasattr(field, fieldname):
31
32
  attr = getattr(field, fieldname)
32
33
  if isinstance(attr, Enum):
33
- return f'{attr.value}'
34
- return f'{attr}'
34
+ return f"{attr.value}"
35
+ return f"{attr}"
35
36
 
36
37
  if hasattr(field, upper_fieldname):
37
38
  attr = getattr(field, upper_fieldname)
38
39
  if isinstance(attr, Enum):
39
- return f'{attr.value}'
40
- return f'{attr}'
40
+ return f"{attr.value}"
41
+ return f"{attr}"
41
42
 
42
43
  return None
43
44
 
45
+ def search_nested_discriminator(obj: Any) -> Optional[str]:
46
+ """Recursively search for discriminator in nested structures."""
47
+ # First try direct field lookup
48
+ discriminator = get_field_discriminator(obj)
49
+ if discriminator is not None:
50
+ return discriminator
51
+
52
+ # If it's a dict, search in nested values
53
+ if isinstance(obj, dict):
54
+ for value in obj.values():
55
+ if isinstance(value, list):
56
+ # Search in list items
57
+ for item in value:
58
+ nested_discriminator = search_nested_discriminator(item)
59
+ if nested_discriminator is not None:
60
+ return nested_discriminator
61
+ elif isinstance(value, dict):
62
+ # Search in nested dict
63
+ nested_discriminator = search_nested_discriminator(value)
64
+ if nested_discriminator is not None:
65
+ return nested_discriminator
66
+
67
+ return None
44
68
 
45
69
  if isinstance(model, list):
46
70
  for field in model:
47
- discriminator = get_field_discriminator(field)
71
+ discriminator = search_nested_discriminator(field)
48
72
  if discriminator is not None:
49
73
  return discriminator
50
74
 
51
- discriminator = get_field_discriminator(model)
75
+ discriminator = search_nested_discriminator(model)
52
76
  if discriminator is not None:
53
77
  return discriminator
54
78
 
55
- raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
79
+ raise ValueError(f"Could not find discriminator field {fieldname} in {model}")
@@ -17,6 +17,9 @@ T = TypeVar("T")
17
17
 
18
18
 
19
19
  class EventStream(Generic[T]):
20
+ # Holds a reference to the SDK client to avoid it being garbage collected
21
+ # and cause termination of the underlying httpx client.
22
+ client_ref: Optional[object]
20
23
  response: httpx.Response
21
24
  generator: Generator[T, None, None]
22
25
 
@@ -25,9 +28,11 @@ class EventStream(Generic[T]):
25
28
  response: httpx.Response,
26
29
  decoder: Callable[[str], T],
27
30
  sentinel: Optional[str] = None,
31
+ client_ref: Optional[object] = None,
28
32
  ):
29
33
  self.response = response
30
34
  self.generator = stream_events(response, decoder, sentinel)
35
+ self.client_ref = client_ref
31
36
 
32
37
  def __iter__(self):
33
38
  return self
@@ -43,6 +48,9 @@ class EventStream(Generic[T]):
43
48
 
44
49
 
45
50
  class EventStreamAsync(Generic[T]):
51
+ # Holds a reference to the SDK client to avoid it being garbage collected
52
+ # and cause termination of the underlying httpx client.
53
+ client_ref: Optional[object]
46
54
  response: httpx.Response
47
55
  generator: AsyncGenerator[T, None]
48
56
 
@@ -51,9 +59,11 @@ class EventStreamAsync(Generic[T]):
51
59
  response: httpx.Response,
52
60
  decoder: Callable[[str], T],
53
61
  sentinel: Optional[str] = None,
62
+ client_ref: Optional[object] = None,
54
63
  ):
55
64
  self.response = response
56
65
  self.generator = stream_events_async(response, decoder, sentinel)
66
+ self.client_ref = client_ref
57
67
 
58
68
  def __aiter__(self):
59
69
  return self
@@ -3,7 +3,9 @@
3
3
  import asyncio
4
4
  import random
5
5
  import time
6
- from typing import List
6
+ from datetime import datetime
7
+ from email.utils import parsedate_to_datetime
8
+ from typing import List, Optional
7
9
 
8
10
  import httpx
9
11
 
@@ -51,9 +53,11 @@ class Retries:
51
53
 
52
54
  class TemporaryError(Exception):
53
55
  response: httpx.Response
56
+ retry_after: Optional[int]
54
57
 
55
58
  def __init__(self, response: httpx.Response):
56
59
  self.response = response
60
+ self.retry_after = _parse_retry_after_header(response)
57
61
 
58
62
 
59
63
  class PermanentError(Exception):
@@ -63,6 +67,62 @@ class PermanentError(Exception):
63
67
  self.inner = inner
64
68
 
65
69
 
70
+ def _parse_retry_after_header(response: httpx.Response) -> Optional[int]:
71
+ """Parse Retry-After header from response.
72
+
73
+ Returns:
74
+ Retry interval in milliseconds, or None if header is missing or invalid.
75
+ """
76
+ retry_after_header = response.headers.get("retry-after")
77
+ if not retry_after_header:
78
+ return None
79
+
80
+ try:
81
+ seconds = float(retry_after_header)
82
+ return round(seconds * 1000)
83
+ except ValueError:
84
+ pass
85
+
86
+ try:
87
+ retry_date = parsedate_to_datetime(retry_after_header)
88
+ delta = (retry_date - datetime.now(retry_date.tzinfo)).total_seconds()
89
+ return round(max(0, delta) * 1000)
90
+ except (ValueError, TypeError):
91
+ pass
92
+
93
+ return None
94
+
95
+
96
+ def _get_sleep_interval(
97
+ exception: Exception,
98
+ initial_interval: int,
99
+ max_interval: int,
100
+ exponent: float,
101
+ retries: int,
102
+ ) -> float:
103
+ """Get sleep interval for retry with exponential backoff.
104
+
105
+ Args:
106
+ exception: The exception that triggered the retry.
107
+ initial_interval: Initial retry interval in milliseconds.
108
+ max_interval: Maximum retry interval in milliseconds.
109
+ exponent: Base for exponential backoff calculation.
110
+ retries: Current retry attempt count.
111
+
112
+ Returns:
113
+ Sleep interval in seconds.
114
+ """
115
+ if (
116
+ isinstance(exception, TemporaryError)
117
+ and exception.retry_after is not None
118
+ and exception.retry_after > 0
119
+ ):
120
+ return exception.retry_after / 1000
121
+
122
+ sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1)
123
+ return min(sleep, max_interval / 1000)
124
+
125
+
66
126
  def retry(func, retries: Retries):
67
127
  if retries.config.strategy == "backoff":
68
128
 
@@ -183,8 +243,10 @@ def retry_with_backoff(
183
243
  return exception.response
184
244
 
185
245
  raise
186
- sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1)
187
- sleep = min(sleep, max_interval / 1000)
246
+
247
+ sleep = _get_sleep_interval(
248
+ exception, initial_interval, max_interval, exponent, retries
249
+ )
188
250
  time.sleep(sleep)
189
251
  retries += 1
190
252
 
@@ -211,7 +273,9 @@ async def retry_with_backoff_async(
211
273
  return exception.response
212
274
 
213
275
  raise
214
- sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1)
215
- sleep = min(sleep, max_interval / 1000)
276
+
277
+ sleep = _get_sleep_interval(
278
+ exception, initial_interval, max_interval, exponent, retries
279
+ )
216
280
  await asyncio.sleep(sleep)
217
281
  retries += 1
@@ -1,12 +1,26 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
- from typing import Any, Optional
3
+ from typing import Any, Optional, Type, TypeVar, overload
4
4
 
5
5
  import httpx
6
6
 
7
7
  from .serializers import unmarshal_json
8
8
  from cribl_control_plane import errors
9
9
 
10
+ T = TypeVar("T")
11
+
12
+
13
+ @overload
14
+ def unmarshal_json_response(
15
+ typ: Type[T], http_res: httpx.Response, body: Optional[str] = None
16
+ ) -> T: ...
17
+
18
+
19
+ @overload
20
+ def unmarshal_json_response(
21
+ typ: Any, http_res: httpx.Response, body: Optional[str] = None
22
+ ) -> Any: ...
23
+
10
24
 
11
25
  def unmarshal_json_response(
12
26
  typ: Any, http_res: httpx.Response, body: Optional[str] = None
@@ -6,6 +6,7 @@ from cribl_control_plane.branches import Branches
6
6
  from cribl_control_plane.commits import Commits
7
7
  from cribl_control_plane.statuses import Statuses
8
8
  from cribl_control_plane.versions_configs import VersionsConfigs
9
+ from typing import Optional
9
10
 
10
11
 
11
12
  class Versions(BaseSDK):
@@ -14,13 +15,17 @@ class Versions(BaseSDK):
14
15
  configs: VersionsConfigs
15
16
  statuses: Statuses
16
17
 
17
- def __init__(self, sdk_config: SDKConfiguration) -> None:
18
- BaseSDK.__init__(self, sdk_config)
18
+ def __init__(
19
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
20
+ ) -> None:
21
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
19
22
  self.sdk_configuration = sdk_config
20
23
  self._init_sdks()
21
24
 
22
25
  def _init_sdks(self):
23
- self.branches = Branches(self.sdk_configuration)
24
- self.commits = Commits(self.sdk_configuration)
25
- self.configs = VersionsConfigs(self.sdk_configuration)
26
- self.statuses = Statuses(self.sdk_configuration)
26
+ self.branches = Branches(self.sdk_configuration, parent_ref=self.parent_ref)
27
+ self.commits = Commits(self.sdk_configuration, parent_ref=self.parent_ref)
28
+ self.configs = VersionsConfigs(
29
+ self.sdk_configuration, parent_ref=self.parent_ref
30
+ )
31
+ self.statuses = Statuses(self.sdk_configuration, parent_ref=self.parent_ref)