accsyn-python-api 3.0.0__tar.gz → 3.0.2__tar.gz
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.
- accsyn-python-api-3.0.2/.gitignore +9 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/PKG-INFO +1 -1
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/release_notes.rst +14 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/setup.py +1 -1
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_api/session.py +52 -48
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/PKG-INFO +1 -1
- accsyn-python-api-3.0.0/.gitignore +0 -1
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/.github/workflows/github-actions-black.yml +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/.pre-commit-config.yaml +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/.readthedocs.yaml +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/README.md +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/_static/accsyn.css +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/api_reference/index.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/api_reference/session.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/clients.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/conf.py +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/datatypes.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/file.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/glossary.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/index.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/installing.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/introduction.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/jobs.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/misc.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/publish.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/queues.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/render.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/requirements.txt +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/shares.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/users.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/doc/using.rst +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/pyproject.toml +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/readthedocs.yaml +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/setup.cfg +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_api/__init__.py +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_api/_version.py +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/SOURCES.txt +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/dependency_links.txt +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/requires.txt +0 -0
- {accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/top_level.txt +0 -0
|
@@ -13,6 +13,20 @@ Release Notes
|
|
|
13
13
|
|
|
14
14
|
`https://support.accsyn.com <https://support.accsyn.com>`_.
|
|
15
15
|
|
|
16
|
+
.. release:: 3.0.2
|
|
17
|
+
:date: 2024-11-18
|
|
18
|
+
|
|
19
|
+
.. change:: fix
|
|
20
|
+
|
|
21
|
+
* Replaced organization > workspace.
|
|
22
|
+
|
|
23
|
+
.. release:: 3.0.1
|
|
24
|
+
:date: 2024-11-18
|
|
25
|
+
|
|
26
|
+
.. change:: fix
|
|
27
|
+
|
|
28
|
+
* Bug fixes.
|
|
29
|
+
|
|
16
30
|
.. release:: 3.0.0
|
|
17
31
|
:date: 2024-11-17
|
|
18
32
|
|
|
@@ -166,6 +166,7 @@ class Session(object):
|
|
|
166
166
|
self.__version__ = __version__
|
|
167
167
|
self._session_id = str(uuid.uuid4())
|
|
168
168
|
self._uid = None
|
|
169
|
+
self._api_key = None
|
|
169
170
|
self._be_verbose = verbose
|
|
170
171
|
self._pretty_json = pretty_json
|
|
171
172
|
self._proxy = proxy
|
|
@@ -176,33 +177,29 @@ class Session(object):
|
|
|
176
177
|
for key in os.environ:
|
|
177
178
|
if key.startswith("FILMHUB_"):
|
|
178
179
|
Session._warning('Found old FilmHUB product environment variable "{}", ' "please migrate!".format(key))
|
|
179
|
-
if domain
|
|
180
|
-
|
|
181
|
-
"ACCSYN_DOMAIN"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"Please supply your accsyn domain/organization or set " "ACCSYN_DOMAIN environment!"
|
|
180
|
+
if not domain:
|
|
181
|
+
domain = (
|
|
182
|
+
os.environ["ACCSYN_DOMAIN"]
|
|
183
|
+
if "ACCSYN_DOMAIN" in os.environ
|
|
184
|
+
else os.environ.get(
|
|
185
|
+
"ACCSYN_ORG",
|
|
186
186
|
)
|
|
187
|
-
self._domain = domain or (
|
|
188
|
-
os.environ["ACCSYN_DOMAIN"]
|
|
189
|
-
if "ACCSYN_DOMAIN" in os.environ
|
|
190
|
-
else os.environ.get(
|
|
191
|
-
"ACCSYN_ORG",
|
|
192
187
|
)
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
if not domain:
|
|
189
|
+
raise AccsynException(
|
|
190
|
+
"Please supply your accsyn domain/workspace or set " "ACCSYN_DOMAIN environment!"
|
|
191
|
+
)
|
|
192
|
+
if not username:
|
|
193
|
+
username = os.environ.get("ACCSYN_API_USER")
|
|
194
|
+
if not username:
|
|
195
195
|
if not ("ACCSYN_API_USER" in os.environ):
|
|
196
|
-
raise
|
|
197
|
-
"Please supply your accsyn user name (E-mail) or set
|
|
196
|
+
raise AccsynException(
|
|
197
|
+
"Please supply your accsyn user name (E-mail) or set ACCSYN_API_USER environment!"
|
|
198
198
|
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
self._api_key = os.environ.get("ACCSYN_API_KEY")
|
|
204
|
-
if not self._api_key:
|
|
205
|
-
raise accsynException("Please supply your accsyn API KEY or set ACCSYN_API_KEY environment!")
|
|
199
|
+
if not api_key:
|
|
200
|
+
api_key = os.environ.get("ACCSYN_API_KEY")
|
|
201
|
+
if not api_key:
|
|
202
|
+
raise AccsynException("Please supply your accsyn API KEY or set ACCSYN_API_KEY environment!")
|
|
206
203
|
self._hostname = hostname
|
|
207
204
|
self._port = port
|
|
208
205
|
self._timeout = timeout or Session.DEFAULT_TIMEOUT
|
|
@@ -212,19 +209,25 @@ class Session(object):
|
|
|
212
209
|
self._hostname = "127.0.0.1"
|
|
213
210
|
else:
|
|
214
211
|
# Get domain
|
|
215
|
-
|
|
216
|
-
"
|
|
212
|
+
response = self._rest(
|
|
213
|
+
"GET",
|
|
217
214
|
ACCSYN_BACKEND_MASTER_HOSTNAME,
|
|
218
|
-
"
|
|
219
|
-
{"ident":
|
|
215
|
+
"J3PKTtDvolDMBtTy6AFGA",
|
|
216
|
+
{"ident": domain},
|
|
220
217
|
)
|
|
221
218
|
# Store hostname
|
|
219
|
+
if "message" in response:
|
|
220
|
+
raise AccsynException(response["message"])
|
|
221
|
+
result = response.get('result', {})
|
|
222
222
|
assert "hostname" in result, "No API endpoint hostname were provided for us!"
|
|
223
223
|
self._hostname = result["hostname"]
|
|
224
224
|
if self._port is None:
|
|
225
225
|
self._port = result["port"]
|
|
226
226
|
if self._port is None:
|
|
227
227
|
self._port = ACCSYN_PORT if not self._dev else 8181
|
|
228
|
+
self._domain = domain
|
|
229
|
+
self._username = username
|
|
230
|
+
self._api_key = api_key
|
|
228
231
|
self._last_message = None
|
|
229
232
|
self.login()
|
|
230
233
|
|
|
@@ -324,7 +327,7 @@ class Session(object):
|
|
|
324
327
|
if os.path.exists(data):
|
|
325
328
|
data = json.load(open(data, "r"))
|
|
326
329
|
else:
|
|
327
|
-
raise
|
|
330
|
+
raise AccsynException(
|
|
328
331
|
"Cannot build JSON payload data, not a valid JSON " "string or path to a JSON file!"
|
|
329
332
|
)
|
|
330
333
|
else:
|
|
@@ -799,7 +802,7 @@ class Session(object):
|
|
|
799
802
|
data["include"] = include
|
|
800
803
|
if exclude:
|
|
801
804
|
data["exclude"] = exclude
|
|
802
|
-
response = self._event("GET", "
|
|
805
|
+
response = self._event("GET", "workspace/file", data)
|
|
803
806
|
if response:
|
|
804
807
|
return response["result"]
|
|
805
808
|
|
|
@@ -828,7 +831,7 @@ class Session(object):
|
|
|
828
831
|
data["include"] = include
|
|
829
832
|
if exclude:
|
|
830
833
|
data["exclude"] = exclude
|
|
831
|
-
response = self._event("GET", "
|
|
834
|
+
response = self._event("GET", "workspace/file", data)
|
|
832
835
|
if response:
|
|
833
836
|
return response["result"]
|
|
834
837
|
|
|
@@ -846,7 +849,7 @@ class Session(object):
|
|
|
846
849
|
"op": "exists",
|
|
847
850
|
"path": path,
|
|
848
851
|
}
|
|
849
|
-
response = self._event("GET", "
|
|
852
|
+
response = self._event("GET", "workspace/file", data)
|
|
850
853
|
if response:
|
|
851
854
|
return response["result"]
|
|
852
855
|
|
|
@@ -866,7 +869,7 @@ class Session(object):
|
|
|
866
869
|
"op": "mkdir",
|
|
867
870
|
"path": path,
|
|
868
871
|
}
|
|
869
|
-
response = self._event("POST", "
|
|
872
|
+
response = self._event("POST", "workspace/file", data)
|
|
870
873
|
if response:
|
|
871
874
|
return response["result"]
|
|
872
875
|
|
|
@@ -891,7 +894,7 @@ class Session(object):
|
|
|
891
894
|
"path": path,
|
|
892
895
|
"path_to": path_to,
|
|
893
896
|
}
|
|
894
|
-
response = self._event("PUT", "
|
|
897
|
+
response = self._event("PUT", "workspace/file", data)
|
|
895
898
|
if response:
|
|
896
899
|
return response["result"]
|
|
897
900
|
|
|
@@ -916,7 +919,7 @@ class Session(object):
|
|
|
916
919
|
"path": path_src,
|
|
917
920
|
"path_to": path_dst,
|
|
918
921
|
}
|
|
919
|
-
response = self._event("PUT", "
|
|
922
|
+
response = self._event("PUT", "workspace/file", data)
|
|
920
923
|
if response:
|
|
921
924
|
return response["result"]
|
|
922
925
|
|
|
@@ -936,7 +939,7 @@ class Session(object):
|
|
|
936
939
|
"op": "mkdir",
|
|
937
940
|
"path": path,
|
|
938
941
|
}
|
|
939
|
-
response = self._event("POST", "
|
|
942
|
+
response = self._event("POST", "workspace/file", data)
|
|
940
943
|
if response:
|
|
941
944
|
return response["result"]
|
|
942
945
|
|
|
@@ -949,7 +952,7 @@ class Session(object):
|
|
|
949
952
|
:return: Processed publish data, see documentation.
|
|
950
953
|
"""
|
|
951
954
|
if data is None or not isinstance(data, list):
|
|
952
|
-
raise
|
|
955
|
+
raise AccsynException("None or empty data supplied!")
|
|
953
956
|
|
|
954
957
|
# Check entries, calculate size
|
|
955
958
|
def recursive_get_size(files):
|
|
@@ -963,7 +966,7 @@ class Session(object):
|
|
|
963
966
|
return result
|
|
964
967
|
|
|
965
968
|
event_data = {"files": data, "size": recursive_get_size(data)}
|
|
966
|
-
response = self._event("PUT", "
|
|
969
|
+
response = self._event("PUT", "workspace/publish/preprocess", event_data)
|
|
967
970
|
return response["result"]
|
|
968
971
|
|
|
969
972
|
# Settings
|
|
@@ -1043,7 +1046,7 @@ class Session(object):
|
|
|
1043
1046
|
assert len(operation) > 0, 'No operation provided'
|
|
1044
1047
|
return self._event(
|
|
1045
1048
|
"PUT",
|
|
1046
|
-
"
|
|
1049
|
+
"workspace/integration/{}/utility".format(name),
|
|
1047
1050
|
{
|
|
1048
1051
|
'operation': operation,
|
|
1049
1052
|
'data': data,
|
|
@@ -1148,7 +1151,7 @@ class Session(object):
|
|
|
1148
1151
|
Session._warning('Python lacks SOCKS support, please install "pysocks" and' " try again...")
|
|
1149
1152
|
raise ie
|
|
1150
1153
|
elif proxy_type is not None:
|
|
1151
|
-
raise
|
|
1154
|
+
raise AccsynException('Unknown proxy type "{}"!'.format(proxy_type))
|
|
1152
1155
|
url = "http{}://{}:{}/api/v3{}".format(
|
|
1153
1156
|
"s" if ssl else "",
|
|
1154
1157
|
hostname,
|
|
@@ -1164,9 +1167,10 @@ class Session(object):
|
|
|
1164
1167
|
r = None
|
|
1165
1168
|
retval = None
|
|
1166
1169
|
|
|
1170
|
+
headers_effective = dict()
|
|
1167
1171
|
if headers:
|
|
1168
1172
|
headers_effective = copy.deepcopy(headers)
|
|
1169
|
-
|
|
1173
|
+
elif self._api_key:
|
|
1170
1174
|
headers_effective = {
|
|
1171
1175
|
"Authorization": "basic {}:{}".format(
|
|
1172
1176
|
Session._base64_encode(self._username),
|
|
@@ -1229,7 +1233,7 @@ class Session(object):
|
|
|
1229
1233
|
# break
|
|
1230
1234
|
except BaseException:
|
|
1231
1235
|
# if timeout <= 0:
|
|
1232
|
-
raise
|
|
1236
|
+
raise AccsynException(
|
|
1233
1237
|
"Could not reach {}:{}! Make sure backend({}) can"
|
|
1234
1238
|
" be reached from you location and no firewall is "
|
|
1235
1239
|
"blocking outgoing TCP traffic at port {}. "
|
|
@@ -1267,7 +1271,7 @@ class Session(object):
|
|
|
1267
1271
|
traceback.format_exc(),
|
|
1268
1272
|
)
|
|
1269
1273
|
Session._warning(message)
|
|
1270
|
-
raise
|
|
1274
|
+
raise AccsynException(message)
|
|
1271
1275
|
|
|
1272
1276
|
if "exception" in retval:
|
|
1273
1277
|
message = "{} caused an exception! Please contact {} admin for more"
|
|
@@ -1275,11 +1279,11 @@ class Session(object):
|
|
|
1275
1279
|
Session._warning(message)
|
|
1276
1280
|
if self._role in [CLEARANCE_ADMIN, CLEARANCE_SUPPORT]:
|
|
1277
1281
|
Session._warning(retval["exception"])
|
|
1278
|
-
raise
|
|
1282
|
+
raise AccsynException(message)
|
|
1279
1283
|
elif "message" in retval:
|
|
1280
1284
|
message_effective = retval.get("message_hr") or retval["message"]
|
|
1281
1285
|
Session._warning(message_effective)
|
|
1282
|
-
raise
|
|
1286
|
+
raise AccsynException(message_effective)
|
|
1283
1287
|
return retval
|
|
1284
1288
|
|
|
1285
1289
|
# REST get
|
|
@@ -1427,9 +1431,9 @@ class Session(object):
|
|
|
1427
1431
|
uri_base = entitytype
|
|
1428
1432
|
# Send query to server, first determine uri
|
|
1429
1433
|
# if entitytype == 'share':
|
|
1430
|
-
# uri_base = '
|
|
1434
|
+
# uri_base = 'workspace/share'
|
|
1431
1435
|
if entitytype == "site":
|
|
1432
|
-
uri_base = "
|
|
1436
|
+
uri_base = "workspace/site"
|
|
1433
1437
|
elif entitytype == "queue":
|
|
1434
1438
|
uri_base = "job"
|
|
1435
1439
|
elif entitytype == "task":
|
|
@@ -1509,6 +1513,6 @@ class Session(object):
|
|
|
1509
1513
|
return binascii.b2a_base64(s)
|
|
1510
1514
|
|
|
1511
1515
|
|
|
1512
|
-
class
|
|
1516
|
+
class AccsynException(Exception):
|
|
1513
1517
|
def __init__(self, message):
|
|
1514
|
-
super(
|
|
1518
|
+
super(AccsynException, self).__init__(message)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*.pyc
|
{accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/.github/workflows/github-actions-black.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/requires.txt
RENAMED
|
File without changes
|
{accsyn-python-api-3.0.0 → accsyn-python-api-3.0.2}/source/accsyn_python_api.egg-info/top_level.txt
RENAMED
|
File without changes
|