generated from Luis/nextjs-python-web-template
Merge branch 'main' into mermaid
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
treefmt.settings.formatter.prettier.excludes = [
|
treefmt.settings.formatter.prettier.excludes = [
|
||||||
"secrets.yaml"
|
"secrets.yaml"
|
||||||
"key.json"
|
"key.json"
|
||||||
|
"keyfile.json"
|
||||||
|
"**/pkgs/clan-cli/tests/openapi_client/**"
|
||||||
];
|
];
|
||||||
|
|
||||||
treefmt.programs.mypy.enable = true;
|
treefmt.programs.mypy.enable = true;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
host = "127.0.0.1"
|
host = "127.0.0.1"
|
||||||
port_dlg = 7000
|
port_dlg = 7000
|
||||||
port_ap = 7500
|
port_ap = 7500
|
||||||
port_client_base = 8000
|
_port_client_base = 8000
|
||||||
|
c1_port = _port_client_base + 1
|
||||||
|
c2_port = _port_client_base + 2
|
||||||
dlg_url = f"http://{host}:{port_dlg}/docs"
|
dlg_url = f"http://{host}:{port_dlg}/docs"
|
||||||
ap_url = f"http://{host}:{port_ap}/docs"
|
ap_url = f"http://{host}:{port_ap}/docs"
|
||||||
c1_url = f"http://{host}:{port_client_base}/docs"
|
c1_url = f"http://{host}:{c1_port}/docs"
|
||||||
c2_url = f"http://{host}:{port_client_base + 1}/docs"
|
c2_url = f"http://{host}:{c2_port}/docs"
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ app_c2 = FastAPI(swagger_ui_parameters={"tryItOutEnabled": True})
|
|||||||
apps = [
|
apps = [
|
||||||
(app_dlg, config.port_dlg),
|
(app_dlg, config.port_dlg),
|
||||||
(app_ap, config.port_ap),
|
(app_ap, config.port_ap),
|
||||||
(app_c1, config.port_client_base),
|
(app_c1, config.c1_port),
|
||||||
(app_c2, config.port_client_base + 1),
|
(app_c2, config.c2_port),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ def get_health(*, url: str, max_retries: int = 20, delay: float = 0.2) -> str |
|
|||||||
# TODO send_msg???
|
# TODO send_msg???
|
||||||
|
|
||||||
|
|
||||||
@app_c1.get("/consume_service_from_other_entity", response_class=HTMLResponse)
|
@app_c1.get("/v1/print_daemon1", response_class=HTMLResponse)
|
||||||
async def consume_service_from_other_entity_c1() -> HTMLResponse:
|
async def consume_service_from_other_entity_c1() -> HTMLResponse:
|
||||||
html_content = """
|
html_content = """
|
||||||
<html>
|
<html>
|
||||||
@@ -92,7 +92,17 @@ async def consume_service_from_other_entity_c1() -> HTMLResponse:
|
|||||||
return HTMLResponse(content=html_content, status_code=200)
|
return HTMLResponse(content=html_content, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
@app_c2.get("/consume_service_from_other_entity", response_class=HTMLResponse)
|
@app_c1.get("/v1/print_daemon1/register", response_class=JSONResponse)
|
||||||
|
async def register_c1() -> JSONResponse:
|
||||||
|
return JSONResponse(content={"status": "registered"}, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
|
@app_c1.get("/v1/print_daemon1/deregister", response_class=JSONResponse)
|
||||||
|
async def deregister_c1() -> JSONResponse:
|
||||||
|
return JSONResponse(content={"status": "deregistered"}, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
|
@app_c2.get("/v1/print_daemon2", response_class=HTMLResponse)
|
||||||
async def consume_service_from_other_entity_c2() -> HTMLResponse:
|
async def consume_service_from_other_entity_c2() -> HTMLResponse:
|
||||||
html_content = """
|
html_content = """
|
||||||
<html>
|
<html>
|
||||||
@@ -105,6 +115,16 @@ async def consume_service_from_other_entity_c2() -> HTMLResponse:
|
|||||||
return HTMLResponse(content=html_content, status_code=200)
|
return HTMLResponse(content=html_content, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
|
@app_c2.get("/v1/print_daemon1/register", response_class=JSONResponse)
|
||||||
|
async def register_c2() -> JSONResponse:
|
||||||
|
return JSONResponse(content={"status": "registered"}, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
|
@app_c2.get("/v1/print_daemon1/deregister", response_class=JSONResponse)
|
||||||
|
async def deregister_c2() -> JSONResponse:
|
||||||
|
return JSONResponse(content={"status": "deregistered"}, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
@app_ap.get("/ap_list_of_services", response_class=JSONResponse)
|
@app_ap.get("/ap_list_of_services", response_class=JSONResponse)
|
||||||
async def ap_list_of_services() -> JSONResponse:
|
async def ap_list_of_services() -> JSONResponse:
|
||||||
res = [
|
res = [
|
||||||
|
|||||||
13
pkgs/clan-cli/clan_cli/webui/db_types.py
Normal file
13
pkgs/clan-cli/clan_cli/webui/db_types.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class Status(Enum):
|
||||||
|
ONLINE = "online"
|
||||||
|
OFFLINE = "offline"
|
||||||
|
UNKNOWN = "unknown"
|
||||||
|
|
||||||
|
|
||||||
|
class Role(Enum):
|
||||||
|
PROSUMER = "service_prosumer"
|
||||||
|
AP = "AP"
|
||||||
|
DLG = "DLG"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from typing import Any, List, Optional
|
from typing import Any, List
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from fastapi import APIRouter, BackgroundTasks, Depends, Query
|
from fastapi import APIRouter, BackgroundTasks, Depends, Query
|
||||||
@@ -18,6 +18,7 @@ from ..schemas import (
|
|||||||
Role,
|
Role,
|
||||||
Service,
|
Service,
|
||||||
ServiceCreate,
|
ServiceCreate,
|
||||||
|
ServiceUsageCreate,
|
||||||
)
|
)
|
||||||
from ..tags import Tags
|
from ..tags import Tags
|
||||||
|
|
||||||
@@ -35,8 +36,39 @@ log = logging.getLogger(__name__)
|
|||||||
def create_service(
|
def create_service(
|
||||||
service: ServiceCreate, db: Session = Depends(sql_db.get_db)
|
service: ServiceCreate, db: Session = Depends(sql_db.get_db)
|
||||||
) -> Service:
|
) -> Service:
|
||||||
# todo checken ob schon da ...
|
services = sql_crud.create_service(db=db, service=service)
|
||||||
return sql_crud.create_service(db=db, service=service)
|
return services
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/api/v1/service_usage", response_model=Service, tags=[Tags.services])
|
||||||
|
def add_service_usage(
|
||||||
|
usage: ServiceUsageCreate,
|
||||||
|
service_uuid: str = "bdd640fb-0667-1ad1-1c80-317fa3b1799d",
|
||||||
|
db: Session = Depends(sql_db.get_db),
|
||||||
|
) -> Service:
|
||||||
|
service = sql_crud.add_service_usage(db, service_uuid, usage)
|
||||||
|
return service
|
||||||
|
|
||||||
|
|
||||||
|
@router.put("/api/v1/inc_service_usage", response_model=Service, tags=[Tags.services])
|
||||||
|
def inc_service_usage(
|
||||||
|
usage: ServiceUsageCreate,
|
||||||
|
consumer_entity_did: str = "did:sov:test:120",
|
||||||
|
service_uuid: str = "bdd640fb-0667-1ad1-1c80-317fa3b1799d",
|
||||||
|
db: Session = Depends(sql_db.get_db),
|
||||||
|
) -> Service:
|
||||||
|
service = sql_crud.increment_service_usage(db, service_uuid, consumer_entity_did)
|
||||||
|
return service
|
||||||
|
|
||||||
|
|
||||||
|
@router.put("/api/v1/service", response_model=Service, tags=[Tags.services])
|
||||||
|
def update_service(
|
||||||
|
service: ServiceCreate,
|
||||||
|
uuid: str = "bdd640fb-0667-1ad1-1c80-317fa3b1799d",
|
||||||
|
db: Session = Depends(sql_db.get_db),
|
||||||
|
) -> Service:
|
||||||
|
service = sql_crud.set_service(db, uuid, service)
|
||||||
|
return service
|
||||||
|
|
||||||
|
|
||||||
@router.get("/api/v1/services", response_model=List[Service], tags=[Tags.services])
|
@router.get("/api/v1/services", response_model=List[Service], tags=[Tags.services])
|
||||||
@@ -47,7 +79,9 @@ def get_all_services(
|
|||||||
return services
|
return services
|
||||||
|
|
||||||
|
|
||||||
@router.get("/api/v1/service", response_model=List[Service], tags=[Tags.services])
|
@router.get(
|
||||||
|
"/api/v1/service_by_did", response_model=List[Service], tags=[Tags.services]
|
||||||
|
)
|
||||||
def get_service_by_did(
|
def get_service_by_did(
|
||||||
entity_did: str = "did:sov:test:120",
|
entity_did: str = "did:sov:test:120",
|
||||||
skip: int = 0,
|
skip: int = 0,
|
||||||
@@ -58,6 +92,19 @@ def get_service_by_did(
|
|||||||
return service
|
return service
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/api/v1/service", response_model=Service, tags=[Tags.services])
|
||||||
|
def get_service_by_uuid(
|
||||||
|
uuid: str = "bdd640fb-0667-1ad1-1c80-317fa3b1799d",
|
||||||
|
skip: int = 0,
|
||||||
|
limit: int = 100,
|
||||||
|
db: Session = Depends(sql_db.get_db),
|
||||||
|
) -> sql_models.Service:
|
||||||
|
service = sql_crud.get_service_by_uuid(db, uuid=uuid)
|
||||||
|
if service is None:
|
||||||
|
raise ClanError(f"Service with uuid '{uuid}' not found")
|
||||||
|
return service
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/services_without_entity",
|
"/api/v1/services_without_entity",
|
||||||
response_model=List[Service],
|
response_model=List[Service],
|
||||||
@@ -94,18 +141,6 @@ def create_entity(
|
|||||||
return sql_crud.create_entity(db, entity)
|
return sql_crud.create_entity(db, entity)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
|
||||||
"/api/v1/entity_by_name_or_did",
|
|
||||||
response_model=Optional[Entity],
|
|
||||||
tags=[Tags.entities],
|
|
||||||
)
|
|
||||||
def get_entity_by_name_or_did(
|
|
||||||
entity_name_or_did: str = "C1", db: Session = Depends(sql_db.get_db)
|
|
||||||
) -> Optional[sql_models.Entity]:
|
|
||||||
entity = sql_crud.get_entity_by_name_or_did(db, name=entity_name_or_did)
|
|
||||||
return entity
|
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/entity_by_roles", response_model=List[Entity], tags=[Tags.entities]
|
"/api/v1/entity_by_roles", response_model=List[Entity], tags=[Tags.entities]
|
||||||
)
|
)
|
||||||
@@ -124,12 +159,14 @@ def get_all_entities(
|
|||||||
return entities
|
return entities
|
||||||
|
|
||||||
|
|
||||||
@router.get("/api/v1/entity", response_model=Optional[Entity], tags=[Tags.entities])
|
@router.get("/api/v1/entity", response_model=Entity, tags=[Tags.entities])
|
||||||
def get_entity_by_did(
|
def get_entity_by_did(
|
||||||
entity_did: str = "did:sov:test:120",
|
entity_did: str = "did:sov:test:120",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> Optional[sql_models.Entity]:
|
) -> sql_models.Entity:
|
||||||
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
entity = sql_crud.get_entity_by_name_or_did(db, name=entity_did)
|
||||||
|
if entity is None:
|
||||||
|
raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
return entity
|
return entity
|
||||||
|
|
||||||
|
|
||||||
@@ -153,9 +190,6 @@ def detach_entity(
|
|||||||
limit: int = 100,
|
limit: int = 100,
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
|
||||||
if entity is None:
|
|
||||||
raise ClanError(f"Entity with did '{entity_did}' not found")
|
|
||||||
sql_crud.set_stop_health_task(db, entity_did, True)
|
sql_crud.set_stop_health_task(db, entity_did, True)
|
||||||
return {"message": f"Detached {entity_did} successfully"}
|
return {"message": f"Detached {entity_did} successfully"}
|
||||||
|
|
||||||
@@ -243,6 +277,8 @@ def get_rpc_by_role(db: Session, role: Role, path: str) -> Any:
|
|||||||
raise ClanError(f"No {role} found")
|
raise ClanError(f"No {role} found")
|
||||||
if len(matching_entities) > 1:
|
if len(matching_entities) > 1:
|
||||||
raise ClanError(f"More than one {role} found")
|
raise ClanError(f"More than one {role} found")
|
||||||
|
if len(matching_entities) == 0:
|
||||||
|
raise ClanError(f"No {role} found")
|
||||||
dlg = matching_entities[0]
|
dlg = matching_entities[0]
|
||||||
|
|
||||||
url = f"http://{dlg.ip}/{path}"
|
url = f"http://{dlg.ip}/{path}"
|
||||||
@@ -317,7 +353,6 @@ def get_all_eventmessages(
|
|||||||
# #
|
# #
|
||||||
##############################
|
##############################
|
||||||
@router.get("/emulate", response_class=HTMLResponse)
|
@router.get("/emulate", response_class=HTMLResponse)
|
||||||
@router.get("/emu", response_class=HTMLResponse)
|
|
||||||
def get_emulated_enpoints() -> HTMLResponse:
|
def get_emulated_enpoints() -> HTMLResponse:
|
||||||
from clan_cli.config import ap_url, c1_url, c2_url, dlg_url
|
from clan_cli.config import ap_url, c1_url, c2_url, dlg_url
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,15 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from enum import Enum
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from pydantic import BaseModel, Field, validator
|
from pydantic import BaseModel, Field, validator
|
||||||
|
|
||||||
|
from . import sql_models
|
||||||
|
from .db_types import Role, Status
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Status(Enum):
|
|
||||||
ONLINE = "online"
|
|
||||||
OFFLINE = "offline"
|
|
||||||
UNKNOWN = "unknown"
|
|
||||||
|
|
||||||
|
|
||||||
class Role(Enum):
|
|
||||||
PROSUMER = "service_prosumer"
|
|
||||||
AP = "AP"
|
|
||||||
DLG = "DLG"
|
|
||||||
|
|
||||||
|
|
||||||
class Machine(BaseModel):
|
class Machine(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
status: Status
|
status: Status
|
||||||
@@ -72,8 +62,15 @@ class Entity(EntityBase):
|
|||||||
|
|
||||||
# define a custom getter function for roles
|
# define a custom getter function for roles
|
||||||
@validator("roles", pre=True)
|
@validator("roles", pre=True)
|
||||||
def get_roles(cls, v: List[EntityRoles]) -> List[Role]:
|
def get_roles(cls, v: List[sql_models.EntityRoles | Role]) -> List[Role]:
|
||||||
return [x.role for x in v]
|
if (
|
||||||
|
isinstance(v, list)
|
||||||
|
and len(v) > 0
|
||||||
|
and isinstance(v[0], sql_models.EntityRoles)
|
||||||
|
):
|
||||||
|
return [x.role for x in v] # type: ignore
|
||||||
|
else:
|
||||||
|
return v # type: ignore
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
@@ -81,30 +78,50 @@ class Entity(EntityBase):
|
|||||||
# Service #
|
# Service #
|
||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
|
class ServiceUsageBase(BaseModel):
|
||||||
|
times_consumed: int = Field(..., example=2)
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceUsageCreate(ServiceUsageBase):
|
||||||
|
consumer_entity_did: str = Field(..., example="did:sov:test:120")
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceUsage(ServiceUsageCreate):
|
||||||
|
class Config:
|
||||||
|
orm_mode = True
|
||||||
|
|
||||||
|
|
||||||
class ServiceBase(BaseModel):
|
class ServiceBase(BaseModel):
|
||||||
uuid: str = Field(..., example="8e285c0c-4e40-430a-a477-26b3b81e30df")
|
uuid: str = Field(..., example="bdd640fb-0667-1ad1-1c80-317fa3b1799d")
|
||||||
service_name: str = Field(..., example="Carlos Printing")
|
service_name: str = Field(..., example="Carlos Printing")
|
||||||
service_type: str = Field(..., example="3D Printing")
|
service_type: str = Field(..., example="3D Printing")
|
||||||
endpoint_url: str = Field(..., example="http://127.0.0.1:8000")
|
endpoint_url: str = Field(..., example="http://127.0.0.1:8000")
|
||||||
status: str = Field(..., example="unknown")
|
other: dict = Field(..., example={"test": "test"})
|
||||||
other: dict = Field(
|
entity_did: str = Field(..., example="did:sov:test:120")
|
||||||
..., example={"action": ["register", "deregister", "delete", "create"]}
|
status: dict = Field(..., example={"data": ["draft", "registered"]})
|
||||||
|
action: dict = Field(
|
||||||
|
...,
|
||||||
|
example={
|
||||||
|
"data": [
|
||||||
|
{"name": "register", "path": "/register"},
|
||||||
|
{"name": "deregister", "path": "/deregister"},
|
||||||
|
]
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class ServiceCreate(ServiceBase):
|
class ServiceCreate(ServiceBase):
|
||||||
entity_did: str = Field(..., example="did:sov:test:120")
|
usage: List[ServiceUsageCreate]
|
||||||
|
|
||||||
|
|
||||||
class Service(ServiceCreate):
|
class Service(ServiceBase):
|
||||||
entity: Entity
|
usage: List[ServiceUsage]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
orm_mode = True
|
orm_mode = True
|
||||||
|
|
||||||
|
|
||||||
class ServicesByName(BaseModel):
|
class ServicesByName(BaseModel):
|
||||||
entity: Entity
|
|
||||||
services: List[Service]
|
services: List[Service]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|||||||
@@ -7,21 +7,121 @@ from sqlalchemy.sql.expression import true
|
|||||||
from ..errors import ClanError
|
from ..errors import ClanError
|
||||||
from . import schemas, sql_models
|
from . import schemas, sql_models
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# #
|
# #
|
||||||
# service #
|
# service #
|
||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
|
|
||||||
def create_service(db: Session, service: schemas.ServiceCreate) -> sql_models.Service:
|
def create_service(db: Session, service: schemas.ServiceCreate) -> sql_models.Service:
|
||||||
db_service = sql_models.Service(**service.dict())
|
if get_entity_by_did(db, service.entity_did) is None:
|
||||||
|
raise ClanError(f"Entity with did '{service.entity_did}' not found")
|
||||||
|
if get_service_by_uuid(db, service.uuid) is not None:
|
||||||
|
raise ClanError(f"Service with uuid '{service.uuid}' already exists")
|
||||||
|
db_service = sql_models.Service(
|
||||||
|
uuid=service.uuid,
|
||||||
|
service_name=service.service_name,
|
||||||
|
service_type=service.service_type,
|
||||||
|
endpoint_url=service.endpoint_url,
|
||||||
|
status=service.status,
|
||||||
|
other=service.other,
|
||||||
|
entity_did=service.entity_did,
|
||||||
|
action=service.action,
|
||||||
|
)
|
||||||
|
db_usage = []
|
||||||
|
for usage in service.usage:
|
||||||
|
db_usage.append(
|
||||||
|
sql_models.ServiceUsage(
|
||||||
|
times_consumed=usage.times_consumed,
|
||||||
|
consumer_entity_did=usage.consumer_entity_did,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
db_service.usage = db_usage
|
||||||
db.add(db_service)
|
db.add(db_service)
|
||||||
db.commit()
|
db.commit()
|
||||||
db.refresh(db_service)
|
db.refresh(db_service)
|
||||||
return db_service
|
return db_service
|
||||||
|
|
||||||
|
|
||||||
|
def set_service_usage(
|
||||||
|
db: Session, service_uuid: str, usages: List[schemas.ServiceUsageCreate]
|
||||||
|
) -> sql_models.Service:
|
||||||
|
db_service = get_service_by_uuid(db, service_uuid)
|
||||||
|
if db_service is None:
|
||||||
|
raise ClanError(f"Service with uuid '{service_uuid}' not found")
|
||||||
|
db_usage = []
|
||||||
|
for usage in usages:
|
||||||
|
db_usage.append(
|
||||||
|
sql_models.ServiceUsage(
|
||||||
|
times_consumed=usage.times_consumed,
|
||||||
|
consumer_entity_did=usage.consumer_entity_did,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
db_service.usage = db_usage
|
||||||
|
db.add(db_service)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_service)
|
||||||
|
return db_service
|
||||||
|
|
||||||
|
|
||||||
|
def set_service(
|
||||||
|
db: Session, service_uuid: str, service: schemas.ServiceCreate
|
||||||
|
) -> sql_models.Service:
|
||||||
|
db_service = get_service_by_uuid(db, service_uuid)
|
||||||
|
if db_service is None:
|
||||||
|
raise ClanError(f"Service with uuid '{service_uuid}' not found")
|
||||||
|
db_service.service_name = service.service_name # type: ignore
|
||||||
|
db_service.service_type = service.service_type # type: ignore
|
||||||
|
db_service.endpoint_url = service.endpoint_url # type: ignore
|
||||||
|
db_service.status = service.status # type: ignore
|
||||||
|
db_service.other = service.other # type: ignore
|
||||||
|
db_service.entity_did = service.entity_did # type: ignore
|
||||||
|
db_service.action = service.action # type: ignore
|
||||||
|
db.add(db_service)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_service)
|
||||||
|
return db_service
|
||||||
|
|
||||||
|
|
||||||
|
def add_service_usage(
|
||||||
|
db: Session, service_uuid: str, usage: schemas.ServiceUsageCreate
|
||||||
|
) -> sql_models.Service:
|
||||||
|
db_service = get_service_by_uuid(db, service_uuid)
|
||||||
|
if db_service is None:
|
||||||
|
raise ClanError(f"Service with uuid '{service_uuid}' not found")
|
||||||
|
db_service.usage.append(
|
||||||
|
sql_models.ServiceUsage(
|
||||||
|
times_consumed=usage.times_consumed,
|
||||||
|
consumer_entity_did=usage.consumer_entity_did,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
db.add(db_service)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_service)
|
||||||
|
return db_service
|
||||||
|
|
||||||
|
|
||||||
|
def increment_service_usage(
|
||||||
|
db: Session, service_uuid: str, consumer_entity_did: str
|
||||||
|
) -> sql_models.ServiceUsage:
|
||||||
|
db_service = get_service_by_uuid(db, service_uuid)
|
||||||
|
if db_service is None:
|
||||||
|
raise ClanError(f"Service with uuid '{service_uuid}' not found")
|
||||||
|
# TODO: Make a query for this
|
||||||
|
for usage in db_service.usage:
|
||||||
|
if usage.consumer_entity_did == consumer_entity_did:
|
||||||
|
usage.times_consumed += 1
|
||||||
|
break
|
||||||
|
db.add(db_service)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_service)
|
||||||
|
return db_service
|
||||||
|
|
||||||
|
|
||||||
|
def get_service_by_uuid(db: Session, uuid: str) -> Optional[sql_models.Service]:
|
||||||
|
return db.query(sql_models.Service).filter(sql_models.Service.uuid == uuid).first()
|
||||||
|
|
||||||
|
|
||||||
def get_services(
|
def get_services(
|
||||||
db: Session, skip: int = 0, limit: int = 100
|
db: Session, skip: int = 0, limit: int = 100
|
||||||
) -> List[sql_models.Service]:
|
) -> List[sql_models.Service]:
|
||||||
@@ -65,6 +165,10 @@ def get_services_without_entity_id(
|
|||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
def create_entity(db: Session, entity: schemas.EntityCreate) -> sql_models.Entity:
|
def create_entity(db: Session, entity: schemas.EntityCreate) -> sql_models.Entity:
|
||||||
|
if get_entity_by_did(db, entity.did) is not None:
|
||||||
|
raise ClanError(f"Entity with did '{entity.did}' already exists")
|
||||||
|
if get_entity_by_name_or_did(db, entity.name) is not None:
|
||||||
|
raise ClanError(f"Entity with name '{entity.name}' already exists")
|
||||||
db_entity = sql_models.Entity(
|
db_entity = sql_models.Entity(
|
||||||
did=entity.did,
|
did=entity.did,
|
||||||
name=entity.name,
|
name=entity.name,
|
||||||
@@ -142,7 +246,9 @@ def get_attached_entities(
|
|||||||
|
|
||||||
|
|
||||||
# Returns same entity if setting didnt changed something
|
# Returns same entity if setting didnt changed something
|
||||||
def set_stop_health_task(db: Session, entity_did: str, value: bool) -> None:
|
def set_stop_health_task(
|
||||||
|
db: Session, entity_did: str, value: bool
|
||||||
|
) -> sql_models.Entity:
|
||||||
db_entity = get_entity_by_did(db, entity_did)
|
db_entity = get_entity_by_did(db, entity_did)
|
||||||
if db_entity is None:
|
if db_entity is None:
|
||||||
raise ClanError(f"Entity with did '{entity_did}' not found")
|
raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
@@ -152,9 +258,13 @@ def set_stop_health_task(db: Session, entity_did: str, value: bool) -> None:
|
|||||||
# save changes in db
|
# save changes in db
|
||||||
db.add(db_entity)
|
db.add(db_entity)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
db.refresh(db_entity)
|
||||||
|
return db_entity
|
||||||
|
|
||||||
|
|
||||||
def set_attached_by_entity_did(db: Session, entity_did: str, attached: bool) -> None:
|
def set_attached_by_entity_did(
|
||||||
|
db: Session, entity_did: str, attached: bool
|
||||||
|
) -> sql_models.Entity:
|
||||||
db_entity = get_entity_by_did(db, entity_did)
|
db_entity = get_entity_by_did(db, entity_did)
|
||||||
if db_entity is None:
|
if db_entity is None:
|
||||||
raise ClanError(f"Entity with did '{entity_did}' not found")
|
raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
@@ -164,6 +274,8 @@ def set_attached_by_entity_did(db: Session, entity_did: str, attached: bool) ->
|
|||||||
# save changes in db
|
# save changes in db
|
||||||
db.add(db_entity)
|
db.add(db_entity)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
db.refresh(db_entity)
|
||||||
|
return db_entity
|
||||||
|
|
||||||
|
|
||||||
def delete_entity_by_did(db: Session, did: str) -> None:
|
def delete_entity_by_did(db: Session, did: str) -> None:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from sqlalchemy import JSON, Boolean, Column, Enum, ForeignKey, Integer, String, Text
|
from sqlalchemy import JSON, Boolean, Column, Enum, ForeignKey, Integer, String, Text
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from .schemas import Role
|
from .db_types import Role
|
||||||
from .sql_db import Base
|
from .sql_db import Base
|
||||||
|
|
||||||
# Relationsship example
|
# Relationsship example
|
||||||
@@ -27,6 +27,7 @@ class Entity(Base):
|
|||||||
## Relations ##
|
## Relations ##
|
||||||
services = relationship("Service", back_populates="entity")
|
services = relationship("Service", back_populates="entity")
|
||||||
roles = relationship("EntityRoles", back_populates="entity")
|
roles = relationship("EntityRoles", back_populates="entity")
|
||||||
|
consumes = relationship("ServiceUsage", back_populates="consumer_entity")
|
||||||
|
|
||||||
|
|
||||||
class EntityRoles(Base):
|
class EntityRoles(Base):
|
||||||
@@ -41,29 +42,41 @@ class EntityRoles(Base):
|
|||||||
entity = relationship("Entity", back_populates="roles")
|
entity = relationship("Entity", back_populates="roles")
|
||||||
|
|
||||||
|
|
||||||
class ServiceAbstract(Base):
|
class ServiceUsage(Base):
|
||||||
__abstract__ = True
|
__tablename__ = "service_usage"
|
||||||
|
|
||||||
|
## Queryable body ##
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
consumer_entity_did = Column(String, ForeignKey("entities.did"))
|
||||||
|
consumer_entity = relationship("Entity", back_populates="consumes")
|
||||||
|
times_consumed = Column(Integer, index=True, nullable=False)
|
||||||
|
|
||||||
|
service_uuid = Column(String, ForeignKey("services.uuid"))
|
||||||
|
service = relationship("Service", back_populates="usage")
|
||||||
|
|
||||||
|
|
||||||
|
class Service(Base):
|
||||||
|
__tablename__ = "services"
|
||||||
|
|
||||||
# Queryable body
|
# Queryable body
|
||||||
uuid = Column(Text(length=36), primary_key=True, index=True)
|
uuid = Column(Text(length=36), primary_key=True, index=True)
|
||||||
service_name = Column(String, index=True)
|
service_name = Column(String, index=True)
|
||||||
service_type = Column(String, index=True)
|
service_type = Column(String, index=True)
|
||||||
endpoint_url = Column(String, index=True)
|
endpoint_url = Column(String, index=True)
|
||||||
status = Column(String, index=True)
|
|
||||||
|
|
||||||
## Non queryable body ##
|
## Non queryable body ##
|
||||||
# In here we deposit: Action
|
# In here we deposit: Action
|
||||||
other = Column(JSON)
|
other = Column(JSON)
|
||||||
|
status = Column(JSON, index=True)
|
||||||
|
action = Column(JSON, index=True)
|
||||||
class Service(ServiceAbstract):
|
|
||||||
__tablename__ = "services"
|
|
||||||
|
|
||||||
## Relations ##
|
## Relations ##
|
||||||
# One entity can have many services
|
# One entity can have many services
|
||||||
entity = relationship("Entity", back_populates="services")
|
entity = relationship("Entity", back_populates="services")
|
||||||
entity_did = Column(String, ForeignKey("entities.did"))
|
entity_did = Column(String, ForeignKey("entities.did"))
|
||||||
|
|
||||||
|
usage = relationship("ServiceUsage", back_populates="service")
|
||||||
|
|
||||||
|
|
||||||
class Eventmessage(Base):
|
class Eventmessage(Base):
|
||||||
__tablename__ = "eventmessages"
|
__tablename__ = "eventmessages"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ __version__ = "1.0.0"
|
|||||||
from openapi_client.api.default_api import DefaultApi
|
from openapi_client.api.default_api import DefaultApi
|
||||||
from openapi_client.api.entities_api import EntitiesApi
|
from openapi_client.api.entities_api import EntitiesApi
|
||||||
from openapi_client.api.eventmessages_api import EventmessagesApi
|
from openapi_client.api.eventmessages_api import EventmessagesApi
|
||||||
|
from openapi_client.api.repositories_api import RepositoriesApi
|
||||||
from openapi_client.api.resolution_api import ResolutionApi
|
from openapi_client.api.resolution_api import ResolutionApi
|
||||||
from openapi_client.api.services_api import ServicesApi
|
from openapi_client.api.services_api import ServicesApi
|
||||||
|
|
||||||
@@ -45,6 +46,8 @@ from openapi_client.models.resolution import Resolution
|
|||||||
from openapi_client.models.role import Role
|
from openapi_client.models.role import Role
|
||||||
from openapi_client.models.service import Service
|
from openapi_client.models.service import Service
|
||||||
from openapi_client.models.service_create import ServiceCreate
|
from openapi_client.models.service_create import ServiceCreate
|
||||||
|
from openapi_client.models.service_usage import ServiceUsage
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
from openapi_client.models.status import Status
|
from openapi_client.models.status import Status
|
||||||
from openapi_client.models.validation_error import ValidationError
|
from openapi_client.models.validation_error import ValidationError
|
||||||
from openapi_client.models.validation_error_loc_inner import ValidationErrorLocInner
|
from openapi_client.models.validation_error_loc_inner import ValidationErrorLocInner
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
from openapi_client.api.default_api import DefaultApi
|
from openapi_client.api.default_api import DefaultApi
|
||||||
from openapi_client.api.entities_api import EntitiesApi
|
from openapi_client.api.entities_api import EntitiesApi
|
||||||
from openapi_client.api.eventmessages_api import EventmessagesApi
|
from openapi_client.api.eventmessages_api import EventmessagesApi
|
||||||
|
from openapi_client.api.repositories_api import RepositoriesApi
|
||||||
from openapi_client.api.resolution_api import ResolutionApi
|
from openapi_client.api.resolution_api import ResolutionApi
|
||||||
from openapi_client.api.services_api import ServicesApi
|
from openapi_client.api.services_api import ServicesApi
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,136 @@ class DefaultApi:
|
|||||||
collection_formats=_collection_formats,
|
collection_formats=_collection_formats,
|
||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_emulated_enpoints(self, **kwargs) -> str: # noqa: E501
|
||||||
|
"""Get Emulated Enpoints # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_emulated_enpoints(async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
If one number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
if '_preload_content' in kwargs:
|
||||||
|
message = "Error! Please call the get_emulated_enpoints_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
|
raise ValueError(message)
|
||||||
|
return self.get_emulated_enpoints_with_http_info(**kwargs) # noqa: E501
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_emulated_enpoints_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
|
"""Get Emulated Enpoints # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_emulated_enpoints_with_http_info(async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _preload_content: if False, the ApiResponse.data will
|
||||||
|
be set to none and raw_data will store the
|
||||||
|
HTTP response body without reading/decoding.
|
||||||
|
Default is True.
|
||||||
|
:type _preload_content: bool, optional
|
||||||
|
:param _return_http_data_only: response data instead of ApiResponse
|
||||||
|
object with status code, headers, etc
|
||||||
|
:type _return_http_data_only: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:type _request_auth: dict, optional
|
||||||
|
:type _content_type: string, optional: force content-type for the request
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
"""
|
||||||
|
|
||||||
|
_params = locals()
|
||||||
|
|
||||||
|
_all_params = [
|
||||||
|
]
|
||||||
|
_all_params.extend(
|
||||||
|
[
|
||||||
|
'async_req',
|
||||||
|
'_return_http_data_only',
|
||||||
|
'_preload_content',
|
||||||
|
'_request_timeout',
|
||||||
|
'_request_auth',
|
||||||
|
'_content_type',
|
||||||
|
'_headers'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# validate the arguments
|
||||||
|
for _key, _val in _params['kwargs'].items():
|
||||||
|
if _key not in _all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_emulated_enpoints" % _key
|
||||||
|
)
|
||||||
|
_params[_key] = _val
|
||||||
|
del _params['kwargs']
|
||||||
|
|
||||||
|
_collection_formats = {}
|
||||||
|
|
||||||
|
# process the path parameters
|
||||||
|
_path_params = {}
|
||||||
|
|
||||||
|
# process the query parameters
|
||||||
|
_query_params = []
|
||||||
|
# process the header parameters
|
||||||
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
|
# process the form parameters
|
||||||
|
_form_params = []
|
||||||
|
_files = {}
|
||||||
|
# process the body parameter
|
||||||
|
_body_params = None
|
||||||
|
# set the HTTP header `Accept`
|
||||||
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
|
['text/html']) # noqa: E501
|
||||||
|
|
||||||
|
# authentication setting
|
||||||
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
|
_response_types_map = {
|
||||||
|
'200': "str",
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.api_client.call_api(
|
||||||
|
'/emulate', 'GET',
|
||||||
|
_path_params,
|
||||||
|
_query_params,
|
||||||
|
_header_params,
|
||||||
|
body=_body_params,
|
||||||
|
post_params=_form_params,
|
||||||
|
files=_files,
|
||||||
|
response_types_map=_response_types_map,
|
||||||
|
auth_settings=_auth_settings,
|
||||||
|
async_req=_params.get('async_req'),
|
||||||
|
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=_params.get('_preload_content', True),
|
||||||
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
|
collection_formats=_collection_formats,
|
||||||
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def health(self, **kwargs) -> Machine: # noqa: E501
|
def health(self, **kwargs) -> Machine: # noqa: E501
|
||||||
"""Health # noqa: E501
|
"""Health # noqa: E501
|
||||||
|
|||||||
@@ -1074,145 +1074,6 @@ class EntitiesApi:
|
|||||||
collection_formats=_collection_formats,
|
collection_formats=_collection_formats,
|
||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
|
||||||
def get_entity_by_name_or_did(self, entity_name_or_did : Optional[StrictStr] = None, **kwargs) -> Entity: # noqa: E501
|
|
||||||
"""Get Entity By Name Or Did # noqa: E501
|
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
|
||||||
asynchronous HTTP request, please pass async_req=True
|
|
||||||
|
|
||||||
>>> thread = api.get_entity_by_name_or_did(entity_name_or_did, async_req=True)
|
|
||||||
>>> result = thread.get()
|
|
||||||
|
|
||||||
:param entity_name_or_did:
|
|
||||||
:type entity_name_or_did: str
|
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
|
||||||
:type async_req: bool, optional
|
|
||||||
:param _request_timeout: timeout setting for this request.
|
|
||||||
If one number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
:return: Returns the result object.
|
|
||||||
If the method is called asynchronously,
|
|
||||||
returns the request thread.
|
|
||||||
:rtype: Entity
|
|
||||||
"""
|
|
||||||
kwargs['_return_http_data_only'] = True
|
|
||||||
if '_preload_content' in kwargs:
|
|
||||||
message = "Error! Please call the get_entity_by_name_or_did_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
|
||||||
raise ValueError(message)
|
|
||||||
return self.get_entity_by_name_or_did_with_http_info(entity_name_or_did, **kwargs) # noqa: E501
|
|
||||||
|
|
||||||
@validate_arguments
|
|
||||||
def get_entity_by_name_or_did_with_http_info(self, entity_name_or_did : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
|
||||||
"""Get Entity By Name Or Did # noqa: E501
|
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
|
||||||
asynchronous HTTP request, please pass async_req=True
|
|
||||||
|
|
||||||
>>> thread = api.get_entity_by_name_or_did_with_http_info(entity_name_or_did, async_req=True)
|
|
||||||
>>> result = thread.get()
|
|
||||||
|
|
||||||
:param entity_name_or_did:
|
|
||||||
:type entity_name_or_did: str
|
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
|
||||||
:type async_req: bool, optional
|
|
||||||
:param _preload_content: if False, the ApiResponse.data will
|
|
||||||
be set to none and raw_data will store the
|
|
||||||
HTTP response body without reading/decoding.
|
|
||||||
Default is True.
|
|
||||||
:type _preload_content: bool, optional
|
|
||||||
:param _return_http_data_only: response data instead of ApiResponse
|
|
||||||
object with status code, headers, etc
|
|
||||||
:type _return_http_data_only: bool, optional
|
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
|
||||||
number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
:param _request_auth: set to override the auth_settings for an a single
|
|
||||||
request; this effectively ignores the authentication
|
|
||||||
in the spec for a single request.
|
|
||||||
:type _request_auth: dict, optional
|
|
||||||
:type _content_type: string, optional: force content-type for the request
|
|
||||||
:return: Returns the result object.
|
|
||||||
If the method is called asynchronously,
|
|
||||||
returns the request thread.
|
|
||||||
:rtype: tuple(Entity, status_code(int), headers(HTTPHeaderDict))
|
|
||||||
"""
|
|
||||||
|
|
||||||
_params = locals()
|
|
||||||
|
|
||||||
_all_params = [
|
|
||||||
'entity_name_or_did'
|
|
||||||
]
|
|
||||||
_all_params.extend(
|
|
||||||
[
|
|
||||||
'async_req',
|
|
||||||
'_return_http_data_only',
|
|
||||||
'_preload_content',
|
|
||||||
'_request_timeout',
|
|
||||||
'_request_auth',
|
|
||||||
'_content_type',
|
|
||||||
'_headers'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
# validate the arguments
|
|
||||||
for _key, _val in _params['kwargs'].items():
|
|
||||||
if _key not in _all_params:
|
|
||||||
raise ApiTypeError(
|
|
||||||
"Got an unexpected keyword argument '%s'"
|
|
||||||
" to method get_entity_by_name_or_did" % _key
|
|
||||||
)
|
|
||||||
_params[_key] = _val
|
|
||||||
del _params['kwargs']
|
|
||||||
|
|
||||||
_collection_formats = {}
|
|
||||||
|
|
||||||
# process the path parameters
|
|
||||||
_path_params = {}
|
|
||||||
|
|
||||||
# process the query parameters
|
|
||||||
_query_params = []
|
|
||||||
if _params.get('entity_name_or_did') is not None: # noqa: E501
|
|
||||||
_query_params.append(('entity_name_or_did', _params['entity_name_or_did']))
|
|
||||||
|
|
||||||
# process the header parameters
|
|
||||||
_header_params = dict(_params.get('_headers', {}))
|
|
||||||
# process the form parameters
|
|
||||||
_form_params = []
|
|
||||||
_files = {}
|
|
||||||
# process the body parameter
|
|
||||||
_body_params = None
|
|
||||||
# set the HTTP header `Accept`
|
|
||||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
||||||
['application/json']) # noqa: E501
|
|
||||||
|
|
||||||
# authentication setting
|
|
||||||
_auth_settings = [] # noqa: E501
|
|
||||||
|
|
||||||
_response_types_map = {
|
|
||||||
'200': "Entity",
|
|
||||||
'422': "HTTPValidationError",
|
|
||||||
}
|
|
||||||
|
|
||||||
return self.api_client.call_api(
|
|
||||||
'/api/v1/entity_by_name_or_did', 'GET',
|
|
||||||
_path_params,
|
|
||||||
_query_params,
|
|
||||||
_header_params,
|
|
||||||
body=_body_params,
|
|
||||||
post_params=_form_params,
|
|
||||||
files=_files,
|
|
||||||
response_types_map=_response_types_map,
|
|
||||||
auth_settings=_auth_settings,
|
|
||||||
async_req=_params.get('async_req'),
|
|
||||||
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
|
||||||
_preload_content=_params.get('_preload_content', True),
|
|
||||||
_request_timeout=_params.get('_request_timeout'),
|
|
||||||
collection_formats=_collection_formats,
|
|
||||||
_request_auth=_params.get('_request_auth'))
|
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_entity_by_roles(self, roles : conlist(Role), **kwargs) -> List[Entity]: # noqa: E501
|
def get_entity_by_roles(self, roles : conlist(Role), **kwargs) -> List[Entity]: # noqa: E501
|
||||||
"""Get Entity By Roles # noqa: E501
|
"""Get Entity By Roles # noqa: E501
|
||||||
|
|||||||
192
pkgs/clan-cli/tests/openapi_client/api/repositories_api.py
Normal file
192
pkgs/clan-cli/tests/openapi_client/api/repositories_api.py
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
FastAPI
|
||||||
|
|
||||||
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 0.1.0
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
import re # noqa: F401
|
||||||
|
import io
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
from pydantic import validate_arguments, ValidationError
|
||||||
|
|
||||||
|
from pydantic import StrictInt
|
||||||
|
|
||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from openapi_client.models.service import Service
|
||||||
|
|
||||||
|
from openapi_client.api_client import ApiClient
|
||||||
|
from openapi_client.api_response import ApiResponse
|
||||||
|
from openapi_client.exceptions import ( # noqa: F401
|
||||||
|
ApiTypeError,
|
||||||
|
ApiValueError
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class RepositoriesApi:
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, api_client=None) -> None:
|
||||||
|
if api_client is None:
|
||||||
|
api_client = ApiClient.get_default()
|
||||||
|
self.api_client = api_client
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_all_repositories(self, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
|
||||||
|
"""Get All Repositories # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_all_repositories(skip, limit, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param skip:
|
||||||
|
:type skip: int
|
||||||
|
:param limit:
|
||||||
|
:type limit: int
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
If one number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: List[Service]
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
if '_preload_content' in kwargs:
|
||||||
|
message = "Error! Please call the get_all_repositories_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
|
raise ValueError(message)
|
||||||
|
return self.get_all_repositories_with_http_info(skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_all_repositories_with_http_info(self, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
|
"""Get All Repositories # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_all_repositories_with_http_info(skip, limit, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param skip:
|
||||||
|
:type skip: int
|
||||||
|
:param limit:
|
||||||
|
:type limit: int
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _preload_content: if False, the ApiResponse.data will
|
||||||
|
be set to none and raw_data will store the
|
||||||
|
HTTP response body without reading/decoding.
|
||||||
|
Default is True.
|
||||||
|
:type _preload_content: bool, optional
|
||||||
|
:param _return_http_data_only: response data instead of ApiResponse
|
||||||
|
object with status code, headers, etc
|
||||||
|
:type _return_http_data_only: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:type _request_auth: dict, optional
|
||||||
|
:type _content_type: string, optional: force content-type for the request
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: tuple(List[Service], status_code(int), headers(HTTPHeaderDict))
|
||||||
|
"""
|
||||||
|
|
||||||
|
_params = locals()
|
||||||
|
|
||||||
|
_all_params = [
|
||||||
|
'skip',
|
||||||
|
'limit'
|
||||||
|
]
|
||||||
|
_all_params.extend(
|
||||||
|
[
|
||||||
|
'async_req',
|
||||||
|
'_return_http_data_only',
|
||||||
|
'_preload_content',
|
||||||
|
'_request_timeout',
|
||||||
|
'_request_auth',
|
||||||
|
'_content_type',
|
||||||
|
'_headers'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# validate the arguments
|
||||||
|
for _key, _val in _params['kwargs'].items():
|
||||||
|
if _key not in _all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_all_repositories" % _key
|
||||||
|
)
|
||||||
|
_params[_key] = _val
|
||||||
|
del _params['kwargs']
|
||||||
|
|
||||||
|
_collection_formats = {}
|
||||||
|
|
||||||
|
# process the path parameters
|
||||||
|
_path_params = {}
|
||||||
|
|
||||||
|
# process the query parameters
|
||||||
|
_query_params = []
|
||||||
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
|
_query_params.append(('skip', _params['skip']))
|
||||||
|
|
||||||
|
if _params.get('limit') is not None: # noqa: E501
|
||||||
|
_query_params.append(('limit', _params['limit']))
|
||||||
|
|
||||||
|
# process the header parameters
|
||||||
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
|
# process the form parameters
|
||||||
|
_form_params = []
|
||||||
|
_files = {}
|
||||||
|
# process the body parameter
|
||||||
|
_body_params = None
|
||||||
|
# set the HTTP header `Accept`
|
||||||
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
|
['application/json']) # noqa: E501
|
||||||
|
|
||||||
|
# authentication setting
|
||||||
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
|
_response_types_map = {
|
||||||
|
'200': "List[Service]",
|
||||||
|
'422': "HTTPValidationError",
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.api_client.call_api(
|
||||||
|
'/api/v1/repositories', 'GET',
|
||||||
|
_path_params,
|
||||||
|
_query_params,
|
||||||
|
_header_params,
|
||||||
|
body=_body_params,
|
||||||
|
post_params=_form_params,
|
||||||
|
files=_files,
|
||||||
|
response_types_map=_response_types_map,
|
||||||
|
auth_settings=_auth_settings,
|
||||||
|
async_req=_params.get('async_req'),
|
||||||
|
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=_params.get('_preload_content', True),
|
||||||
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
|
collection_formats=_collection_formats,
|
||||||
|
_request_auth=_params.get('_request_auth'))
|
||||||
@@ -24,6 +24,7 @@ from typing import Any, List, Optional, Dict
|
|||||||
|
|
||||||
from openapi_client.models.service import Service
|
from openapi_client.models.service import Service
|
||||||
from openapi_client.models.service_create import ServiceCreate
|
from openapi_client.models.service_create import ServiceCreate
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
|
|
||||||
from openapi_client.api_client import ApiClient
|
from openapi_client.api_client import ApiClient
|
||||||
from openapi_client.api_response import ApiResponse
|
from openapi_client.api_response import ApiResponse
|
||||||
@@ -45,6 +46,160 @@ class ServicesApi:
|
|||||||
api_client = ApiClient.get_default()
|
api_client = ApiClient.get_default()
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def add_service_usage(self, service_usage_create : ServiceUsageCreate, service_uuid : Optional[StrictStr] = None, **kwargs) -> Service: # noqa: E501
|
||||||
|
"""Add Service Usage # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.add_service_usage(service_usage_create, service_uuid, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param service_usage_create: (required)
|
||||||
|
:type service_usage_create: ServiceUsageCreate
|
||||||
|
:param service_uuid:
|
||||||
|
:type service_uuid: str
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
If one number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: Service
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
if '_preload_content' in kwargs:
|
||||||
|
message = "Error! Please call the add_service_usage_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
|
raise ValueError(message)
|
||||||
|
return self.add_service_usage_with_http_info(service_usage_create, service_uuid, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def add_service_usage_with_http_info(self, service_usage_create : ServiceUsageCreate, service_uuid : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
|
"""Add Service Usage # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.add_service_usage_with_http_info(service_usage_create, service_uuid, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param service_usage_create: (required)
|
||||||
|
:type service_usage_create: ServiceUsageCreate
|
||||||
|
:param service_uuid:
|
||||||
|
:type service_uuid: str
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _preload_content: if False, the ApiResponse.data will
|
||||||
|
be set to none and raw_data will store the
|
||||||
|
HTTP response body without reading/decoding.
|
||||||
|
Default is True.
|
||||||
|
:type _preload_content: bool, optional
|
||||||
|
:param _return_http_data_only: response data instead of ApiResponse
|
||||||
|
object with status code, headers, etc
|
||||||
|
:type _return_http_data_only: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:type _request_auth: dict, optional
|
||||||
|
:type _content_type: string, optional: force content-type for the request
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: tuple(Service, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
"""
|
||||||
|
|
||||||
|
_params = locals()
|
||||||
|
|
||||||
|
_all_params = [
|
||||||
|
'service_usage_create',
|
||||||
|
'service_uuid'
|
||||||
|
]
|
||||||
|
_all_params.extend(
|
||||||
|
[
|
||||||
|
'async_req',
|
||||||
|
'_return_http_data_only',
|
||||||
|
'_preload_content',
|
||||||
|
'_request_timeout',
|
||||||
|
'_request_auth',
|
||||||
|
'_content_type',
|
||||||
|
'_headers'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# validate the arguments
|
||||||
|
for _key, _val in _params['kwargs'].items():
|
||||||
|
if _key not in _all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method add_service_usage" % _key
|
||||||
|
)
|
||||||
|
_params[_key] = _val
|
||||||
|
del _params['kwargs']
|
||||||
|
|
||||||
|
_collection_formats = {}
|
||||||
|
|
||||||
|
# process the path parameters
|
||||||
|
_path_params = {}
|
||||||
|
|
||||||
|
# process the query parameters
|
||||||
|
_query_params = []
|
||||||
|
if _params.get('service_uuid') is not None: # noqa: E501
|
||||||
|
_query_params.append(('service_uuid', _params['service_uuid']))
|
||||||
|
|
||||||
|
# process the header parameters
|
||||||
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
|
# process the form parameters
|
||||||
|
_form_params = []
|
||||||
|
_files = {}
|
||||||
|
# process the body parameter
|
||||||
|
_body_params = None
|
||||||
|
if _params['service_usage_create'] is not None:
|
||||||
|
_body_params = _params['service_usage_create']
|
||||||
|
|
||||||
|
# set the HTTP header `Accept`
|
||||||
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
|
['application/json']) # noqa: E501
|
||||||
|
|
||||||
|
# set the HTTP header `Content-Type`
|
||||||
|
_content_types_list = _params.get('_content_type',
|
||||||
|
self.api_client.select_header_content_type(
|
||||||
|
['application/json']))
|
||||||
|
if _content_types_list:
|
||||||
|
_header_params['Content-Type'] = _content_types_list
|
||||||
|
|
||||||
|
# authentication setting
|
||||||
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
|
_response_types_map = {
|
||||||
|
'200': "Service",
|
||||||
|
'422': "HTTPValidationError",
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.api_client.call_api(
|
||||||
|
'/api/v1/service_usage', 'POST',
|
||||||
|
_path_params,
|
||||||
|
_query_params,
|
||||||
|
_header_params,
|
||||||
|
body=_body_params,
|
||||||
|
post_params=_form_params,
|
||||||
|
files=_files,
|
||||||
|
response_types_map=_response_types_map,
|
||||||
|
auth_settings=_auth_settings,
|
||||||
|
async_req=_params.get('async_req'),
|
||||||
|
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=_params.get('_preload_content', True),
|
||||||
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
|
collection_formats=_collection_formats,
|
||||||
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def create_service(self, service_create : ServiceCreate, **kwargs) -> Service: # noqa: E501
|
def create_service(self, service_create : ServiceCreate, **kwargs) -> Service: # noqa: E501
|
||||||
"""Create Service # noqa: E501
|
"""Create Service # noqa: E501
|
||||||
@@ -615,6 +770,161 @@ class ServicesApi:
|
|||||||
'422': "HTTPValidationError",
|
'422': "HTTPValidationError",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return self.api_client.call_api(
|
||||||
|
'/api/v1/service_by_did', 'GET',
|
||||||
|
_path_params,
|
||||||
|
_query_params,
|
||||||
|
_header_params,
|
||||||
|
body=_body_params,
|
||||||
|
post_params=_form_params,
|
||||||
|
files=_files,
|
||||||
|
response_types_map=_response_types_map,
|
||||||
|
auth_settings=_auth_settings,
|
||||||
|
async_req=_params.get('async_req'),
|
||||||
|
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=_params.get('_preload_content', True),
|
||||||
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
|
collection_formats=_collection_formats,
|
||||||
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_service_by_uuid(self, uuid : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> Service: # noqa: E501
|
||||||
|
"""Get Service By Uuid # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_service_by_uuid(uuid, skip, limit, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param uuid:
|
||||||
|
:type uuid: str
|
||||||
|
:param skip:
|
||||||
|
:type skip: int
|
||||||
|
:param limit:
|
||||||
|
:type limit: int
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
If one number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: Service
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
if '_preload_content' in kwargs:
|
||||||
|
message = "Error! Please call the get_service_by_uuid_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
|
raise ValueError(message)
|
||||||
|
return self.get_service_by_uuid_with_http_info(uuid, skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def get_service_by_uuid_with_http_info(self, uuid : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
|
"""Get Service By Uuid # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.get_service_by_uuid_with_http_info(uuid, skip, limit, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param uuid:
|
||||||
|
:type uuid: str
|
||||||
|
:param skip:
|
||||||
|
:type skip: int
|
||||||
|
:param limit:
|
||||||
|
:type limit: int
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _preload_content: if False, the ApiResponse.data will
|
||||||
|
be set to none and raw_data will store the
|
||||||
|
HTTP response body without reading/decoding.
|
||||||
|
Default is True.
|
||||||
|
:type _preload_content: bool, optional
|
||||||
|
:param _return_http_data_only: response data instead of ApiResponse
|
||||||
|
object with status code, headers, etc
|
||||||
|
:type _return_http_data_only: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:type _request_auth: dict, optional
|
||||||
|
:type _content_type: string, optional: force content-type for the request
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: tuple(Service, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
"""
|
||||||
|
|
||||||
|
_params = locals()
|
||||||
|
|
||||||
|
_all_params = [
|
||||||
|
'uuid',
|
||||||
|
'skip',
|
||||||
|
'limit'
|
||||||
|
]
|
||||||
|
_all_params.extend(
|
||||||
|
[
|
||||||
|
'async_req',
|
||||||
|
'_return_http_data_only',
|
||||||
|
'_preload_content',
|
||||||
|
'_request_timeout',
|
||||||
|
'_request_auth',
|
||||||
|
'_content_type',
|
||||||
|
'_headers'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# validate the arguments
|
||||||
|
for _key, _val in _params['kwargs'].items():
|
||||||
|
if _key not in _all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_service_by_uuid" % _key
|
||||||
|
)
|
||||||
|
_params[_key] = _val
|
||||||
|
del _params['kwargs']
|
||||||
|
|
||||||
|
_collection_formats = {}
|
||||||
|
|
||||||
|
# process the path parameters
|
||||||
|
_path_params = {}
|
||||||
|
|
||||||
|
# process the query parameters
|
||||||
|
_query_params = []
|
||||||
|
if _params.get('uuid') is not None: # noqa: E501
|
||||||
|
_query_params.append(('uuid', _params['uuid']))
|
||||||
|
|
||||||
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
|
_query_params.append(('skip', _params['skip']))
|
||||||
|
|
||||||
|
if _params.get('limit') is not None: # noqa: E501
|
||||||
|
_query_params.append(('limit', _params['limit']))
|
||||||
|
|
||||||
|
# process the header parameters
|
||||||
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
|
# process the form parameters
|
||||||
|
_form_params = []
|
||||||
|
_files = {}
|
||||||
|
# process the body parameter
|
||||||
|
_body_params = None
|
||||||
|
# set the HTTP header `Accept`
|
||||||
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
|
['application/json']) # noqa: E501
|
||||||
|
|
||||||
|
# authentication setting
|
||||||
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
|
_response_types_map = {
|
||||||
|
'200': "Service",
|
||||||
|
'422': "HTTPValidationError",
|
||||||
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/service', 'GET',
|
'/api/v1/service', 'GET',
|
||||||
_path_params,
|
_path_params,
|
||||||
@@ -786,3 +1096,165 @@ class ServicesApi:
|
|||||||
_request_timeout=_params.get('_request_timeout'),
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
collection_formats=_collection_formats,
|
collection_formats=_collection_formats,
|
||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def inc_service_usage(self, service_usage_create : ServiceUsageCreate, consumer_entity_did : Optional[StrictStr] = None, service_uuid : Optional[StrictStr] = None, **kwargs) -> Service: # noqa: E501
|
||||||
|
"""Inc Service Usage # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.inc_service_usage(service_usage_create, consumer_entity_did, service_uuid, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param service_usage_create: (required)
|
||||||
|
:type service_usage_create: ServiceUsageCreate
|
||||||
|
:param consumer_entity_did:
|
||||||
|
:type consumer_entity_did: str
|
||||||
|
:param service_uuid:
|
||||||
|
:type service_uuid: str
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
If one number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: Service
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
if '_preload_content' in kwargs:
|
||||||
|
message = "Error! Please call the inc_service_usage_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
|
raise ValueError(message)
|
||||||
|
return self.inc_service_usage_with_http_info(service_usage_create, consumer_entity_did, service_uuid, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
@validate_arguments
|
||||||
|
def inc_service_usage_with_http_info(self, service_usage_create : ServiceUsageCreate, consumer_entity_did : Optional[StrictStr] = None, service_uuid : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
|
"""Inc Service Usage # noqa: E501
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
|
>>> thread = api.inc_service_usage_with_http_info(service_usage_create, consumer_entity_did, service_uuid, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param service_usage_create: (required)
|
||||||
|
:type service_usage_create: ServiceUsageCreate
|
||||||
|
:param consumer_entity_did:
|
||||||
|
:type consumer_entity_did: str
|
||||||
|
:param service_uuid:
|
||||||
|
:type service_uuid: str
|
||||||
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
|
:type async_req: bool, optional
|
||||||
|
:param _preload_content: if False, the ApiResponse.data will
|
||||||
|
be set to none and raw_data will store the
|
||||||
|
HTTP response body without reading/decoding.
|
||||||
|
Default is True.
|
||||||
|
:type _preload_content: bool, optional
|
||||||
|
:param _return_http_data_only: response data instead of ApiResponse
|
||||||
|
object with status code, headers, etc
|
||||||
|
:type _return_http_data_only: bool, optional
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:type _request_auth: dict, optional
|
||||||
|
:type _content_type: string, optional: force content-type for the request
|
||||||
|
:return: Returns the result object.
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
:rtype: tuple(Service, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
"""
|
||||||
|
|
||||||
|
_params = locals()
|
||||||
|
|
||||||
|
_all_params = [
|
||||||
|
'service_usage_create',
|
||||||
|
'consumer_entity_did',
|
||||||
|
'service_uuid'
|
||||||
|
]
|
||||||
|
_all_params.extend(
|
||||||
|
[
|
||||||
|
'async_req',
|
||||||
|
'_return_http_data_only',
|
||||||
|
'_preload_content',
|
||||||
|
'_request_timeout',
|
||||||
|
'_request_auth',
|
||||||
|
'_content_type',
|
||||||
|
'_headers'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# validate the arguments
|
||||||
|
for _key, _val in _params['kwargs'].items():
|
||||||
|
if _key not in _all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method inc_service_usage" % _key
|
||||||
|
)
|
||||||
|
_params[_key] = _val
|
||||||
|
del _params['kwargs']
|
||||||
|
|
||||||
|
_collection_formats = {}
|
||||||
|
|
||||||
|
# process the path parameters
|
||||||
|
_path_params = {}
|
||||||
|
|
||||||
|
# process the query parameters
|
||||||
|
_query_params = []
|
||||||
|
if _params.get('consumer_entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('consumer_entity_did', _params['consumer_entity_did']))
|
||||||
|
|
||||||
|
if _params.get('service_uuid') is not None: # noqa: E501
|
||||||
|
_query_params.append(('service_uuid', _params['service_uuid']))
|
||||||
|
|
||||||
|
# process the header parameters
|
||||||
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
|
# process the form parameters
|
||||||
|
_form_params = []
|
||||||
|
_files = {}
|
||||||
|
# process the body parameter
|
||||||
|
_body_params = None
|
||||||
|
if _params['service_usage_create'] is not None:
|
||||||
|
_body_params = _params['service_usage_create']
|
||||||
|
|
||||||
|
# set the HTTP header `Accept`
|
||||||
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
|
['application/json']) # noqa: E501
|
||||||
|
|
||||||
|
# set the HTTP header `Content-Type`
|
||||||
|
_content_types_list = _params.get('_content_type',
|
||||||
|
self.api_client.select_header_content_type(
|
||||||
|
['application/json']))
|
||||||
|
if _content_types_list:
|
||||||
|
_header_params['Content-Type'] = _content_types_list
|
||||||
|
|
||||||
|
# authentication setting
|
||||||
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
|
_response_types_map = {
|
||||||
|
'200': "Service",
|
||||||
|
'422': "HTTPValidationError",
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.api_client.call_api(
|
||||||
|
'/api/v1/inc_service_usage', 'PUT',
|
||||||
|
_path_params,
|
||||||
|
_query_params,
|
||||||
|
_header_params,
|
||||||
|
body=_body_params,
|
||||||
|
post_params=_form_params,
|
||||||
|
files=_files,
|
||||||
|
response_types_map=_response_types_map,
|
||||||
|
auth_settings=_auth_settings,
|
||||||
|
async_req=_params.get('async_req'),
|
||||||
|
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=_params.get('_preload_content', True),
|
||||||
|
_request_timeout=_params.get('_request_timeout'),
|
||||||
|
collection_formats=_collection_formats,
|
||||||
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
# openapi_client.DefaultApi
|
# openapi_client.DefaultApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**get**](DefaultApi.md#get) | **GET** /ws2_example | Get
|
||||||
|
[**get_emulated_enpoints**](DefaultApi.md#get_emulated_enpoints) | **GET** /emulate | Get Emulated Enpoints
|
||||||
|
[**health**](DefaultApi.md#health) | **GET** /health | Health
|
||||||
|
[**root**](DefaultApi.md#root) | **GET** /{path_name} | Root
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| ---------------------------------- | -------------------- | ----------- |
|
|
||||||
| [**get**](DefaultApi.md#get) | **GET** /ws2_example | Get |
|
|
||||||
| [**health**](DefaultApi.md#health) | **GET** /health | Health |
|
|
||||||
| [**root**](DefaultApi.md#root) | **GET** /{path_name} | Root |
|
|
||||||
|
|
||||||
# **get**
|
# **get**
|
||||||
|
|
||||||
> get()
|
> get()
|
||||||
|
|
||||||
Get
|
Get
|
||||||
@@ -42,8 +43,9 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling DefaultApi->get: %s\n" % e)
|
print("Exception when calling DefaultApi->get: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
This endpoint does not need any parameter.
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@@ -60,15 +62,73 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_emulated_enpoints**
|
||||||
|
> str get_emulated_enpoints()
|
||||||
|
|
||||||
|
Get Emulated Enpoints
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to http://localhost
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = openapi_client.Configuration(
|
||||||
|
host = "http://localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = openapi_client.DefaultApi(api_client)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Get Emulated Enpoints
|
||||||
|
api_response = api_instance.get_emulated_enpoints()
|
||||||
|
print("The response of DefaultApi->get_emulated_enpoints:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except Exception as e:
|
||||||
|
print("Exception when calling DefaultApi->get_emulated_enpoints: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**str**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: text/html
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Successful Response | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **health**
|
# **health**
|
||||||
|
|
||||||
> Machine health()
|
> Machine health()
|
||||||
|
|
||||||
Health
|
Health
|
||||||
@@ -104,8 +164,9 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling DefaultApi->health: %s\n" % e)
|
print("Exception when calling DefaultApi->health: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
This endpoint does not need any parameter.
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@@ -122,15 +183,13 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **root**
|
# **root**
|
||||||
|
|
||||||
> root(path_name)
|
> root(path_name)
|
||||||
|
|
||||||
Root
|
Root
|
||||||
@@ -164,11 +223,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling DefaultApi->root: %s\n" % e)
|
print("Exception when calling DefaultApi->root: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| ------------- | ------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **path_name** | **str** | |
|
**path_name** | **str**| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -184,10 +245,10 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
# openapi_client.EntitiesApi
|
# openapi_client.EntitiesApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**attach_entity**](EntitiesApi.md#attach_entity) | **PUT** /api/v1/attach | Attach Entity
|
||||||
|
[**create_entity**](EntitiesApi.md#create_entity) | **POST** /api/v1/entity | Create Entity
|
||||||
|
[**delete_entity**](EntitiesApi.md#delete_entity) | **DELETE** /api/v1/entity | Delete Entity
|
||||||
|
[**detach_entity**](EntitiesApi.md#detach_entity) | **PUT** /api/v1/detach | Detach Entity
|
||||||
|
[**get_all_entities**](EntitiesApi.md#get_all_entities) | **GET** /api/v1/entities | Get All Entities
|
||||||
|
[**get_attached_entities**](EntitiesApi.md#get_attached_entities) | **GET** /api/v1/attached_entities | Get Attached Entities
|
||||||
|
[**get_entity_by_did**](EntitiesApi.md#get_entity_by_did) | **GET** /api/v1/entity | Get Entity By Did
|
||||||
|
[**get_entity_by_roles**](EntitiesApi.md#get_entity_by_roles) | **GET** /api/v1/entity_by_roles | Get Entity By Roles
|
||||||
|
[**is_attached**](EntitiesApi.md#is_attached) | **GET** /api/v1/is_attached | Is Attached
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| ------------------------------------------------------------------------- | ------------------------------------- | ------------------------- |
|
|
||||||
| [**attach_entity**](EntitiesApi.md#attach_entity) | **PUT** /api/v1/attach | Attach Entity |
|
|
||||||
| [**create_entity**](EntitiesApi.md#create_entity) | **POST** /api/v1/entity | Create Entity |
|
|
||||||
| [**delete_entity**](EntitiesApi.md#delete_entity) | **DELETE** /api/v1/entity | Delete Entity |
|
|
||||||
| [**detach_entity**](EntitiesApi.md#detach_entity) | **PUT** /api/v1/detach | Detach Entity |
|
|
||||||
| [**get_all_entities**](EntitiesApi.md#get_all_entities) | **GET** /api/v1/entities | Get All Entities |
|
|
||||||
| [**get_attached_entities**](EntitiesApi.md#get_attached_entities) | **GET** /api/v1/attached_entities | Get Attached Entities |
|
|
||||||
| [**get_entity_by_did**](EntitiesApi.md#get_entity_by_did) | **GET** /api/v1/entity | Get Entity By Did |
|
|
||||||
| [**get_entity_by_name_or_did**](EntitiesApi.md#get_entity_by_name_or_did) | **GET** /api/v1/entity_by_name_or_did | Get Entity By Name Or Did |
|
|
||||||
| [**get_entity_by_roles**](EntitiesApi.md#get_entity_by_roles) | **GET** /api/v1/entity_by_roles | Get Entity By Roles |
|
|
||||||
| [**is_attached**](EntitiesApi.md#is_attached) | **GET** /api/v1/is_attached | Is Attached |
|
|
||||||
|
|
||||||
# **attach_entity**
|
# **attach_entity**
|
||||||
|
|
||||||
> Dict[str, str] attach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
> Dict[str, str] attach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
|
|
||||||
Attach Entity
|
Attach Entity
|
||||||
@@ -41,7 +40,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
api_instance = openapi_client.EntitiesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
skip = 0 # int | (optional) (default to 0)
|
skip = 0 # int | (optional) (default to 0)
|
||||||
limit = 100 # int | (optional) (default to 100)
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
@@ -54,13 +53,15 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->attach_entity: %s\n" % e)
|
print("Exception when calling EntitiesApi->attach_entity: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -76,16 +77,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **create_entity**
|
# **create_entity**
|
||||||
|
|
||||||
> Entity create_entity(entity_create)
|
> Entity create_entity(entity_create)
|
||||||
|
|
||||||
Create Entity
|
Create Entity
|
||||||
@@ -123,11 +122,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->create_entity: %s\n" % e)
|
print("Exception when calling EntitiesApi->create_entity: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| ----------------- | ----------------------------------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_create** | [**EntityCreate**](EntityCreate.md) | |
|
**entity_create** | [**EntityCreate**](EntityCreate.md)| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -143,16 +144,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **delete_entity**
|
# **delete_entity**
|
||||||
|
|
||||||
> Dict[str, str] delete_entity(entity_did=entity_did)
|
> Dict[str, str] delete_entity(entity_did=entity_did)
|
||||||
|
|
||||||
Delete Entity
|
Delete Entity
|
||||||
@@ -177,7 +176,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
api_instance = openapi_client.EntitiesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete Entity
|
# Delete Entity
|
||||||
@@ -188,11 +187,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->delete_entity: %s\n" % e)
|
print("Exception when calling EntitiesApi->delete_entity: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -208,16 +209,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **detach_entity**
|
# **detach_entity**
|
||||||
|
|
||||||
> Dict[str, str] detach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
> Dict[str, str] detach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
|
|
||||||
Detach Entity
|
Detach Entity
|
||||||
@@ -242,7 +241,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
api_instance = openapi_client.EntitiesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
skip = 0 # int | (optional) (default to 0)
|
skip = 0 # int | (optional) (default to 0)
|
||||||
limit = 100 # int | (optional) (default to 100)
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
@@ -255,13 +254,15 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->detach_entity: %s\n" % e)
|
print("Exception when calling EntitiesApi->detach_entity: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -277,16 +278,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_all_entities**
|
# **get_all_entities**
|
||||||
|
|
||||||
> List[Entity] get_all_entities(skip=skip, limit=limit)
|
> List[Entity] get_all_entities(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get All Entities
|
Get All Entities
|
||||||
@@ -324,12 +323,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->get_all_entities: %s\n" % e)
|
print("Exception when calling EntitiesApi->get_all_entities: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------- | ----------- | --------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -345,16 +346,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_attached_entities**
|
# **get_attached_entities**
|
||||||
|
|
||||||
> List[Entity] get_attached_entities(skip=skip, limit=limit)
|
> List[Entity] get_attached_entities(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get Attached Entities
|
Get Attached Entities
|
||||||
@@ -392,12 +391,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->get_attached_entities: %s\n" % e)
|
print("Exception when calling EntitiesApi->get_attached_entities: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------- | ----------- | --------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -413,16 +414,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_entity_by_did**
|
# **get_entity_by_did**
|
||||||
|
|
||||||
> Entity get_entity_by_did(entity_did=entity_did)
|
> Entity get_entity_by_did(entity_did=entity_did)
|
||||||
|
|
||||||
Get Entity By Did
|
Get Entity By Did
|
||||||
@@ -448,7 +447,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
api_instance = openapi_client.EntitiesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get Entity By Did
|
# Get Entity By Did
|
||||||
@@ -459,11 +458,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->get_entity_by_did: %s\n" % e)
|
print("Exception when calling EntitiesApi->get_entity_by_did: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -479,82 +480,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
# **get_entity_by_name_or_did**
|
|
||||||
|
|
||||||
> Entity get_entity_by_name_or_did(entity_name_or_did=entity_name_or_did)
|
|
||||||
|
|
||||||
Get Entity By Name Or Did
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
import time
|
|
||||||
import os
|
|
||||||
import openapi_client
|
|
||||||
from openapi_client.models.entity import Entity
|
|
||||||
from openapi_client.rest import ApiException
|
|
||||||
from pprint import pprint
|
|
||||||
|
|
||||||
# Defining the host is optional and defaults to http://localhost
|
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
|
||||||
configuration = openapi_client.Configuration(
|
|
||||||
host = "http://localhost"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
|
||||||
with openapi_client.ApiClient(configuration) as api_client:
|
|
||||||
# Create an instance of the API class
|
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
|
||||||
entity_name_or_did = 'C1' # str | (optional) (default to 'C1')
|
|
||||||
|
|
||||||
try:
|
|
||||||
# Get Entity By Name Or Did
|
|
||||||
api_response = api_instance.get_entity_by_name_or_did(entity_name_or_did=entity_name_or_did)
|
|
||||||
print("The response of EntitiesApi->get_entity_by_name_or_did:\n")
|
|
||||||
pprint(api_response)
|
|
||||||
except Exception as e:
|
|
||||||
print("Exception when calling EntitiesApi->get_entity_by_name_or_did: %s\n" % e)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
|
||||||
| ---------------------- | ------- | ----------- | ------------------------------------ |
|
|
||||||
| **entity_name_or_did** | **str** | | [optional] [default to 'C1'] |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**Entity**](Entity.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
| ----------- | ------------------- | ---------------- |
|
|
||||||
| **200** | Successful Response | - |
|
|
||||||
| **422** | Validation Error | - |
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_entity_by_roles**
|
# **get_entity_by_roles**
|
||||||
|
|
||||||
> List[Entity] get_entity_by_roles(roles)
|
> List[Entity] get_entity_by_roles(roles)
|
||||||
|
|
||||||
Get Entity By Roles
|
Get Entity By Roles
|
||||||
@@ -592,11 +525,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->get_entity_by_roles: %s\n" % e)
|
print("Exception when calling EntitiesApi->get_entity_by_roles: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------------------------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **roles** | [**List[Role]**](Role.md) | |
|
**roles** | [**List[Role]**](Role.md)| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -612,16 +547,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **is_attached**
|
# **is_attached**
|
||||||
|
|
||||||
> Dict[str, str] is_attached(entity_did=entity_did)
|
> Dict[str, str] is_attached(entity_did=entity_did)
|
||||||
|
|
||||||
Is Attached
|
Is Attached
|
||||||
@@ -646,7 +579,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.EntitiesApi(api_client)
|
api_instance = openapi_client.EntitiesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Is Attached
|
# Is Attached
|
||||||
@@ -657,11 +590,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->is_attached: %s\n" % e)
|
print("Exception when calling EntitiesApi->is_attached: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -677,10 +612,10 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# Entity
|
# Entity
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| -------------------- | ------------------------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **did** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **name** | **str** | |
|
**did** | **str** | |
|
||||||
| **ip** | **str** | |
|
**name** | **str** | |
|
||||||
| **network** | **str** | |
|
**ip** | **str** | |
|
||||||
| **visible** | **bool** | |
|
**network** | **str** | |
|
||||||
| **other** | **object** | |
|
**visible** | **bool** | |
|
||||||
| **attached** | **bool** | |
|
**other** | **object** | |
|
||||||
| **stop_health_task** | **bool** | |
|
**attached** | **bool** | |
|
||||||
| **roles** | [**List[Role]**](Role.md) | |
|
**stop_health_task** | **bool** | |
|
||||||
|
**roles** | [**List[Role]**](Role.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -31,5 +31,6 @@ entity_dict = entity_instance.to_dict()
|
|||||||
# create an instance of Entity from a dict
|
# create an instance of Entity from a dict
|
||||||
entity_form_dict = entity.from_dict(entity_dict)
|
entity_form_dict = entity.from_dict(entity_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# EntityCreate
|
# EntityCreate
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ----------- | ------------------------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **did** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **name** | **str** | |
|
**did** | **str** | |
|
||||||
| **ip** | **str** | |
|
**name** | **str** | |
|
||||||
| **network** | **str** | |
|
**ip** | **str** | |
|
||||||
| **visible** | **bool** | |
|
**network** | **str** | |
|
||||||
| **other** | **object** | |
|
**visible** | **bool** | |
|
||||||
| **roles** | [**List[Role]**](Role.md) | |
|
**other** | **object** | |
|
||||||
|
**roles** | [**List[Role]**](Role.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -29,5 +29,6 @@ entity_create_dict = entity_create_instance.to_dict()
|
|||||||
# create an instance of EntityCreate from a dict
|
# create an instance of EntityCreate from a dict
|
||||||
entity_create_form_dict = entity_create.from_dict(entity_create_dict)
|
entity_create_form_dict = entity_create.from_dict(entity_create_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
# Eventmessage
|
# Eventmessage
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ------------- | ---------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **timestamp** | **int** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **group** | **int** | |
|
**timestamp** | **int** | |
|
||||||
| **group_id** | **int** | |
|
**group** | **int** | |
|
||||||
| **msg_type** | **int** | |
|
**group_id** | **int** | |
|
||||||
| **src_did** | **str** | |
|
**msg_type** | **int** | |
|
||||||
| **des_did** | **str** | |
|
**src_did** | **str** | |
|
||||||
| **msg** | **object** | |
|
**des_did** | **str** | |
|
||||||
| **id** | **int** | |
|
**msg** | **object** | |
|
||||||
|
**id** | **int** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -30,5 +30,6 @@ eventmessage_dict = eventmessage_instance.to_dict()
|
|||||||
# create an instance of Eventmessage from a dict
|
# create an instance of Eventmessage from a dict
|
||||||
eventmessage_form_dict = eventmessage.from_dict(eventmessage_dict)
|
eventmessage_form_dict = eventmessage.from_dict(eventmessage_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# EventmessageCreate
|
# EventmessageCreate
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ------------- | ---------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **timestamp** | **int** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **group** | **int** | |
|
**timestamp** | **int** | |
|
||||||
| **group_id** | **int** | |
|
**group** | **int** | |
|
||||||
| **msg_type** | **int** | |
|
**group_id** | **int** | |
|
||||||
| **src_did** | **str** | |
|
**msg_type** | **int** | |
|
||||||
| **des_did** | **str** | |
|
**src_did** | **str** | |
|
||||||
| **msg** | **object** | |
|
**des_did** | **str** | |
|
||||||
|
**msg** | **object** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -29,5 +29,6 @@ eventmessage_create_dict = eventmessage_create_instance.to_dict()
|
|||||||
# create an instance of EventmessageCreate from a dict
|
# create an instance of EventmessageCreate from a dict
|
||||||
eventmessage_create_form_dict = eventmessage_create.from_dict(eventmessage_create_dict)
|
eventmessage_create_form_dict = eventmessage_create.from_dict(eventmessage_create_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# openapi_client.EventmessagesApi
|
# openapi_client.EventmessagesApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**create_eventmessage**](EventmessagesApi.md#create_eventmessage) | **POST** /api/v1/event_message | Create Eventmessage
|
||||||
|
[**get_all_eventmessages**](EventmessagesApi.md#get_all_eventmessages) | **GET** /api/v1/event_messages | Get All Eventmessages
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| ---------------------------------------------------------------------- | ------------------------------ | --------------------- |
|
|
||||||
| [**create_eventmessage**](EventmessagesApi.md#create_eventmessage) | **POST** /api/v1/event_message | Create Eventmessage |
|
|
||||||
| [**get_all_eventmessages**](EventmessagesApi.md#get_all_eventmessages) | **GET** /api/v1/event_messages | Get All Eventmessages |
|
|
||||||
|
|
||||||
# **create_eventmessage**
|
# **create_eventmessage**
|
||||||
|
|
||||||
> Eventmessage create_eventmessage(eventmessage_create)
|
> Eventmessage create_eventmessage(eventmessage_create)
|
||||||
|
|
||||||
Create Eventmessage
|
Create Eventmessage
|
||||||
@@ -46,11 +46,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EventmessagesApi->create_eventmessage: %s\n" % e)
|
print("Exception when calling EventmessagesApi->create_eventmessage: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| ----------------------- | ----------------------------------------------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **eventmessage_create** | [**EventmessageCreate**](EventmessageCreate.md) | |
|
**eventmessage_create** | [**EventmessageCreate**](EventmessageCreate.md)| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -66,16 +68,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_all_eventmessages**
|
# **get_all_eventmessages**
|
||||||
|
|
||||||
> List[Eventmessage] get_all_eventmessages(skip=skip, limit=limit)
|
> List[Eventmessage] get_all_eventmessages(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get All Eventmessages
|
Get All Eventmessages
|
||||||
@@ -113,12 +113,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EventmessagesApi->get_all_eventmessages: %s\n" % e)
|
print("Exception when calling EventmessagesApi->get_all_eventmessages: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------- | ----------- | --------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -134,10 +136,10 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# HTTPValidationError
|
# HTTPValidationError
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ---------- | ----------------------------------------------- | ----------- | ---------- |
|
Name | Type | Description | Notes
|
||||||
| **detail** | [**List[ValidationError]**](ValidationError.md) | | [optional] |
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**detail** | [**List[ValidationError]**](ValidationError.md) | | [optional]
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -23,5 +23,6 @@ http_validation_error_dict = http_validation_error_instance.to_dict()
|
|||||||
# create an instance of HTTPValidationError from a dict
|
# create an instance of HTTPValidationError from a dict
|
||||||
http_validation_error_form_dict = http_validation_error.from_dict(http_validation_error_dict)
|
http_validation_error_form_dict = http_validation_error.from_dict(http_validation_error_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Machine
|
# Machine
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ---------- | ----------------------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **name** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **status** | [**Status**](Status.md) | |
|
**name** | **str** | |
|
||||||
|
**status** | [**Status**](Status.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -24,5 +24,6 @@ machine_dict = machine_instance.to_dict()
|
|||||||
# create an instance of Machine from a dict
|
# create an instance of Machine from a dict
|
||||||
machine_form_dict = machine.from_dict(machine_dict)
|
machine_form_dict = machine.from_dict(machine_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
77
pkgs/clan-cli/tests/openapi_client/docs/RepositoriesApi.md
Normal file
77
pkgs/clan-cli/tests/openapi_client/docs/RepositoriesApi.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# openapi_client.RepositoriesApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**get_all_repositories**](RepositoriesApi.md#get_all_repositories) | **GET** /api/v1/repositories | Get All Repositories
|
||||||
|
|
||||||
|
|
||||||
|
# **get_all_repositories**
|
||||||
|
> List[Service] get_all_repositories(skip=skip, limit=limit)
|
||||||
|
|
||||||
|
Get All Repositories
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.models.service import Service
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to http://localhost
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = openapi_client.Configuration(
|
||||||
|
host = "http://localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = openapi_client.RepositoriesApi(api_client)
|
||||||
|
skip = 0 # int | (optional) (default to 0)
|
||||||
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Get All Repositories
|
||||||
|
api_response = api_instance.get_all_repositories(skip=skip, limit=limit)
|
||||||
|
print("The response of RepositoriesApi->get_all_repositories:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except Exception as e:
|
||||||
|
print("Exception when calling RepositoriesApi->get_all_repositories: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List[Service]**](Service.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Successful Response | - |
|
||||||
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
# Resolution
|
# Resolution
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ------------------ | ------------ | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **requester_name** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **requester_did** | **str** | |
|
**requester_name** | **str** | |
|
||||||
| **resolved_did** | **str** | |
|
**requester_did** | **str** | |
|
||||||
| **other** | **object** | |
|
**resolved_did** | **str** | |
|
||||||
| **timestamp** | **datetime** | |
|
**other** | **object** | |
|
||||||
| **id** | **int** | |
|
**timestamp** | **datetime** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -28,5 +27,6 @@ resolution_dict = resolution_instance.to_dict()
|
|||||||
# create an instance of Resolution from a dict
|
# create an instance of Resolution from a dict
|
||||||
resolution_form_dict = resolution.from_dict(resolution_dict)
|
resolution_form_dict = resolution.from_dict(resolution_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# openapi_client.ResolutionApi
|
# openapi_client.ResolutionApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**get_all_resolutions**](ResolutionApi.md#get_all_resolutions) | **GET** /api/v1/resolutions | Get All Resolutions
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| --------------------------------------------------------------- | --------------------------- | ------------------- |
|
|
||||||
| [**get_all_resolutions**](ResolutionApi.md#get_all_resolutions) | **GET** /api/v1/resolutions | Get All Resolutions |
|
|
||||||
|
|
||||||
# **get_all_resolutions**
|
# **get_all_resolutions**
|
||||||
|
|
||||||
> List[Resolution] get_all_resolutions(skip=skip, limit=limit)
|
> List[Resolution] get_all_resolutions(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get All Resolutions
|
Get All Resolutions
|
||||||
@@ -45,12 +45,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ResolutionApi->get_all_resolutions: %s\n" % e)
|
print("Exception when calling ResolutionApi->get_all_resolutions: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------- | ----------- | --------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -66,10 +68,10 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
An enumeration.
|
An enumeration.
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
| Name | Type | Description | Notes |
|
------------ | ------------- | ------------- | -------------
|
||||||
| ---- | ---- | ----------- | ----- |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
# Service
|
# Service
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ---------------- | ----------------------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **uuid** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **service_name** | **str** | |
|
**uuid** | **str** | |
|
||||||
| **service_type** | **str** | |
|
**service_name** | **str** | |
|
||||||
| **endpoint_url** | **str** | |
|
**service_type** | **str** | |
|
||||||
| **status** | **str** | |
|
**endpoint_url** | **str** | |
|
||||||
| **other** | **object** | |
|
**other** | **object** | |
|
||||||
| **entity_did** | **str** | |
|
**entity_did** | **str** | |
|
||||||
| **entity** | [**Entity**](Entity.md) | |
|
**status** | **object** | |
|
||||||
|
**action** | **object** | |
|
||||||
|
**usage** | [**List[ServiceUsage]**](ServiceUsage.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -30,5 +31,6 @@ service_dict = service_instance.to_dict()
|
|||||||
# create an instance of Service from a dict
|
# create an instance of Service from a dict
|
||||||
service_form_dict = service.from_dict(service_dict)
|
service_form_dict = service.from_dict(service_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
# ServiceCreate
|
# ServiceCreate
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ---------------- | ---------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **uuid** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **service_name** | **str** | |
|
**uuid** | **str** | |
|
||||||
| **service_type** | **str** | |
|
**service_name** | **str** | |
|
||||||
| **endpoint_url** | **str** | |
|
**service_type** | **str** | |
|
||||||
| **status** | **str** | |
|
**endpoint_url** | **str** | |
|
||||||
| **other** | **object** | |
|
**other** | **object** | |
|
||||||
| **entity_did** | **str** | |
|
**entity_did** | **str** | |
|
||||||
|
**status** | **object** | |
|
||||||
|
**action** | **object** | |
|
||||||
|
**usage** | [**List[ServiceUsageCreate]**](ServiceUsageCreate.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -29,5 +31,6 @@ service_create_dict = service_create_instance.to_dict()
|
|||||||
# create an instance of ServiceCreate from a dict
|
# create an instance of ServiceCreate from a dict
|
||||||
service_create_form_dict = service_create.from_dict(service_create_dict)
|
service_create_form_dict = service_create.from_dict(service_create_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
pkgs/clan-cli/tests/openapi_client/docs/ServiceUsage.md
Normal file
29
pkgs/clan-cli/tests/openapi_client/docs/ServiceUsage.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# ServiceUsage
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**times_consumed** | **int** | |
|
||||||
|
**consumer_entity_did** | **str** | |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from openapi_client.models.service_usage import ServiceUsage
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of ServiceUsage from a JSON string
|
||||||
|
service_usage_instance = ServiceUsage.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print ServiceUsage.to_json()
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
service_usage_dict = service_usage_instance.to_dict()
|
||||||
|
# create an instance of ServiceUsage from a dict
|
||||||
|
service_usage_form_dict = service_usage.from_dict(service_usage_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# ServiceUsageCreate
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**times_consumed** | **int** | |
|
||||||
|
**consumer_entity_did** | **str** | |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of ServiceUsageCreate from a JSON string
|
||||||
|
service_usage_create_instance = ServiceUsageCreate.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print ServiceUsageCreate.to_json()
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
service_usage_create_dict = service_usage_create_instance.to_dict()
|
||||||
|
# create an instance of ServiceUsageCreate from a dict
|
||||||
|
service_usage_create_form_dict = service_usage_create.from_dict(service_usage_create_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,89 @@
|
|||||||
# openapi_client.ServicesApi
|
# openapi_client.ServicesApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
Method | HTTP request | Description
|
||||||
| ----------------------------------------------------------------------------- | --------------------------------------- | --------------------------- |
|
------------- | ------------- | -------------
|
||||||
| [**create_service**](ServicesApi.md#create_service) | **POST** /api/v1/service | Create Service |
|
[**add_service_usage**](ServicesApi.md#add_service_usage) | **POST** /api/v1/service_usage | Add Service Usage
|
||||||
| [**delete_service**](ServicesApi.md#delete_service) | **DELETE** /api/v1/service | Delete Service |
|
[**create_service**](ServicesApi.md#create_service) | **POST** /api/v1/service | Create Service
|
||||||
| [**get_all_services**](ServicesApi.md#get_all_services) | **GET** /api/v1/services | Get All Services |
|
[**delete_service**](ServicesApi.md#delete_service) | **DELETE** /api/v1/service | Delete Service
|
||||||
| [**get_service_by_did**](ServicesApi.md#get_service_by_did) | **GET** /api/v1/service | Get Service By Did |
|
[**get_all_services**](ServicesApi.md#get_all_services) | **GET** /api/v1/services | Get All Services
|
||||||
| [**get_services_without_entity**](ServicesApi.md#get_services_without_entity) | **GET** /api/v1/services_without_entity | Get Services Without Entity |
|
[**get_service_by_did**](ServicesApi.md#get_service_by_did) | **GET** /api/v1/service_by_did | Get Service By Did
|
||||||
|
[**get_service_by_uuid**](ServicesApi.md#get_service_by_uuid) | **GET** /api/v1/service | Get Service By Uuid
|
||||||
|
[**get_services_without_entity**](ServicesApi.md#get_services_without_entity) | **GET** /api/v1/services_without_entity | Get Services Without Entity
|
||||||
|
[**inc_service_usage**](ServicesApi.md#inc_service_usage) | **PUT** /api/v1/inc_service_usage | Inc Service Usage
|
||||||
|
|
||||||
|
|
||||||
|
# **add_service_usage**
|
||||||
|
> Service add_service_usage(service_usage_create, service_uuid=service_uuid)
|
||||||
|
|
||||||
|
Add Service Usage
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.models.service import Service
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to http://localhost
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = openapi_client.Configuration(
|
||||||
|
host = "http://localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
|
service_usage_create = openapi_client.ServiceUsageCreate() # ServiceUsageCreate |
|
||||||
|
service_uuid = 'bdd640fb-0667-1ad1-1c80-317fa3b1799d' # str | (optional) (default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d')
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Add Service Usage
|
||||||
|
api_response = api_instance.add_service_usage(service_usage_create, service_uuid=service_uuid)
|
||||||
|
print("The response of ServicesApi->add_service_usage:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except Exception as e:
|
||||||
|
print("Exception when calling ServicesApi->add_service_usage: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**service_usage_create** | [**ServiceUsageCreate**](ServiceUsageCreate.md)| |
|
||||||
|
**service_uuid** | **str**| | [optional] [default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d']
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Service**](Service.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Successful Response | - |
|
||||||
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **create_service**
|
# **create_service**
|
||||||
|
|
||||||
> Service create_service(service_create)
|
> Service create_service(service_create)
|
||||||
|
|
||||||
Create Service
|
Create Service
|
||||||
@@ -49,11 +121,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ServicesApi->create_service: %s\n" % e)
|
print("Exception when calling ServicesApi->create_service: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| ------------------ | ------------------------------------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **service_create** | [**ServiceCreate**](ServiceCreate.md) | |
|
**service_create** | [**ServiceCreate**](ServiceCreate.md)| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -69,16 +143,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **delete_service**
|
# **delete_service**
|
||||||
|
|
||||||
> Dict[str, str] delete_service(entity_did=entity_did)
|
> Dict[str, str] delete_service(entity_did=entity_did)
|
||||||
|
|
||||||
Delete Service
|
Delete Service
|
||||||
@@ -103,7 +175,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.ServicesApi(api_client)
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete Service
|
# Delete Service
|
||||||
@@ -114,11 +186,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ServicesApi->delete_service: %s\n" % e)
|
print("Exception when calling ServicesApi->delete_service: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -134,16 +208,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_all_services**
|
# **get_all_services**
|
||||||
|
|
||||||
> List[Service] get_all_services(skip=skip, limit=limit)
|
> List[Service] get_all_services(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get All Services
|
Get All Services
|
||||||
@@ -181,12 +253,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ServicesApi->get_all_services: %s\n" % e)
|
print("Exception when calling ServicesApi->get_all_services: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------- | ------- | ----------- | --------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -202,16 +276,14 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_service_by_did**
|
# **get_service_by_did**
|
||||||
|
|
||||||
> List[Service] get_service_by_did(entity_did=entity_did, skip=skip, limit=limit)
|
> List[Service] get_service_by_did(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
|
|
||||||
Get Service By Did
|
Get Service By Did
|
||||||
@@ -237,7 +309,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.ServicesApi(api_client)
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
skip = 0 # int | (optional) (default to 0)
|
skip = 0 # int | (optional) (default to 0)
|
||||||
limit = 100 # int | (optional) (default to 100)
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
@@ -250,13 +322,15 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ServicesApi->get_service_by_did: %s\n" % e)
|
print("Exception when calling ServicesApi->get_service_by_did: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -272,16 +346,84 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **get_service_by_uuid**
|
||||||
|
> Service get_service_by_uuid(uuid=uuid, skip=skip, limit=limit)
|
||||||
|
|
||||||
|
Get Service By Uuid
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.models.service import Service
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to http://localhost
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = openapi_client.Configuration(
|
||||||
|
host = "http://localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
|
uuid = 'bdd640fb-0667-1ad1-1c80-317fa3b1799d' # str | (optional) (default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d')
|
||||||
|
skip = 0 # int | (optional) (default to 0)
|
||||||
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Get Service By Uuid
|
||||||
|
api_response = api_instance.get_service_by_uuid(uuid=uuid, skip=skip, limit=limit)
|
||||||
|
print("The response of ServicesApi->get_service_by_uuid:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except Exception as e:
|
||||||
|
print("Exception when calling ServicesApi->get_service_by_uuid: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**uuid** | **str**| | [optional] [default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d']
|
||||||
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Service**](Service.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Successful Response | - |
|
||||||
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **get_services_without_entity**
|
# **get_services_without_entity**
|
||||||
|
|
||||||
> List[Service] get_services_without_entity(entity_did=entity_did, skip=skip, limit=limit)
|
> List[Service] get_services_without_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
|
|
||||||
Get Services Without Entity
|
Get Services Without Entity
|
||||||
@@ -307,7 +449,7 @@ configuration = openapi_client.Configuration(
|
|||||||
with openapi_client.ApiClient(configuration) as api_client:
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = openapi_client.ServicesApi(api_client)
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
skip = 0 # int | (optional) (default to 0)
|
skip = 0 # int | (optional) (default to 0)
|
||||||
limit = 100 # int | (optional) (default to 100)
|
limit = 100 # int | (optional) (default to 100)
|
||||||
|
|
||||||
@@ -320,13 +462,15 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling ServicesApi->get_services_without_entity: %s\n" % e)
|
print("Exception when calling ServicesApi->get_services_without_entity: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| -------------- | ------- | ----------- | --------------------------------------------------- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_did** | **str** | | [optional] [default to 'did:sov:test:1234'] |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
| **skip** | **int** | | [optional] [default to 0] |
|
**skip** | **int**| | [optional] [default to 0]
|
||||||
| **limit** | **int** | | [optional] [default to 100] |
|
**limit** | **int**| | [optional] [default to 100]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -342,10 +486,81 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
| ----------- | ------------------- | ---------------- |
|
|-------------|-------------|------------------|
|
||||||
| **200** | Successful Response | - |
|
**200** | Successful Response | - |
|
||||||
| **422** | Validation Error | - |
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **inc_service_usage**
|
||||||
|
> Service inc_service_usage(service_usage_create, consumer_entity_did=consumer_entity_did, service_uuid=service_uuid)
|
||||||
|
|
||||||
|
Inc Service Usage
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.models.service import Service
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to http://localhost
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = openapi_client.Configuration(
|
||||||
|
host = "http://localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with openapi_client.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = openapi_client.ServicesApi(api_client)
|
||||||
|
service_usage_create = openapi_client.ServiceUsageCreate() # ServiceUsageCreate |
|
||||||
|
consumer_entity_did = 'did:sov:test:120' # str | (optional) (default to 'did:sov:test:120')
|
||||||
|
service_uuid = 'bdd640fb-0667-1ad1-1c80-317fa3b1799d' # str | (optional) (default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d')
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Inc Service Usage
|
||||||
|
api_response = api_instance.inc_service_usage(service_usage_create, consumer_entity_did=consumer_entity_did, service_uuid=service_uuid)
|
||||||
|
print("The response of ServicesApi->inc_service_usage:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except Exception as e:
|
||||||
|
print("Exception when calling ServicesApi->inc_service_usage: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**service_usage_create** | [**ServiceUsageCreate**](ServiceUsageCreate.md)| |
|
||||||
|
**consumer_entity_did** | **str**| | [optional] [default to 'did:sov:test:120']
|
||||||
|
**service_uuid** | **str**| | [optional] [default to 'bdd640fb-0667-1ad1-1c80-317fa3b1799d']
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Service**](Service.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Successful Response | - |
|
||||||
|
**422** | Validation Error | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
An enumeration.
|
An enumeration.
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
| Name | Type | Description | Notes |
|
------------ | ------------- | ------------- | -------------
|
||||||
| ---- | ---- | ----------- | ----- |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# ValidationError
|
# ValidationError
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| -------- | --------------------------------------------------------------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **loc** | [**List[ValidationErrorLocInner]**](ValidationErrorLocInner.md) | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **msg** | **str** | |
|
**loc** | [**List[ValidationErrorLocInner]**](ValidationErrorLocInner.md) | |
|
||||||
| **type** | **str** | |
|
**msg** | **str** | |
|
||||||
|
**type** | **str** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -25,5 +25,6 @@ validation_error_dict = validation_error_instance.to_dict()
|
|||||||
# create an instance of ValidationError from a dict
|
# create an instance of ValidationError from a dict
|
||||||
validation_error_form_dict = validation_error.from_dict(validation_error_dict)
|
validation_error_form_dict = validation_error.from_dict(validation_error_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# ValidationErrorLocInner
|
# ValidationErrorLocInner
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ---- | ---- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -22,5 +22,6 @@ validation_error_loc_inner_dict = validation_error_loc_inner_instance.to_dict()
|
|||||||
# create an instance of ValidationErrorLocInner from a dict
|
# create an instance of ValidationErrorLocInner from a dict
|
||||||
validation_error_loc_inner_form_dict = validation_error_loc_inner.from_dict(validation_error_loc_inner_dict)
|
validation_error_loc_inner_form_dict = validation_error_loc_inner.from_dict(validation_error_loc_inner_dict)
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ from openapi_client.models.resolution import Resolution
|
|||||||
from openapi_client.models.role import Role
|
from openapi_client.models.role import Role
|
||||||
from openapi_client.models.service import Service
|
from openapi_client.models.service import Service
|
||||||
from openapi_client.models.service_create import ServiceCreate
|
from openapi_client.models.service_create import ServiceCreate
|
||||||
|
from openapi_client.models.service_usage import ServiceUsage
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
from openapi_client.models.status import Status
|
from openapi_client.models.status import Status
|
||||||
from openapi_client.models.validation_error import ValidationError
|
from openapi_client.models.validation_error import ValidationError
|
||||||
from openapi_client.models.validation_error_loc_inner import ValidationErrorLocInner
|
from openapi_client.models.validation_error_loc_inner import ValidationErrorLocInner
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import json
|
|||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
from pydantic import BaseModel, Field, StrictInt, StrictStr
|
from pydantic import BaseModel, Field, StrictStr
|
||||||
|
|
||||||
class Resolution(BaseModel):
|
class Resolution(BaseModel):
|
||||||
"""
|
"""
|
||||||
@@ -30,8 +30,7 @@ class Resolution(BaseModel):
|
|||||||
resolved_did: StrictStr = Field(...)
|
resolved_did: StrictStr = Field(...)
|
||||||
other: Dict[str, Any] = Field(...)
|
other: Dict[str, Any] = Field(...)
|
||||||
timestamp: datetime = Field(...)
|
timestamp: datetime = Field(...)
|
||||||
id: StrictInt = Field(...)
|
__properties = ["requester_name", "requester_did", "resolved_did", "other", "timestamp"]
|
||||||
__properties = ["requester_name", "requester_did", "resolved_did", "other", "timestamp", "id"]
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Pydantic configuration"""
|
"""Pydantic configuration"""
|
||||||
@@ -73,8 +72,7 @@ class Resolution(BaseModel):
|
|||||||
"requester_did": obj.get("requester_did"),
|
"requester_did": obj.get("requester_did"),
|
||||||
"resolved_did": obj.get("resolved_did"),
|
"resolved_did": obj.get("resolved_did"),
|
||||||
"other": obj.get("other"),
|
"other": obj.get("other"),
|
||||||
"timestamp": obj.get("timestamp"),
|
"timestamp": obj.get("timestamp")
|
||||||
"id": obj.get("id")
|
|
||||||
})
|
})
|
||||||
return _obj
|
return _obj
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import re # noqa: F401
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, List
|
||||||
from pydantic import BaseModel, Field, StrictStr
|
from pydantic import BaseModel, Field, StrictStr, conlist
|
||||||
from openapi_client.models.entity import Entity
|
from openapi_client.models.service_usage import ServiceUsage
|
||||||
|
|
||||||
class Service(BaseModel):
|
class Service(BaseModel):
|
||||||
"""
|
"""
|
||||||
@@ -30,11 +30,12 @@ class Service(BaseModel):
|
|||||||
service_name: StrictStr = Field(...)
|
service_name: StrictStr = Field(...)
|
||||||
service_type: StrictStr = Field(...)
|
service_type: StrictStr = Field(...)
|
||||||
endpoint_url: StrictStr = Field(...)
|
endpoint_url: StrictStr = Field(...)
|
||||||
status: StrictStr = Field(...)
|
|
||||||
other: Dict[str, Any] = Field(...)
|
other: Dict[str, Any] = Field(...)
|
||||||
entity_did: StrictStr = Field(...)
|
entity_did: StrictStr = Field(...)
|
||||||
entity: Entity = Field(...)
|
status: Dict[str, Any] = Field(...)
|
||||||
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "status", "other", "entity_did", "entity"]
|
action: Dict[str, Any] = Field(...)
|
||||||
|
usage: conlist(ServiceUsage) = Field(...)
|
||||||
|
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "other", "entity_did", "status", "action", "usage"]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Pydantic configuration"""
|
"""Pydantic configuration"""
|
||||||
@@ -60,9 +61,13 @@ class Service(BaseModel):
|
|||||||
exclude={
|
exclude={
|
||||||
},
|
},
|
||||||
exclude_none=True)
|
exclude_none=True)
|
||||||
# override the default output from pydantic by calling `to_dict()` of entity
|
# override the default output from pydantic by calling `to_dict()` of each item in usage (list)
|
||||||
if self.entity:
|
_items = []
|
||||||
_dict['entity'] = self.entity.to_dict()
|
if self.usage:
|
||||||
|
for _item in self.usage:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['usage'] = _items
|
||||||
return _dict
|
return _dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -79,10 +84,11 @@ class Service(BaseModel):
|
|||||||
"service_name": obj.get("service_name"),
|
"service_name": obj.get("service_name"),
|
||||||
"service_type": obj.get("service_type"),
|
"service_type": obj.get("service_type"),
|
||||||
"endpoint_url": obj.get("endpoint_url"),
|
"endpoint_url": obj.get("endpoint_url"),
|
||||||
"status": obj.get("status"),
|
|
||||||
"other": obj.get("other"),
|
"other": obj.get("other"),
|
||||||
"entity_did": obj.get("entity_did"),
|
"entity_did": obj.get("entity_did"),
|
||||||
"entity": Entity.from_dict(obj.get("entity")) if obj.get("entity") is not None else None
|
"status": obj.get("status"),
|
||||||
|
"action": obj.get("action"),
|
||||||
|
"usage": [ServiceUsage.from_dict(_item) for _item in obj.get("usage")] if obj.get("usage") is not None else None
|
||||||
})
|
})
|
||||||
return _obj
|
return _obj
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, List
|
||||||
from pydantic import BaseModel, Field, StrictStr
|
from pydantic import BaseModel, Field, StrictStr, conlist
|
||||||
|
from openapi_client.models.service_usage_create import ServiceUsageCreate
|
||||||
|
|
||||||
class ServiceCreate(BaseModel):
|
class ServiceCreate(BaseModel):
|
||||||
"""
|
"""
|
||||||
@@ -29,10 +30,12 @@ class ServiceCreate(BaseModel):
|
|||||||
service_name: StrictStr = Field(...)
|
service_name: StrictStr = Field(...)
|
||||||
service_type: StrictStr = Field(...)
|
service_type: StrictStr = Field(...)
|
||||||
endpoint_url: StrictStr = Field(...)
|
endpoint_url: StrictStr = Field(...)
|
||||||
status: StrictStr = Field(...)
|
|
||||||
other: Dict[str, Any] = Field(...)
|
other: Dict[str, Any] = Field(...)
|
||||||
entity_did: StrictStr = Field(...)
|
entity_did: StrictStr = Field(...)
|
||||||
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "status", "other", "entity_did"]
|
status: Dict[str, Any] = Field(...)
|
||||||
|
action: Dict[str, Any] = Field(...)
|
||||||
|
usage: conlist(ServiceUsageCreate) = Field(...)
|
||||||
|
__properties = ["uuid", "service_name", "service_type", "endpoint_url", "other", "entity_did", "status", "action", "usage"]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Pydantic configuration"""
|
"""Pydantic configuration"""
|
||||||
@@ -58,6 +61,13 @@ class ServiceCreate(BaseModel):
|
|||||||
exclude={
|
exclude={
|
||||||
},
|
},
|
||||||
exclude_none=True)
|
exclude_none=True)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in usage (list)
|
||||||
|
_items = []
|
||||||
|
if self.usage:
|
||||||
|
for _item in self.usage:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['usage'] = _items
|
||||||
return _dict
|
return _dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -74,9 +84,11 @@ class ServiceCreate(BaseModel):
|
|||||||
"service_name": obj.get("service_name"),
|
"service_name": obj.get("service_name"),
|
||||||
"service_type": obj.get("service_type"),
|
"service_type": obj.get("service_type"),
|
||||||
"endpoint_url": obj.get("endpoint_url"),
|
"endpoint_url": obj.get("endpoint_url"),
|
||||||
"status": obj.get("status"),
|
|
||||||
"other": obj.get("other"),
|
"other": obj.get("other"),
|
||||||
"entity_did": obj.get("entity_did")
|
"entity_did": obj.get("entity_did"),
|
||||||
|
"status": obj.get("status"),
|
||||||
|
"action": obj.get("action"),
|
||||||
|
"usage": [ServiceUsageCreate.from_dict(_item) for _item in obj.get("usage")] if obj.get("usage") is not None else None
|
||||||
})
|
})
|
||||||
return _obj
|
return _obj
|
||||||
|
|
||||||
|
|||||||
73
pkgs/clan-cli/tests/openapi_client/models/service_usage.py
Normal file
73
pkgs/clan-cli/tests/openapi_client/models/service_usage.py
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
FastAPI
|
||||||
|
|
||||||
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 0.1.0
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field, StrictInt, StrictStr
|
||||||
|
|
||||||
|
class ServiceUsage(BaseModel):
|
||||||
|
"""
|
||||||
|
ServiceUsage
|
||||||
|
"""
|
||||||
|
times_consumed: StrictInt = Field(...)
|
||||||
|
consumer_entity_did: StrictStr = Field(...)
|
||||||
|
__properties = ["times_consumed", "consumer_entity_did"]
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
"""Pydantic configuration"""
|
||||||
|
allow_population_by_field_name = True
|
||||||
|
validate_assignment = True
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.dict(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> ServiceUsage:
|
||||||
|
"""Create an instance of ServiceUsage from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Returns the dictionary representation of the model using alias"""
|
||||||
|
_dict = self.dict(by_alias=True,
|
||||||
|
exclude={
|
||||||
|
},
|
||||||
|
exclude_none=True)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: dict) -> ServiceUsage:
|
||||||
|
"""Create an instance of ServiceUsage from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return ServiceUsage.parse_obj(obj)
|
||||||
|
|
||||||
|
_obj = ServiceUsage.parse_obj({
|
||||||
|
"times_consumed": obj.get("times_consumed"),
|
||||||
|
"consumer_entity_did": obj.get("consumer_entity_did")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
FastAPI
|
||||||
|
|
||||||
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 0.1.0
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field, StrictInt, StrictStr
|
||||||
|
|
||||||
|
class ServiceUsageCreate(BaseModel):
|
||||||
|
"""
|
||||||
|
ServiceUsageCreate
|
||||||
|
"""
|
||||||
|
times_consumed: StrictInt = Field(...)
|
||||||
|
consumer_entity_did: StrictStr = Field(...)
|
||||||
|
__properties = ["times_consumed", "consumer_entity_did"]
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
"""Pydantic configuration"""
|
||||||
|
allow_population_by_field_name = True
|
||||||
|
validate_assignment = True
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.dict(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> ServiceUsageCreate:
|
||||||
|
"""Create an instance of ServiceUsageCreate from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Returns the dictionary representation of the model using alias"""
|
||||||
|
_dict = self.dict(by_alias=True,
|
||||||
|
exclude={
|
||||||
|
},
|
||||||
|
exclude_none=True)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: dict) -> ServiceUsageCreate:
|
||||||
|
"""Create an instance of ServiceUsageCreate from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return ServiceUsageCreate.parse_obj(obj)
|
||||||
|
|
||||||
|
_obj = ServiceUsageCreate.parse_obj({
|
||||||
|
"times_consumed": obj.get("times_consumed"),
|
||||||
|
"consumer_entity_did": obj.get("consumer_entity_did")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ random.seed(42)
|
|||||||
host = config.host
|
host = config.host
|
||||||
port_dlg = config.port_dlg
|
port_dlg = config.port_dlg
|
||||||
port_ap = config.port_ap
|
port_ap = config.port_ap
|
||||||
port_client_base = config.port_client_base
|
port_client_base = config._port_client_base
|
||||||
|
|
||||||
num_uuids = 100
|
num_uuids = 100
|
||||||
uuids = [str(uuid.UUID(int=random.getrandbits(128))) for i in range(num_uuids)]
|
uuids = [str(uuid.UUID(int=random.getrandbits(128))) for i in range(num_uuids)]
|
||||||
@@ -38,7 +38,7 @@ def test_health(api_client: ApiClient) -> None:
|
|||||||
assert res.status == Status.ONLINE
|
assert res.status == Status.ONLINE
|
||||||
|
|
||||||
|
|
||||||
def create_entities(num: int = 10, role: str = "entity") -> list[EntityCreate]:
|
def create_entities(num: int = 5, role: str = "entity") -> list[EntityCreate]:
|
||||||
res = []
|
res = []
|
||||||
for i in range(num):
|
for i in range(num):
|
||||||
en = EntityCreate(
|
en = EntityCreate(
|
||||||
@@ -79,10 +79,23 @@ def create_service(idx: int, entity: Entity) -> ServiceCreate:
|
|||||||
uuid=uuids[idx],
|
uuid=uuids[idx],
|
||||||
service_name=f"Carlos Printing{idx}",
|
service_name=f"Carlos Printing{idx}",
|
||||||
service_type="3D Printing",
|
service_type="3D Printing",
|
||||||
endpoint_url=f"{entity.ip}/v1/print_daemon{idx}",
|
endpoint_url=f"http://{entity.ip}/v1/print_daemon{idx}",
|
||||||
status="unknown",
|
status={"data": ["draft", "registered"]},
|
||||||
other={"action": ["register", "deregister", "delete", "create"]},
|
other={},
|
||||||
|
action={
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"name": "register",
|
||||||
|
"endpoint": f"http://{entity.ip}/v1/print_daemon{idx}/register",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "deregister",
|
||||||
|
"endpoint": f"http://{entity.ip}/v1/print_daemon{idx}/deregister",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
entity_did=entity.did,
|
entity_did=entity.did,
|
||||||
|
usage=[{"times_consumed": 2, "consumer_entity_did": "did:sov:test:120"}],
|
||||||
)
|
)
|
||||||
|
|
||||||
return se
|
return se
|
||||||
@@ -101,8 +114,7 @@ def test_create_services(api_client: ApiClient) -> None:
|
|||||||
sapi = ServicesApi(api_client=api_client)
|
sapi = ServicesApi(api_client=api_client)
|
||||||
eapi = EntitiesApi(api_client=api_client)
|
eapi = EntitiesApi(api_client=api_client)
|
||||||
for midx, entity in enumerate(eapi.get_all_entities()):
|
for midx, entity in enumerate(eapi.get_all_entities()):
|
||||||
for idx in range(4):
|
service_obj = create_service(midx, entity)
|
||||||
service_obj = create_service(idx + 4 * midx, entity)
|
|
||||||
service = sapi.create_service(service_obj)
|
service = sapi.create_service(service_obj)
|
||||||
assert service.uuid == service_obj.uuid
|
assert service.uuid == service_obj.uuid
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ fetchzip }:
|
{ fetchzip }:
|
||||||
fetchzip {
|
fetchzip {
|
||||||
url = "https://gitea.gchq.icu/api/packages/IoSL/generic/IoSL-service-aware-frontend/04h6w20fgq1zd4qzqm1rqkyk1s3mxnra1088icdrshsdm29x81xa/assets.tar.gz";
|
url = "https://gitea.gchq.icu/api/packages/IoSL/generic/IoSL-service-aware-frontend/0pbv23wd89x487ik4hbxgyghqvj95cb42sq44vzki3yghfdc5miw/assets.tar.gz";
|
||||||
sha256 = "04h6w20fgq1zd4qzqm1rqkyk1s3mxnra1088icdrshsdm29x81xa";
|
sha256 = "0pbv23wd89x487ik4hbxgyghqvj95cb42sq44vzki3yghfdc5miw";
|
||||||
}
|
}
|
||||||
|
|||||||
49
pkgs/ui/src/components/error_boundary.tsx
Normal file
49
pkgs/ui/src/components/error_boundary.tsx
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface State {
|
||||||
|
hasError: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ErrorBoundary extends React.Component<Props, State> {
|
||||||
|
constructor(props: Props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
// Define a state variable to track whether is an error or not
|
||||||
|
this.state = { hasError: false };
|
||||||
|
}
|
||||||
|
static getDerivedStateFromError(error: Error): State {
|
||||||
|
console.error(error);
|
||||||
|
// Update state so the next render will show the fallback UI
|
||||||
|
return { hasError: true };
|
||||||
|
}
|
||||||
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {
|
||||||
|
// You can use your own error logging service here
|
||||||
|
console.log({ error, errorInfo });
|
||||||
|
}
|
||||||
|
render(): React.ReactNode {
|
||||||
|
// Check if the error is thrown
|
||||||
|
if (this.state.hasError) {
|
||||||
|
// You can render any custom fallback UI
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h2>Oops, there is an error!</h2>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => this.setState({ hasError: false })}
|
||||||
|
>
|
||||||
|
Try again?
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return children components in case of no error
|
||||||
|
return this.props.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ErrorBoundary;
|
||||||
@@ -45,6 +45,18 @@ const menuEntityEntries: MenuEntry[] = [
|
|||||||
to: "/client/C2",
|
to: "/client/C2",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: <PersonIcon />,
|
||||||
|
label: "C3",
|
||||||
|
to: "/client/C3",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <PersonIcon />,
|
||||||
|
label: "C4",
|
||||||
|
to: "/client/C4",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const menuEntries: MenuEntry[] = [
|
const menuEntries: MenuEntry[] = [
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { NoDataOverlay } from "@/components/noDataOverlay";
|
|||||||
import { StyledTableCell, StyledTableRow } from "./style";
|
import { StyledTableCell, StyledTableRow } from "./style";
|
||||||
import { ICustomTable, CustomTableConfiguration } from "@/types";
|
import { ICustomTable, CustomTableConfiguration } from "@/types";
|
||||||
import { Checkbox, Skeleton } from "@mui/material";
|
import { Checkbox, Skeleton } from "@mui/material";
|
||||||
|
import ErrorBoundary from "@/components/error_boundary";
|
||||||
|
|
||||||
const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
|
const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
|
||||||
if (loading)
|
if (loading)
|
||||||
@@ -35,11 +36,15 @@ const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
|
|||||||
|
|
||||||
// cover use case if we want to render a component
|
// cover use case if we want to render a component
|
||||||
if (render) renderedValue = render(value);
|
if (render) renderedValue = render(value);
|
||||||
|
if (typeof renderedValue === "object" && render === undefined) {
|
||||||
|
console.warn("Missing render function for column " + cellKey);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
|
<ErrorBoundary>
|
||||||
<StyledTableCell key={cellKey} align="left">
|
<StyledTableCell key={cellKey} align="left">
|
||||||
{renderedValue}
|
{renderedValue}
|
||||||
</StyledTableCell>
|
</StyledTableCell>
|
||||||
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,19 +54,28 @@ export const ServiceTableConfig = [
|
|||||||
{
|
{
|
||||||
key: "status",
|
key: "status",
|
||||||
label: "Status",
|
label: "Status",
|
||||||
|
render: (value: any) => {
|
||||||
|
let renderedValue: any = "";
|
||||||
|
if (Array.isArray(value.data)) {
|
||||||
|
renderedValue = value.data.join(", ");
|
||||||
|
} else {
|
||||||
|
console.error("Status is not an array", value);
|
||||||
|
}
|
||||||
|
return renderedValue;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "other",
|
key: "action",
|
||||||
label: "Action",
|
label: "Action",
|
||||||
render: (value: any) => {
|
render: (value: any) => {
|
||||||
let renderedValue: any = "";
|
let renderedValue: any = "";
|
||||||
|
console.log("value", value.data);
|
||||||
if (typeof value === "object")
|
if (typeof value === "object")
|
||||||
renderedValue = (
|
renderedValue = (
|
||||||
<>
|
<>
|
||||||
{value.action.map((actionType: string) => (
|
{value.data.map((actionType: any) => (
|
||||||
<>
|
<>
|
||||||
<code>{actionType}</code>
|
<Button>{actionType.name}</Button>
|
||||||
<br />
|
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
import { Button } from "@mui/material";
|
|
||||||
|
|
||||||
export const Client2ConsumerTableConfig = [
|
|
||||||
{
|
|
||||||
key: "service_name",
|
|
||||||
label: "Service name",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "service_type",
|
|
||||||
label: "Service Type",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "endpoint_url",
|
|
||||||
label: "End Point",
|
|
||||||
render: () => {
|
|
||||||
return (
|
|
||||||
<Button disabled variant="outlined">
|
|
||||||
Consume
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// key: "entity",
|
|
||||||
// label: "Entity",
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
key: "entity_did",
|
|
||||||
label: "Entity DID",
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// key: "network",
|
|
||||||
// label: "Network",
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const Client2ProducerTableConfig = [
|
|
||||||
{
|
|
||||||
key: "service_name",
|
|
||||||
label: "Service name",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "service_type",
|
|
||||||
label: "Service Type",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "endpoint_url",
|
|
||||||
label: "End Point",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "entity_did",
|
|
||||||
label: "Entity DID",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "status",
|
|
||||||
label: "Status",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "other",
|
|
||||||
label: "Action",
|
|
||||||
render: (value: any) => {
|
|
||||||
let renderedValue: any = "";
|
|
||||||
if (typeof value === "object")
|
|
||||||
renderedValue = (
|
|
||||||
<>
|
|
||||||
{value.action.map((actionType: string) => (
|
|
||||||
<>
|
|
||||||
<code>{actionType}</code>
|
|
||||||
<br />
|
|
||||||
</>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
return renderedValue;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
Reference in New Issue
Block a user