From c35032ca43cca6957f72fd5f85911f59a401cfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sat, 1 Aug 2026 20:28:24 +0400 Subject: [PATCH] =?UTF-8?q?v0.5.2:=20curl-=D0=BF=D1=80=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D1=8B=20=D1=81=D0=BE=20=D1=81=D1=82=D0=B5=D0=BD=D0=B4?= =?UTF-8?q?=D0=BE=D0=BC,=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=20app-autotest,?= =?UTF-8?q?=20serviceId=3D1=20=D0=B2=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/config/loader.py | 2 +- site/templates/index.html | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/site/config/loader.py b/site/config/loader.py index 5c8538b..94ae7e6 100644 --- a/site/config/loader.py +++ b/site/config/loader.py @@ -80,7 +80,7 @@ SERVICES = _DF["SERVICES"] OPS_INDEX = _DF["OPS_INDEX"] DELAY = float(os.getenv("MOCK_OP_DELAY", "0.1")) -VERSION = "0.5.1" +VERSION = "0.5.2" def get_services(stand_id): diff --git a/site/templates/index.html b/site/templates/index.html index b0231c4..8373c19 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -89,32 +89,34 @@

Как использовать

+ {% if stands_list|length > 1 %}Стенд: {{ current_stand }}{% endif %}

1. Получить список сервисов

-
curl -s {{ endpoint }}/api/v1/svc/services | python3 -m json.tool
+
curl -s {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/services | python3 -m json.tool

2. Создать инстанс

-
curl -s -X POST {{ endpoint }}/api/v1/svc/instances \
+        
curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instances \
   -H "Content-Type: application/json" \
-  -d '{"serviceId": "s3", "displayName": "my-bucket"}' | python3 -m json.tool
+ -d '{"serviceId": 1, "displayName": "my-instance"}' | python3 -m json.tool
-

3. Заполнить параметры и запустить операцию

-
# Установить параметры операции
-curl -s -X POST {{ endpoint }}/api/v1/svc/instanceOperationCfsParams/<opUid>
+        

3. Создать и запустить операцию

+
# Создать операцию
+curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperations \
+  -H "Content-Type: application/json" \
+  -d '{"instanceUid": "<uid>", "operation": "create", "svcOperationId": 18}'
 
-# Запустить операцию (create/modify/delete)
-curl -s -X POST {{ endpoint }}/api/v1/svc/instanceOperations/<opUid>/run
+# Установить параметры +curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperationCfsParams \ + -H "Content-Type: application/json" \ + -d '{"instanceOperationUid": "<opUid>", "svcOperationCfsParamId": 242, "paramValue": "my-value"}' + +# Запустить +curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperations/<opUid>/run

4. Сбросить состояние

-
curl -s -X POST {{ endpoint }}/api/v1/svc/_mock/reset
- -
- Подсказка: используйте переменную окружения - POLYGON_ENDPOINT={{ endpoint }} - в app-autotest — и все операции пойдут через полигон - вместо реального API. -
+
curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/_mock/reset \
+  -H "X-Mock-Auth: test-token-123"