Skip empty params, only send non-empty to /params, v1.0.26
This commit is contained in:
+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.25"
|
||||
VERSION = "1.0.26"
|
||||
|
||||
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")
|
||||
|
||||
@@ -101,10 +101,10 @@ def api_test():
|
||||
op_resp = client.post("/instanceOperations", op_payload)
|
||||
op_uid = _find_uid(op_resp) or _uid_from_location(op_resp.get("_location", ""))
|
||||
if op_uid:
|
||||
# задать cfsParams
|
||||
for pid, pval in params.items():
|
||||
client.post(f"/instanceOperations/{op_uid}/params",
|
||||
{"instanceOperationUid": op_uid, "svcOperationCfsParamId": int(pid), "paramValue": str(pval)})
|
||||
if pval.strip(): # не слать пустые — API сбросит дефолты
|
||||
client.post(f"/instanceOperations/{op_uid}/params",
|
||||
{"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