From 00bd0e5e5e68d356b461ad7c78f15995c3e9f6a6 Mon Sep 17 00:00:00 2001 From: aitbc Date: Tue, 19 May 2026 11:42:17 +0200 Subject: [PATCH] refactor: update CLI commands to use /v1 API versioning prefix - Changed monitor.py job endpoints from /jobs to /v1/jobs - Changed monitor.py miner endpoints from /miners to /v1/miners - Changed operations.py agent discovery from /agents/discover to /v1/agents/discover - Changed system.py agent endpoints from /agents/* to /v1/agents/* - Updated agent status, registration, discovery, and retrieval endpoints - Aligns CLI with coordinator-api versioning structure for business logic endpoints --- cli/aitbc_cli/commands/monitor.py | 6 +++--- cli/aitbc_cli/commands/operations.py | 2 +- cli/handlers/system.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/aitbc_cli/commands/monitor.py b/cli/aitbc_cli/commands/monitor.py index 454bc291..ac43181a 100755 --- a/cli/aitbc_cli/commands/monitor.py +++ b/cli/aitbc_cli/commands/monitor.py @@ -128,7 +128,7 @@ def metrics(ctx, period: str, export_path: Optional[str]): # Job metrics try: resp = http_client.get( - f"{config.coordinator_url}/jobs", + f"{config.coordinator_url}/v1/jobs", headers={"X-Api-Key": config.api_key or ""}, params={"limit": 100} ) @@ -147,7 +147,7 @@ def metrics(ctx, period: str, export_path: Optional[str]): # Miner metrics try: resp = http_client.get( - f"{config.coordinator_url}/miners", + f"{config.coordinator_url}/v1/miners", headers={"X-Api-Key": config.api_key or ""} ) if resp.status_code == 200: @@ -273,7 +273,7 @@ def history(ctx, period: str): http_client = AITBCHTTPClient(base_url=config.exchange_service_url, timeout=10) try: resp = http_client.get( - f"{config.coordinator_url}/jobs", + f"{config.coordinator_url}/v1/jobs", headers={"X-Api-Key": config.api_key or ""}, params={"limit": 500} ) diff --git a/cli/aitbc_cli/commands/operations.py b/cli/aitbc_cli/commands/operations.py index 44a91637..b602e60d 100644 --- a/cli/aitbc_cli/commands/operations.py +++ b/cli/aitbc_cli/commands/operations.py @@ -247,7 +247,7 @@ def list(status: Optional[str], format: str): if status: query["status"] = status - response = requests.post(f"{coordinator_url}/agents/discover", json=query, timeout=10) + response = requests.post(f"{coordinator_url}/v1/agents/discover", json=query, timeout=10) if response.status_code == 200: data = response.json() diff --git a/cli/handlers/system.py b/cli/handlers/system.py index 4ec355b0..db583538 100644 --- a/cli/handlers/system.py +++ b/cli/handlers/system.py @@ -148,7 +148,7 @@ def handle_agent_sdk_action(args, render_mapping): try: import requests response = requests.put( - f"{coordinator_url}/agents/{agent_id}/status", + f"{coordinator_url}/v1/agents/{agent_id}/status", json=status_update_request, timeout=30 ) @@ -189,7 +189,7 @@ def handle_agent_sdk_action(args, render_mapping): try: import requests response = requests.post( - f"{coordinator_url}/agents/register", + f"{coordinator_url}/v1/agents/register", json=registration_request, timeout=30 ) @@ -223,7 +223,7 @@ def handle_agent_sdk_action(args, render_mapping): try: import requests response = requests.post( - f"{coordinator_url}/agents/discover", + f"{coordinator_url}/v1/agents/discover", json=query, timeout=30 ) @@ -249,7 +249,7 @@ def handle_agent_sdk_action(args, render_mapping): try: import requests response = requests.get( - f"{coordinator_url}/agents/{agent_id}", + f"{coordinator_url}/v1/agents/{agent_id}", timeout=30 )