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"