rda-python-globus 1.0.14__tar.gz → 1.0.17__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.
Files changed (21) hide show
  1. {rda_python_globus-1.0.14/src/rda_python_globus.egg-info → rda_python_globus-1.0.17}/PKG-INFO +1 -1
  2. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/pyproject.toml +1 -1
  3. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/task_management.py +50 -0
  4. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17/src/rda_python_globus.egg-info}/PKG-INFO +1 -1
  5. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/LICENSE +0 -0
  6. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/README.md +0 -0
  7. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/setup.cfg +0 -0
  8. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/__init__.py +0 -0
  9. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/file_management.py +0 -0
  10. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/lib/__init__.py +0 -0
  11. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/lib/auth.py +0 -0
  12. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/lib/config.py +0 -0
  13. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/list.py +0 -0
  14. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/main.py +0 -0
  15. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus/transfer.py +0 -0
  16. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus.egg-info/SOURCES.txt +0 -0
  17. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus.egg-info/dependency_links.txt +0 -0
  18. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus.egg-info/entry_points.txt +0 -0
  19. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus.egg-info/requires.txt +0 -0
  20. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/src/rda_python_globus.egg-info/top_level.txt +0 -0
  21. {rda_python_globus-1.0.14 → rda_python_globus-1.0.17}/tests/test_example.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_globus
3
- Version: 1.0.14
3
+ Version: 1.0.17
4
4
  Summary: Tools for managing Globus transfers supporting the NSF NCAR Geoscience Data Exchange (GDEX) project.
5
5
  Author-email: Thomas Cram <tcram@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-globus
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "rda_python_globus"
9
- version = "1.0.14"
9
+ version = "1.0.17"
10
10
  authors = [
11
11
  { name="Thomas Cram", email="tcram@ucar.edu" },
12
12
  ]
@@ -212,6 +212,55 @@ def task_list(
212
212
 
213
213
  print_table(tasks, fields)
214
214
 
215
+ @click.command(
216
+ help="List events and show details about a Globus task, including faults and error messages.",
217
+ )
218
+ @click.argument(
219
+ "task-id",
220
+ type=click.UUID,
221
+ )
222
+ @click.option(
223
+ "--limit",
224
+ "-l",
225
+ type=int,
226
+ default=None,
227
+ show_default=True,
228
+ help="Limit the number of results returned.",
229
+ )
230
+ @click.option(
231
+ "--offset",
232
+ "-o",
233
+ type=int,
234
+ default=None,
235
+ help="Offset used in pagination.",
236
+ )
237
+ @click.option(
238
+ "--error-only",
239
+ "-e",
240
+ is_flag=True,
241
+ help="Only show events with error codes.",
242
+ )
243
+ @namespace_options
244
+ @common_options
245
+ def task_event_list(task_id: uuid.UUID, limit: int, offset: int, error_only: bool, namespace: str) -> None:
246
+ """
247
+ List the events associated with a Globus task. This includes status
248
+ updates, error messages, and other information about the task's progress.
249
+ """
250
+ if not task_id:
251
+ raise click.UsageError("TASK_ID is required.")
252
+
253
+ tc = transfer_client(namespace=namespace)
254
+ try:
255
+ if error_only:
256
+ filters = {"filter": "is_error:1"}
257
+ for event in tc.task_event_list(task_id, limit=limit, offset=offset, query_params=filters):
258
+ print(f"Event on Task({task_id}) at {event['time']}:\n{event['code']}\n{event['description']}\n{event['details']}\n")
259
+ except (GlobusAPIError, NetworkError) as e:
260
+ logger.error(f"Error: {e}")
261
+ click.echo("Failed to get task events.")
262
+ return
263
+
215
264
  @click.command(
216
265
  help="Cancel a Globus task.",
217
266
  )
@@ -241,4 +290,5 @@ def add_commands(group):
241
290
  """ Add task management commands to a click group. """
242
291
  group.add_command(get_task)
243
292
  group.add_command(task_list)
293
+ group.add_command(task_event_list)
244
294
  group.add_command(cancel_task)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_globus
3
- Version: 1.0.14
3
+ Version: 1.0.17
4
4
  Summary: Tools for managing Globus transfers supporting the NSF NCAR Geoscience Data Exchange (GDEX) project.
5
5
  Author-email: Thomas Cram <tcram@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-globus