dnastack-client-library 3.1.210__py3-none-any.whl → 3.1.212__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.
- dnastack/cli/commands/workbench/runs/__init__.py +2 -0
- dnastack/cli/commands/workbench/runs/hooks/__init__.py +10 -0
- dnastack/cli/commands/workbench/runs/hooks/commands.py +71 -0
- dnastack/client/workbench/ewes/client.py +21 -1
- dnastack/client/workbench/ewes/models.py +6 -0
- dnastack/client/workbench/workbench_user_service/models.py +3 -1
- dnastack/constants.py +1 -1
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/METADATA +1 -1
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/RECORD +13 -11
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dnastack.cli.commands.workbench.runs.commands import init_runs_commands
|
|
2
2
|
from dnastack.cli.commands.workbench.runs.events import events_command_group
|
|
3
|
+
from dnastack.cli.commands.workbench.runs.hooks import hooks_command_group
|
|
3
4
|
from dnastack.cli.commands.workbench.runs.tasks import tasks_command_group
|
|
4
5
|
from dnastack.cli.core.group import formatted_group
|
|
5
6
|
|
|
@@ -14,3 +15,4 @@ init_runs_commands(runs_command_group)
|
|
|
14
15
|
# Register sub-groups
|
|
15
16
|
runs_command_group.add_command(tasks_command_group)
|
|
16
17
|
runs_command_group.add_command(events_command_group)
|
|
18
|
+
runs_command_group.add_command(hooks_command_group)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from dnastack.cli.commands.workbench.runs.hooks.commands import init_hooks_commands
|
|
2
|
+
from dnastack.cli.core.group import formatted_group
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@formatted_group('hooks')
|
|
6
|
+
def hooks_command_group():
|
|
7
|
+
"""Interact with a run's hooks"""
|
|
8
|
+
|
|
9
|
+
# Initialize all commands
|
|
10
|
+
init_hooks_commands(hooks_command_group)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from dnastack.cli.commands.workbench.utils import get_ewes_client, NAMESPACE_ARG
|
|
6
|
+
from dnastack.cli.core.command import formatted_command
|
|
7
|
+
from dnastack.cli.core.command_spec import ArgumentSpec, ArgumentType, CONTEXT_ARG, SINGLE_ENDPOINT_ID_ARG
|
|
8
|
+
from dnastack.cli.helpers.exporter import to_json, normalize
|
|
9
|
+
from dnastack.cli.helpers.iterator_printer import show_iterator, OutputFormat
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def init_hooks_commands(group):
|
|
13
|
+
|
|
14
|
+
@formatted_command(
|
|
15
|
+
group=group,
|
|
16
|
+
name='list',
|
|
17
|
+
specs=[
|
|
18
|
+
ArgumentSpec(
|
|
19
|
+
name='run_id',
|
|
20
|
+
arg_names=['--run-id'],
|
|
21
|
+
help='Specify the run whose hooks should be listed.',
|
|
22
|
+
required=True,
|
|
23
|
+
),
|
|
24
|
+
NAMESPACE_ARG,
|
|
25
|
+
CONTEXT_ARG,
|
|
26
|
+
SINGLE_ENDPOINT_ID_ARG,
|
|
27
|
+
]
|
|
28
|
+
)
|
|
29
|
+
def list_hooks(context: Optional[str],
|
|
30
|
+
endpoint_id: Optional[str],
|
|
31
|
+
namespace: Optional[str],
|
|
32
|
+
run_id: str):
|
|
33
|
+
"""
|
|
34
|
+
List hooks for a run
|
|
35
|
+
"""
|
|
36
|
+
client = get_ewes_client(context_name=context, endpoint_id=endpoint_id, namespace=namespace)
|
|
37
|
+
response = client.list_hooks(run_id)
|
|
38
|
+
show_iterator(output_format=OutputFormat.JSON, iterator=response.hooks or [])
|
|
39
|
+
|
|
40
|
+
@formatted_command(
|
|
41
|
+
group=group,
|
|
42
|
+
name='describe',
|
|
43
|
+
specs=[
|
|
44
|
+
ArgumentSpec(
|
|
45
|
+
name='hook_id',
|
|
46
|
+
arg_type=ArgumentType.POSITIONAL,
|
|
47
|
+
help='The hook ID to describe.',
|
|
48
|
+
required=True,
|
|
49
|
+
),
|
|
50
|
+
ArgumentSpec(
|
|
51
|
+
name='run_id',
|
|
52
|
+
arg_names=['--run-id'],
|
|
53
|
+
help='Specify the run the hook belongs to.',
|
|
54
|
+
required=True,
|
|
55
|
+
),
|
|
56
|
+
NAMESPACE_ARG,
|
|
57
|
+
CONTEXT_ARG,
|
|
58
|
+
SINGLE_ENDPOINT_ID_ARG,
|
|
59
|
+
]
|
|
60
|
+
)
|
|
61
|
+
def describe_hook(context: Optional[str],
|
|
62
|
+
endpoint_id: Optional[str],
|
|
63
|
+
namespace: Optional[str],
|
|
64
|
+
run_id: str,
|
|
65
|
+
hook_id: str):
|
|
66
|
+
"""
|
|
67
|
+
Describe a specific hook for a run
|
|
68
|
+
"""
|
|
69
|
+
client = get_ewes_client(context_name=context, endpoint_id=endpoint_id, namespace=namespace)
|
|
70
|
+
hook = client.get_hook(run_id, hook_id)
|
|
71
|
+
click.echo(to_json(normalize(hook)))
|
|
@@ -11,7 +11,8 @@ from dnastack.client.workbench.ewes.models import ExtendedRunEvents, WesServiceI
|
|
|
11
11
|
BatchRunResponse, BatchRunRequest, ExtendedRunRequest, Log, TaskListOptions, \
|
|
12
12
|
TaskListResponse, LogType, ExecutionEngineListOptions, ExecutionEngineListResponse, ExecutionEngine, \
|
|
13
13
|
EngineParamPreset, EngineParamPresetListOptions, EngineParamPresetListResponse, \
|
|
14
|
-
EngineHealthCheck, EngineHealthCheckListOptions, EngineHealthCheckListResponse
|
|
14
|
+
EngineHealthCheck, EngineHealthCheckListOptions, EngineHealthCheckListResponse, \
|
|
15
|
+
Hook, HookListResponse
|
|
15
16
|
from dnastack.common.tracing import Span
|
|
16
17
|
from dnastack.http.session import HttpSession
|
|
17
18
|
|
|
@@ -280,6 +281,25 @@ class EWesClient(BaseWorkbenchClient):
|
|
|
280
281
|
trace_context=trace)
|
|
281
282
|
return ExtendedRunEvents(**response.json())
|
|
282
283
|
|
|
284
|
+
|
|
285
|
+
def list_hooks(self, run_id: str, trace: Optional[Span] = None) -> HookListResponse:
|
|
286
|
+
trace = trace or Span(origin=self)
|
|
287
|
+
with self.create_http_session() as session:
|
|
288
|
+
response = session.get(
|
|
289
|
+
urljoin(self.endpoint.url, f'{self.namespace}/ga4gh/wes/v1/runs/{run_id}/hooks'),
|
|
290
|
+
trace_context=trace,
|
|
291
|
+
)
|
|
292
|
+
return HookListResponse(**response.json())
|
|
293
|
+
|
|
294
|
+
def get_hook(self, run_id: str, hook_id: str, trace: Optional[Span] = None) -> Hook:
|
|
295
|
+
trace = trace or Span(origin=self)
|
|
296
|
+
with self.create_http_session() as session:
|
|
297
|
+
response = session.get(
|
|
298
|
+
urljoin(self.endpoint.url, f'{self.namespace}/ga4gh/wes/v1/runs/{run_id}/hooks/{hook_id}'),
|
|
299
|
+
trace_context=trace,
|
|
300
|
+
)
|
|
301
|
+
return Hook(**response.json())
|
|
302
|
+
|
|
283
303
|
def list_engines(self,
|
|
284
304
|
list_options: ExecutionEngineListOptions,
|
|
285
305
|
max_results: int = None,
|
|
@@ -46,6 +46,12 @@ class Hook(BaseModel):
|
|
|
46
46
|
finished_at: Optional[datetime] = None
|
|
47
47
|
updated_at: Optional[datetime] = None
|
|
48
48
|
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class HookListResponse(BaseModel):
|
|
52
|
+
hooks: Optional[List[Hook]] = None
|
|
53
|
+
pagination: Optional[Dict] = None
|
|
54
|
+
|
|
49
55
|
class ExtendedRunStatus(BaseModel):
|
|
50
56
|
run_id: str
|
|
51
57
|
external_id: Optional[str] = None
|
dnastack/constants.py
CHANGED
{dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dnastack/__init__.py,sha256=mslf7se8vBSK_HkqWTGPdibeVhT4xyKXgzQBV7dEK1M,333
|
|
2
2
|
dnastack/__main__.py,sha256=EKmtIs4TBseQJi-OT_U6LqRyKLiyrGTBuTQg9zE-G2I,4376
|
|
3
|
-
dnastack/constants.py,sha256=
|
|
3
|
+
dnastack/constants.py,sha256=9Sf_vPSu2KXtLAAdUB6tkq_kLkVEeJ3FsinMhTeUIFk,113
|
|
4
4
|
dnastack/feature_flags.py,sha256=UMNDB07R_ep6Fx3iClhzwOpkWfyYnb418FpoJo50CGs,1411
|
|
5
5
|
dnastack/json_path.py,sha256=TyghhDf7nGQmnsUWBhenU_fKsE_Ez-HLVER6HgH5-hU,2700
|
|
6
6
|
dnastack/omics_cli.py,sha256=ZppKZTHv_XjUUZyRIzSkx0Ug5ODAYrCOTsU0ezCOVrA,3694
|
|
@@ -74,11 +74,13 @@ dnastack/cli/commands/workbench/instruments/__init__.py,sha256=ZuRgZxCgqYWkFQdmo
|
|
|
74
74
|
dnastack/cli/commands/workbench/instruments/commands.py,sha256=MOC1hkZzhwTtcYRk000nUS4uaDpOkSOkx5IWb6nfaBs,2206
|
|
75
75
|
dnastack/cli/commands/workbench/namespaces/__init__.py,sha256=D4b8BMxuVb7tuQ8ZY-vQracVp-wPv7RrIHhOe9DeAvA,309
|
|
76
76
|
dnastack/cli/commands/workbench/namespaces/commands.py,sha256=36WHG4h6U69_32tnTWvTFRzNtRvTCbF-u0P4U5qsCoc,887
|
|
77
|
-
dnastack/cli/commands/workbench/runs/__init__.py,sha256=
|
|
77
|
+
dnastack/cli/commands/workbench/runs/__init__.py,sha256=8M_Hd6nikM7YrxOQXbshGCOAxZAfdI9ZPYeajMXsEhg,727
|
|
78
78
|
dnastack/cli/commands/workbench/runs/commands.py,sha256=eosuaLoT-UEebK7nnZqzxrqy1pweXl04bcXVy478MK8,27599
|
|
79
79
|
dnastack/cli/commands/workbench/runs/events.py,sha256=eJL8zApopJKGumZlDlFGxNbToCgnzKltanbUUeXjUw8,1244
|
|
80
80
|
dnastack/cli/commands/workbench/runs/tasks.py,sha256=aYLgSAAv3XqN36gLw-YeJ4_gQ-csiFp7bF4yLEX1QMw,1719
|
|
81
81
|
dnastack/cli/commands/workbench/runs/utils.py,sha256=5ROpUn9JIG5J6oHNQjDIPUHjLvKOuddYOesDL3PTT24,233
|
|
82
|
+
dnastack/cli/commands/workbench/runs/hooks/__init__.py,sha256=HgaQqV_BIq0F8HaSKOafhlvNwv-8fDdlA9oOUuNffYs,296
|
|
83
|
+
dnastack/cli/commands/workbench/runs/hooks/commands.py,sha256=8elGEH7Rj5sva2Lv580Q2SSpP4k0Tl81jp5xGvYcG-w,2387
|
|
82
84
|
dnastack/cli/commands/workbench/samples/__init__.py,sha256=cRfeKCdHO-0Dq3PFoVcqO7OrQspajIO3h1zNqknKP2U,456
|
|
83
85
|
dnastack/cli/commands/workbench/samples/commands.py,sha256=4o3MwcFib9km23weEOiz_JHGj-BDeWvMO8hItB5W3ng,9521
|
|
84
86
|
dnastack/cli/commands/workbench/samples/files.py,sha256=ihZgHV04fXC8-B0EFZ463SesgI93YSbXXlEtYyaUn8U,3021
|
|
@@ -141,8 +143,8 @@ dnastack/client/workbench/models.py,sha256=d0OzcPKePDuyJnOnoScSRQqzHx7SMu_qq1t_b
|
|
|
141
143
|
dnastack/client/workbench/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
144
|
dnastack/client/workbench/common/models.py,sha256=cOlwpZGxA23CkjYQ7Uox2-uOA_MwqszHt10OSjXT6AQ,1070
|
|
143
145
|
dnastack/client/workbench/ewes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
144
|
-
dnastack/client/workbench/ewes/client.py,sha256=
|
|
145
|
-
dnastack/client/workbench/ewes/models.py,sha256=
|
|
146
|
+
dnastack/client/workbench/ewes/client.py,sha256=deaG6vCb2r5q7Habfp9QfCVbXQJNjl2GC5dxm_PnDwE,16524
|
|
147
|
+
dnastack/client/workbench/ewes/models.py,sha256=BLG0Jd-8N8r_0yKqb94oZglZ3ymAaS2gdqb0kPcunoY,12729
|
|
146
148
|
dnastack/client/workbench/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
149
|
dnastack/client/workbench/samples/client.py,sha256=2X34SYTjV6n4yZz0q7Kaa4NPWDHRi2ut0uJWL3zXZWA,5901
|
|
148
150
|
dnastack/client/workbench/samples/models.py,sha256=oExpYx32nunvO2rBUCIZQcU-dUZmLLpSTOAFdKAzk1k,3785
|
|
@@ -151,7 +153,7 @@ dnastack/client/workbench/storage/client.py,sha256=SdvY3ieUjFeBoX0AvdeNjVBx5gM5B
|
|
|
151
153
|
dnastack/client/workbench/storage/models.py,sha256=O2Z6mlUZU7Xtp6ehXYthEh3qZNvj8DH2FDOW7WM5beA,2198
|
|
152
154
|
dnastack/client/workbench/workbench_user_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
153
155
|
dnastack/client/workbench/workbench_user_service/client.py,sha256=ZpMOFw5L3NxbC2WtKpH3OJ435zEjy0-m4p0WgzQEOB0,1219
|
|
154
|
-
dnastack/client/workbench/workbench_user_service/models.py,sha256=
|
|
156
|
+
dnastack/client/workbench/workbench_user_service/models.py,sha256=WPiXK9sTzsD6OPJ7zQPRbz0ArsQx7BcAPIEd1qhSU0c,172
|
|
155
157
|
dnastack/client/workbench/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
158
|
dnastack/client/workbench/workflow/client.py,sha256=UCNGy9SsIOIQuP5AFgFB0WH1ZUvO0ShSaPjrcTN4aMU,22351
|
|
157
159
|
dnastack/client/workbench/workflow/models.py,sha256=3xT8kbG8dDmDzc9_0XXIW8tC1U_sC2sg1N4sJ0i3iEk,6044
|
|
@@ -198,9 +200,9 @@ dnastack/http/authenticators/oauth2_adapter/device_code_flow.py,sha256=dXI5CyUcs
|
|
|
198
200
|
dnastack/http/authenticators/oauth2_adapter/factory.py,sha256=ZtNXOklWEim-26ooNoPp3ji_hRg1vf4fHHnY94F0wLI,1087
|
|
199
201
|
dnastack/http/authenticators/oauth2_adapter/models.py,sha256=7UsC8DkStMBx7Bz_xHQNi_J1UO_H4nfHme7oBhokj2I,1339
|
|
200
202
|
dnastack/http/authenticators/oauth2_adapter/token_exchange.py,sha256=nSuAsSKWa_UNqHSbPMOEk4komaFITYAnE04Sk5WOrLc,6332
|
|
201
|
-
dnastack_client_library-3.1.
|
|
202
|
-
dnastack_client_library-3.1.
|
|
203
|
-
dnastack_client_library-3.1.
|
|
204
|
-
dnastack_client_library-3.1.
|
|
205
|
-
dnastack_client_library-3.1.
|
|
206
|
-
dnastack_client_library-3.1.
|
|
203
|
+
dnastack_client_library-3.1.212.dist-info/licenses/LICENSE,sha256=uwybO-wUbQhxkosgjhJlxmYATMy-AzoULFO9FUedE34,11580
|
|
204
|
+
dnastack_client_library-3.1.212.dist-info/METADATA,sha256=qIfHGjiiDyoovD_YgHONvDhQcyv1mxJkNm1aGQ-JPZQ,1791
|
|
205
|
+
dnastack_client_library-3.1.212.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
206
|
+
dnastack_client_library-3.1.212.dist-info/entry_points.txt,sha256=Y6OeicsiyGn3-8D-SiV4NiKlJgXfkSqK88kFBR6R1rY,89
|
|
207
|
+
dnastack_client_library-3.1.212.dist-info/top_level.txt,sha256=P2RgRyqJ7hfNy1wLVRoVLJYEppUVkCX3syGK9zBqkt8,9
|
|
208
|
+
dnastack_client_library-3.1.212.dist-info/RECORD,,
|
{dnastack_client_library-3.1.210.dist-info → dnastack_client_library-3.1.212.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|