Fix: use /instanceOperationCfsParams endpoint, v1.0.28
This commit is contained in:
@@ -18,9 +18,10 @@ class HttpClient:
|
||||
|
||||
def post(self, path, data=None, **kwargs):
|
||||
kwargs.setdefault("timeout", 30)
|
||||
r = self._session.post(f"{self._endpoint}{path}", json=data, **kwargs)
|
||||
url = f"{self._endpoint}{path}"
|
||||
r = self._session.post(url, json=data, **kwargs)
|
||||
if not r.ok:
|
||||
raise Exception(f"{r.status_code} {r.reason}: {r.text[:200]}")
|
||||
raise Exception(f"POST {path}: {r.status_code} {r.reason}: {r.text[:200]}")
|
||||
result = {}
|
||||
try:
|
||||
parsed = r.json()
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ from routes.main import bp as main_bp
|
||||
from routes.api import bp as api_bp
|
||||
from routes.api_test import bp as api_test_bp
|
||||
|
||||
VERSION = "1.0.26"
|
||||
VERSION = "1.0.28"
|
||||
|
||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
||||
|
||||
@@ -102,8 +102,8 @@ def api_test():
|
||||
op_uid = _find_uid(op_resp) or _uid_from_location(op_resp.get("_location", ""))
|
||||
if op_uid:
|
||||
for pid, pval in params.items():
|
||||
if pval.strip(): # не слать пустые — API сбросит дефолты
|
||||
client.post(f"/instanceOperations/{op_uid}/params",
|
||||
if pval.strip():
|
||||
client.post("/instanceOperationCfsParams",
|
||||
{"instanceOperationUid": op_uid, "svcOperationCfsParamId": int(pid), "paramValue": str(pval)})
|
||||
client.post(f"/instanceOperations/{op_uid}/validate")
|
||||
client.post(f"/instanceOperations/{op_uid}/run")
|
||||
|
||||
Reference in New Issue
Block a user