sws-api-client 0.0.8.dev0__tar.gz → 0.0.10.dev0__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.
- {sws_api_client-0.0.8.dev0/sws_api_client.egg-info → sws_api_client-0.0.10.dev0}/PKG-INFO +1 -1
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/setup.py +1 -1
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/tasks.py +29 -24
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0/sws_api_client.egg-info}/PKG-INFO +1 -1
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/LICENSE +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/README.md +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/setup.cfg +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/__init__.py +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/datasets.py +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/discover.py +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/sws_api_client.py +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client/tags.py +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/SOURCES.txt +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/dependency_links.txt +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/requires.txt +0 -0
- {sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sws_api_client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10.dev0
|
|
4
4
|
Summary: A Python client to easily interact with the FAO SWS REST APIs
|
|
5
5
|
Home-page: https://bitbucket.org/cioapps/sws-it-python-api-client/src/main/
|
|
6
6
|
Author: Mansillo, Daniele (CSI)
|
|
@@ -112,22 +112,22 @@ class TaskManager:
|
|
|
112
112
|
return TaskResponse(
|
|
113
113
|
task_id=task['taskId'],
|
|
114
114
|
info=TaskInfo(
|
|
115
|
-
detail_status=task
|
|
116
|
-
ended_on=task
|
|
117
|
-
description=task
|
|
118
|
-
updated_on=task
|
|
119
|
-
created_on=task
|
|
120
|
-
service_user=task
|
|
121
|
-
tags=task
|
|
122
|
-
output=task
|
|
123
|
-
input=json.loads(task
|
|
124
|
-
task_type=task
|
|
125
|
-
context=task
|
|
126
|
-
progress=task
|
|
127
|
-
user=task
|
|
128
|
-
outcome=task
|
|
129
|
-
status=task
|
|
130
|
-
group=task
|
|
115
|
+
detail_status=task.get('info').get('detailStatus'),
|
|
116
|
+
ended_on=task.get('info').get('endedOn'),
|
|
117
|
+
description=task.get('info').get('description'),
|
|
118
|
+
updated_on=task.get('info').get('updatedOn'),
|
|
119
|
+
created_on=task.get('info').get('createdOn'),
|
|
120
|
+
service_user=task.get('info').get('serviceUser'),
|
|
121
|
+
tags=task.get('info').get('tags'),
|
|
122
|
+
output=task.get('info').get('output'),
|
|
123
|
+
input=json.loads(task.get('info').get('input', '{}')), # Default to an empty dictionary if 'input' is missing
|
|
124
|
+
task_type=task.get('info').get('taskType'),
|
|
125
|
+
context=task.get('info').get('context'),
|
|
126
|
+
progress=task.get('info').get('progress'),
|
|
127
|
+
user=task.get('info').get('user'),
|
|
128
|
+
outcome=task.get('info').get('outcome'),
|
|
129
|
+
status=task.get('info').get('status'),
|
|
130
|
+
group=task.get('info').get('group')
|
|
131
131
|
)
|
|
132
132
|
)
|
|
133
133
|
|
|
@@ -165,18 +165,23 @@ class TaskManager:
|
|
|
165
165
|
Returns:
|
|
166
166
|
str: The final outcome of the task.
|
|
167
167
|
"""
|
|
168
|
+
not_created_counter = 0
|
|
168
169
|
while True:
|
|
169
170
|
task_response = self.get_task(task_id)
|
|
170
171
|
|
|
171
|
-
if not task_response:
|
|
172
|
+
if not task_response and not_created_counter > 5:
|
|
172
173
|
raise ValueError(f"Task with ID {task_id} not found.")
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
elif not task_response:
|
|
175
|
+
not_created_counter += 1
|
|
176
|
+
else:
|
|
177
|
+
not_created_counter = 0
|
|
178
|
+
|
|
179
|
+
task_status = task_response.info.detail_status
|
|
180
|
+
print(f"Task {task_id} status: {task_status}")
|
|
181
|
+
if task_status == 'ENDED':
|
|
182
|
+
return task_response
|
|
183
|
+
|
|
184
|
+
time.sleep(poll_interval)
|
|
180
185
|
|
|
181
186
|
def wait_completion_by_ids(self, task_ids: List[str], poll_interval: int = 10) -> List[TaskResponse]:
|
|
182
187
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sws_api_client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10.dev0
|
|
4
4
|
Summary: A Python client to easily interact with the FAO SWS REST APIs
|
|
5
5
|
Home-page: https://bitbucket.org/cioapps/sws-it-python-api-client/src/main/
|
|
6
6
|
Author: Mansillo, Daniele (CSI)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/requires.txt
RENAMED
|
File without changes
|
{sws_api_client-0.0.8.dev0 → sws_api_client-0.0.10.dev0}/sws_api_client.egg-info/top_level.txt
RENAMED
|
File without changes
|