cribl-control-plane 0.2.1rc7__py3-none-any.whl → 0.3.0a1__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 (179) hide show
  1. cribl_control_plane/_version.py +4 -4
  2. cribl_control_plane/errors/__init__.py +5 -8
  3. cribl_control_plane/errors/{healthserverstatus_error.py → healthstatus_error.py} +9 -10
  4. cribl_control_plane/groups_sdk.py +28 -52
  5. cribl_control_plane/health.py +16 -22
  6. cribl_control_plane/models/__init__.py +54 -217
  7. cribl_control_plane/models/appmode.py +14 -0
  8. cribl_control_plane/models/authtoken.py +1 -5
  9. cribl_control_plane/models/cacheconnection.py +0 -20
  10. cribl_control_plane/models/configgroup.py +7 -55
  11. cribl_control_plane/models/configgroupcloud.py +1 -11
  12. cribl_control_plane/models/createconfiggroupbyproductop.py +5 -17
  13. cribl_control_plane/models/createroutesappendbyidop.py +2 -2
  14. cribl_control_plane/models/createversionundoop.py +3 -3
  15. cribl_control_plane/models/cribllakedataset.py +1 -11
  16. cribl_control_plane/models/cribllakedatasetupdate.py +1 -11
  17. cribl_control_plane/models/datasetmetadata.py +1 -11
  18. cribl_control_plane/models/deleteconfiggroupbyproductandidop.py +0 -11
  19. cribl_control_plane/models/deleteoutputpqbyidop.py +2 -2
  20. cribl_control_plane/models/distributedsummary.py +0 -6
  21. cribl_control_plane/models/error.py +16 -0
  22. cribl_control_plane/models/getconfiggroupaclbyproductandidop.py +0 -20
  23. cribl_control_plane/models/getconfiggroupaclteamsbyproductandidop.py +0 -20
  24. cribl_control_plane/models/getconfiggroupbyproductandidop.py +0 -11
  25. cribl_control_plane/models/getconfiggroupconfigversionbyproductandidop.py +0 -11
  26. cribl_control_plane/models/gethealthinfoop.py +17 -0
  27. cribl_control_plane/models/getsummaryop.py +0 -11
  28. cribl_control_plane/models/hbcriblinfo.py +3 -24
  29. cribl_control_plane/models/{healthserverstatus.py → healthstatus.py} +8 -27
  30. cribl_control_plane/models/heartbeatmetadata.py +0 -3
  31. cribl_control_plane/models/input.py +78 -80
  32. cribl_control_plane/models/inputappscope.py +17 -80
  33. cribl_control_plane/models/inputazureblob.py +1 -33
  34. cribl_control_plane/models/inputcollection.py +1 -24
  35. cribl_control_plane/models/inputconfluentcloud.py +18 -195
  36. cribl_control_plane/models/inputcribl.py +1 -24
  37. cribl_control_plane/models/inputcriblhttp.py +17 -62
  38. cribl_control_plane/models/inputcribllakehttp.py +17 -62
  39. cribl_control_plane/models/inputcriblmetrics.py +1 -24
  40. cribl_control_plane/models/inputcribltcp.py +17 -62
  41. cribl_control_plane/models/inputcrowdstrike.py +1 -54
  42. cribl_control_plane/models/inputdatadogagent.py +17 -62
  43. cribl_control_plane/models/inputdatagen.py +1 -24
  44. cribl_control_plane/models/inputedgeprometheus.py +34 -147
  45. cribl_control_plane/models/inputelastic.py +27 -119
  46. cribl_control_plane/models/inputeventhub.py +1 -182
  47. cribl_control_plane/models/inputexec.py +1 -33
  48. cribl_control_plane/models/inputfile.py +3 -42
  49. cribl_control_plane/models/inputfirehose.py +17 -62
  50. cribl_control_plane/models/inputgooglepubsub.py +1 -36
  51. cribl_control_plane/models/inputgrafana.py +32 -157
  52. cribl_control_plane/models/inputhttp.py +17 -62
  53. cribl_control_plane/models/inputhttpraw.py +17 -62
  54. cribl_control_plane/models/inputjournalfiles.py +1 -24
  55. cribl_control_plane/models/inputkafka.py +17 -189
  56. cribl_control_plane/models/inputkinesis.py +1 -80
  57. cribl_control_plane/models/inputkubeevents.py +1 -24
  58. cribl_control_plane/models/inputkubelogs.py +1 -33
  59. cribl_control_plane/models/inputkubemetrics.py +1 -33
  60. cribl_control_plane/models/inputloki.py +17 -71
  61. cribl_control_plane/models/inputmetrics.py +17 -62
  62. cribl_control_plane/models/inputmodeldriventelemetry.py +17 -62
  63. cribl_control_plane/models/inputmsk.py +18 -81
  64. cribl_control_plane/models/inputnetflow.py +1 -24
  65. cribl_control_plane/models/inputoffice365mgmt.py +1 -67
  66. cribl_control_plane/models/inputoffice365msgtrace.py +1 -67
  67. cribl_control_plane/models/inputoffice365service.py +1 -67
  68. cribl_control_plane/models/inputopentelemetry.py +16 -92
  69. cribl_control_plane/models/inputprometheus.py +34 -138
  70. cribl_control_plane/models/inputprometheusrw.py +17 -71
  71. cribl_control_plane/models/inputrawudp.py +1 -24
  72. cribl_control_plane/models/inputs3.py +1 -45
  73. cribl_control_plane/models/inputs3inventory.py +1 -54
  74. cribl_control_plane/models/inputsecuritylake.py +1 -54
  75. cribl_control_plane/models/inputsnmp.py +1 -40
  76. cribl_control_plane/models/inputsplunk.py +17 -85
  77. cribl_control_plane/models/inputsplunkhec.py +16 -70
  78. cribl_control_plane/models/inputsplunksearch.py +1 -63
  79. cribl_control_plane/models/inputsqs.py +1 -56
  80. cribl_control_plane/models/inputsyslog.py +32 -121
  81. cribl_control_plane/models/inputsystemmetrics.py +9 -142
  82. cribl_control_plane/models/inputsystemstate.py +1 -33
  83. cribl_control_plane/models/inputtcp.py +17 -81
  84. cribl_control_plane/models/inputtcpjson.py +17 -71
  85. cribl_control_plane/models/inputwef.py +1 -71
  86. cribl_control_plane/models/inputwindowsmetrics.py +9 -129
  87. cribl_control_plane/models/inputwineventlogs.py +1 -60
  88. cribl_control_plane/models/inputwiz.py +1 -45
  89. cribl_control_plane/models/inputwizwebhook.py +17 -62
  90. cribl_control_plane/models/inputzscalerhec.py +16 -70
  91. cribl_control_plane/models/jobinfo.py +1 -4
  92. cribl_control_plane/models/jobstatus.py +3 -34
  93. cribl_control_plane/models/listconfiggroupbyproductop.py +0 -11
  94. cribl_control_plane/models/logininfo.py +3 -3
  95. cribl_control_plane/models/masterworkerentry.py +1 -11
  96. cribl_control_plane/models/nodeprovidedinfo.py +1 -11
  97. cribl_control_plane/models/nodeupgradestatus.py +0 -38
  98. cribl_control_plane/models/output.py +88 -93
  99. cribl_control_plane/models/outputazureblob.py +1 -110
  100. cribl_control_plane/models/outputazuredataexplorer.py +87 -452
  101. cribl_control_plane/models/outputazureeventhub.py +19 -281
  102. cribl_control_plane/models/outputazurelogs.py +19 -115
  103. cribl_control_plane/models/outputchronicle.py +19 -115
  104. cribl_control_plane/models/outputclickhouse.py +19 -155
  105. cribl_control_plane/models/outputcloudwatch.py +19 -106
  106. cribl_control_plane/models/outputconfluentcloud.py +38 -311
  107. cribl_control_plane/models/outputcriblhttp.py +19 -135
  108. cribl_control_plane/models/outputcribllake.py +1 -97
  109. cribl_control_plane/models/outputcribltcp.py +19 -132
  110. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +20 -129
  111. cribl_control_plane/models/outputdatadog.py +19 -159
  112. cribl_control_plane/models/outputdataset.py +19 -143
  113. cribl_control_plane/models/outputdiskspool.py +1 -11
  114. cribl_control_plane/models/outputdls3.py +1 -152
  115. cribl_control_plane/models/outputdynatracehttp.py +19 -160
  116. cribl_control_plane/models/outputdynatraceotlp.py +19 -160
  117. cribl_control_plane/models/outputelastic.py +19 -163
  118. cribl_control_plane/models/outputelasticcloud.py +19 -140
  119. cribl_control_plane/models/outputexabeam.py +1 -61
  120. cribl_control_plane/models/outputfilesystem.py +1 -87
  121. cribl_control_plane/models/outputgooglechronicle.py +20 -166
  122. cribl_control_plane/models/outputgooglecloudlogging.py +20 -131
  123. cribl_control_plane/models/outputgooglecloudstorage.py +1 -136
  124. cribl_control_plane/models/outputgooglepubsub.py +19 -106
  125. cribl_control_plane/models/outputgrafanacloud.py +37 -288
  126. cribl_control_plane/models/outputgraphite.py +19 -105
  127. cribl_control_plane/models/outputhoneycomb.py +19 -115
  128. cribl_control_plane/models/outputhumiohec.py +19 -126
  129. cribl_control_plane/models/outputinfluxdb.py +19 -130
  130. cribl_control_plane/models/outputkafka.py +34 -302
  131. cribl_control_plane/models/outputkinesis.py +19 -133
  132. cribl_control_plane/models/outputloki.py +17 -129
  133. cribl_control_plane/models/outputminio.py +1 -145
  134. cribl_control_plane/models/outputmsk.py +34 -193
  135. cribl_control_plane/models/outputnewrelic.py +19 -136
  136. cribl_control_plane/models/outputnewrelicevents.py +20 -128
  137. cribl_control_plane/models/outputopentelemetry.py +19 -178
  138. cribl_control_plane/models/outputprometheus.py +19 -115
  139. cribl_control_plane/models/outputring.py +1 -31
  140. cribl_control_plane/models/outputs3.py +1 -152
  141. cribl_control_plane/models/outputsecuritylake.py +1 -114
  142. cribl_control_plane/models/outputsentinel.py +19 -135
  143. cribl_control_plane/models/outputsentineloneaisiem.py +20 -134
  144. cribl_control_plane/models/outputservicenow.py +19 -168
  145. cribl_control_plane/models/outputsignalfx.py +19 -115
  146. cribl_control_plane/models/outputsns.py +17 -113
  147. cribl_control_plane/models/outputsplunk.py +19 -153
  148. cribl_control_plane/models/outputsplunkhec.py +19 -208
  149. cribl_control_plane/models/outputsplunklb.py +19 -182
  150. cribl_control_plane/models/outputsqs.py +17 -124
  151. cribl_control_plane/models/outputstatsd.py +19 -105
  152. cribl_control_plane/models/outputstatsdext.py +19 -105
  153. cribl_control_plane/models/outputsumologic.py +19 -117
  154. cribl_control_plane/models/outputsyslog.py +96 -259
  155. cribl_control_plane/models/outputtcpjson.py +19 -141
  156. cribl_control_plane/models/outputwavefront.py +19 -115
  157. cribl_control_plane/models/outputwebhook.py +19 -161
  158. cribl_control_plane/models/outputxsiam.py +17 -113
  159. cribl_control_plane/models/packinfo.py +5 -8
  160. cribl_control_plane/models/packinstallinfo.py +5 -8
  161. cribl_control_plane/models/resourcepolicy.py +0 -11
  162. cribl_control_plane/models/{uploadpackresponse.py → routecloneconf.py} +4 -4
  163. cribl_control_plane/models/routeconf.py +4 -3
  164. cribl_control_plane/models/runnablejobcollection.py +9 -72
  165. cribl_control_plane/models/runnablejobexecutor.py +9 -32
  166. cribl_control_plane/models/runnablejobscheduledsearch.py +9 -23
  167. cribl_control_plane/models/updateconfiggroupbyproductandidop.py +0 -11
  168. cribl_control_plane/models/updateconfiggroupdeploybyproductandidop.py +0 -11
  169. cribl_control_plane/packs.py +7 -202
  170. cribl_control_plane/routes_sdk.py +6 -6
  171. cribl_control_plane/tokens.py +15 -23
  172. {cribl_control_plane-0.2.1rc7.dist-info → cribl_control_plane-0.3.0a1.dist-info}/METADATA +9 -50
  173. cribl_control_plane-0.3.0a1.dist-info/RECORD +330 -0
  174. cribl_control_plane/models/groupcreaterequest.py +0 -171
  175. cribl_control_plane/models/outpostnodeinfo.py +0 -16
  176. cribl_control_plane/models/outputdatabricks.py +0 -482
  177. cribl_control_plane/models/updatepacksop.py +0 -25
  178. cribl_control_plane-0.2.1rc7.dist-info/RECORD +0 -331
  179. {cribl_control_plane-0.2.1rc7.dist-info → cribl_control_plane-0.3.0a1.dist-info}/WHEEL +0 -0
@@ -1,12 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from cribl_control_plane import models, utils
4
+ from cribl_control_plane import utils
5
5
  from cribl_control_plane.types import BaseModel
6
6
  from cribl_control_plane.utils import validate_open_enum
7
7
  from enum import Enum
8
8
  import pydantic
9
- from pydantic import field_serializer
10
9
  from pydantic.functional_validators import PlainValidator
11
10
  from typing import List, Optional
12
11
  from typing_extensions import Annotated, NotRequired, TypedDict
@@ -19,11 +18,8 @@ class OutputKinesisType(str, Enum):
19
18
  class OutputKinesisAuthenticationMethod(str, Enum, metaclass=utils.OpenEnumMeta):
20
19
  r"""AWS authentication method. Choose Auto to use IAM roles."""
21
20
 
22
- # Auto
23
21
  AUTO = "auto"
24
- # Manual
25
22
  MANUAL = "manual"
26
- # Secret Key pair
27
23
  SECRET = "secret"
28
24
 
29
25
 
@@ -37,52 +33,40 @@ class OutputKinesisSignatureVersion(str, Enum, metaclass=utils.OpenEnumMeta):
37
33
  class OutputKinesisCompression(str, Enum, metaclass=utils.OpenEnumMeta):
38
34
  r"""Compression type to use for records"""
39
35
 
40
- # None
41
36
  NONE = "none"
42
- # Gzip
43
37
  GZIP = "gzip"
44
38
 
45
39
 
46
40
  class OutputKinesisBackpressureBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
47
41
  r"""How to handle events when all receivers are exerting backpressure"""
48
42
 
49
- # Block
50
43
  BLOCK = "block"
51
- # Drop
52
44
  DROP = "drop"
53
- # Persistent Queue
54
45
  QUEUE = "queue"
55
46
 
56
47
 
57
- class OutputKinesisMode(str, Enum, metaclass=utils.OpenEnumMeta):
58
- 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."""
59
-
60
- # Error
61
- ERROR = "error"
62
- # Backpressure
63
- ALWAYS = "always"
64
- # Always On
65
- BACKPRESSURE = "backpressure"
66
-
67
-
68
48
  class OutputKinesisPqCompressCompression(str, Enum, metaclass=utils.OpenEnumMeta):
69
49
  r"""Codec to use to compress the persisted data"""
70
50
 
71
- # None
72
51
  NONE = "none"
73
- # Gzip
74
52
  GZIP = "gzip"
75
53
 
76
54
 
77
55
  class OutputKinesisQueueFullBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
78
56
  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."""
79
57
 
80
- # Block
81
58
  BLOCK = "block"
82
- # Drop new data
83
59
  DROP = "drop"
84
60
 
85
61
 
62
+ class OutputKinesisMode(str, Enum, metaclass=utils.OpenEnumMeta):
63
+ 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."""
64
+
65
+ ERROR = "error"
66
+ BACKPRESSURE = "backpressure"
67
+ ALWAYS = "always"
68
+
69
+
86
70
  class OutputKinesisPqControlsTypedDict(TypedDict):
87
71
  pass
88
72
 
@@ -144,18 +128,6 @@ class OutputKinesisTypedDict(TypedDict):
144
128
  aws_api_key: NotRequired[str]
145
129
  aws_secret: NotRequired[str]
146
130
  r"""Select or create a stored secret that references your access key and secret key"""
147
- max_events_per_flush: NotRequired[float]
148
- r"""Maximum number of records to send in a single request"""
149
- pq_strict_ordering: NotRequired[bool]
150
- r"""Use FIFO (first in, first out) processing. Disable to forward new events to receivers before queue is flushed."""
151
- pq_rate_per_sec: NotRequired[float]
152
- r"""Throttling rate (in events per second) to impose while writing to Destinations from PQ. Defaults to 0, which disables throttling."""
153
- pq_mode: NotRequired[OutputKinesisMode]
154
- 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."""
155
- pq_max_buffer_size: NotRequired[float]
156
- r"""The maximum number of events to hold in memory before writing the events to disk"""
157
- pq_max_backpressure_sec: NotRequired[float]
158
- r"""How long (in seconds) to wait for backpressure to resolve before engaging the queue"""
159
131
  pq_max_file_size: NotRequired[str]
160
132
  r"""The maximum size to store in each queue file before closing and optionally compressing (KB, MB, etc.)"""
161
133
  pq_max_size: NotRequired[str]
@@ -166,6 +138,8 @@ class OutputKinesisTypedDict(TypedDict):
166
138
  r"""Codec to use to compress the persisted data"""
167
139
  pq_on_backpressure: NotRequired[OutputKinesisQueueFullBehavior]
168
140
  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."""
141
+ pq_mode: NotRequired[OutputKinesisMode]
142
+ 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."""
169
143
  pq_controls: NotRequired[OutputKinesisPqControlsTypedDict]
170
144
 
171
145
 
@@ -292,39 +266,6 @@ class OutputKinesis(BaseModel):
292
266
  aws_secret: Annotated[Optional[str], pydantic.Field(alias="awsSecret")] = None
293
267
  r"""Select or create a stored secret that references your access key and secret key"""
294
268
 
295
- max_events_per_flush: Annotated[
296
- Optional[float], pydantic.Field(alias="maxEventsPerFlush")
297
- ] = 500
298
- r"""Maximum number of records to send in a single request"""
299
-
300
- pq_strict_ordering: Annotated[
301
- Optional[bool], pydantic.Field(alias="pqStrictOrdering")
302
- ] = True
303
- r"""Use FIFO (first in, first out) processing. Disable to forward new events to receivers before queue is flushed."""
304
-
305
- pq_rate_per_sec: Annotated[
306
- Optional[float], pydantic.Field(alias="pqRatePerSec")
307
- ] = 0
308
- r"""Throttling rate (in events per second) to impose while writing to Destinations from PQ. Defaults to 0, which disables throttling."""
309
-
310
- pq_mode: Annotated[
311
- Annotated[
312
- Optional[OutputKinesisMode], PlainValidator(validate_open_enum(False))
313
- ],
314
- pydantic.Field(alias="pqMode"),
315
- ] = OutputKinesisMode.ERROR
316
- 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."""
317
-
318
- pq_max_buffer_size: Annotated[
319
- Optional[float], pydantic.Field(alias="pqMaxBufferSize")
320
- ] = 42
321
- r"""The maximum number of events to hold in memory before writing the events to disk"""
322
-
323
- pq_max_backpressure_sec: Annotated[
324
- Optional[float], pydantic.Field(alias="pqMaxBackpressureSec")
325
- ] = 30
326
- r"""How long (in seconds) to wait for backpressure to resolve before engaging the queue"""
327
-
328
269
  pq_max_file_size: Annotated[
329
270
  Optional[str], pydantic.Field(alias="pqMaxFileSize")
330
271
  ] = "1 MB"
@@ -356,69 +297,14 @@ class OutputKinesis(BaseModel):
356
297
  ] = OutputKinesisQueueFullBehavior.BLOCK
357
298
  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."""
358
299
 
300
+ pq_mode: Annotated[
301
+ Annotated[
302
+ Optional[OutputKinesisMode], PlainValidator(validate_open_enum(False))
303
+ ],
304
+ pydantic.Field(alias="pqMode"),
305
+ ] = OutputKinesisMode.ERROR
306
+ 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."""
307
+
359
308
  pq_controls: Annotated[
360
309
  Optional[OutputKinesisPqControls], pydantic.Field(alias="pqControls")
361
310
  ] = None
362
-
363
- @field_serializer("aws_authentication_method")
364
- def serialize_aws_authentication_method(self, value):
365
- if isinstance(value, str):
366
- try:
367
- return models.OutputKinesisAuthenticationMethod(value)
368
- except ValueError:
369
- return value
370
- return value
371
-
372
- @field_serializer("signature_version")
373
- def serialize_signature_version(self, value):
374
- if isinstance(value, str):
375
- try:
376
- return models.OutputKinesisSignatureVersion(value)
377
- except ValueError:
378
- return value
379
- return value
380
-
381
- @field_serializer("compression")
382
- def serialize_compression(self, value):
383
- if isinstance(value, str):
384
- try:
385
- return models.OutputKinesisCompression(value)
386
- except ValueError:
387
- return value
388
- return value
389
-
390
- @field_serializer("on_backpressure")
391
- def serialize_on_backpressure(self, value):
392
- if isinstance(value, str):
393
- try:
394
- return models.OutputKinesisBackpressureBehavior(value)
395
- except ValueError:
396
- return value
397
- return value
398
-
399
- @field_serializer("pq_mode")
400
- def serialize_pq_mode(self, value):
401
- if isinstance(value, str):
402
- try:
403
- return models.OutputKinesisMode(value)
404
- except ValueError:
405
- return value
406
- return value
407
-
408
- @field_serializer("pq_compress")
409
- def serialize_pq_compress(self, value):
410
- if isinstance(value, str):
411
- try:
412
- return models.OutputKinesisPqCompressCompression(value)
413
- except ValueError:
414
- return value
415
- return value
416
-
417
- @field_serializer("pq_on_backpressure")
418
- def serialize_pq_on_backpressure(self, value):
419
- if isinstance(value, str):
420
- try:
421
- return models.OutputKinesisQueueFullBehavior(value)
422
- except ValueError:
423
- return value
424
- return value
@@ -1,12 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from cribl_control_plane import models, utils
4
+ from cribl_control_plane import utils
5
5
  from cribl_control_plane.types import BaseModel
6
6
  from cribl_control_plane.utils import validate_open_enum
7
7
  from enum import Enum
8
8
  import pydantic
9
- from pydantic import field_serializer
10
9
  from pydantic.functional_validators import PlainValidator
11
10
  from typing import List, Optional
12
11
  from typing_extensions import Annotated, NotRequired, TypedDict
@@ -19,9 +18,7 @@ class OutputLokiType(str, Enum):
19
18
  class OutputLokiMessageFormat(str, Enum, metaclass=utils.OpenEnumMeta):
20
19
  r"""Format to use when sending logs to Loki (Protobuf or JSON)"""
21
20
 
22
- # Protobuf
23
21
  PROTOBUF = "protobuf"
24
- # JSON
25
22
  JSON = "json"
26
23
 
27
24
 
@@ -37,15 +34,10 @@ class OutputLokiLabel(BaseModel):
37
34
 
38
35
 
39
36
  class OutputLokiAuthenticationType(str, Enum, metaclass=utils.OpenEnumMeta):
40
- # None
41
37
  NONE = "none"
42
- # Auth token
43
38
  TOKEN = "token"
44
- # Auth token (text secret)
45
39
  TEXT_SECRET = "textSecret"
46
- # Basic
47
40
  BASIC = "basic"
48
- # Basic (credentials secret)
49
41
  CREDENTIALS_SECRET = "credentialsSecret"
50
42
 
51
43
 
@@ -63,11 +55,8 @@ class OutputLokiExtraHTTPHeader(BaseModel):
63
55
  class OutputLokiFailedRequestLoggingMode(str, Enum, metaclass=utils.OpenEnumMeta):
64
56
  r"""Data to log when a request fails. All headers are redacted by default, unless listed as safe headers below."""
65
57
 
66
- # Payload
67
58
  PAYLOAD = "payload"
68
- # Payload + Headers
69
59
  PAYLOAD_AND_HEADERS = "payloadAndHeaders"
70
- # None
71
60
  NONE = "none"
72
61
 
73
62
 
@@ -128,43 +117,33 @@ class OutputLokiTimeoutRetrySettings(BaseModel):
128
117
  class OutputLokiBackpressureBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
129
118
  r"""How to handle events when all receivers are exerting backpressure"""
130
119
 
131
- # Block
132
120
  BLOCK = "block"
133
- # Drop
134
121
  DROP = "drop"
135
- # Persistent Queue
136
122
  QUEUE = "queue"
137
123
 
138
124
 
139
- class OutputLokiMode(str, Enum, metaclass=utils.OpenEnumMeta):
140
- 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."""
141
-
142
- # Error
143
- ERROR = "error"
144
- # Backpressure
145
- ALWAYS = "always"
146
- # Always On
147
- BACKPRESSURE = "backpressure"
148
-
149
-
150
125
  class OutputLokiCompression(str, Enum, metaclass=utils.OpenEnumMeta):
151
126
  r"""Codec to use to compress the persisted data"""
152
127
 
153
- # None
154
128
  NONE = "none"
155
- # Gzip
156
129
  GZIP = "gzip"
157
130
 
158
131
 
159
132
  class OutputLokiQueueFullBehavior(str, Enum, metaclass=utils.OpenEnumMeta):
160
133
  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."""
161
134
 
162
- # Block
163
135
  BLOCK = "block"
164
- # Drop new data
165
136
  DROP = "drop"
166
137
 
167
138
 
139
+ class OutputLokiMode(str, Enum, metaclass=utils.OpenEnumMeta):
140
+ 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."""
141
+
142
+ ERROR = "error"
143
+ BACKPRESSURE = "backpressure"
144
+ ALWAYS = "always"
145
+
146
+
168
147
  class OutputLokiPqControlsTypedDict(TypedDict):
169
148
  pass
170
149
 
@@ -241,16 +220,6 @@ class OutputLokiTypedDict(TypedDict):
241
220
  r"""Password (API key in Grafana Cloud domain) for authentication"""
242
221
  credentials_secret: NotRequired[str]
243
222
  r"""Select or create a secret that references your credentials"""
244
- pq_strict_ordering: NotRequired[bool]
245
- r"""Use FIFO (first in, first out) processing. Disable to forward new events to receivers before queue is flushed."""
246
- pq_rate_per_sec: NotRequired[float]
247
- r"""Throttling rate (in events per second) to impose while writing to Destinations from PQ. Defaults to 0, which disables throttling."""
248
- pq_mode: NotRequired[OutputLokiMode]
249
- 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."""
250
- pq_max_buffer_size: NotRequired[float]
251
- r"""The maximum number of events to hold in memory before writing the events to disk"""
252
- pq_max_backpressure_sec: NotRequired[float]
253
- r"""How long (in seconds) to wait for backpressure to resolve before engaging the queue"""
254
223
  pq_max_file_size: NotRequired[str]
255
224
  r"""The maximum size to store in each queue file before closing and optionally compressing (KB, MB, etc.)"""
256
225
  pq_max_size: NotRequired[str]
@@ -261,6 +230,8 @@ class OutputLokiTypedDict(TypedDict):
261
230
  r"""Codec to use to compress the persisted data"""
262
231
  pq_on_backpressure: NotRequired[OutputLokiQueueFullBehavior]
263
232
  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."""
233
+ pq_mode: NotRequired[OutputLokiMode]
234
+ r"""In Error mode, PQ writes events to the filesystem if the Destination is unavailable. In Backpressure mode, PQ writes events to the filesystem when it detects backpressure from the Destination. In Always On mode, PQ always writes events to the filesystem."""
264
235
  pq_controls: NotRequired[OutputLokiPqControlsTypedDict]
265
236
 
266
237
 
@@ -420,32 +391,6 @@ class OutputLoki(BaseModel):
420
391
  ] = None
421
392
  r"""Select or create a secret that references your credentials"""
422
393
 
423
- pq_strict_ordering: Annotated[
424
- Optional[bool], pydantic.Field(alias="pqStrictOrdering")
425
- ] = True
426
- r"""Use FIFO (first in, first out) processing. Disable to forward new events to receivers before queue is flushed."""
427
-
428
- pq_rate_per_sec: Annotated[
429
- Optional[float], pydantic.Field(alias="pqRatePerSec")
430
- ] = 0
431
- r"""Throttling rate (in events per second) to impose while writing to Destinations from PQ. Defaults to 0, which disables throttling."""
432
-
433
- pq_mode: Annotated[
434
- Annotated[Optional[OutputLokiMode], PlainValidator(validate_open_enum(False))],
435
- pydantic.Field(alias="pqMode"),
436
- ] = OutputLokiMode.ERROR
437
- 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."""
438
-
439
- pq_max_buffer_size: Annotated[
440
- Optional[float], pydantic.Field(alias="pqMaxBufferSize")
441
- ] = 42
442
- r"""The maximum number of events to hold in memory before writing the events to disk"""
443
-
444
- pq_max_backpressure_sec: Annotated[
445
- Optional[float], pydantic.Field(alias="pqMaxBackpressureSec")
446
- ] = 30
447
- r"""How long (in seconds) to wait for backpressure to resolve before engaging the queue"""
448
-
449
394
  pq_max_file_size: Annotated[
450
395
  Optional[str], pydantic.Field(alias="pqMaxFileSize")
451
396
  ] = "1 MB"
@@ -476,69 +421,12 @@ class OutputLoki(BaseModel):
476
421
  ] = OutputLokiQueueFullBehavior.BLOCK
477
422
  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."""
478
423
 
424
+ pq_mode: Annotated[
425
+ Annotated[Optional[OutputLokiMode], PlainValidator(validate_open_enum(False))],
426
+ pydantic.Field(alias="pqMode"),
427
+ ] = OutputLokiMode.ERROR
428
+ 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."""
429
+
479
430
  pq_controls: Annotated[
480
431
  Optional[OutputLokiPqControls], pydantic.Field(alias="pqControls")
481
432
  ] = None
482
-
483
- @field_serializer("message_format")
484
- def serialize_message_format(self, value):
485
- if isinstance(value, str):
486
- try:
487
- return models.OutputLokiMessageFormat(value)
488
- except ValueError:
489
- return value
490
- return value
491
-
492
- @field_serializer("auth_type")
493
- def serialize_auth_type(self, value):
494
- if isinstance(value, str):
495
- try:
496
- return models.OutputLokiAuthenticationType(value)
497
- except ValueError:
498
- return value
499
- return value
500
-
501
- @field_serializer("failed_request_logging_mode")
502
- def serialize_failed_request_logging_mode(self, value):
503
- if isinstance(value, str):
504
- try:
505
- return models.OutputLokiFailedRequestLoggingMode(value)
506
- except ValueError:
507
- return value
508
- return value
509
-
510
- @field_serializer("on_backpressure")
511
- def serialize_on_backpressure(self, value):
512
- if isinstance(value, str):
513
- try:
514
- return models.OutputLokiBackpressureBehavior(value)
515
- except ValueError:
516
- return value
517
- return value
518
-
519
- @field_serializer("pq_mode")
520
- def serialize_pq_mode(self, value):
521
- if isinstance(value, str):
522
- try:
523
- return models.OutputLokiMode(value)
524
- except ValueError:
525
- return value
526
- return value
527
-
528
- @field_serializer("pq_compress")
529
- def serialize_pq_compress(self, value):
530
- if isinstance(value, str):
531
- try:
532
- return models.OutputLokiCompression(value)
533
- except ValueError:
534
- return value
535
- return value
536
-
537
- @field_serializer("pq_on_backpressure")
538
- def serialize_pq_on_backpressure(self, value):
539
- if isinstance(value, str):
540
- try:
541
- return models.OutputLokiQueueFullBehavior(value)
542
- except ValueError:
543
- return value
544
- return value