fix: create_client → get_client — POLYGON_ENDPOINT в main/api/runner (v1.2.27)

This commit is contained in:
2026-08-01 09:00:45 +04:00
parent 4a0cfcaa61
commit ca2367724e
4 changed files with 19 additions and 16 deletions
+9 -11
View File
@@ -11,7 +11,7 @@ GET /api/operations/<svc_id> — операции и autotest-инста
from flask import Blueprint, current_app, render_template, request, make_response, jsonify, redirect
from api.http_client import HttpClient, detect_endpoint, create_client, stand_name
from api.auth import get_token, get_client_id, get_token_info, get_token_masked
from api.auth import get_token, get_client_id, get_token_info, get_token_masked, get_client, get_stand
from operations.get_instances import get_organization, get_instances
from operations.get_services import get_services, get_service_detail
from operations.service_list import load_service_ids
@@ -105,11 +105,11 @@ def index():
config["service_ids"] = []
stand = "?"
if active_token:
# create_client — автоопределение стенда + HttpClient
result = create_client(active_token, current_app.config["NUBES_API_ENDPOINT"])
if result:
client, endpoint = result
stand = stand_name(endpoint)
# get_client — учитывает POLYGON_ENDPOINT
client = get_client()
endpoint = current_app.config["NUBES_API_ENDPOINT"]
stand = get_stand()
if client:
try:
# Организация — инстанс с serviceId=19
org = get_organization(client)
@@ -168,11 +168,9 @@ def api_operations(svc_id):
active_token = user_token or env_token
try:
# Автоопределение стенда + HttpClient
result = create_client(active_token, current_app.config["NUBES_API_ENDPOINT"])
if not result:
return jsonify({"error": "Не удалось определить стенд"}), 500
client, endpoint = result
# get_client — учитывает POLYGON_ENDPOINT
client = get_client()
endpoint = current_app.config["NUBES_API_ENDPOINT"]
# Детали сервиса: список операций (modify, delete, suspend, ...)
detail = get_service_detail(client, svc_id)