onex-cli 1.9.3__tar.gz → 1.9.4__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.
- {onex_cli-1.9.3/onex_cli.egg-info → onex_cli-1.9.4}/PKG-INFO +1 -1
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/__init__.py +1 -1
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/status.py +43 -6
- {onex_cli-1.9.3 → onex_cli-1.9.4/onex_cli.egg-info}/PKG-INFO +1 -1
- {onex_cli-1.9.3 → onex_cli-1.9.4}/CHANGELOG.md +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/LICENSE +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/MANIFEST.in +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/README.md +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/__main__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/create.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/create_e2e.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/debug.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/deploy.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/dev.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/env.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/es.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/init.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/invoke.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/login.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/logout.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/logs.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/mcp.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/platform.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/provision.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/replay.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/switch.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/test.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/trace.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/undeploy.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/validate.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/commands/vpn.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/config.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/mcp/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/mcp/server.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/mcp/tools/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/runtime/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/runtime/local_runtime.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/schema/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/schema/service_descriptor.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/schema/validator.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/README.md.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/service.yml.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/models/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/models/schemas.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/repositories/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/services/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/e2e/data_service.yml.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/e2e/test_service_e2e.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/README.md.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/service.yml.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/src/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/src/triggers/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/src/triggers/events.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/event-driven/src/triggers/schedules.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/README.md.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/service.yml.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/src/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/minimal/src/apis/hello.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/README.md.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/service.yml.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/src/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/rest-api/src/apis/handlers.py.j2 +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/utils/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/utils/auth.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/utils/crypto.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/utils/email.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/utils/helpers.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/vpn/__init__.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/vpn/platform_detector.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/vpn/setup_vpn.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex/vpn/wireguard_manager.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex_cli.egg-info/SOURCES.txt +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex_cli.egg-info/dependency_links.txt +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex_cli.egg-info/entry_points.txt +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex_cli.egg-info/requires.txt +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/onex_cli.egg-info/top_level.txt +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/setup.cfg +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/setup.py +0 -0
- {onex_cli-1.9.3 → onex_cli-1.9.4}/tests/test_mcp_logs_e2e.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# OneXEOS Services CLI
|
|
2
|
-
__version__ = "1.9.
|
|
2
|
+
__version__ = "1.9.4"
|
|
@@ -4,11 +4,46 @@ Status command - Check service status on platform
|
|
|
4
4
|
|
|
5
5
|
import click
|
|
6
6
|
import requests
|
|
7
|
+
from datetime import datetime, timezone
|
|
7
8
|
from onex.config import get_config, get_access_token
|
|
8
9
|
from onex.utils import print_success, print_error, print_info, print_warning
|
|
9
10
|
from onex.utils.auth import auto_refresh_token
|
|
10
11
|
|
|
11
12
|
|
|
13
|
+
def _format_relative_time(timestamp_str):
|
|
14
|
+
"""Format a timestamp string as relative time (e.g., '2m ago')."""
|
|
15
|
+
if not timestamp_str:
|
|
16
|
+
return "-"
|
|
17
|
+
try:
|
|
18
|
+
# Parse ISO format timestamp
|
|
19
|
+
if isinstance(timestamp_str, str):
|
|
20
|
+
ts = timestamp_str.replace("Z", "+00:00")
|
|
21
|
+
dt = datetime.fromisoformat(ts)
|
|
22
|
+
else:
|
|
23
|
+
return "-"
|
|
24
|
+
|
|
25
|
+
# Make offset-aware if naive
|
|
26
|
+
if dt.tzinfo is None:
|
|
27
|
+
dt = dt.replace(tzinfo=timezone.utc)
|
|
28
|
+
|
|
29
|
+
now = datetime.now(timezone.utc)
|
|
30
|
+
diff = now - dt
|
|
31
|
+
|
|
32
|
+
seconds = int(diff.total_seconds())
|
|
33
|
+
if seconds < 0:
|
|
34
|
+
return "just now"
|
|
35
|
+
elif seconds < 60:
|
|
36
|
+
return f"{seconds}s ago"
|
|
37
|
+
elif seconds < 3600:
|
|
38
|
+
return f"{seconds // 60}m ago"
|
|
39
|
+
elif seconds < 86400:
|
|
40
|
+
return f"{seconds // 3600}h ago"
|
|
41
|
+
else:
|
|
42
|
+
return f"{seconds // 86400}d ago"
|
|
43
|
+
except (ValueError, TypeError):
|
|
44
|
+
return "-"
|
|
45
|
+
|
|
46
|
+
|
|
12
47
|
@click.command()
|
|
13
48
|
@click.argument('service_name', required=False)
|
|
14
49
|
@click.option('--env', default=None, help='Environment (local/dev/staging/prod, defaults to active)')
|
|
@@ -150,14 +185,15 @@ def status(service_name, env, platform_url):
|
|
|
150
185
|
click.echo()
|
|
151
186
|
|
|
152
187
|
# Table header
|
|
153
|
-
click.echo(f"{'Service':<20} {'Version':<10} {'Mode':<12} {'Status':<10} {'Health':<12} {'Routes':<8}")
|
|
154
|
-
click.echo("-" *
|
|
188
|
+
click.echo(f"{'Service':<20} {'Version':<10} {'Mode':<12} {'Status':<10} {'Health':<12} {'Last Check':<12} {'Routes':<8}")
|
|
189
|
+
click.echo("-" * 94)
|
|
155
190
|
|
|
156
191
|
for svc_name, svc_data in services.items():
|
|
157
192
|
version = svc_data.get('version', 'N/A')
|
|
158
193
|
mode = svc_data.get('mode', 'shared')
|
|
159
194
|
status_val = svc_data.get('status', 'unknown')
|
|
160
195
|
health_val = svc_data.get('health_status', 'unknown')
|
|
196
|
+
last_check = _format_relative_time(svc_data.get('last_health_check'))
|
|
161
197
|
route_count = len(svc_data.get('apis', []))
|
|
162
198
|
|
|
163
199
|
# Color code status
|
|
@@ -178,7 +214,7 @@ def status(service_name, env, platform_url):
|
|
|
178
214
|
else:
|
|
179
215
|
health_colored = click.style(health_val, fg='yellow')
|
|
180
216
|
|
|
181
|
-
click.echo(f"{svc_name:<20} {version:<10} {mode:<12} {status_colored:<19} {health_colored:<21} {route_count:<8}")
|
|
217
|
+
click.echo(f"{svc_name:<20} {version:<10} {mode:<12} {status_colored:<19} {health_colored:<21} {last_check:<12} {route_count:<8}")
|
|
182
218
|
|
|
183
219
|
click.echo()
|
|
184
220
|
print_info(f"Platform: {platform_base_url}")
|
|
@@ -198,13 +234,14 @@ def status(service_name, env, platform_url):
|
|
|
198
234
|
return
|
|
199
235
|
click.echo(f"Found {len(services)} service(s):")
|
|
200
236
|
click.echo()
|
|
201
|
-
click.echo(f"{'Service':<20} {'Version':<10} {'Mode':<12} {'Status':<10} {'Health':<12} {'Routes':<8}")
|
|
202
|
-
click.echo("-" *
|
|
237
|
+
click.echo(f"{'Service':<20} {'Version':<10} {'Mode':<12} {'Status':<10} {'Health':<12} {'Last Check':<12} {'Routes':<8}")
|
|
238
|
+
click.echo("-" * 94)
|
|
203
239
|
for svc_name, svc_data in services.items():
|
|
204
240
|
version = svc_data.get('version', 'N/A')
|
|
205
241
|
mode = svc_data.get('mode', 'shared')
|
|
206
242
|
status_val = svc_data.get('status', 'unknown')
|
|
207
243
|
health_val = svc_data.get('health_status', 'unknown')
|
|
244
|
+
last_check = _format_relative_time(svc_data.get('last_health_check'))
|
|
208
245
|
route_count = len(svc_data.get('apis', []))
|
|
209
246
|
if status_val == 'running':
|
|
210
247
|
status_colored = click.style(status_val, fg='green')
|
|
@@ -220,7 +257,7 @@ def status(service_name, env, platform_url):
|
|
|
220
257
|
health_colored = click.style(health_val, fg='yellow')
|
|
221
258
|
else:
|
|
222
259
|
health_colored = click.style(health_val, fg='yellow')
|
|
223
|
-
click.echo(f"{svc_name:<20} {version:<10} {mode:<12} {status_colored:<19} {health_colored:<21} {route_count:<8}")
|
|
260
|
+
click.echo(f"{svc_name:<20} {version:<10} {mode:<12} {status_colored:<19} {health_colored:<21} {last_check:<12} {route_count:<8}")
|
|
224
261
|
click.echo()
|
|
225
262
|
print_info(f"Platform: {platform_base_url}")
|
|
226
263
|
print_info("Use 'onex status <service_name>' for detailed info")
|
|
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
|
|
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
|
{onex_cli-1.9.3 → onex_cli-1.9.4}/onex/templates/crud-service/src/repositories/__init__.py.j2
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
|
|
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
|