cribl-control-plane 0.0.26__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.
- cribl_control_plane/_version.py +3 -3
- cribl_control_plane/acl.py +203 -0
- cribl_control_plane/auth_sdk.py +9 -176
- cribl_control_plane/branches.py +335 -0
- cribl_control_plane/commits.py +1141 -0
- cribl_control_plane/commits_files.py +371 -0
- cribl_control_plane/configs_versions.py +189 -0
- cribl_control_plane/destinations.py +16 -729
- cribl_control_plane/destinations_pq.py +359 -0
- cribl_control_plane/groups_configs.py +17 -0
- cribl_control_plane/groups_sdk.py +12 -545
- cribl_control_plane/hectokens.py +479 -0
- cribl_control_plane/models/__init__.py +0 -8
- cribl_control_plane/nodes.py +9 -171
- cribl_control_plane/samples.py +391 -0
- cribl_control_plane/sdk.py +3 -5
- cribl_control_plane/sources.py +13 -469
- cribl_control_plane/statuses.py +185 -0
- cribl_control_plane/summaries.py +185 -0
- cribl_control_plane/teams.py +201 -0
- cribl_control_plane/tokens.py +182 -0
- cribl_control_plane/versions.py +26 -0
- cribl_control_plane/versions_configs.py +171 -0
- {cribl_control_plane-0.0.26.dist-info → cribl_control_plane-0.0.27.dist-info}/METADATA +67 -29
- {cribl_control_plane-0.0.26.dist-info → cribl_control_plane-0.0.27.dist-info}/RECORD +26 -13
- cribl_control_plane/models/createversionsyncop.py +0 -23
- cribl_control_plane/versioning.py +0 -2309
- {cribl_control_plane-0.0.26.dist-info → cribl_control_plane-0.0.27.dist-info}/WHEEL +0 -0
cribl_control_plane/sources.py
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
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.hectokens import HecTokens
|
|
6
8
|
from cribl_control_plane.types import BaseModel, OptionalNullable, UNSET
|
|
7
9
|
from cribl_control_plane.utils import get_security_from_env
|
|
8
10
|
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
-
from typing import Any,
|
|
11
|
+
from typing import Any, Mapping, Optional, Union, cast
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class Sources(BaseSDK):
|
|
13
15
|
r"""Actions related to Sources"""
|
|
14
16
|
|
|
17
|
+
hec_tokens: HecTokens
|
|
18
|
+
|
|
19
|
+
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
20
|
+
BaseSDK.__init__(self, sdk_config)
|
|
21
|
+
self.sdk_configuration = sdk_config
|
|
22
|
+
self._init_sdks()
|
|
23
|
+
|
|
24
|
+
def _init_sdks(self):
|
|
25
|
+
self.hec_tokens = HecTokens(self.sdk_configuration)
|
|
26
|
+
|
|
15
27
|
def list(
|
|
16
28
|
self,
|
|
17
29
|
*,
|
|
@@ -885,471 +897,3 @@ class Sources(BaseSDK):
|
|
|
885
897
|
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
886
898
|
|
|
887
899
|
raise errors.APIError("Unexpected response received", http_res)
|
|
888
|
-
|
|
889
|
-
def create_hec_token(
|
|
890
|
-
self,
|
|
891
|
-
*,
|
|
892
|
-
id: str,
|
|
893
|
-
token: str,
|
|
894
|
-
description: Optional[str] = None,
|
|
895
|
-
enabled: Optional[bool] = None,
|
|
896
|
-
metadata: Optional[
|
|
897
|
-
Union[
|
|
898
|
-
List[models.AddHecTokenRequestMetadatum],
|
|
899
|
-
List[models.AddHecTokenRequestMetadatumTypedDict],
|
|
900
|
-
]
|
|
901
|
-
] = None,
|
|
902
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
903
|
-
server_url: Optional[str] = None,
|
|
904
|
-
timeout_ms: Optional[int] = None,
|
|
905
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
906
|
-
) -> models.CreateInputHecTokenByIDResponse:
|
|
907
|
-
r"""Add an HEC token and optional metadata to a Splunk HEC Source
|
|
908
|
-
|
|
909
|
-
Add token and optional metadata to an existing HEC Source
|
|
910
|
-
|
|
911
|
-
:param id: HEC Source id
|
|
912
|
-
:param token:
|
|
913
|
-
:param description:
|
|
914
|
-
:param enabled:
|
|
915
|
-
:param metadata:
|
|
916
|
-
:param retries: Override the default retry configuration for this method
|
|
917
|
-
:param server_url: Override the default server URL for this method
|
|
918
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
919
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
920
|
-
"""
|
|
921
|
-
base_url = None
|
|
922
|
-
url_variables = None
|
|
923
|
-
if timeout_ms is None:
|
|
924
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
925
|
-
|
|
926
|
-
if server_url is not None:
|
|
927
|
-
base_url = server_url
|
|
928
|
-
else:
|
|
929
|
-
base_url = self._get_url(base_url, url_variables)
|
|
930
|
-
|
|
931
|
-
request = models.CreateInputHecTokenByIDRequest(
|
|
932
|
-
id=id,
|
|
933
|
-
add_hec_token_request=models.AddHecTokenRequest(
|
|
934
|
-
description=description,
|
|
935
|
-
enabled=enabled,
|
|
936
|
-
metadata=utils.get_pydantic_model(
|
|
937
|
-
metadata, Optional[List[models.AddHecTokenRequestMetadatum]]
|
|
938
|
-
),
|
|
939
|
-
token=token,
|
|
940
|
-
),
|
|
941
|
-
)
|
|
942
|
-
|
|
943
|
-
req = self._build_request(
|
|
944
|
-
method="POST",
|
|
945
|
-
path="/system/inputs/{id}/hectoken",
|
|
946
|
-
base_url=base_url,
|
|
947
|
-
url_variables=url_variables,
|
|
948
|
-
request=request,
|
|
949
|
-
request_body_required=True,
|
|
950
|
-
request_has_path_params=True,
|
|
951
|
-
request_has_query_params=True,
|
|
952
|
-
user_agent_header="user-agent",
|
|
953
|
-
accept_header_value="application/json",
|
|
954
|
-
http_headers=http_headers,
|
|
955
|
-
security=self.sdk_configuration.security,
|
|
956
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
957
|
-
request.add_hec_token_request,
|
|
958
|
-
False,
|
|
959
|
-
False,
|
|
960
|
-
"json",
|
|
961
|
-
models.AddHecTokenRequest,
|
|
962
|
-
),
|
|
963
|
-
timeout_ms=timeout_ms,
|
|
964
|
-
)
|
|
965
|
-
|
|
966
|
-
if retries == UNSET:
|
|
967
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
968
|
-
retries = self.sdk_configuration.retry_config
|
|
969
|
-
|
|
970
|
-
retry_config = None
|
|
971
|
-
if isinstance(retries, utils.RetryConfig):
|
|
972
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
973
|
-
|
|
974
|
-
http_res = self.do_request(
|
|
975
|
-
hook_ctx=HookContext(
|
|
976
|
-
config=self.sdk_configuration,
|
|
977
|
-
base_url=base_url or "",
|
|
978
|
-
operation_id="createInputHecTokenById",
|
|
979
|
-
oauth2_scopes=[],
|
|
980
|
-
security_source=get_security_from_env(
|
|
981
|
-
self.sdk_configuration.security, models.Security
|
|
982
|
-
),
|
|
983
|
-
),
|
|
984
|
-
request=req,
|
|
985
|
-
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
986
|
-
retry_config=retry_config,
|
|
987
|
-
)
|
|
988
|
-
|
|
989
|
-
response_data: Any = None
|
|
990
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
991
|
-
return unmarshal_json_response(
|
|
992
|
-
models.CreateInputHecTokenByIDResponse, http_res
|
|
993
|
-
)
|
|
994
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
995
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
996
|
-
raise errors.Error(response_data, http_res)
|
|
997
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
998
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
999
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1000
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1001
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1002
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1003
|
-
|
|
1004
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1005
|
-
|
|
1006
|
-
async def create_hec_token_async(
|
|
1007
|
-
self,
|
|
1008
|
-
*,
|
|
1009
|
-
id: str,
|
|
1010
|
-
token: str,
|
|
1011
|
-
description: Optional[str] = None,
|
|
1012
|
-
enabled: Optional[bool] = None,
|
|
1013
|
-
metadata: Optional[
|
|
1014
|
-
Union[
|
|
1015
|
-
List[models.AddHecTokenRequestMetadatum],
|
|
1016
|
-
List[models.AddHecTokenRequestMetadatumTypedDict],
|
|
1017
|
-
]
|
|
1018
|
-
] = None,
|
|
1019
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1020
|
-
server_url: Optional[str] = None,
|
|
1021
|
-
timeout_ms: Optional[int] = None,
|
|
1022
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1023
|
-
) -> models.CreateInputHecTokenByIDResponse:
|
|
1024
|
-
r"""Add an HEC token and optional metadata to a Splunk HEC Source
|
|
1025
|
-
|
|
1026
|
-
Add token and optional metadata to an existing HEC Source
|
|
1027
|
-
|
|
1028
|
-
:param id: HEC Source id
|
|
1029
|
-
:param token:
|
|
1030
|
-
:param description:
|
|
1031
|
-
:param enabled:
|
|
1032
|
-
:param metadata:
|
|
1033
|
-
:param retries: Override the default retry configuration for this method
|
|
1034
|
-
:param server_url: Override the default server URL for this method
|
|
1035
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1036
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1037
|
-
"""
|
|
1038
|
-
base_url = None
|
|
1039
|
-
url_variables = None
|
|
1040
|
-
if timeout_ms is None:
|
|
1041
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1042
|
-
|
|
1043
|
-
if server_url is not None:
|
|
1044
|
-
base_url = server_url
|
|
1045
|
-
else:
|
|
1046
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1047
|
-
|
|
1048
|
-
request = models.CreateInputHecTokenByIDRequest(
|
|
1049
|
-
id=id,
|
|
1050
|
-
add_hec_token_request=models.AddHecTokenRequest(
|
|
1051
|
-
description=description,
|
|
1052
|
-
enabled=enabled,
|
|
1053
|
-
metadata=utils.get_pydantic_model(
|
|
1054
|
-
metadata, Optional[List[models.AddHecTokenRequestMetadatum]]
|
|
1055
|
-
),
|
|
1056
|
-
token=token,
|
|
1057
|
-
),
|
|
1058
|
-
)
|
|
1059
|
-
|
|
1060
|
-
req = self._build_request_async(
|
|
1061
|
-
method="POST",
|
|
1062
|
-
path="/system/inputs/{id}/hectoken",
|
|
1063
|
-
base_url=base_url,
|
|
1064
|
-
url_variables=url_variables,
|
|
1065
|
-
request=request,
|
|
1066
|
-
request_body_required=True,
|
|
1067
|
-
request_has_path_params=True,
|
|
1068
|
-
request_has_query_params=True,
|
|
1069
|
-
user_agent_header="user-agent",
|
|
1070
|
-
accept_header_value="application/json",
|
|
1071
|
-
http_headers=http_headers,
|
|
1072
|
-
security=self.sdk_configuration.security,
|
|
1073
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1074
|
-
request.add_hec_token_request,
|
|
1075
|
-
False,
|
|
1076
|
-
False,
|
|
1077
|
-
"json",
|
|
1078
|
-
models.AddHecTokenRequest,
|
|
1079
|
-
),
|
|
1080
|
-
timeout_ms=timeout_ms,
|
|
1081
|
-
)
|
|
1082
|
-
|
|
1083
|
-
if retries == UNSET:
|
|
1084
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1085
|
-
retries = self.sdk_configuration.retry_config
|
|
1086
|
-
|
|
1087
|
-
retry_config = None
|
|
1088
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1089
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1090
|
-
|
|
1091
|
-
http_res = await self.do_request_async(
|
|
1092
|
-
hook_ctx=HookContext(
|
|
1093
|
-
config=self.sdk_configuration,
|
|
1094
|
-
base_url=base_url or "",
|
|
1095
|
-
operation_id="createInputHecTokenById",
|
|
1096
|
-
oauth2_scopes=[],
|
|
1097
|
-
security_source=get_security_from_env(
|
|
1098
|
-
self.sdk_configuration.security, models.Security
|
|
1099
|
-
),
|
|
1100
|
-
),
|
|
1101
|
-
request=req,
|
|
1102
|
-
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1103
|
-
retry_config=retry_config,
|
|
1104
|
-
)
|
|
1105
|
-
|
|
1106
|
-
response_data: Any = None
|
|
1107
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1108
|
-
return unmarshal_json_response(
|
|
1109
|
-
models.CreateInputHecTokenByIDResponse, http_res
|
|
1110
|
-
)
|
|
1111
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
1112
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1113
|
-
raise errors.Error(response_data, http_res)
|
|
1114
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1115
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1116
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1117
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1118
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1119
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1120
|
-
|
|
1121
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1122
|
-
|
|
1123
|
-
def update_hec_token_metadata(
|
|
1124
|
-
self,
|
|
1125
|
-
*,
|
|
1126
|
-
id: str,
|
|
1127
|
-
token: str,
|
|
1128
|
-
description: Optional[str] = None,
|
|
1129
|
-
enabled: Optional[bool] = None,
|
|
1130
|
-
metadata: Optional[
|
|
1131
|
-
Union[
|
|
1132
|
-
List[models.UpdateHecTokenRequestMetadatum],
|
|
1133
|
-
List[models.UpdateHecTokenRequestMetadatumTypedDict],
|
|
1134
|
-
]
|
|
1135
|
-
] = None,
|
|
1136
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1137
|
-
server_url: Optional[str] = None,
|
|
1138
|
-
timeout_ms: Optional[int] = None,
|
|
1139
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1140
|
-
) -> models.UpdateInputHecTokenByIDAndTokenResponse:
|
|
1141
|
-
r"""Update metadata for an HEC token for a Splunk HEC Source
|
|
1142
|
-
|
|
1143
|
-
Update token metadata on existing HEC Source
|
|
1144
|
-
|
|
1145
|
-
:param id: HEC Source id
|
|
1146
|
-
:param token: token to update
|
|
1147
|
-
:param description:
|
|
1148
|
-
:param enabled:
|
|
1149
|
-
:param metadata:
|
|
1150
|
-
:param retries: Override the default retry configuration for this method
|
|
1151
|
-
:param server_url: Override the default server URL for this method
|
|
1152
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1153
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1154
|
-
"""
|
|
1155
|
-
base_url = None
|
|
1156
|
-
url_variables = None
|
|
1157
|
-
if timeout_ms is None:
|
|
1158
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1159
|
-
|
|
1160
|
-
if server_url is not None:
|
|
1161
|
-
base_url = server_url
|
|
1162
|
-
else:
|
|
1163
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1164
|
-
|
|
1165
|
-
request = models.UpdateInputHecTokenByIDAndTokenRequest(
|
|
1166
|
-
id=id,
|
|
1167
|
-
token=token,
|
|
1168
|
-
update_hec_token_request=models.UpdateHecTokenRequest(
|
|
1169
|
-
description=description,
|
|
1170
|
-
enabled=enabled,
|
|
1171
|
-
metadata=utils.get_pydantic_model(
|
|
1172
|
-
metadata, Optional[List[models.UpdateHecTokenRequestMetadatum]]
|
|
1173
|
-
),
|
|
1174
|
-
),
|
|
1175
|
-
)
|
|
1176
|
-
|
|
1177
|
-
req = self._build_request(
|
|
1178
|
-
method="PATCH",
|
|
1179
|
-
path="/system/inputs/{id}/hectoken/{token}",
|
|
1180
|
-
base_url=base_url,
|
|
1181
|
-
url_variables=url_variables,
|
|
1182
|
-
request=request,
|
|
1183
|
-
request_body_required=True,
|
|
1184
|
-
request_has_path_params=True,
|
|
1185
|
-
request_has_query_params=True,
|
|
1186
|
-
user_agent_header="user-agent",
|
|
1187
|
-
accept_header_value="application/json",
|
|
1188
|
-
http_headers=http_headers,
|
|
1189
|
-
security=self.sdk_configuration.security,
|
|
1190
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1191
|
-
request.update_hec_token_request,
|
|
1192
|
-
False,
|
|
1193
|
-
False,
|
|
1194
|
-
"json",
|
|
1195
|
-
models.UpdateHecTokenRequest,
|
|
1196
|
-
),
|
|
1197
|
-
timeout_ms=timeout_ms,
|
|
1198
|
-
)
|
|
1199
|
-
|
|
1200
|
-
if retries == UNSET:
|
|
1201
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1202
|
-
retries = self.sdk_configuration.retry_config
|
|
1203
|
-
|
|
1204
|
-
retry_config = None
|
|
1205
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1206
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1207
|
-
|
|
1208
|
-
http_res = self.do_request(
|
|
1209
|
-
hook_ctx=HookContext(
|
|
1210
|
-
config=self.sdk_configuration,
|
|
1211
|
-
base_url=base_url or "",
|
|
1212
|
-
operation_id="updateInputHecTokenByIdAndToken",
|
|
1213
|
-
oauth2_scopes=[],
|
|
1214
|
-
security_source=get_security_from_env(
|
|
1215
|
-
self.sdk_configuration.security, models.Security
|
|
1216
|
-
),
|
|
1217
|
-
),
|
|
1218
|
-
request=req,
|
|
1219
|
-
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1220
|
-
retry_config=retry_config,
|
|
1221
|
-
)
|
|
1222
|
-
|
|
1223
|
-
response_data: Any = None
|
|
1224
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1225
|
-
return unmarshal_json_response(
|
|
1226
|
-
models.UpdateInputHecTokenByIDAndTokenResponse, http_res
|
|
1227
|
-
)
|
|
1228
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
1229
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1230
|
-
raise errors.Error(response_data, http_res)
|
|
1231
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1232
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1233
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1234
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1235
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1236
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1237
|
-
|
|
1238
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1239
|
-
|
|
1240
|
-
async def update_hec_token_metadata_async(
|
|
1241
|
-
self,
|
|
1242
|
-
*,
|
|
1243
|
-
id: str,
|
|
1244
|
-
token: str,
|
|
1245
|
-
description: Optional[str] = None,
|
|
1246
|
-
enabled: Optional[bool] = None,
|
|
1247
|
-
metadata: Optional[
|
|
1248
|
-
Union[
|
|
1249
|
-
List[models.UpdateHecTokenRequestMetadatum],
|
|
1250
|
-
List[models.UpdateHecTokenRequestMetadatumTypedDict],
|
|
1251
|
-
]
|
|
1252
|
-
] = None,
|
|
1253
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1254
|
-
server_url: Optional[str] = None,
|
|
1255
|
-
timeout_ms: Optional[int] = None,
|
|
1256
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1257
|
-
) -> models.UpdateInputHecTokenByIDAndTokenResponse:
|
|
1258
|
-
r"""Update metadata for an HEC token for a Splunk HEC Source
|
|
1259
|
-
|
|
1260
|
-
Update token metadata on existing HEC Source
|
|
1261
|
-
|
|
1262
|
-
:param id: HEC Source id
|
|
1263
|
-
:param token: token to update
|
|
1264
|
-
:param description:
|
|
1265
|
-
:param enabled:
|
|
1266
|
-
:param metadata:
|
|
1267
|
-
:param retries: Override the default retry configuration for this method
|
|
1268
|
-
:param server_url: Override the default server URL for this method
|
|
1269
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1270
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1271
|
-
"""
|
|
1272
|
-
base_url = None
|
|
1273
|
-
url_variables = None
|
|
1274
|
-
if timeout_ms is None:
|
|
1275
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1276
|
-
|
|
1277
|
-
if server_url is not None:
|
|
1278
|
-
base_url = server_url
|
|
1279
|
-
else:
|
|
1280
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1281
|
-
|
|
1282
|
-
request = models.UpdateInputHecTokenByIDAndTokenRequest(
|
|
1283
|
-
id=id,
|
|
1284
|
-
token=token,
|
|
1285
|
-
update_hec_token_request=models.UpdateHecTokenRequest(
|
|
1286
|
-
description=description,
|
|
1287
|
-
enabled=enabled,
|
|
1288
|
-
metadata=utils.get_pydantic_model(
|
|
1289
|
-
metadata, Optional[List[models.UpdateHecTokenRequestMetadatum]]
|
|
1290
|
-
),
|
|
1291
|
-
),
|
|
1292
|
-
)
|
|
1293
|
-
|
|
1294
|
-
req = self._build_request_async(
|
|
1295
|
-
method="PATCH",
|
|
1296
|
-
path="/system/inputs/{id}/hectoken/{token}",
|
|
1297
|
-
base_url=base_url,
|
|
1298
|
-
url_variables=url_variables,
|
|
1299
|
-
request=request,
|
|
1300
|
-
request_body_required=True,
|
|
1301
|
-
request_has_path_params=True,
|
|
1302
|
-
request_has_query_params=True,
|
|
1303
|
-
user_agent_header="user-agent",
|
|
1304
|
-
accept_header_value="application/json",
|
|
1305
|
-
http_headers=http_headers,
|
|
1306
|
-
security=self.sdk_configuration.security,
|
|
1307
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1308
|
-
request.update_hec_token_request,
|
|
1309
|
-
False,
|
|
1310
|
-
False,
|
|
1311
|
-
"json",
|
|
1312
|
-
models.UpdateHecTokenRequest,
|
|
1313
|
-
),
|
|
1314
|
-
timeout_ms=timeout_ms,
|
|
1315
|
-
)
|
|
1316
|
-
|
|
1317
|
-
if retries == UNSET:
|
|
1318
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1319
|
-
retries = self.sdk_configuration.retry_config
|
|
1320
|
-
|
|
1321
|
-
retry_config = None
|
|
1322
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1323
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1324
|
-
|
|
1325
|
-
http_res = await self.do_request_async(
|
|
1326
|
-
hook_ctx=HookContext(
|
|
1327
|
-
config=self.sdk_configuration,
|
|
1328
|
-
base_url=base_url or "",
|
|
1329
|
-
operation_id="updateInputHecTokenByIdAndToken",
|
|
1330
|
-
oauth2_scopes=[],
|
|
1331
|
-
security_source=get_security_from_env(
|
|
1332
|
-
self.sdk_configuration.security, models.Security
|
|
1333
|
-
),
|
|
1334
|
-
),
|
|
1335
|
-
request=req,
|
|
1336
|
-
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1337
|
-
retry_config=retry_config,
|
|
1338
|
-
)
|
|
1339
|
-
|
|
1340
|
-
response_data: Any = None
|
|
1341
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1342
|
-
return unmarshal_json_response(
|
|
1343
|
-
models.UpdateInputHecTokenByIDAndTokenResponse, http_res
|
|
1344
|
-
)
|
|
1345
|
-
if utils.match_response(http_res, "500", "application/json"):
|
|
1346
|
-
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1347
|
-
raise errors.Error(response_data, http_res)
|
|
1348
|
-
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1349
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1350
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1351
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1352
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1353
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1354
|
-
|
|
1355
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from cribl_control_plane import errors, models, utils
|
|
5
|
+
from cribl_control_plane._hooks import HookContext
|
|
6
|
+
from cribl_control_plane.types import OptionalNullable, UNSET
|
|
7
|
+
from cribl_control_plane.utils import get_security_from_env
|
|
8
|
+
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, Mapping, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Statuses(BaseSDK):
|
|
13
|
+
def get(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
group: Optional[str] = None,
|
|
17
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
18
|
+
server_url: Optional[str] = None,
|
|
19
|
+
timeout_ms: Optional[int] = None,
|
|
20
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
21
|
+
) -> models.GetVersionStatusResponse:
|
|
22
|
+
r"""Retrieve the status of the current working tree
|
|
23
|
+
|
|
24
|
+
get the the working tree status
|
|
25
|
+
|
|
26
|
+
:param group: Group ID
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if server_url is not None:
|
|
38
|
+
base_url = server_url
|
|
39
|
+
else:
|
|
40
|
+
base_url = self._get_url(base_url, url_variables)
|
|
41
|
+
|
|
42
|
+
request = models.GetVersionStatusRequest(
|
|
43
|
+
group=group,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
req = self._build_request(
|
|
47
|
+
method="GET",
|
|
48
|
+
path="/version/status",
|
|
49
|
+
base_url=base_url,
|
|
50
|
+
url_variables=url_variables,
|
|
51
|
+
request=request,
|
|
52
|
+
request_body_required=False,
|
|
53
|
+
request_has_path_params=False,
|
|
54
|
+
request_has_query_params=True,
|
|
55
|
+
user_agent_header="user-agent",
|
|
56
|
+
accept_header_value="application/json",
|
|
57
|
+
http_headers=http_headers,
|
|
58
|
+
security=self.sdk_configuration.security,
|
|
59
|
+
timeout_ms=timeout_ms,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if retries == UNSET:
|
|
63
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
64
|
+
retries = self.sdk_configuration.retry_config
|
|
65
|
+
|
|
66
|
+
retry_config = None
|
|
67
|
+
if isinstance(retries, utils.RetryConfig):
|
|
68
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
69
|
+
|
|
70
|
+
http_res = self.do_request(
|
|
71
|
+
hook_ctx=HookContext(
|
|
72
|
+
config=self.sdk_configuration,
|
|
73
|
+
base_url=base_url or "",
|
|
74
|
+
operation_id="getVersionStatus",
|
|
75
|
+
oauth2_scopes=[],
|
|
76
|
+
security_source=get_security_from_env(
|
|
77
|
+
self.sdk_configuration.security, models.Security
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
request=req,
|
|
81
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
82
|
+
retry_config=retry_config,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
response_data: Any = None
|
|
86
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
87
|
+
return unmarshal_json_response(models.GetVersionStatusResponse, http_res)
|
|
88
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
89
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
90
|
+
raise errors.Error(response_data, http_res)
|
|
91
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
92
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
93
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
94
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
95
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
96
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
97
|
+
|
|
98
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
99
|
+
|
|
100
|
+
async def get_async(
|
|
101
|
+
self,
|
|
102
|
+
*,
|
|
103
|
+
group: Optional[str] = None,
|
|
104
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
105
|
+
server_url: Optional[str] = None,
|
|
106
|
+
timeout_ms: Optional[int] = None,
|
|
107
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
108
|
+
) -> models.GetVersionStatusResponse:
|
|
109
|
+
r"""Retrieve the status of the current working tree
|
|
110
|
+
|
|
111
|
+
get the the working tree status
|
|
112
|
+
|
|
113
|
+
:param group: Group ID
|
|
114
|
+
:param retries: Override the default retry configuration for this method
|
|
115
|
+
:param server_url: Override the default server URL for this method
|
|
116
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
117
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
118
|
+
"""
|
|
119
|
+
base_url = None
|
|
120
|
+
url_variables = None
|
|
121
|
+
if timeout_ms is None:
|
|
122
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
123
|
+
|
|
124
|
+
if server_url is not None:
|
|
125
|
+
base_url = server_url
|
|
126
|
+
else:
|
|
127
|
+
base_url = self._get_url(base_url, url_variables)
|
|
128
|
+
|
|
129
|
+
request = models.GetVersionStatusRequest(
|
|
130
|
+
group=group,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
req = self._build_request_async(
|
|
134
|
+
method="GET",
|
|
135
|
+
path="/version/status",
|
|
136
|
+
base_url=base_url,
|
|
137
|
+
url_variables=url_variables,
|
|
138
|
+
request=request,
|
|
139
|
+
request_body_required=False,
|
|
140
|
+
request_has_path_params=False,
|
|
141
|
+
request_has_query_params=True,
|
|
142
|
+
user_agent_header="user-agent",
|
|
143
|
+
accept_header_value="application/json",
|
|
144
|
+
http_headers=http_headers,
|
|
145
|
+
security=self.sdk_configuration.security,
|
|
146
|
+
timeout_ms=timeout_ms,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
if retries == UNSET:
|
|
150
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
151
|
+
retries = self.sdk_configuration.retry_config
|
|
152
|
+
|
|
153
|
+
retry_config = None
|
|
154
|
+
if isinstance(retries, utils.RetryConfig):
|
|
155
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
156
|
+
|
|
157
|
+
http_res = await self.do_request_async(
|
|
158
|
+
hook_ctx=HookContext(
|
|
159
|
+
config=self.sdk_configuration,
|
|
160
|
+
base_url=base_url or "",
|
|
161
|
+
operation_id="getVersionStatus",
|
|
162
|
+
oauth2_scopes=[],
|
|
163
|
+
security_source=get_security_from_env(
|
|
164
|
+
self.sdk_configuration.security, models.Security
|
|
165
|
+
),
|
|
166
|
+
),
|
|
167
|
+
request=req,
|
|
168
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
169
|
+
retry_config=retry_config,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
response_data: Any = None
|
|
173
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
174
|
+
return unmarshal_json_response(models.GetVersionStatusResponse, http_res)
|
|
175
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
176
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
177
|
+
raise errors.Error(response_data, http_res)
|
|
178
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
179
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
180
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
181
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
182
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
183
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
184
|
+
|
|
185
|
+
raise errors.APIError("Unexpected response received", http_res)
|