Files
app-autotest/site/operations/get_services.py
T

23 lines
845 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
Операции с сервисами Nubes — получение списка и деталей через API.
"""
from api.http_client import HttpClient
def get_services(client):
"""GET /services → список ВСЕХ сервисов пользователя.
Возвращает list[dict], каждый с ключами: svcId, svc, svcExtendedName, operations, ..."""
data = client.get("/services")
return data.get("results", [])
def get_service_detail(client, svc_id):
"""GET /services/{svcId} → детали одного сервиса.
Возвращает dict с ключами: svc, operations[], ...
operations — список доступных операций (create, modify, delete, ...)."""
data = client.get(f"/services/{svc_id}")
return data.get("svc", {})