Include cfsParams in POST /instanceOperations, v1.0.23
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 import bp as api_bp
|
||||||
from routes.api_test import bp as api_test_bp
|
from routes.api_test import bp as api_test_bp
|
||||||
|
|
||||||
VERSION = "1.0.22"
|
VERSION = "1.0.23"
|
||||||
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
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")
|
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
||||||
|
|||||||
@@ -95,10 +95,12 @@ def api_test():
|
|||||||
resp = client.post("/instances", payload)
|
resp = client.post("/instances", payload)
|
||||||
instance_uid = resp.get("instanceUid") or _find_uid(resp) or _uid_from_location(resp.get("_location", ""))
|
instance_uid = resp.get("instanceUid") or _find_uid(resp) or _uid_from_location(resp.get("_location", ""))
|
||||||
|
|
||||||
# Шаг 2: запустить операцию create
|
# Шаг 2: запустить операцию create с параметрами
|
||||||
if instance_uid:
|
if instance_uid:
|
||||||
op_resp = client.post("/instanceOperations", {"instanceUid": instance_uid, "operation": "create"})
|
op_payload = {"instanceUid": instance_uid, "operation": "create"}
|
||||||
# run
|
if params:
|
||||||
|
op_payload["cfsParams"] = [{"svcOperationCfsParamId": int(k), "paramValue": str(v)} for k, v in params.items()]
|
||||||
|
op_resp = client.post("/instanceOperations", op_payload)
|
||||||
op_uid = _find_uid(op_resp) or _uid_from_location(op_resp.get("_location", ""))
|
op_uid = _find_uid(op_resp) or _uid_from_location(op_resp.get("_location", ""))
|
||||||
if op_uid:
|
if op_uid:
|
||||||
client.post(f"/instanceOperations/{op_uid}/run")
|
client.post(f"/instanceOperations/{op_uid}/run")
|
||||||
|
|||||||
Reference in New Issue
Block a user