testzeus-cli 0.0.29__tar.gz → 0.0.31__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.
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/PKG-INFO +2 -2
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/pyproject.toml +2 -2
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/cli.py +0 -2
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/hypermind_code_blocks.py +2 -11
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_suites.py +1 -8
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/tests.py +0 -9
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/tests_authoring.py +0 -5
- testzeus_cli-0.0.29/testzeus_cli/commands/extensions.py +0 -205
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/LICENSE +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/README.md +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/__init__.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/auth.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/__init__.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/agent_harness.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/connected_environments.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/daemon.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/device_pool.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/environments.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/knowledge_bases.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/notification_channels.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/tags.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_data.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_report_runs.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_report_schedules.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_run_groups.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_runs.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_suite_node_runs.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_suite_runs.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/test_suite_schedules.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/tests_ai_generator.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/commands/user_integrations.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/config.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/__init__.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/auth.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/client.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/files.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/formatters.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/links.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/profile.py +0 -0
- {testzeus_cli-0.0.29 → testzeus_cli-0.0.31}/testzeus_cli/utils/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testzeus-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.31
|
|
4
4
|
Summary: Command-line interface for TestZeus testing platform
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Shriyansh Agnihotri
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pocketbase (>=0.15.0,<0.16.0)
|
|
|
22
22
|
Requires-Dist: pydantic (>=2.0.0,<3.0.0)
|
|
23
23
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
24
24
|
Requires-Dist: rich (>=13.3.1,<14.0.0)
|
|
25
|
-
Requires-Dist: testzeus-sdk (>=0.0.
|
|
25
|
+
Requires-Dist: testzeus-sdk (>=0.0.27,<0.1.0)
|
|
26
26
|
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
27
27
|
Project-URL: Repository, https://github.com/test-zeus-ai/testzeus-cli
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "testzeus-cli"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.31"
|
|
8
8
|
description = "Command-line interface for TestZeus testing platform"
|
|
9
9
|
authors = ["Shriyansh Agnihotri <shriyansh@testzeus.com>"]
|
|
10
10
|
readme = "README.md"
|
|
@@ -22,7 +22,7 @@ pydantic = "^2.0.0"
|
|
|
22
22
|
pyyaml = "^6.0"
|
|
23
23
|
keyring = "^24.0.0"
|
|
24
24
|
ipdb = "^0.13.13"
|
|
25
|
-
testzeus-sdk = ">=0.0.
|
|
25
|
+
testzeus-sdk = ">=0.0.27,<0.1.0"
|
|
26
26
|
pocketbase = "^0.15.0"
|
|
27
27
|
toml = "^0.10.2"
|
|
28
28
|
aiohttp = "^3.14.1"
|
|
@@ -31,7 +31,6 @@ from testzeus_cli.commands.connected_environments import connected_environments_
|
|
|
31
31
|
from testzeus_cli.commands.test_report_schedules import test_report_schedules_group
|
|
32
32
|
from testzeus_cli.commands.test_report_runs import test_report_runs_group
|
|
33
33
|
from testzeus_cli.commands.notification_channels import notification_channels_group
|
|
34
|
-
from testzeus_cli.commands.extensions import extensions_group
|
|
35
34
|
from testzeus_cli.commands.tests_ai_generator import tests_ai_generator_group
|
|
36
35
|
from testzeus_cli.commands.hypermind_code_blocks import hypermind_code_blocks_group
|
|
37
36
|
from testzeus_cli.commands.user_integrations import user_integrations_group
|
|
@@ -99,7 +98,6 @@ cli.add_command(connected_environments_group)
|
|
|
99
98
|
cli.add_command(test_report_schedules_group)
|
|
100
99
|
cli.add_command(test_report_runs_group)
|
|
101
100
|
cli.add_command(notification_channels_group)
|
|
102
|
-
cli.add_command(extensions_group)
|
|
103
101
|
cli.add_command(tests_ai_generator_group)
|
|
104
102
|
cli.add_command(hypermind_code_blocks_group)
|
|
105
103
|
cli.add_command(user_integrations_group)
|
|
@@ -91,9 +91,6 @@ def get_hypermind_code_block(ctx, code_block_id, expand):
|
|
|
91
91
|
|
|
92
92
|
@hypermind_code_blocks_group.command(name="create")
|
|
93
93
|
@click.option("--name", required=True, help="Hypermind code block name")
|
|
94
|
-
@click.option(
|
|
95
|
-
"--status", default="draft", help="Code block status (draft, ready, deleted)"
|
|
96
|
-
)
|
|
97
94
|
@click.option("--tags", help="Comma-separated list of tags")
|
|
98
95
|
@click.option(
|
|
99
96
|
"--file",
|
|
@@ -103,7 +100,7 @@ def get_hypermind_code_block(ctx, code_block_id, expand):
|
|
|
103
100
|
help="Path to code file(s) to upload",
|
|
104
101
|
)
|
|
105
102
|
@click.pass_context
|
|
106
|
-
def create_hypermind_code_block(ctx, name,
|
|
103
|
+
def create_hypermind_code_block(ctx, name, tags, file):
|
|
107
104
|
"""Create new Hypermind code block"""
|
|
108
105
|
|
|
109
106
|
async def _run():
|
|
@@ -115,7 +112,6 @@ def create_hypermind_code_block(ctx, name, status, tags, file):
|
|
|
115
112
|
# Prepare code block data
|
|
116
113
|
code_block_data = {
|
|
117
114
|
"name": name,
|
|
118
|
-
"status": status,
|
|
119
115
|
"tenant": tenant_id,
|
|
120
116
|
"modified_by": user_id,
|
|
121
117
|
"metadata": {},
|
|
@@ -155,7 +151,6 @@ def create_hypermind_code_block(ctx, name, status, tags, file):
|
|
|
155
151
|
@hypermind_code_blocks_group.command(name="update")
|
|
156
152
|
@click.argument("code_block_id")
|
|
157
153
|
@click.option("--name", help="New code block name")
|
|
158
|
-
@click.option("--status", help="New code block status (draft, ready, deleted)")
|
|
159
154
|
@click.option("--tags", help="Comma-separated list of tags")
|
|
160
155
|
@click.option(
|
|
161
156
|
"--file",
|
|
@@ -165,7 +160,7 @@ def create_hypermind_code_block(ctx, name, status, tags, file):
|
|
|
165
160
|
help="Path to code file(s) to add",
|
|
166
161
|
)
|
|
167
162
|
@click.pass_context
|
|
168
|
-
def update_hypermind_code_block(ctx, code_block_id, name,
|
|
163
|
+
def update_hypermind_code_block(ctx, code_block_id, name, tags, file):
|
|
169
164
|
"""Update an existing Hypermind code block"""
|
|
170
165
|
|
|
171
166
|
async def _run():
|
|
@@ -192,10 +187,6 @@ def update_hypermind_code_block(ctx, code_block_id, name, status, tags, file):
|
|
|
192
187
|
updates["name"] = name
|
|
193
188
|
has_updates = True
|
|
194
189
|
|
|
195
|
-
if status:
|
|
196
|
-
updates["status"] = status
|
|
197
|
-
has_updates = True
|
|
198
|
-
|
|
199
190
|
if tags and tags != "none":
|
|
200
191
|
updates["tags"] = tags.split(",")
|
|
201
192
|
has_updates = True
|
|
@@ -61,7 +61,7 @@ def list_test_suites(ctx, filters, sort, expand, page, per_page):
|
|
|
61
61
|
format_output(
|
|
62
62
|
asyncio.run(_run()),
|
|
63
63
|
ctx.obj["FORMAT"],
|
|
64
|
-
columns=["id", "name", "
|
|
64
|
+
columns=["id", "name", "created", "updated", "tests"],
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
|
|
@@ -96,7 +96,6 @@ def get_test_suite(ctx, suite_id, expand):
|
|
|
96
96
|
@click.option("--default-inputs", help="Default suite inputs as JSON")
|
|
97
97
|
@click.option("--input-schema", help="Input schema as JSON")
|
|
98
98
|
@click.option("--description", help="Description")
|
|
99
|
-
@click.option("--status", default="draft", help="Suite status")
|
|
100
99
|
@click.option("--execution-mode", default="lenient", help="Execution mode")
|
|
101
100
|
@click.option("--environment", help="Environment ID")
|
|
102
101
|
@click.option("--tags", help="Tag IDs (comma-separated)")
|
|
@@ -109,7 +108,6 @@ def create_test_suite(
|
|
|
109
108
|
default_inputs,
|
|
110
109
|
input_schema,
|
|
111
110
|
description,
|
|
112
|
-
status,
|
|
113
111
|
execution_mode,
|
|
114
112
|
environment,
|
|
115
113
|
tags,
|
|
@@ -130,7 +128,6 @@ def create_test_suite(
|
|
|
130
128
|
"default_inputs": default_inputs_value,
|
|
131
129
|
"input_schema": input_schema_value,
|
|
132
130
|
"description": description,
|
|
133
|
-
"status": status,
|
|
134
131
|
"execution_mode": execution_mode,
|
|
135
132
|
"tenant": tenant_id,
|
|
136
133
|
"created_by": user_id,
|
|
@@ -164,7 +161,6 @@ def create_test_suite(
|
|
|
164
161
|
@click.option("--default-inputs", help="Default suite inputs as JSON")
|
|
165
162
|
@click.option("--input-schema", help="Input schema as JSON")
|
|
166
163
|
@click.option("--description", help="Description")
|
|
167
|
-
@click.option("--status", help="Suite status")
|
|
168
164
|
@click.option("--execution-mode", help="Execution mode")
|
|
169
165
|
@click.option("--environment", help="Environment ID")
|
|
170
166
|
@click.option("--tags", help="Tag IDs (comma-separated)")
|
|
@@ -178,7 +174,6 @@ def update_test_suite(
|
|
|
178
174
|
default_inputs,
|
|
179
175
|
input_schema,
|
|
180
176
|
description,
|
|
181
|
-
status,
|
|
182
177
|
execution_mode,
|
|
183
178
|
environment,
|
|
184
179
|
tags,
|
|
@@ -205,8 +200,6 @@ def update_test_suite(
|
|
|
205
200
|
payload["input_schema"] = input_schema_value
|
|
206
201
|
if description is not None:
|
|
207
202
|
payload["description"] = description
|
|
208
|
-
if status is not None:
|
|
209
|
-
payload["status"] = status
|
|
210
203
|
if execution_mode is not None:
|
|
211
204
|
payload["execution_mode"] = execution_mode
|
|
212
205
|
if environment is not None:
|
|
@@ -161,7 +161,6 @@ def _resolve_json_input(
|
|
|
161
161
|
@click.option("--test-params-file", help="Path to JSON file containing default test params")
|
|
162
162
|
@click.option("--output-schema", help="Output schema as inline JSON")
|
|
163
163
|
@click.option("--output-schema-file", help="Path to JSON file containing output schema")
|
|
164
|
-
@click.option("--status", default="draft", help="Test status (draft, ready, deleted)")
|
|
165
164
|
@click.option("--data", multiple=True, help="Test data IDs")
|
|
166
165
|
@click.option("--tags", multiple=True, help="Tag IDs")
|
|
167
166
|
@click.option("--environment", help="Environment ID (required for mobile tests)")
|
|
@@ -185,7 +184,6 @@ def create_test(
|
|
|
185
184
|
test_params_file,
|
|
186
185
|
output_schema,
|
|
187
186
|
output_schema_file,
|
|
188
|
-
status,
|
|
189
187
|
data,
|
|
190
188
|
tags,
|
|
191
189
|
environment,
|
|
@@ -230,7 +228,6 @@ def create_test(
|
|
|
230
228
|
# Prepare parameters
|
|
231
229
|
test_data = {
|
|
232
230
|
"name": name,
|
|
233
|
-
"status": status,
|
|
234
231
|
"execution_mode": execution_mode,
|
|
235
232
|
"testing_type": testing_type,
|
|
236
233
|
"tenant": stored_tenant_id,
|
|
@@ -287,7 +284,6 @@ def create_test(
|
|
|
287
284
|
@click.option("--test-params-file", help="Path to JSON file containing default test params")
|
|
288
285
|
@click.option("--output-schema", help="Output schema as inline JSON")
|
|
289
286
|
@click.option("--output-schema-file", help="Path to JSON file containing output schema")
|
|
290
|
-
@click.option("--status", help="New test status (draft, ready, deleted)")
|
|
291
287
|
@click.option("--data", multiple=True, help="Test data IDs")
|
|
292
288
|
@click.option("--tags", multiple=True, help="Tag IDs")
|
|
293
289
|
@click.option("--environment", help="Environment ID (required for mobile tests)")
|
|
@@ -308,7 +304,6 @@ def update_test(
|
|
|
308
304
|
test_params_file,
|
|
309
305
|
output_schema,
|
|
310
306
|
output_schema_file,
|
|
311
|
-
status,
|
|
312
307
|
data,
|
|
313
308
|
tags,
|
|
314
309
|
environment,
|
|
@@ -374,10 +369,6 @@ def update_test(
|
|
|
374
369
|
update_data["test_feature"] = feature_content
|
|
375
370
|
has_updates = True
|
|
376
371
|
|
|
377
|
-
if status:
|
|
378
|
-
update_data["status"] = status
|
|
379
|
-
has_updates = True
|
|
380
|
-
|
|
381
372
|
if data:
|
|
382
373
|
update_data["test_data"] = list(data)
|
|
383
374
|
has_updates = True
|
|
@@ -458,7 +458,6 @@ def wizard(
|
|
|
458
458
|
# Create the test
|
|
459
459
|
test_data = {
|
|
460
460
|
"name": params["name"],
|
|
461
|
-
"status": "draft",
|
|
462
461
|
"execution_mode": "lenient",
|
|
463
462
|
"tenant": stored_tenant_id,
|
|
464
463
|
"modified_by": stored_user_id,
|
|
@@ -560,7 +559,6 @@ def quick(
|
|
|
560
559
|
# Create the test
|
|
561
560
|
test_data = {
|
|
562
561
|
"name": name,
|
|
563
|
-
"status": "draft",
|
|
564
562
|
"execution_mode": "lenient",
|
|
565
563
|
"tenant": stored_tenant_id,
|
|
566
564
|
"modified_by": stored_user_id,
|
|
@@ -680,7 +678,6 @@ def _read_feature_content(feature: str = None, feature_file: str = None) -> str:
|
|
|
680
678
|
@click.option("--test-params-file", help="Path to JSON file containing default test params")
|
|
681
679
|
@click.option("--output-schema", help="Output schema as inline JSON")
|
|
682
680
|
@click.option("--output-schema-file", help="Path to JSON file containing output schema")
|
|
683
|
-
@click.option("--status", default="draft", help="Test status (draft, ready, deleted)")
|
|
684
681
|
@click.option("--data", multiple=True, help="Test data IDs")
|
|
685
682
|
@click.option("--tags", multiple=True, help="Tag IDs")
|
|
686
683
|
@click.option("--environment", help="Environment ID")
|
|
@@ -696,7 +693,6 @@ def manual(
|
|
|
696
693
|
test_params_file,
|
|
697
694
|
output_schema,
|
|
698
695
|
output_schema_file,
|
|
699
|
-
status,
|
|
700
696
|
data,
|
|
701
697
|
tags,
|
|
702
698
|
environment,
|
|
@@ -750,7 +746,6 @@ def manual(
|
|
|
750
746
|
# Build test data
|
|
751
747
|
test_data = {
|
|
752
748
|
"name": name,
|
|
753
|
-
"status": status,
|
|
754
749
|
"execution_mode": execution_mode,
|
|
755
750
|
"tenant": stored_tenant_id,
|
|
756
751
|
"modified_by": stored_user_id,
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Commands for managing extensions in TestZeus CLI.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import asyncio
|
|
6
|
-
import json
|
|
7
|
-
import click
|
|
8
|
-
from rich.console import Console
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
from testzeus_sdk import TestZeusClient
|
|
12
|
-
from testzeus_cli.config import get_client_config
|
|
13
|
-
from testzeus_cli.utils.formatters import format_output, print_message
|
|
14
|
-
from testzeus_cli.utils.validators import validate_id, validate_tenant_ownership, parse_key_value_pairs
|
|
15
|
-
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
16
|
-
from testzeus_cli.utils.links import print_platform_link
|
|
17
|
-
|
|
18
|
-
console = Console()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@click.group(name="extension")
|
|
22
|
-
def extensions_group():
|
|
23
|
-
"""Manage TestZeus extensions"""
|
|
24
|
-
pass
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@extensions_group.command(name="list")
|
|
28
|
-
@click.option(
|
|
29
|
-
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
30
|
-
)
|
|
31
|
-
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
32
|
-
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
33
|
-
@click.option("--page", default=1, help="Page number")
|
|
34
|
-
@click.option("--per-page", default=50, help="Items per page")
|
|
35
|
-
@click.pass_context
|
|
36
|
-
def list_extensions(ctx, filters, sort, expand, page, per_page):
|
|
37
|
-
"""List extensions with optional filters and sorting"""
|
|
38
|
-
|
|
39
|
-
async def _run():
|
|
40
|
-
config, token, _, _ = get_client_config(
|
|
41
|
-
ctx.obj["PROFILE"], api_url=ctx.obj.get("API_URL")
|
|
42
|
-
)
|
|
43
|
-
client = TestZeusClient(**config)
|
|
44
|
-
|
|
45
|
-
filter_dict = parse_key_value_pairs(filters) if filters else {}
|
|
46
|
-
|
|
47
|
-
async with client:
|
|
48
|
-
if token:
|
|
49
|
-
initialize_client_with_token(client, token)
|
|
50
|
-
else:
|
|
51
|
-
await client.ensure_authenticated()
|
|
52
|
-
|
|
53
|
-
extensions = await client.extensions.get_list(
|
|
54
|
-
expand=expand, sort=sort, filters=filter_dict, page=page, per_page=per_page
|
|
55
|
-
)
|
|
56
|
-
return extensions
|
|
57
|
-
|
|
58
|
-
result = asyncio.run(_run())
|
|
59
|
-
print_platform_link(ctx, "training-runs")
|
|
60
|
-
format_output(result, ctx.obj["FORMAT"])
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@extensions_group.command(name="get")
|
|
64
|
-
@click.argument("extension_id")
|
|
65
|
-
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
66
|
-
@click.pass_context
|
|
67
|
-
def get_extension(ctx, extension_id, expand):
|
|
68
|
-
"""Get a single extension by ID"""
|
|
69
|
-
|
|
70
|
-
async def _run():
|
|
71
|
-
config, token, _, _ = get_client_config(
|
|
72
|
-
ctx.obj["PROFILE"], api_url=ctx.obj.get("API_URL")
|
|
73
|
-
)
|
|
74
|
-
client = TestZeusClient(**config)
|
|
75
|
-
|
|
76
|
-
extension_id_validated = validate_id(extension_id, "extension")
|
|
77
|
-
|
|
78
|
-
async with client:
|
|
79
|
-
if token:
|
|
80
|
-
initialize_client_with_token(client, token)
|
|
81
|
-
else:
|
|
82
|
-
await client.ensure_authenticated()
|
|
83
|
-
|
|
84
|
-
extension = await client.extensions.get_one(
|
|
85
|
-
extension_id_validated, expand=expand
|
|
86
|
-
)
|
|
87
|
-
return extension.data
|
|
88
|
-
|
|
89
|
-
result = asyncio.run(_run())
|
|
90
|
-
print_platform_link(ctx, "training-runs")
|
|
91
|
-
format_output(result, ctx.obj["FORMAT"])
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
@extensions_group.command(name="create")
|
|
95
|
-
@click.option("--name", help="Extension name")
|
|
96
|
-
@click.option("--data-content", help="Data content as text")
|
|
97
|
-
@click.option("--data-file", help="Path to file containing data content")
|
|
98
|
-
@click.pass_context
|
|
99
|
-
def create_extension(
|
|
100
|
-
ctx,
|
|
101
|
-
name,
|
|
102
|
-
data_content,
|
|
103
|
-
data_file,
|
|
104
|
-
):
|
|
105
|
-
"""Create a new extension"""
|
|
106
|
-
|
|
107
|
-
if data_content and data_file:
|
|
108
|
-
raise click.UsageError("Cannot use both --data-content and --data-file")
|
|
109
|
-
|
|
110
|
-
# Read data from file if provided
|
|
111
|
-
if data_file:
|
|
112
|
-
data_path = Path(data_file)
|
|
113
|
-
if not data_path.exists():
|
|
114
|
-
raise click.BadParameter(f"Data file not found: {data_file}")
|
|
115
|
-
try:
|
|
116
|
-
with open(data_path, "r", encoding="utf-8") as f:
|
|
117
|
-
data_content = f.read()
|
|
118
|
-
except Exception as e:
|
|
119
|
-
raise click.BadParameter(f"Failed to read data file: {str(e)}")
|
|
120
|
-
|
|
121
|
-
async def _run():
|
|
122
|
-
config, token, stored_tenant_id, stored_user_id = get_client_config(
|
|
123
|
-
ctx.obj["PROFILE"], api_url=ctx.obj.get("API_URL")
|
|
124
|
-
)
|
|
125
|
-
client = TestZeusClient(**config)
|
|
126
|
-
|
|
127
|
-
extension_data = {}
|
|
128
|
-
|
|
129
|
-
if stored_tenant_id:
|
|
130
|
-
extension_data["tenant"] = stored_tenant_id
|
|
131
|
-
|
|
132
|
-
if stored_user_id:
|
|
133
|
-
extension_data["modified_by"] = stored_user_id
|
|
134
|
-
|
|
135
|
-
if name:
|
|
136
|
-
extension_data["name"] = name
|
|
137
|
-
|
|
138
|
-
if data_content:
|
|
139
|
-
extension_data["data_content"] = data_content
|
|
140
|
-
|
|
141
|
-
async with client:
|
|
142
|
-
if token:
|
|
143
|
-
initialize_client_with_token(client, token)
|
|
144
|
-
else:
|
|
145
|
-
await client.ensure_authenticated()
|
|
146
|
-
|
|
147
|
-
if ctx.obj.get("VERBOSE"):
|
|
148
|
-
console.print(
|
|
149
|
-
f"[blue]Creating extension with parameters: {extension_data}[/blue]"
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
new_extension = await client.extensions.create(extension_data)
|
|
153
|
-
return new_extension.data
|
|
154
|
-
|
|
155
|
-
result = asyncio.run(_run())
|
|
156
|
-
print_message(
|
|
157
|
-
f"[green]Extension created successfully with ID: {result['id']}[/green]",
|
|
158
|
-
ctx.obj["FORMAT"],
|
|
159
|
-
)
|
|
160
|
-
format_output(result, ctx.obj["FORMAT"])
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
@extensions_group.command(name="delete")
|
|
164
|
-
@click.argument("extension_id")
|
|
165
|
-
@click.confirmation_option(
|
|
166
|
-
prompt="Are you sure you want to delete this extension?"
|
|
167
|
-
)
|
|
168
|
-
@click.pass_context
|
|
169
|
-
def delete_extension(ctx, extension_id):
|
|
170
|
-
"""Delete an extension"""
|
|
171
|
-
|
|
172
|
-
async def _run():
|
|
173
|
-
config, token, stored_tenant_id, _ = get_client_config(
|
|
174
|
-
ctx.obj["PROFILE"], api_url=ctx.obj.get("API_URL")
|
|
175
|
-
)
|
|
176
|
-
client = TestZeusClient(**config)
|
|
177
|
-
|
|
178
|
-
extension_id_validated = validate_id(extension_id, "extension")
|
|
179
|
-
|
|
180
|
-
async with client:
|
|
181
|
-
if token:
|
|
182
|
-
initialize_client_with_token(client, token)
|
|
183
|
-
else:
|
|
184
|
-
await client.ensure_authenticated()
|
|
185
|
-
|
|
186
|
-
# Validate tenant ownership before deleting
|
|
187
|
-
extension = await client.extensions.get_one(extension_id_validated)
|
|
188
|
-
validate_tenant_ownership(extension.data, stored_tenant_id, "extension")
|
|
189
|
-
|
|
190
|
-
success = await client.extensions.delete(extension_id_validated)
|
|
191
|
-
return {"success": success, "id": extension_id_validated}
|
|
192
|
-
|
|
193
|
-
try:
|
|
194
|
-
result = asyncio.run(_run())
|
|
195
|
-
print_message(
|
|
196
|
-
f"[green]Extension deleted successfully: {result['id']}[/green]",
|
|
197
|
-
ctx.obj["FORMAT"],
|
|
198
|
-
)
|
|
199
|
-
except Exception as e:
|
|
200
|
-
print_message(
|
|
201
|
-
f"[red]Error deleting extension:[/red] {str(e)}",
|
|
202
|
-
ctx.obj["FORMAT"],
|
|
203
|
-
)
|
|
204
|
-
exit(1)
|
|
205
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|