sumo-wrapper-python 1.8.0__py3-none-any.whl → 1.9.0__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.
- sumo/wrapper/__init__.py +1 -1
- sumo/wrapper/_auth_provider.py +10 -50
- sumo/wrapper/_blob_client.py +0 -1
- sumo/wrapper/_logging.py +3 -8
- sumo/wrapper/_retry_strategy.py +0 -2
- sumo/wrapper/_version.py +2 -2
- sumo/wrapper/sumo_client.py +40 -43
- {sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/METADATA +1 -1
- sumo_wrapper_python-1.9.0.dist-info/RECORD +16 -0
- {sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/WHEEL +1 -1
- sumo_wrapper_python-1.8.0.dist-info/RECORD +0 -16
- {sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/entry_points.txt +0 -0
- {sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/licenses/LICENSE +0 -0
- {sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/top_level.txt +0 -0
sumo/wrapper/__init__.py
CHANGED
sumo/wrapper/_auth_provider.py
CHANGED
|
@@ -5,9 +5,8 @@ import platform
|
|
|
5
5
|
import stat
|
|
6
6
|
import sys
|
|
7
7
|
import time
|
|
8
|
-
from datetime import datetime, timedelta
|
|
8
|
+
from datetime import UTC, datetime, timedelta
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import Dict
|
|
11
10
|
from urllib.parse import parse_qs
|
|
12
11
|
|
|
13
12
|
import jwt
|
|
@@ -55,8 +54,6 @@ class AuthProvider:
|
|
|
55
54
|
self._login_timeout_minutes = 5
|
|
56
55
|
os.system("") # Ensure color init on all platforms (win10)
|
|
57
56
|
|
|
58
|
-
return
|
|
59
|
-
|
|
60
57
|
@tn.retry(
|
|
61
58
|
retry=tn.retry_if_exception(_maybe_nfs_exception),
|
|
62
59
|
stop=tn.stop_after_attempt(6),
|
|
@@ -77,7 +74,7 @@ class AuthProvider:
|
|
|
77
74
|
# ELSE
|
|
78
75
|
return result["access_token"]
|
|
79
76
|
|
|
80
|
-
def get_authorization(self) ->
|
|
77
|
+
def get_authorization(self) -> dict:
|
|
81
78
|
token = self.get_token()
|
|
82
79
|
if token is None:
|
|
83
80
|
return {}
|
|
@@ -92,7 +89,6 @@ class AuthProvider:
|
|
|
92
89
|
) as f:
|
|
93
90
|
f.write(token)
|
|
94
91
|
protect_token_cache(self._resource_id, ".sharedkey", case_uuid)
|
|
95
|
-
return
|
|
96
92
|
|
|
97
93
|
def has_case_token(self, case_uuid):
|
|
98
94
|
return os.path.exists(
|
|
@@ -102,15 +98,11 @@ class AuthProvider:
|
|
|
102
98
|
def delete_token(self):
|
|
103
99
|
return False
|
|
104
100
|
|
|
105
|
-
pass
|
|
106
|
-
|
|
107
101
|
|
|
108
102
|
class AuthProviderNone(AuthProvider):
|
|
109
103
|
def get_token(self):
|
|
110
104
|
raise Exception("No valid authorization provider found.")
|
|
111
105
|
|
|
112
|
-
pass
|
|
113
|
-
|
|
114
106
|
|
|
115
107
|
class AuthProviderSilent(AuthProvider):
|
|
116
108
|
def __init__(self, client_id, authority, resource_id):
|
|
@@ -130,7 +122,6 @@ class AuthProviderAccessToken(AuthProvider):
|
|
|
130
122
|
payload = jwt.decode(access_token, options={"verify_signature": False})
|
|
131
123
|
self._expires = payload["exp"]
|
|
132
124
|
self._resource_id = payload["aud"]
|
|
133
|
-
return
|
|
134
125
|
|
|
135
126
|
def get_token(self):
|
|
136
127
|
if time.time() >= self._expires:
|
|
@@ -138,8 +129,6 @@ class AuthProviderAccessToken(AuthProvider):
|
|
|
138
129
|
# ELSE
|
|
139
130
|
return self._access_token
|
|
140
131
|
|
|
141
|
-
pass
|
|
142
|
-
|
|
143
132
|
|
|
144
133
|
class AuthProviderRefreshToken(AuthProvider):
|
|
145
134
|
def __init__(self, refresh_token, client_id, authority, resource_id):
|
|
@@ -149,9 +138,6 @@ class AuthProviderRefreshToken(AuthProvider):
|
|
|
149
138
|
)
|
|
150
139
|
self._scope = scope_for_resource(resource_id)
|
|
151
140
|
self._app.acquire_token_by_refresh_token(refresh_token, [self._scope])
|
|
152
|
-
return
|
|
153
|
-
|
|
154
|
-
pass
|
|
155
141
|
|
|
156
142
|
|
|
157
143
|
@tn.retry(
|
|
@@ -186,14 +172,10 @@ def get_token_cache(resource_id, suffix):
|
|
|
186
172
|
token = FilePersistence(token_path).load()
|
|
187
173
|
with open(token_path, "w") as f:
|
|
188
174
|
f.truncate()
|
|
189
|
-
pass
|
|
190
175
|
encrypted_persistence.save(token)
|
|
191
|
-
pass
|
|
192
|
-
pass
|
|
193
176
|
|
|
194
177
|
persistence = build_encrypted_persistence(token_path)
|
|
195
178
|
cache = PersistedTokenCache(persistence)
|
|
196
|
-
pass
|
|
197
179
|
return cache
|
|
198
180
|
|
|
199
181
|
|
|
@@ -218,10 +200,7 @@ def protect_token_cache(resource_id, suffix, case_uuid=None):
|
|
|
218
200
|
foldermode = stat.filemode(os.stat(folder).st_mode)
|
|
219
201
|
if foldermode != "drwx------":
|
|
220
202
|
os.chmod(os.path.dirname(token_path), 0o700)
|
|
221
|
-
pass
|
|
222
|
-
pass
|
|
223
203
|
return
|
|
224
|
-
pass
|
|
225
204
|
|
|
226
205
|
|
|
227
206
|
class AuthProviderInteractive(AuthProvider):
|
|
@@ -237,8 +216,6 @@ class AuthProviderInteractive(AuthProvider):
|
|
|
237
216
|
|
|
238
217
|
if self.get_token() is None:
|
|
239
218
|
self.login()
|
|
240
|
-
pass
|
|
241
|
-
return
|
|
242
219
|
|
|
243
220
|
@tn.retry(
|
|
244
221
|
retry=tn.retry_if_exception(_maybe_nfs_exception),
|
|
@@ -262,7 +239,7 @@ class AuthProviderInteractive(AuthProvider):
|
|
|
262
239
|
+ "that is before "
|
|
263
240
|
+ str(
|
|
264
241
|
(
|
|
265
|
-
datetime.now()
|
|
242
|
+
datetime.now().astimezone()
|
|
266
243
|
+ timedelta(minutes=self._login_timeout_minutes)
|
|
267
244
|
).strftime("%H:%M:%S")
|
|
268
245
|
)
|
|
@@ -291,8 +268,6 @@ class AuthProviderInteractive(AuthProvider):
|
|
|
291
268
|
)
|
|
292
269
|
return
|
|
293
270
|
|
|
294
|
-
pass
|
|
295
|
-
|
|
296
271
|
|
|
297
272
|
class AuthProviderDeviceCode(AuthProvider):
|
|
298
273
|
def __init__(self, client_id, authority, resource_id):
|
|
@@ -305,8 +280,6 @@ class AuthProviderDeviceCode(AuthProvider):
|
|
|
305
280
|
self._scope = scope_for_resource(resource_id)
|
|
306
281
|
if self.get_token() is None:
|
|
307
282
|
self.login()
|
|
308
|
-
pass
|
|
309
|
-
return
|
|
310
283
|
|
|
311
284
|
@tn.retry(
|
|
312
285
|
retry=tn.retry_if_exception(_maybe_nfs_exception),
|
|
@@ -324,9 +297,10 @@ class AuthProviderDeviceCode(AuthProvider):
|
|
|
324
297
|
flow = self._app.initiate_device_flow(scopes)
|
|
325
298
|
if "error" in flow:
|
|
326
299
|
print(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
300
|
+
(
|
|
301
|
+
"\n\n \033[31m"
|
|
302
|
+
+ "Failed to initiate device-code login. Err: {}\033[0m"
|
|
303
|
+
).format(json.dumps(flow, indent=4))
|
|
330
304
|
)
|
|
331
305
|
return
|
|
332
306
|
flow["expires_at"] = (
|
|
@@ -363,15 +337,12 @@ class AuthProviderDeviceCode(AuthProvider):
|
|
|
363
337
|
|
|
364
338
|
return
|
|
365
339
|
|
|
366
|
-
pass
|
|
367
|
-
|
|
368
340
|
|
|
369
341
|
class AuthProviderManaged(AuthProvider):
|
|
370
342
|
def __init__(self, resource_id):
|
|
371
343
|
super().__init__(resource_id)
|
|
372
344
|
self._app = ManagedIdentityCredential()
|
|
373
345
|
self._scope = scope_for_resource(resource_id)
|
|
374
|
-
return
|
|
375
346
|
|
|
376
347
|
@tn.retry(
|
|
377
348
|
retry=tn.retry_if_exception(_maybe_nfs_exception),
|
|
@@ -386,8 +357,6 @@ class AuthProviderManaged(AuthProvider):
|
|
|
386
357
|
def get_token(self):
|
|
387
358
|
return self._app.get_token(self._scope).token
|
|
388
359
|
|
|
389
|
-
pass
|
|
390
|
-
|
|
391
360
|
|
|
392
361
|
class AuthProviderSumoToken(AuthProvider):
|
|
393
362
|
@tn.retry(
|
|
@@ -407,8 +376,6 @@ class AuthProviderSumoToken(AuthProvider):
|
|
|
407
376
|
with open(self.token_path, "r") as f:
|
|
408
377
|
self._token = f.readline().strip()
|
|
409
378
|
|
|
410
|
-
return
|
|
411
|
-
|
|
412
379
|
def get_token(self):
|
|
413
380
|
return self._token
|
|
414
381
|
|
|
@@ -460,7 +427,6 @@ def get_auth_provider(
|
|
|
460
427
|
token = auth_silent.get_token()
|
|
461
428
|
if token is not None:
|
|
462
429
|
return auth_silent
|
|
463
|
-
pass
|
|
464
430
|
# ELSE
|
|
465
431
|
if all(
|
|
466
432
|
os.getenv(x)
|
|
@@ -484,7 +450,6 @@ def get_auth_provider(
|
|
|
484
450
|
"\n\n\033[1mDetected chromium lockfile for different node; using firefox to authenticate.\033[0m"
|
|
485
451
|
)
|
|
486
452
|
os.environ["BROWSER"] = "firefox"
|
|
487
|
-
pass
|
|
488
453
|
|
|
489
454
|
return AuthProviderInteractive(client_id, authority, resource_id)
|
|
490
455
|
# ELSE
|
|
@@ -510,15 +475,10 @@ def cleanup_shared_keys():
|
|
|
510
475
|
token = file.read()
|
|
511
476
|
pq = parse_qs(token)
|
|
512
477
|
se = pq["se"][0]
|
|
513
|
-
end = datetime.
|
|
514
|
-
now = datetime.now(
|
|
478
|
+
end = datetime.fromisoformat(se)
|
|
479
|
+
now = datetime.now(UTC)
|
|
515
480
|
if now.timestamp() > end.timestamp():
|
|
516
481
|
os.unlink(ff)
|
|
517
|
-
|
|
518
|
-
pass
|
|
519
|
-
pass
|
|
520
|
-
except Exception:
|
|
482
|
+
except Exception: # noqa: S110
|
|
521
483
|
pass
|
|
522
|
-
pass
|
|
523
|
-
pass
|
|
524
484
|
return
|
sumo/wrapper/_blob_client.py
CHANGED
sumo/wrapper/_logging.py
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class LogHandlerSumo(logging.Handler):
|
|
6
6
|
def __init__(self, sumo_client):
|
|
7
7
|
logging.Handler.__init__(self)
|
|
8
8
|
self._sumoClient = sumo_client
|
|
9
|
-
return
|
|
10
9
|
|
|
11
10
|
def emit(self, record):
|
|
12
11
|
try:
|
|
13
12
|
dt = (
|
|
14
|
-
datetime.now(
|
|
13
|
+
datetime.now(UTC)
|
|
15
14
|
.replace(microsecond=0, tzinfo=None)
|
|
16
15
|
.isoformat()
|
|
17
16
|
+ "Z"
|
|
@@ -32,10 +31,6 @@ class LogHandlerSumo(logging.Handler):
|
|
|
32
31
|
json["details"] = record.__dict__.get("details")
|
|
33
32
|
|
|
34
33
|
self._sumoClient.post("/message-log/new", json=json)
|
|
35
|
-
except Exception:
|
|
34
|
+
except Exception: # noqa: S110
|
|
36
35
|
# Never fail on logging
|
|
37
36
|
pass
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
pass
|
sumo/wrapper/_retry_strategy.py
CHANGED
|
@@ -12,7 +12,6 @@ def _log_retry_info(retry_state):
|
|
|
12
12
|
f"Attempts: {retry_state.attempt_number}; "
|
|
13
13
|
f"Elapsed: {retry_state.seconds_since_start}"
|
|
14
14
|
)
|
|
15
|
-
return
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
# Define the conditions for retrying based on exception types
|
|
@@ -49,7 +48,6 @@ class RetryStrategy:
|
|
|
49
48
|
self._multiplier = multiplier
|
|
50
49
|
self._exp_base = exp_base
|
|
51
50
|
self._before_sleep = before_sleep
|
|
52
|
-
return
|
|
53
51
|
|
|
54
52
|
def make_retryer(self) -> tn.Retrying:
|
|
55
53
|
return tn.Retrying(
|
sumo/wrapper/_version.py
CHANGED
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.
|
|
22
|
-
__version_tuple__ = version_tuple = (1,
|
|
21
|
+
__version__ = version = '1.9.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 9, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
sumo/wrapper/sumo_client.py
CHANGED
|
@@ -4,7 +4,6 @@ import logging
|
|
|
4
4
|
import os
|
|
5
5
|
import re
|
|
6
6
|
import time
|
|
7
|
-
from typing import Dict, Optional, Tuple
|
|
8
7
|
|
|
9
8
|
import httpx
|
|
10
9
|
import jwt
|
|
@@ -38,16 +37,16 @@ class SumoClient:
|
|
|
38
37
|
def __init__(
|
|
39
38
|
self,
|
|
40
39
|
env: str = "prod",
|
|
41
|
-
token:
|
|
40
|
+
token: str | None = None,
|
|
42
41
|
interactive: bool = True,
|
|
43
42
|
devicecode: bool = False,
|
|
44
43
|
verbosity: str = "CRITICAL",
|
|
45
|
-
retry_strategy=
|
|
44
|
+
retry_strategy=None,
|
|
46
45
|
timeout=DEFAULT_TIMEOUT,
|
|
47
46
|
case_uuid=None,
|
|
48
47
|
http_client=None,
|
|
49
48
|
async_http_client=None,
|
|
50
|
-
client_id:
|
|
49
|
+
client_id: str | None = None,
|
|
51
50
|
):
|
|
52
51
|
"""Initialize a new Sumo object
|
|
53
52
|
|
|
@@ -71,10 +70,17 @@ class SumoClient:
|
|
|
71
70
|
AZURE_CLIENT_ID from environment variables or the config. Defaults to None.
|
|
72
71
|
"""
|
|
73
72
|
|
|
73
|
+
if retry_strategy is None:
|
|
74
|
+
retry_strategy = RetryStrategy()
|
|
74
75
|
logger.setLevel(verbosity)
|
|
75
76
|
global well_known
|
|
76
77
|
if well_known is None:
|
|
77
|
-
|
|
78
|
+
|
|
79
|
+
def _get():
|
|
80
|
+
return httpx.get(WELL_KNOWN, timeout=timeout)
|
|
81
|
+
|
|
82
|
+
retryer = retry_strategy.make_retryer()
|
|
83
|
+
well_known = retryer(_get).json()
|
|
78
84
|
if env not in well_known["envs"]:
|
|
79
85
|
raise ValueError(f"Invalid environment: {env}")
|
|
80
86
|
|
|
@@ -128,8 +134,6 @@ class SumoClient:
|
|
|
128
134
|
"treating it as a refresh token"
|
|
129
135
|
)
|
|
130
136
|
refresh_token = token
|
|
131
|
-
pass
|
|
132
|
-
pass
|
|
133
137
|
|
|
134
138
|
cleanup_shared_keys()
|
|
135
139
|
self.auth = get_auth_provider(
|
|
@@ -144,7 +148,6 @@ class SumoClient:
|
|
|
144
148
|
)
|
|
145
149
|
|
|
146
150
|
self.base_url = base_url
|
|
147
|
-
return
|
|
148
151
|
|
|
149
152
|
def __enter__(self):
|
|
150
153
|
return self
|
|
@@ -165,19 +168,16 @@ class SumoClient:
|
|
|
165
168
|
def __del__(self):
|
|
166
169
|
if self._client is not None and not self._borrowed_client:
|
|
167
170
|
self._client.close()
|
|
168
|
-
pass
|
|
169
171
|
if self._async_client is not None and not self._borrowed_async_client:
|
|
170
172
|
|
|
171
173
|
async def closeit(client):
|
|
172
174
|
await client.aclose()
|
|
173
|
-
return
|
|
174
175
|
|
|
175
176
|
try:
|
|
176
177
|
loop = asyncio.get_running_loop()
|
|
177
178
|
loop.create_task(closeit(self._async_client))
|
|
178
179
|
except RuntimeError:
|
|
179
180
|
pass
|
|
180
|
-
pass
|
|
181
181
|
|
|
182
182
|
def authenticate(self):
|
|
183
183
|
if self.auth is None:
|
|
@@ -222,8 +222,8 @@ class SumoClient:
|
|
|
222
222
|
def get(
|
|
223
223
|
self,
|
|
224
224
|
path: str,
|
|
225
|
-
params:
|
|
226
|
-
retry_strategy:
|
|
225
|
+
params: dict | None = None,
|
|
226
|
+
retry_strategy: RetryStrategy | None = None,
|
|
227
227
|
) -> httpx.Response:
|
|
228
228
|
"""Performs a GET-request to the Sumo API.
|
|
229
229
|
|
|
@@ -261,12 +261,12 @@ class SumoClient:
|
|
|
261
261
|
follow_redirects = False
|
|
262
262
|
if (
|
|
263
263
|
re.match(
|
|
264
|
-
r"^/objects\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/blob$",
|
|
264
|
+
r"^/objects\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/blob$",
|
|
265
265
|
path,
|
|
266
266
|
)
|
|
267
267
|
is not None
|
|
268
268
|
or re.match(
|
|
269
|
-
r"^/tasks\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/result$",
|
|
269
|
+
r"^/tasks\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/result$",
|
|
270
270
|
path,
|
|
271
271
|
)
|
|
272
272
|
is not None
|
|
@@ -291,10 +291,10 @@ class SumoClient:
|
|
|
291
291
|
def post(
|
|
292
292
|
self,
|
|
293
293
|
path: str,
|
|
294
|
-
blob:
|
|
295
|
-
json:
|
|
296
|
-
params:
|
|
297
|
-
retry_strategy:
|
|
294
|
+
blob: bytes | None = None,
|
|
295
|
+
json: dict | None = None,
|
|
296
|
+
params: dict | None = None,
|
|
297
|
+
retry_strategy: RetryStrategy | None = None,
|
|
298
298
|
) -> httpx.Response:
|
|
299
299
|
"""Performs a POST-request to the Sumo API.
|
|
300
300
|
|
|
@@ -369,9 +369,9 @@ class SumoClient:
|
|
|
369
369
|
def put(
|
|
370
370
|
self,
|
|
371
371
|
path: str,
|
|
372
|
-
blob:
|
|
373
|
-
json:
|
|
374
|
-
retry_strategy:
|
|
372
|
+
blob: bytes | None = None,
|
|
373
|
+
json: dict | None = None,
|
|
374
|
+
retry_strategy: RetryStrategy | None = None,
|
|
375
375
|
) -> httpx.Response:
|
|
376
376
|
"""Performs a PUT-request to the Sumo API.
|
|
377
377
|
|
|
@@ -421,8 +421,8 @@ class SumoClient:
|
|
|
421
421
|
def delete(
|
|
422
422
|
self,
|
|
423
423
|
path: str,
|
|
424
|
-
params:
|
|
425
|
-
retry_strategy:
|
|
424
|
+
params: dict | None = None,
|
|
425
|
+
retry_strategy: RetryStrategy | None = None,
|
|
426
426
|
) -> httpx.Response:
|
|
427
427
|
"""Performs a DELETE-request to the Sumo API.
|
|
428
428
|
|
|
@@ -462,7 +462,7 @@ class SumoClient:
|
|
|
462
462
|
|
|
463
463
|
return retryer(_delete)
|
|
464
464
|
|
|
465
|
-
def _get_retry_details(self, response_in) ->
|
|
465
|
+
def _get_retry_details(self, response_in) -> tuple[str, int]:
|
|
466
466
|
assert response_in.status_code == 202, (
|
|
467
467
|
"Incorrect status code; expcted 202"
|
|
468
468
|
)
|
|
@@ -480,7 +480,7 @@ class SumoClient:
|
|
|
480
480
|
self,
|
|
481
481
|
response_in: httpx.Response,
|
|
482
482
|
timeout=None,
|
|
483
|
-
retry_strategy:
|
|
483
|
+
retry_strategy: RetryStrategy | None = None,
|
|
484
484
|
) -> httpx.Response:
|
|
485
485
|
"""Poll a specific endpoint until a result is obtained.
|
|
486
486
|
|
|
@@ -502,7 +502,6 @@ class SumoClient:
|
|
|
502
502
|
"No response within specified timeout."
|
|
503
503
|
)
|
|
504
504
|
location, retry_after = self._get_retry_details(response)
|
|
505
|
-
pass
|
|
506
505
|
|
|
507
506
|
def getLogger(self, name):
|
|
508
507
|
"""Gets a logger object that sends log objects into the message_log
|
|
@@ -521,7 +520,6 @@ class SumoClient:
|
|
|
521
520
|
if len(logger.handlers) == 0:
|
|
522
521
|
handler = LogHandlerSumo(self)
|
|
523
522
|
logger.addHandler(handler)
|
|
524
|
-
pass
|
|
525
523
|
return logger
|
|
526
524
|
|
|
527
525
|
def create_shared_access_key_for_case(self, case_uuid):
|
|
@@ -561,8 +559,8 @@ class SumoClient:
|
|
|
561
559
|
async def get_async(
|
|
562
560
|
self,
|
|
563
561
|
path: str,
|
|
564
|
-
params:
|
|
565
|
-
retry_strategy:
|
|
562
|
+
params: dict | None = None,
|
|
563
|
+
retry_strategy: RetryStrategy | None = None,
|
|
566
564
|
) -> httpx.Response:
|
|
567
565
|
"""Performs an async GET-request to the Sumo API.
|
|
568
566
|
|
|
@@ -600,12 +598,12 @@ class SumoClient:
|
|
|
600
598
|
follow_redirects = False
|
|
601
599
|
if (
|
|
602
600
|
re.match(
|
|
603
|
-
r"^/objects\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/blob$",
|
|
601
|
+
r"^/objects\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/blob$",
|
|
604
602
|
path,
|
|
605
603
|
)
|
|
606
604
|
is not None
|
|
607
605
|
or re.match(
|
|
608
|
-
r"^/tasks\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/result$",
|
|
606
|
+
r"^/tasks\('[0-9a-fA-F-]{8}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{4}-[0-9a-fA-F-]{12}'\)/result$",
|
|
609
607
|
path,
|
|
610
608
|
)
|
|
611
609
|
is not None
|
|
@@ -631,10 +629,10 @@ class SumoClient:
|
|
|
631
629
|
async def post_async(
|
|
632
630
|
self,
|
|
633
631
|
path: str,
|
|
634
|
-
blob:
|
|
635
|
-
json:
|
|
636
|
-
params:
|
|
637
|
-
retry_strategy:
|
|
632
|
+
blob: bytes | None = None,
|
|
633
|
+
json: dict | None = None,
|
|
634
|
+
params: dict | None = None,
|
|
635
|
+
retry_strategy: RetryStrategy | None = None,
|
|
638
636
|
) -> httpx.Response:
|
|
639
637
|
"""Performs an async POST-request to the Sumo API.
|
|
640
638
|
|
|
@@ -710,9 +708,9 @@ class SumoClient:
|
|
|
710
708
|
async def put_async(
|
|
711
709
|
self,
|
|
712
710
|
path: str,
|
|
713
|
-
blob:
|
|
714
|
-
json:
|
|
715
|
-
retry_strategy:
|
|
711
|
+
blob: bytes | None = None,
|
|
712
|
+
json: dict | None = None,
|
|
713
|
+
retry_strategy: RetryStrategy | None = None,
|
|
716
714
|
) -> httpx.Response:
|
|
717
715
|
"""Performs an async PUT-request to the Sumo API.
|
|
718
716
|
|
|
@@ -762,8 +760,8 @@ class SumoClient:
|
|
|
762
760
|
async def delete_async(
|
|
763
761
|
self,
|
|
764
762
|
path: str,
|
|
765
|
-
params:
|
|
766
|
-
retry_strategy:
|
|
763
|
+
params: dict | None = None,
|
|
764
|
+
retry_strategy: RetryStrategy | None = None,
|
|
767
765
|
) -> httpx.Response:
|
|
768
766
|
"""Performs an async DELETE-request to the Sumo API.
|
|
769
767
|
|
|
@@ -807,7 +805,7 @@ class SumoClient:
|
|
|
807
805
|
self,
|
|
808
806
|
response_in: httpx.Response,
|
|
809
807
|
timeout=None,
|
|
810
|
-
retry_strategy:
|
|
808
|
+
retry_strategy: RetryStrategy | None = None,
|
|
811
809
|
) -> httpx.Response:
|
|
812
810
|
"""Poll a specific endpoint until a result is obtained.
|
|
813
811
|
|
|
@@ -831,4 +829,3 @@ class SumoClient:
|
|
|
831
829
|
"No response within specified timeout."
|
|
832
830
|
)
|
|
833
831
|
location, retry_after = self._get_retry_details(response)
|
|
834
|
-
pass
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
sumo/__init__.py,sha256=ftS-xRPSH-vU7fIHlnZQaCTWbNvs4owJivNW65kzsIM,85
|
|
2
|
+
sumo/wrapper/__init__.py,sha256=srvnJZqUgtAWhvjsM8ovl4dPcppZNU8MXRZszicrUoA,235
|
|
3
|
+
sumo/wrapper/_auth_provider.py,sha256=CkTdDVjQ9DTkoHiaFSC_f4mSFaAlYYKi0w2XaE3NMTg,16171
|
|
4
|
+
sumo/wrapper/_blob_client.py,sha256=QLJmgjFZk44jgxhbFed95JbQ1a69xpO6eQJFuTKyU3A,1608
|
|
5
|
+
sumo/wrapper/_decorators.py,sha256=ZwyrWkfAXiGNSgYsQSEXA13D-WIQM2XPf0v2z9N8HyQ,1002
|
|
6
|
+
sumo/wrapper/_logging.py,sha256=Au77-3D9eYTK0FhaNQLQV6Pl4sKJi0PpQjcUfCckLus,1144
|
|
7
|
+
sumo/wrapper/_retry_strategy.py,sha256=D-4aayNv9BrDrEYMRhkhod6szvyw5d9oZvTekAa4BBI,2624
|
|
8
|
+
sumo/wrapper/_version.py,sha256=OUQ9Ng15kRCe7xhTtcSldmCpPE9ugON0d9kKGsiC7-c,520
|
|
9
|
+
sumo/wrapper/login.py,sha256=PtpQ5Qi8Gm1N0hMnE79Je4QvQ8JMuKqa46TwZgjHRnM,2328
|
|
10
|
+
sumo/wrapper/sumo_client.py,sha256=zROiw6I-zY9kkVsjXz5xN1D6KC8G_jb0Xd175gyp_3E,24295
|
|
11
|
+
sumo_wrapper_python-1.9.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
sumo_wrapper_python-1.9.0.dist-info/METADATA,sha256=BHunLpm0o2wwvndk3okJ4uFRynuu9DD0pqpH6p19oYc,14615
|
|
13
|
+
sumo_wrapper_python-1.9.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
14
|
+
sumo_wrapper_python-1.9.0.dist-info/entry_points.txt,sha256=V_vGky2C3He5vohJAxnBdvpt_fqfUDFj5irUm9HtoFc,55
|
|
15
|
+
sumo_wrapper_python-1.9.0.dist-info/top_level.txt,sha256=rLbKyH9rWgCj3PoLeR7fvC5X8vCaUc5LF8-Y_GBWZL0,5
|
|
16
|
+
sumo_wrapper_python-1.9.0.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
sumo/__init__.py,sha256=ftS-xRPSH-vU7fIHlnZQaCTWbNvs4owJivNW65kzsIM,85
|
|
2
|
-
sumo/wrapper/__init__.py,sha256=JK6iMAy2Fdrc7iaIHTn60fHPdRvsgNjZwWD6DJtGUYQ,235
|
|
3
|
-
sumo/wrapper/_auth_provider.py,sha256=XO2WcEJjQuXsDhFZ3wplOL_plxNdAqk2yw2jzv3iLSQ,16660
|
|
4
|
-
sumo/wrapper/_blob_client.py,sha256=SyfyFZ1hHVWKU4lmgUqSjl5TaK_OJNQ__0wDETrp-ag,1623
|
|
5
|
-
sumo/wrapper/_decorators.py,sha256=ZwyrWkfAXiGNSgYsQSEXA13D-WIQM2XPf0v2z9N8HyQ,1002
|
|
6
|
-
sumo/wrapper/_logging.py,sha256=vm85iaarcqeM40kvv32dO1UKKCWVfeF8a3rN1-K82S0,1185
|
|
7
|
-
sumo/wrapper/_retry_strategy.py,sha256=33eY_PxgcDXJs6_NDQOOkllADePnZgge_cELtaLfJZM,2650
|
|
8
|
-
sumo/wrapper/_version.py,sha256=n6hqiGWubG62zMPv1zntf2ad8WUFfELiXM1ZL13KtJA,520
|
|
9
|
-
sumo/wrapper/login.py,sha256=PtpQ5Qi8Gm1N0hMnE79Je4QvQ8JMuKqa46TwZgjHRnM,2328
|
|
10
|
-
sumo/wrapper/sumo_client.py,sha256=fI9khiMOgpK6Vai0Sk8YD3vp0dREbdr_1WHW9nv9WWg,24430
|
|
11
|
-
sumo_wrapper_python-1.8.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
-
sumo_wrapper_python-1.8.0.dist-info/METADATA,sha256=q0aV31EJYFco6NYg0f7bCRUc-7ocS7CGR9zAP7inUPk,14615
|
|
13
|
-
sumo_wrapper_python-1.8.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
14
|
-
sumo_wrapper_python-1.8.0.dist-info/entry_points.txt,sha256=V_vGky2C3He5vohJAxnBdvpt_fqfUDFj5irUm9HtoFc,55
|
|
15
|
-
sumo_wrapper_python-1.8.0.dist-info/top_level.txt,sha256=rLbKyH9rWgCj3PoLeR7fvC5X8vCaUc5LF8-Y_GBWZL0,5
|
|
16
|
-
sumo_wrapper_python-1.8.0.dist-info/RECORD,,
|
{sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{sumo_wrapper_python-1.8.0.dist-info → sumo_wrapper_python-1.9.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|