cribl-control-plane 0.0.26a1__py3-none-any.whl → 0.0.27__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 (127) hide show
  1. cribl_control_plane/_version.py +3 -3
  2. cribl_control_plane/acl.py +203 -0
  3. cribl_control_plane/auth_sdk.py +9 -176
  4. cribl_control_plane/branches.py +335 -0
  5. cribl_control_plane/commits.py +1141 -0
  6. cribl_control_plane/commits_files.py +371 -0
  7. cribl_control_plane/configs_versions.py +189 -0
  8. cribl_control_plane/destinations.py +18 -729
  9. cribl_control_plane/destinations_pq.py +359 -0
  10. cribl_control_plane/errors/healthstatus_error.py +1 -1
  11. cribl_control_plane/groups_configs.py +17 -0
  12. cribl_control_plane/groups_sdk.py +18 -551
  13. cribl_control_plane/{healthinfo.py → health.py} +3 -1
  14. cribl_control_plane/hectokens.py +479 -0
  15. cribl_control_plane/models/__init__.py +3 -35
  16. cribl_control_plane/models/healthstatus.py +3 -3
  17. cribl_control_plane/models/inputappscope.py +5 -5
  18. cribl_control_plane/models/inputcollection.py +2 -2
  19. cribl_control_plane/models/inputconfluentcloud.py +3 -3
  20. cribl_control_plane/models/inputcribl.py +5 -5
  21. cribl_control_plane/models/inputcriblhttp.py +3 -3
  22. cribl_control_plane/models/inputcribllakehttp.py +3 -3
  23. cribl_control_plane/models/inputcriblmetrics.py +5 -5
  24. cribl_control_plane/models/inputcribltcp.py +3 -3
  25. cribl_control_plane/models/inputdatadogagent.py +3 -3
  26. cribl_control_plane/models/inputedgeprometheus.py +3 -3
  27. cribl_control_plane/models/inputelastic.py +3 -3
  28. cribl_control_plane/models/inputeventhub.py +3 -3
  29. cribl_control_plane/models/inputfile.py +5 -5
  30. cribl_control_plane/models/inputfirehose.py +3 -3
  31. cribl_control_plane/models/inputgooglepubsub.py +3 -3
  32. cribl_control_plane/models/inputgrafana.py +6 -6
  33. cribl_control_plane/models/inputhttp.py +3 -3
  34. cribl_control_plane/models/inputhttpraw.py +3 -3
  35. cribl_control_plane/models/inputjournalfiles.py +3 -3
  36. cribl_control_plane/models/inputkafka.py +3 -3
  37. cribl_control_plane/models/inputkinesis.py +3 -3
  38. cribl_control_plane/models/inputkubeevents.py +5 -5
  39. cribl_control_plane/models/inputkubelogs.py +5 -5
  40. cribl_control_plane/models/inputkubemetrics.py +5 -5
  41. cribl_control_plane/models/inputloki.py +3 -3
  42. cribl_control_plane/models/inputmodeldriventelemetry.py +3 -3
  43. cribl_control_plane/models/inputmsk.py +3 -3
  44. cribl_control_plane/models/inputnetflow.py +3 -3
  45. cribl_control_plane/models/inputoffice365mgmt.py +3 -3
  46. cribl_control_plane/models/inputoffice365msgtrace.py +3 -3
  47. cribl_control_plane/models/inputoffice365service.py +3 -3
  48. cribl_control_plane/models/inputopentelemetry.py +3 -3
  49. cribl_control_plane/models/inputprometheus.py +3 -3
  50. cribl_control_plane/models/inputprometheusrw.py +3 -3
  51. cribl_control_plane/models/inputrawudp.py +3 -3
  52. cribl_control_plane/models/inputsnmp.py +3 -3
  53. cribl_control_plane/models/inputsplunk.py +3 -3
  54. cribl_control_plane/models/inputsplunkhec.py +3 -3
  55. cribl_control_plane/models/inputsplunksearch.py +3 -3
  56. cribl_control_plane/models/inputsqs.py +3 -3
  57. cribl_control_plane/models/inputsystemmetrics.py +5 -5
  58. cribl_control_plane/models/inputsystemstate.py +5 -5
  59. cribl_control_plane/models/inputtcp.py +3 -3
  60. cribl_control_plane/models/inputtcpjson.py +3 -3
  61. cribl_control_plane/models/inputwef.py +3 -3
  62. cribl_control_plane/models/inputwindowsmetrics.py +5 -5
  63. cribl_control_plane/models/inputwiz.py +3 -3
  64. cribl_control_plane/models/inputzscalerhec.py +3 -3
  65. cribl_control_plane/models/outputazureblob.py +3 -3
  66. cribl_control_plane/models/outputazuredataexplorer.py +3 -3
  67. cribl_control_plane/models/outputazureeventhub.py +3 -3
  68. cribl_control_plane/models/outputclickhouse.py +3 -3
  69. cribl_control_plane/models/outputcloudwatch.py +3 -3
  70. cribl_control_plane/models/outputconfluentcloud.py +3 -3
  71. cribl_control_plane/models/outputcriblhttp.py +5 -5
  72. cribl_control_plane/models/outputcribllake.py +5 -5
  73. cribl_control_plane/models/outputcribltcp.py +5 -5
  74. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +3 -3
  75. cribl_control_plane/models/outputdatadog.py +5 -5
  76. cribl_control_plane/models/outputdataset.py +5 -5
  77. cribl_control_plane/models/outputdevnull.py +5 -5
  78. cribl_control_plane/models/outputdiskspool.py +5 -5
  79. cribl_control_plane/models/outputdls3.py +3 -3
  80. cribl_control_plane/models/outputdynatracehttp.py +3 -3
  81. cribl_control_plane/models/outputdynatraceotlp.py +3 -3
  82. cribl_control_plane/models/outputelasticcloud.py +3 -3
  83. cribl_control_plane/models/outputexabeam.py +3 -3
  84. cribl_control_plane/models/outputgooglecloudlogging.py +3 -3
  85. cribl_control_plane/models/outputgooglecloudstorage.py +3 -3
  86. cribl_control_plane/models/outputgrafanacloud.py +10 -10
  87. cribl_control_plane/models/outputgraphite.py +3 -3
  88. cribl_control_plane/models/outputhumiohec.py +3 -3
  89. cribl_control_plane/models/outputkafka.py +3 -3
  90. cribl_control_plane/models/outputkinesis.py +3 -3
  91. cribl_control_plane/models/outputminio.py +3 -3
  92. cribl_control_plane/models/outputmsk.py +3 -3
  93. cribl_control_plane/models/outputnewrelic.py +5 -5
  94. cribl_control_plane/models/outputnewrelicevents.py +3 -3
  95. cribl_control_plane/models/outputring.py +5 -5
  96. cribl_control_plane/models/outputs3.py +3 -3
  97. cribl_control_plane/models/outputsecuritylake.py +3 -3
  98. cribl_control_plane/models/outputsentinel.py +3 -3
  99. cribl_control_plane/models/outputsentineloneaisiem.py +3 -3
  100. cribl_control_plane/models/outputservicenow.py +3 -3
  101. cribl_control_plane/models/outputsns.py +3 -3
  102. cribl_control_plane/models/outputsplunk.py +3 -3
  103. cribl_control_plane/models/outputsplunkhec.py +5 -5
  104. cribl_control_plane/models/outputsqs.py +3 -3
  105. cribl_control_plane/models/outputstatsd.py +3 -3
  106. cribl_control_plane/models/outputstatsdext.py +3 -3
  107. cribl_control_plane/models/outputsyslog.py +5 -5
  108. cribl_control_plane/models/outputtcpjson.py +5 -5
  109. cribl_control_plane/models/outputwebhook.py +5 -5
  110. cribl_control_plane/models/outputxsiam.py +5 -5
  111. cribl_control_plane/nodes.py +90 -68
  112. cribl_control_plane/samples.py +391 -0
  113. cribl_control_plane/sdk.py +11 -17
  114. cribl_control_plane/sources.py +15 -469
  115. cribl_control_plane/{workers_sdk.py → statuses.py} +23 -25
  116. cribl_control_plane/{deployments.py → summaries.py} +3 -3
  117. cribl_control_plane/teams.py +201 -0
  118. cribl_control_plane/tokens.py +182 -0
  119. cribl_control_plane/versions.py +26 -0
  120. cribl_control_plane/versions_configs.py +171 -0
  121. {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/METADATA +67 -36
  122. {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/RECORD +123 -114
  123. cribl_control_plane/models/createversionsyncop.py +0 -23
  124. cribl_control_plane/models/restartresponse.py +0 -26
  125. cribl_control_plane/models/updateworkersrestartop.py +0 -24
  126. cribl_control_plane/versioning.py +0 -2309
  127. {cribl_control_plane-0.0.26a1.dist-info → cribl_control_plane-0.0.27.dist-info}/WHEEL +0 -0
@@ -1,15 +1,32 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from .basesdk import BaseSDK
4
+ from .sdkconfiguration import SDKConfiguration
4
5
  from cribl_control_plane import errors, models, utils
5
6
  from cribl_control_plane._hooks import HookContext
7
+ from cribl_control_plane.destinations_pq import DestinationsPq
8
+ from cribl_control_plane.samples import Samples
6
9
  from cribl_control_plane.types import BaseModel, OptionalNullable, UNSET
7
10
  from cribl_control_plane.utils import get_security_from_env
8
11
  from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
9
- from typing import Any, List, Mapping, Optional, Union, cast
12
+ from typing import Any, Mapping, Optional, Union, cast
10
13
 
11
14
 
12
15
  class Destinations(BaseSDK):
16
+ r"""Actions related to Destinations"""
17
+
18
+ pq: DestinationsPq
19
+ samples: Samples
20
+
21
+ def __init__(self, sdk_config: SDKConfiguration) -> None:
22
+ BaseSDK.__init__(self, sdk_config)
23
+ self.sdk_configuration = sdk_config
24
+ self._init_sdks()
25
+
26
+ def _init_sdks(self):
27
+ self.pq = DestinationsPq(self.sdk_configuration)
28
+ self.samples = Samples(self.sdk_configuration)
29
+
13
30
  def list(
14
31
  self,
15
32
  *,
@@ -883,731 +900,3 @@ class Destinations(BaseSDK):
883
900
  raise errors.APIError("API error occurred", http_res, http_res_text)
884
901
 
885
902
  raise errors.APIError("Unexpected response received", http_res)
886
-
887
- def clear_persistent_queue(
888
- self,
889
- *,
890
- id: str,
891
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
892
- server_url: Optional[str] = None,
893
- timeout_ms: Optional[int] = None,
894
- http_headers: Optional[Mapping[str, str]] = None,
895
- ) -> models.DeleteOutputPqByIDResponse:
896
- r"""Clear the persistent queue for a Destination
897
-
898
- Clears destination persistent queue
899
-
900
- :param id: Destination Id
901
- :param retries: Override the default retry configuration for this method
902
- :param server_url: Override the default server URL for this method
903
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
904
- :param http_headers: Additional headers to set or replace on requests.
905
- """
906
- base_url = None
907
- url_variables = None
908
- if timeout_ms is None:
909
- timeout_ms = self.sdk_configuration.timeout_ms
910
-
911
- if server_url is not None:
912
- base_url = server_url
913
- else:
914
- base_url = self._get_url(base_url, url_variables)
915
-
916
- request = models.DeleteOutputPqByIDRequest(
917
- id=id,
918
- )
919
-
920
- req = self._build_request(
921
- method="DELETE",
922
- path="/system/outputs/{id}/pq",
923
- base_url=base_url,
924
- url_variables=url_variables,
925
- request=request,
926
- request_body_required=False,
927
- request_has_path_params=True,
928
- request_has_query_params=True,
929
- user_agent_header="user-agent",
930
- accept_header_value="application/json",
931
- http_headers=http_headers,
932
- security=self.sdk_configuration.security,
933
- timeout_ms=timeout_ms,
934
- )
935
-
936
- if retries == UNSET:
937
- if self.sdk_configuration.retry_config is not UNSET:
938
- retries = self.sdk_configuration.retry_config
939
-
940
- retry_config = None
941
- if isinstance(retries, utils.RetryConfig):
942
- retry_config = (retries, ["429", "500", "502", "503", "504"])
943
-
944
- http_res = self.do_request(
945
- hook_ctx=HookContext(
946
- config=self.sdk_configuration,
947
- base_url=base_url or "",
948
- operation_id="deleteOutputPqById",
949
- oauth2_scopes=[],
950
- security_source=get_security_from_env(
951
- self.sdk_configuration.security, models.Security
952
- ),
953
- ),
954
- request=req,
955
- error_status_codes=["401", "4XX", "500", "5XX"],
956
- retry_config=retry_config,
957
- )
958
-
959
- response_data: Any = None
960
- if utils.match_response(http_res, "200", "application/json"):
961
- return unmarshal_json_response(models.DeleteOutputPqByIDResponse, http_res)
962
- if utils.match_response(http_res, "500", "application/json"):
963
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
964
- raise errors.Error(response_data, http_res)
965
- if utils.match_response(http_res, ["401", "4XX"], "*"):
966
- http_res_text = utils.stream_to_text(http_res)
967
- raise errors.APIError("API error occurred", http_res, http_res_text)
968
- if utils.match_response(http_res, "5XX", "*"):
969
- http_res_text = utils.stream_to_text(http_res)
970
- raise errors.APIError("API error occurred", http_res, http_res_text)
971
-
972
- raise errors.APIError("Unexpected response received", http_res)
973
-
974
- async def clear_persistent_queue_async(
975
- self,
976
- *,
977
- id: str,
978
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
979
- server_url: Optional[str] = None,
980
- timeout_ms: Optional[int] = None,
981
- http_headers: Optional[Mapping[str, str]] = None,
982
- ) -> models.DeleteOutputPqByIDResponse:
983
- r"""Clear the persistent queue for a Destination
984
-
985
- Clears destination persistent queue
986
-
987
- :param id: Destination Id
988
- :param retries: Override the default retry configuration for this method
989
- :param server_url: Override the default server URL for this method
990
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
991
- :param http_headers: Additional headers to set or replace on requests.
992
- """
993
- base_url = None
994
- url_variables = None
995
- if timeout_ms is None:
996
- timeout_ms = self.sdk_configuration.timeout_ms
997
-
998
- if server_url is not None:
999
- base_url = server_url
1000
- else:
1001
- base_url = self._get_url(base_url, url_variables)
1002
-
1003
- request = models.DeleteOutputPqByIDRequest(
1004
- id=id,
1005
- )
1006
-
1007
- req = self._build_request_async(
1008
- method="DELETE",
1009
- path="/system/outputs/{id}/pq",
1010
- base_url=base_url,
1011
- url_variables=url_variables,
1012
- request=request,
1013
- request_body_required=False,
1014
- request_has_path_params=True,
1015
- request_has_query_params=True,
1016
- user_agent_header="user-agent",
1017
- accept_header_value="application/json",
1018
- http_headers=http_headers,
1019
- security=self.sdk_configuration.security,
1020
- timeout_ms=timeout_ms,
1021
- )
1022
-
1023
- if retries == UNSET:
1024
- if self.sdk_configuration.retry_config is not UNSET:
1025
- retries = self.sdk_configuration.retry_config
1026
-
1027
- retry_config = None
1028
- if isinstance(retries, utils.RetryConfig):
1029
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1030
-
1031
- http_res = await self.do_request_async(
1032
- hook_ctx=HookContext(
1033
- config=self.sdk_configuration,
1034
- base_url=base_url or "",
1035
- operation_id="deleteOutputPqById",
1036
- oauth2_scopes=[],
1037
- security_source=get_security_from_env(
1038
- self.sdk_configuration.security, models.Security
1039
- ),
1040
- ),
1041
- request=req,
1042
- error_status_codes=["401", "4XX", "500", "5XX"],
1043
- retry_config=retry_config,
1044
- )
1045
-
1046
- response_data: Any = None
1047
- if utils.match_response(http_res, "200", "application/json"):
1048
- return unmarshal_json_response(models.DeleteOutputPqByIDResponse, http_res)
1049
- if utils.match_response(http_res, "500", "application/json"):
1050
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1051
- raise errors.Error(response_data, http_res)
1052
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1053
- http_res_text = await utils.stream_to_text_async(http_res)
1054
- raise errors.APIError("API error occurred", http_res, http_res_text)
1055
- if utils.match_response(http_res, "5XX", "*"):
1056
- http_res_text = await utils.stream_to_text_async(http_res)
1057
- raise errors.APIError("API error occurred", http_res, http_res_text)
1058
-
1059
- raise errors.APIError("Unexpected response received", http_res)
1060
-
1061
- def get_persistent_queue_status(
1062
- self,
1063
- *,
1064
- id: str,
1065
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1066
- server_url: Optional[str] = None,
1067
- timeout_ms: Optional[int] = None,
1068
- http_headers: Optional[Mapping[str, str]] = None,
1069
- ) -> models.GetOutputPqByIDResponse:
1070
- r"""Retrieve information about the latest job to clear the persistent queue for a Destination
1071
-
1072
- Retrieves status of latest clear PQ job for a destination
1073
-
1074
- :param id: Destination Id
1075
- :param retries: Override the default retry configuration for this method
1076
- :param server_url: Override the default server URL for this method
1077
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1078
- :param http_headers: Additional headers to set or replace on requests.
1079
- """
1080
- base_url = None
1081
- url_variables = None
1082
- if timeout_ms is None:
1083
- timeout_ms = self.sdk_configuration.timeout_ms
1084
-
1085
- if server_url is not None:
1086
- base_url = server_url
1087
- else:
1088
- base_url = self._get_url(base_url, url_variables)
1089
-
1090
- request = models.GetOutputPqByIDRequest(
1091
- id=id,
1092
- )
1093
-
1094
- req = self._build_request(
1095
- method="GET",
1096
- path="/system/outputs/{id}/pq",
1097
- base_url=base_url,
1098
- url_variables=url_variables,
1099
- request=request,
1100
- request_body_required=False,
1101
- request_has_path_params=True,
1102
- request_has_query_params=True,
1103
- user_agent_header="user-agent",
1104
- accept_header_value="application/json",
1105
- http_headers=http_headers,
1106
- security=self.sdk_configuration.security,
1107
- timeout_ms=timeout_ms,
1108
- )
1109
-
1110
- if retries == UNSET:
1111
- if self.sdk_configuration.retry_config is not UNSET:
1112
- retries = self.sdk_configuration.retry_config
1113
-
1114
- retry_config = None
1115
- if isinstance(retries, utils.RetryConfig):
1116
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1117
-
1118
- http_res = self.do_request(
1119
- hook_ctx=HookContext(
1120
- config=self.sdk_configuration,
1121
- base_url=base_url or "",
1122
- operation_id="getOutputPqById",
1123
- oauth2_scopes=[],
1124
- security_source=get_security_from_env(
1125
- self.sdk_configuration.security, models.Security
1126
- ),
1127
- ),
1128
- request=req,
1129
- error_status_codes=["401", "4XX", "500", "5XX"],
1130
- retry_config=retry_config,
1131
- )
1132
-
1133
- response_data: Any = None
1134
- if utils.match_response(http_res, "200", "application/json"):
1135
- return unmarshal_json_response(models.GetOutputPqByIDResponse, http_res)
1136
- if utils.match_response(http_res, "500", "application/json"):
1137
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1138
- raise errors.Error(response_data, http_res)
1139
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1140
- http_res_text = utils.stream_to_text(http_res)
1141
- raise errors.APIError("API error occurred", http_res, http_res_text)
1142
- if utils.match_response(http_res, "5XX", "*"):
1143
- http_res_text = utils.stream_to_text(http_res)
1144
- raise errors.APIError("API error occurred", http_res, http_res_text)
1145
-
1146
- raise errors.APIError("Unexpected response received", http_res)
1147
-
1148
- async def get_persistent_queue_status_async(
1149
- self,
1150
- *,
1151
- id: str,
1152
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1153
- server_url: Optional[str] = None,
1154
- timeout_ms: Optional[int] = None,
1155
- http_headers: Optional[Mapping[str, str]] = None,
1156
- ) -> models.GetOutputPqByIDResponse:
1157
- r"""Retrieve information about the latest job to clear the persistent queue for a Destination
1158
-
1159
- Retrieves status of latest clear PQ job for a destination
1160
-
1161
- :param id: Destination Id
1162
- :param retries: Override the default retry configuration for this method
1163
- :param server_url: Override the default server URL for this method
1164
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1165
- :param http_headers: Additional headers to set or replace on requests.
1166
- """
1167
- base_url = None
1168
- url_variables = None
1169
- if timeout_ms is None:
1170
- timeout_ms = self.sdk_configuration.timeout_ms
1171
-
1172
- if server_url is not None:
1173
- base_url = server_url
1174
- else:
1175
- base_url = self._get_url(base_url, url_variables)
1176
-
1177
- request = models.GetOutputPqByIDRequest(
1178
- id=id,
1179
- )
1180
-
1181
- req = self._build_request_async(
1182
- method="GET",
1183
- path="/system/outputs/{id}/pq",
1184
- base_url=base_url,
1185
- url_variables=url_variables,
1186
- request=request,
1187
- request_body_required=False,
1188
- request_has_path_params=True,
1189
- request_has_query_params=True,
1190
- user_agent_header="user-agent",
1191
- accept_header_value="application/json",
1192
- http_headers=http_headers,
1193
- security=self.sdk_configuration.security,
1194
- timeout_ms=timeout_ms,
1195
- )
1196
-
1197
- if retries == UNSET:
1198
- if self.sdk_configuration.retry_config is not UNSET:
1199
- retries = self.sdk_configuration.retry_config
1200
-
1201
- retry_config = None
1202
- if isinstance(retries, utils.RetryConfig):
1203
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1204
-
1205
- http_res = await self.do_request_async(
1206
- hook_ctx=HookContext(
1207
- config=self.sdk_configuration,
1208
- base_url=base_url or "",
1209
- operation_id="getOutputPqById",
1210
- oauth2_scopes=[],
1211
- security_source=get_security_from_env(
1212
- self.sdk_configuration.security, models.Security
1213
- ),
1214
- ),
1215
- request=req,
1216
- error_status_codes=["401", "4XX", "500", "5XX"],
1217
- retry_config=retry_config,
1218
- )
1219
-
1220
- response_data: Any = None
1221
- if utils.match_response(http_res, "200", "application/json"):
1222
- return unmarshal_json_response(models.GetOutputPqByIDResponse, http_res)
1223
- if utils.match_response(http_res, "500", "application/json"):
1224
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1225
- raise errors.Error(response_data, http_res)
1226
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1227
- http_res_text = await utils.stream_to_text_async(http_res)
1228
- raise errors.APIError("API error occurred", http_res, http_res_text)
1229
- if utils.match_response(http_res, "5XX", "*"):
1230
- http_res_text = await utils.stream_to_text_async(http_res)
1231
- raise errors.APIError("API error occurred", http_res, http_res_text)
1232
-
1233
- raise errors.APIError("Unexpected response received", http_res)
1234
-
1235
- def get_sample_data(
1236
- self,
1237
- *,
1238
- id: str,
1239
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1240
- server_url: Optional[str] = None,
1241
- timeout_ms: Optional[int] = None,
1242
- http_headers: Optional[Mapping[str, str]] = None,
1243
- ) -> models.GetOutputSamplesByIDResponse:
1244
- r"""Retrieve sample event data for a Destination
1245
-
1246
- Retrieve samples data for the specified destination. Used to get sample data for the test action.
1247
-
1248
- :param id: Destination Id
1249
- :param retries: Override the default retry configuration for this method
1250
- :param server_url: Override the default server URL for this method
1251
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1252
- :param http_headers: Additional headers to set or replace on requests.
1253
- """
1254
- base_url = None
1255
- url_variables = None
1256
- if timeout_ms is None:
1257
- timeout_ms = self.sdk_configuration.timeout_ms
1258
-
1259
- if server_url is not None:
1260
- base_url = server_url
1261
- else:
1262
- base_url = self._get_url(base_url, url_variables)
1263
-
1264
- request = models.GetOutputSamplesByIDRequest(
1265
- id=id,
1266
- )
1267
-
1268
- req = self._build_request(
1269
- method="GET",
1270
- path="/system/outputs/{id}/samples",
1271
- base_url=base_url,
1272
- url_variables=url_variables,
1273
- request=request,
1274
- request_body_required=False,
1275
- request_has_path_params=True,
1276
- request_has_query_params=True,
1277
- user_agent_header="user-agent",
1278
- accept_header_value="application/json",
1279
- http_headers=http_headers,
1280
- security=self.sdk_configuration.security,
1281
- timeout_ms=timeout_ms,
1282
- )
1283
-
1284
- if retries == UNSET:
1285
- if self.sdk_configuration.retry_config is not UNSET:
1286
- retries = self.sdk_configuration.retry_config
1287
-
1288
- retry_config = None
1289
- if isinstance(retries, utils.RetryConfig):
1290
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1291
-
1292
- http_res = self.do_request(
1293
- hook_ctx=HookContext(
1294
- config=self.sdk_configuration,
1295
- base_url=base_url or "",
1296
- operation_id="getOutputSamplesById",
1297
- oauth2_scopes=[],
1298
- security_source=get_security_from_env(
1299
- self.sdk_configuration.security, models.Security
1300
- ),
1301
- ),
1302
- request=req,
1303
- error_status_codes=["401", "4XX", "500", "5XX"],
1304
- retry_config=retry_config,
1305
- )
1306
-
1307
- response_data: Any = None
1308
- if utils.match_response(http_res, "200", "application/json"):
1309
- return unmarshal_json_response(
1310
- models.GetOutputSamplesByIDResponse, http_res
1311
- )
1312
- if utils.match_response(http_res, "500", "application/json"):
1313
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1314
- raise errors.Error(response_data, http_res)
1315
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1316
- http_res_text = utils.stream_to_text(http_res)
1317
- raise errors.APIError("API error occurred", http_res, http_res_text)
1318
- if utils.match_response(http_res, "5XX", "*"):
1319
- http_res_text = utils.stream_to_text(http_res)
1320
- raise errors.APIError("API error occurred", http_res, http_res_text)
1321
-
1322
- raise errors.APIError("Unexpected response received", http_res)
1323
-
1324
- async def get_sample_data_async(
1325
- self,
1326
- *,
1327
- id: str,
1328
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1329
- server_url: Optional[str] = None,
1330
- timeout_ms: Optional[int] = None,
1331
- http_headers: Optional[Mapping[str, str]] = None,
1332
- ) -> models.GetOutputSamplesByIDResponse:
1333
- r"""Retrieve sample event data for a Destination
1334
-
1335
- Retrieve samples data for the specified destination. Used to get sample data for the test action.
1336
-
1337
- :param id: Destination Id
1338
- :param retries: Override the default retry configuration for this method
1339
- :param server_url: Override the default server URL for this method
1340
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1341
- :param http_headers: Additional headers to set or replace on requests.
1342
- """
1343
- base_url = None
1344
- url_variables = None
1345
- if timeout_ms is None:
1346
- timeout_ms = self.sdk_configuration.timeout_ms
1347
-
1348
- if server_url is not None:
1349
- base_url = server_url
1350
- else:
1351
- base_url = self._get_url(base_url, url_variables)
1352
-
1353
- request = models.GetOutputSamplesByIDRequest(
1354
- id=id,
1355
- )
1356
-
1357
- req = self._build_request_async(
1358
- method="GET",
1359
- path="/system/outputs/{id}/samples",
1360
- base_url=base_url,
1361
- url_variables=url_variables,
1362
- request=request,
1363
- request_body_required=False,
1364
- request_has_path_params=True,
1365
- request_has_query_params=True,
1366
- user_agent_header="user-agent",
1367
- accept_header_value="application/json",
1368
- http_headers=http_headers,
1369
- security=self.sdk_configuration.security,
1370
- timeout_ms=timeout_ms,
1371
- )
1372
-
1373
- if retries == UNSET:
1374
- if self.sdk_configuration.retry_config is not UNSET:
1375
- retries = self.sdk_configuration.retry_config
1376
-
1377
- retry_config = None
1378
- if isinstance(retries, utils.RetryConfig):
1379
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1380
-
1381
- http_res = await self.do_request_async(
1382
- hook_ctx=HookContext(
1383
- config=self.sdk_configuration,
1384
- base_url=base_url or "",
1385
- operation_id="getOutputSamplesById",
1386
- oauth2_scopes=[],
1387
- security_source=get_security_from_env(
1388
- self.sdk_configuration.security, models.Security
1389
- ),
1390
- ),
1391
- request=req,
1392
- error_status_codes=["401", "4XX", "500", "5XX"],
1393
- retry_config=retry_config,
1394
- )
1395
-
1396
- response_data: Any = None
1397
- if utils.match_response(http_res, "200", "application/json"):
1398
- return unmarshal_json_response(
1399
- models.GetOutputSamplesByIDResponse, http_res
1400
- )
1401
- if utils.match_response(http_res, "500", "application/json"):
1402
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1403
- raise errors.Error(response_data, http_res)
1404
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1405
- http_res_text = await utils.stream_to_text_async(http_res)
1406
- raise errors.APIError("API error occurred", http_res, http_res_text)
1407
- if utils.match_response(http_res, "5XX", "*"):
1408
- http_res_text = await utils.stream_to_text_async(http_res)
1409
- raise errors.APIError("API error occurred", http_res, http_res_text)
1410
-
1411
- raise errors.APIError("Unexpected response received", http_res)
1412
-
1413
- def create_sample_data(
1414
- self,
1415
- *,
1416
- id: str,
1417
- events: Union[List[models.CriblEvent], List[models.CriblEventTypedDict]],
1418
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1419
- server_url: Optional[str] = None,
1420
- timeout_ms: Optional[int] = None,
1421
- http_headers: Optional[Mapping[str, str]] = None,
1422
- ) -> models.CreateOutputTestByIDResponse:
1423
- r"""Send sample event data to a Destination
1424
-
1425
- Send sample data to a destination to validate configuration or test connectivity
1426
-
1427
- :param id: Destination Id
1428
- :param events:
1429
- :param retries: Override the default retry configuration for this method
1430
- :param server_url: Override the default server URL for this method
1431
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1432
- :param http_headers: Additional headers to set or replace on requests.
1433
- """
1434
- base_url = None
1435
- url_variables = None
1436
- if timeout_ms is None:
1437
- timeout_ms = self.sdk_configuration.timeout_ms
1438
-
1439
- if server_url is not None:
1440
- base_url = server_url
1441
- else:
1442
- base_url = self._get_url(base_url, url_variables)
1443
-
1444
- request = models.CreateOutputTestByIDRequest(
1445
- id=id,
1446
- output_test_request=models.OutputTestRequest(
1447
- events=utils.get_pydantic_model(events, List[models.CriblEvent]),
1448
- ),
1449
- )
1450
-
1451
- req = self._build_request(
1452
- method="POST",
1453
- path="/system/outputs/{id}/test",
1454
- base_url=base_url,
1455
- url_variables=url_variables,
1456
- request=request,
1457
- request_body_required=True,
1458
- request_has_path_params=True,
1459
- request_has_query_params=True,
1460
- user_agent_header="user-agent",
1461
- accept_header_value="application/json",
1462
- http_headers=http_headers,
1463
- security=self.sdk_configuration.security,
1464
- get_serialized_body=lambda: utils.serialize_request_body(
1465
- request.output_test_request,
1466
- False,
1467
- False,
1468
- "json",
1469
- models.OutputTestRequest,
1470
- ),
1471
- timeout_ms=timeout_ms,
1472
- )
1473
-
1474
- if retries == UNSET:
1475
- if self.sdk_configuration.retry_config is not UNSET:
1476
- retries = self.sdk_configuration.retry_config
1477
-
1478
- retry_config = None
1479
- if isinstance(retries, utils.RetryConfig):
1480
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1481
-
1482
- http_res = self.do_request(
1483
- hook_ctx=HookContext(
1484
- config=self.sdk_configuration,
1485
- base_url=base_url or "",
1486
- operation_id="createOutputTestById",
1487
- oauth2_scopes=[],
1488
- security_source=get_security_from_env(
1489
- self.sdk_configuration.security, models.Security
1490
- ),
1491
- ),
1492
- request=req,
1493
- error_status_codes=["401", "4XX", "500", "5XX"],
1494
- retry_config=retry_config,
1495
- )
1496
-
1497
- response_data: Any = None
1498
- if utils.match_response(http_res, "200", "application/json"):
1499
- return unmarshal_json_response(
1500
- models.CreateOutputTestByIDResponse, http_res
1501
- )
1502
- if utils.match_response(http_res, "500", "application/json"):
1503
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1504
- raise errors.Error(response_data, http_res)
1505
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1506
- http_res_text = utils.stream_to_text(http_res)
1507
- raise errors.APIError("API error occurred", http_res, http_res_text)
1508
- if utils.match_response(http_res, "5XX", "*"):
1509
- http_res_text = utils.stream_to_text(http_res)
1510
- raise errors.APIError("API error occurred", http_res, http_res_text)
1511
-
1512
- raise errors.APIError("Unexpected response received", http_res)
1513
-
1514
- async def create_sample_data_async(
1515
- self,
1516
- *,
1517
- id: str,
1518
- events: Union[List[models.CriblEvent], List[models.CriblEventTypedDict]],
1519
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1520
- server_url: Optional[str] = None,
1521
- timeout_ms: Optional[int] = None,
1522
- http_headers: Optional[Mapping[str, str]] = None,
1523
- ) -> models.CreateOutputTestByIDResponse:
1524
- r"""Send sample event data to a Destination
1525
-
1526
- Send sample data to a destination to validate configuration or test connectivity
1527
-
1528
- :param id: Destination Id
1529
- :param events:
1530
- :param retries: Override the default retry configuration for this method
1531
- :param server_url: Override the default server URL for this method
1532
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1533
- :param http_headers: Additional headers to set or replace on requests.
1534
- """
1535
- base_url = None
1536
- url_variables = None
1537
- if timeout_ms is None:
1538
- timeout_ms = self.sdk_configuration.timeout_ms
1539
-
1540
- if server_url is not None:
1541
- base_url = server_url
1542
- else:
1543
- base_url = self._get_url(base_url, url_variables)
1544
-
1545
- request = models.CreateOutputTestByIDRequest(
1546
- id=id,
1547
- output_test_request=models.OutputTestRequest(
1548
- events=utils.get_pydantic_model(events, List[models.CriblEvent]),
1549
- ),
1550
- )
1551
-
1552
- req = self._build_request_async(
1553
- method="POST",
1554
- path="/system/outputs/{id}/test",
1555
- base_url=base_url,
1556
- url_variables=url_variables,
1557
- request=request,
1558
- request_body_required=True,
1559
- request_has_path_params=True,
1560
- request_has_query_params=True,
1561
- user_agent_header="user-agent",
1562
- accept_header_value="application/json",
1563
- http_headers=http_headers,
1564
- security=self.sdk_configuration.security,
1565
- get_serialized_body=lambda: utils.serialize_request_body(
1566
- request.output_test_request,
1567
- False,
1568
- False,
1569
- "json",
1570
- models.OutputTestRequest,
1571
- ),
1572
- timeout_ms=timeout_ms,
1573
- )
1574
-
1575
- if retries == UNSET:
1576
- if self.sdk_configuration.retry_config is not UNSET:
1577
- retries = self.sdk_configuration.retry_config
1578
-
1579
- retry_config = None
1580
- if isinstance(retries, utils.RetryConfig):
1581
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1582
-
1583
- http_res = await self.do_request_async(
1584
- hook_ctx=HookContext(
1585
- config=self.sdk_configuration,
1586
- base_url=base_url or "",
1587
- operation_id="createOutputTestById",
1588
- oauth2_scopes=[],
1589
- security_source=get_security_from_env(
1590
- self.sdk_configuration.security, models.Security
1591
- ),
1592
- ),
1593
- request=req,
1594
- error_status_codes=["401", "4XX", "500", "5XX"],
1595
- retry_config=retry_config,
1596
- )
1597
-
1598
- response_data: Any = None
1599
- if utils.match_response(http_res, "200", "application/json"):
1600
- return unmarshal_json_response(
1601
- models.CreateOutputTestByIDResponse, http_res
1602
- )
1603
- if utils.match_response(http_res, "500", "application/json"):
1604
- response_data = unmarshal_json_response(errors.ErrorData, http_res)
1605
- raise errors.Error(response_data, http_res)
1606
- if utils.match_response(http_res, ["401", "4XX"], "*"):
1607
- http_res_text = await utils.stream_to_text_async(http_res)
1608
- raise errors.APIError("API error occurred", http_res, http_res_text)
1609
- if utils.match_response(http_res, "5XX", "*"):
1610
- http_res_text = await utils.stream_to_text_async(http_res)
1611
- raise errors.APIError("API error occurred", http_res, http_res_text)
1612
-
1613
- raise errors.APIError("Unexpected response received", http_res)