v0.5.2: curl-примеры со стендом, убран app-autotest, serviceId=1 в примере

This commit is contained in:
2026-08-01 20:28:24 +04:00
parent 06bd9f704e
commit c35032ca43
2 changed files with 19 additions and 17 deletions
+18 -16
View File
@@ -89,32 +89,34 @@
<section class="card">
<div class="card-header">
<h2>Как использовать</h2>
{% if stands_list|length > 1 %}<span class="muted">Стенд: <strong>{{ current_stand }}</strong></span>{% endif %}
</div>
<div class="card-body">
<h3 class="h4">1. Получить список сервисов</h3>
<pre class="code-block"><code>curl -s {{ endpoint }}/api/v1/svc/services | python3 -m json.tool</code></pre>
<pre class="code-block"><code>curl -s {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/services | python3 -m json.tool</code></pre>
<h3 class="h4">2. Создать инстанс</h3>
<pre class="code-block"><code>curl -s -X POST {{ endpoint }}/api/v1/svc/instances \
<pre class="code-block"><code>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</code></pre>
-d '{"serviceId": 1, "displayName": "my-instance"}' | python3 -m json.tool</code></pre>
<h3 class="h4">3. Заполнить параметры и запустить операцию</h3>
<pre class="code-block"><code># Установить параметры операции
curl -s -X POST {{ endpoint }}/api/v1/svc/instanceOperationCfsParams/&lt;opUid&gt;
<h3 class="h4">3. Создать и запустить операцию</h3>
<pre class="code-block"><code># Создать операцию
curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperations \
-H "Content-Type: application/json" \
-d '{"instanceUid": "&lt;uid&gt;", "operation": "create", "svcOperationId": 18}'
# Запустить операцию (create/modify/delete)
curl -s -X POST {{ endpoint }}/api/v1/svc/instanceOperations/&lt;opUid&gt;/run</code></pre>
# Установить параметры
curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperationCfsParams \
-H "Content-Type: application/json" \
-d '{"instanceOperationUid": "&lt;opUid&gt;", "svcOperationCfsParamId": 242, "paramValue": "my-value"}'
# Запустить
curl -s -X POST {{ endpoint }}/{% if stands_list|length > 1 %}{{ current_stand }}/{% endif %}api/v1/svc/instanceOperations/&lt;opUid&gt;/run</code></pre>
<h3 class="h4">4. Сбросить состояние</h3>
<pre class="code-block"><code>curl -s -X POST {{ endpoint }}/api/v1/svc/_mock/reset</code></pre>
<div class="note">
<strong>Подсказка:</strong> используйте переменную окружения
<code>POLYGON_ENDPOINT={{ endpoint }}</code>
в <code>app-autotest</code> — и все операции пойдут через полигон
вместо реального API.
</div>
<pre class="code-block"><code>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"</code></pre>
</div>
</section>