generated from Luis/nextjs-python-web-template
Trying to fix attach entity
This commit is contained in:
@@ -33,7 +33,6 @@ for u in cors_url:
|
|||||||
# Logging setup
|
# Logging setup
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def lifespan(app: FastAPI) -> Any:
|
async def lifespan(app: FastAPI) -> Any:
|
||||||
await socket_manager2.brd.connect()
|
await socket_manager2.brd.connect()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import logging
|
|||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
import asyncio
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from fastapi import APIRouter, BackgroundTasks, Depends
|
from fastapi import APIRouter, BackgroundTasks, Depends
|
||||||
@@ -30,7 +31,7 @@ log = logging.getLogger(__name__)
|
|||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
@router.post("/api/v1/service", response_model=Service, tags=[Tags.services])
|
@router.post("/api/v1/service", response_model=Service, tags=[Tags.services])
|
||||||
async 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 ...
|
# todo checken ob schon da ...
|
||||||
@@ -38,7 +39,7 @@ async def create_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])
|
||||||
async def get_all_services(
|
def get_all_services(
|
||||||
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
||||||
) -> List[sql_models.Service]:
|
) -> List[sql_models.Service]:
|
||||||
services = sql_crud.get_services(db, skip=skip, limit=limit)
|
services = sql_crud.get_services(db, skip=skip, limit=limit)
|
||||||
@@ -46,9 +47,9 @@ async def get_all_services(
|
|||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/{entity_did}/service", response_model=List[Service], tags=[Tags.services]
|
"/api/v1/service", response_model=List[Service], tags=[Tags.services]
|
||||||
)
|
)
|
||||||
async def get_service_by_did(
|
def get_service_by_did(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
skip: int = 0,
|
skip: int = 0,
|
||||||
limit: int = 100,
|
limit: int = 100,
|
||||||
@@ -59,25 +60,21 @@ async def get_service_by_did(
|
|||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/services_by_entity_name",
|
"/api/v1/services_without_entity",
|
||||||
response_model=ServicesByName,
|
response_model=List[Service],
|
||||||
tags=[Tags.services],
|
tags=[Tags.services],
|
||||||
)
|
)
|
||||||
async def get_services_by_name(
|
def get_services_without_entity(
|
||||||
entity_name: str,
|
entity_did: str = "did:sov:test:1234",
|
||||||
skip: int = 0,
|
skip: int = 0,
|
||||||
limit: int = 100,
|
limit: int = 100,
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> ServicesByName:
|
) -> List[sql_models.Service]:
|
||||||
entity = sql_crud.get_entity_by_name(db, name=entity_name)
|
service = sql_crud.get_services_without_entity_id(db, entity_did=entity_did)
|
||||||
if entity is None:
|
return service
|
||||||
raise ClanError(f"Entity with name '{entity_name}' not found")
|
|
||||||
services = sql_crud.get_services_by_entity_did(db, entity_did=str(entity.did))
|
|
||||||
return ServicesByName(entity=entity, services=services) # type: ignore
|
|
||||||
|
|
||||||
|
@router.delete("/api/v1/service", tags=[Tags.services])
|
||||||
@router.delete("/api/v1/{entity_did}/service", tags=[Tags.services])
|
def delete_service(
|
||||||
async def delete_service(
|
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
@@ -95,7 +92,7 @@ async def delete_service(
|
|||||||
response_model=List[Service],
|
response_model=List[Service],
|
||||||
tags=[Tags.repositories],
|
tags=[Tags.repositories],
|
||||||
)
|
)
|
||||||
async def get_all_repositories(
|
def get_all_repositories(
|
||||||
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
||||||
) -> List[sql_models.Service]:
|
) -> List[sql_models.Service]:
|
||||||
repositories = sql_crud.get_services(db, skip=skip, limit=limit)
|
repositories = sql_crud.get_services(db, skip=skip, limit=limit)
|
||||||
@@ -108,7 +105,7 @@ async def get_all_repositories(
|
|||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
@router.post("/api/v1/entity", response_model=Entity, tags=[Tags.entities])
|
@router.post("/api/v1/entity", response_model=Entity, tags=[Tags.entities])
|
||||||
async def create_entity(
|
def create_entity(
|
||||||
entity: EntityCreate, db: Session = Depends(sql_db.get_db)
|
entity: EntityCreate, db: Session = Depends(sql_db.get_db)
|
||||||
) -> EntityCreate:
|
) -> EntityCreate:
|
||||||
return sql_crud.create_entity(db, entity)
|
return sql_crud.create_entity(db, entity)
|
||||||
@@ -117,7 +114,7 @@ async def create_entity(
|
|||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/entity_by_name", response_model=Optional[Entity], tags=[Tags.entities]
|
"/api/v1/entity_by_name", response_model=Optional[Entity], tags=[Tags.entities]
|
||||||
)
|
)
|
||||||
async def get_entity_by_name(
|
def get_entity_by_name(
|
||||||
entity_name: str, db: Session = Depends(sql_db.get_db)
|
entity_name: str, db: Session = Depends(sql_db.get_db)
|
||||||
) -> Optional[sql_models.Entity]:
|
) -> Optional[sql_models.Entity]:
|
||||||
entity = sql_crud.get_entity_by_name(db, name=entity_name)
|
entity = sql_crud.get_entity_by_name(db, name=entity_name)
|
||||||
@@ -125,7 +122,7 @@ async def get_entity_by_name(
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/api/v1/entities", response_model=List[Entity], tags=[Tags.entities])
|
@router.get("/api/v1/entities", response_model=List[Entity], tags=[Tags.entities])
|
||||||
async def get_all_entities(
|
def get_all_entities(
|
||||||
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
||||||
) -> List[sql_models.Entity]:
|
) -> List[sql_models.Entity]:
|
||||||
entities = sql_crud.get_entities(db, skip=skip, limit=limit)
|
entities = sql_crud.get_entities(db, skip=skip, limit=limit)
|
||||||
@@ -133,9 +130,9 @@ async def get_all_entities(
|
|||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/{entity_did}/entity", response_model=Optional[Entity], tags=[Tags.entities]
|
"/api/v1/entity", response_model=Optional[Entity], tags=[Tags.entities]
|
||||||
)
|
)
|
||||||
async def get_entity_by_did(
|
def get_entity_by_did(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> Optional[sql_models.Entity]:
|
) -> Optional[sql_models.Entity]:
|
||||||
@@ -148,61 +145,103 @@ async def get_entity_by_did(
|
|||||||
response_model=List[Entity],
|
response_model=List[Entity],
|
||||||
tags=[Tags.entities],
|
tags=[Tags.entities],
|
||||||
)
|
)
|
||||||
async def get_attached_entities(
|
def get_attached_entities(
|
||||||
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
skip: int = 0, limit: int = 100, db: Session = Depends(sql_db.get_db)
|
||||||
) -> List[sql_models.Entity]:
|
) -> List[sql_models.Entity]:
|
||||||
entities = sql_crud.get_attached_entities(db, skip=skip, limit=limit)
|
entities = sql_crud.get_attached_entities(db, skip=skip, limit=limit)
|
||||||
return entities
|
return entities
|
||||||
|
|
||||||
|
@router.get("/api/v1/is_attached", tags=[Tags.entities])
|
||||||
@router.post("/api/v1/{entity_did}/detach", response_model=Entity, tags=[Tags.entities])
|
def is_attached(
|
||||||
async def detach_entity(
|
|
||||||
background_tasks: BackgroundTasks,
|
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
skip: int = 0,
|
db: Session = Depends(sql_db.get_db)) -> dict[str, str]:
|
||||||
limit: int = 100,
|
|
||||||
db: Session = Depends(sql_db.get_db),
|
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
) -> sql_models.Entity:
|
|
||||||
entity = sql_crud.set_attached_by_entity_did(db, entity_did, False)
|
if entity is None:
|
||||||
return entity
|
raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
|
|
||||||
|
timer = 0.0
|
||||||
|
timeout = 2
|
||||||
|
while not entity.attached:
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
timer += 0.1
|
||||||
|
if timer > timeout:
|
||||||
|
url = f"http://{entity.ip}"
|
||||||
|
raise ClanError(f"Entity at {url} not reachable")
|
||||||
|
|
||||||
|
return {"message": f"Attached to {entity.name} successfully"}
|
||||||
|
|
||||||
|
|
||||||
@router.post("/api/v1/{entity_did}/attach", tags=[Tags.entities])
|
|
||||||
async def attach_entity(
|
@router.post("/api/v1/detach", tags=[Tags.entities])
|
||||||
|
def detach_entity(
|
||||||
background_tasks: BackgroundTasks,
|
background_tasks: BackgroundTasks,
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
skip: int = 0,
|
skip: int = 0,
|
||||||
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]:
|
||||||
if sql_crud.get_entity_by_did(db, entity_did) is None:
|
sql_crud.stop_entity_health_task(db, entity_did)
|
||||||
raise ClanError(f"Entity with did '{entity_did}' not found")
|
return {"message": f"Detached {entity_did} successfully"}
|
||||||
|
|
||||||
background_tasks.add_task(attach_entity_loc, db, entity_did)
|
|
||||||
return {"message": "Attaching in the background"}
|
|
||||||
|
|
||||||
|
|
||||||
def attach_entity_loc(db: Session, entity_did: str) -> None:
|
@router.post("/api/v1/attach", tags=[Tags.entities])
|
||||||
db_entity = sql_crud.set_attached_by_entity_did(db, entity_did, True)
|
def attach_entity(
|
||||||
try:
|
background_tasks: BackgroundTasks,
|
||||||
while db_entity.attached:
|
entity_did: str = "did:sov:test:1234",
|
||||||
# query status endpoint
|
skip: int = 0,
|
||||||
# https://www.python-httpx.org/
|
limit: int = 100
|
||||||
response = httpx.get(f"http://{db_entity.ip}", timeout=2)
|
) -> dict[str, str]:
|
||||||
print(response)
|
# entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
# test with:
|
# if entity is None:
|
||||||
# while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N localhost 5555 ; done
|
# raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
# client test (apt install python3-httpx):
|
#url = f"http://{entity.ip}"
|
||||||
# httpx http://localhost:5555
|
#log.info("Start health query at", url)
|
||||||
# except not reached set false
|
background_tasks.add_task(attach_entity_loc, entity_did)
|
||||||
|
return {"message": f"Started attachment task for {entity_did}"}
|
||||||
|
|
||||||
|
|
||||||
|
def attach_entity_loc(entity_did: str) -> None:
|
||||||
|
with sql_db.SessionLocal() as db:
|
||||||
|
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
|
while entity.stop_health_task is False:
|
||||||
|
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
|
assert entity is not None
|
||||||
|
log.warning(f"Stop health status task for {entity.stop_health_task}")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
except Exception:
|
# entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
log.warning(f"Entity {entity_did} not reachable. Setting attached to false")
|
# assert entity is not None
|
||||||
|
# try:
|
||||||
|
|
||||||
db_entity = sql_crud.set_attached_by_entity_did(db, entity_did, False)
|
# while True:
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/api/v1/{entity_did}/entity", tags=[Tags.entities])
|
# if entity.stop_health_task:
|
||||||
|
# print(f"Stop health status task for {entity.name}")
|
||||||
|
# break
|
||||||
|
|
||||||
|
# url = f"http://{entity.ip}"
|
||||||
|
# response = httpx.get(url, timeout=2)
|
||||||
|
# #log.warning(f"Response {response.status_code} from {url}")
|
||||||
|
# print(f"{entity.name}: stop_health_task: {entity.stop_health_task}")
|
||||||
|
# if response.status_code != 200:
|
||||||
|
# raise ClanError(f"Entity with did '{entity_did}' returned {response.status_code}")
|
||||||
|
|
||||||
|
# if entity.attached is False:
|
||||||
|
# sql_crud.set_attached_by_entity_did(db, entity_did, True)
|
||||||
|
# if entity is None:
|
||||||
|
# raise ClanError(f"Entity with did '{entity_did}' has been deleted")
|
||||||
|
|
||||||
|
# time.sleep(1)
|
||||||
|
# except Exception:
|
||||||
|
# log.warning(f"Entity {entity_did} not reachable at {url}")
|
||||||
|
# finally:
|
||||||
|
# sql_crud.set_attached_by_entity_did(db, entity_did, False)
|
||||||
|
|
||||||
|
|
||||||
|
@router.delete("/api/v1/entity", tags=[Tags.entities])
|
||||||
async def delete_entity(
|
async def delete_entity(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:1234",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
@@ -216,8 +255,6 @@ async def delete_entity(
|
|||||||
# Resolution #
|
# Resolution #
|
||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/resolutions", response_model=List[Resolution], tags=[Tags.resolutions]
|
"/api/v1/resolutions", response_model=List[Resolution], tags=[Tags.resolutions]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class EntityCreate(EntityBase):
|
|||||||
|
|
||||||
class Entity(EntityCreate):
|
class Entity(EntityCreate):
|
||||||
attached: bool = Field(...)
|
attached: bool = Field(...)
|
||||||
|
stop_health_task: bool = Field(...)
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
orm_mode = True
|
orm_mode = True
|
||||||
|
|||||||
Binary file not shown.
@@ -64,7 +64,7 @@ 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:
|
||||||
db_entity = sql_models.Entity(**entity.dict(), attached=False)
|
db_entity = sql_models.Entity(**entity.dict(), attached=False, stop_health_task=False)
|
||||||
db.add(db_entity)
|
db.add(db_entity)
|
||||||
db.commit()
|
db.commit()
|
||||||
db.refresh(db_entity)
|
db.refresh(db_entity)
|
||||||
@@ -100,20 +100,35 @@ def get_attached_entities(
|
|||||||
|
|
||||||
|
|
||||||
# Returns same entity if setting didnt changed something
|
# Returns same entity if setting didnt changed something
|
||||||
def set_attached_by_entity_did(
|
def stop_entity_health_task(
|
||||||
db: Session, entity_did: str, value: bool
|
db: Session, entity_did: str
|
||||||
) -> sql_models.Entity:
|
) -> None:
|
||||||
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")
|
||||||
|
|
||||||
setattr(db_entity, "attached", value)
|
setattr(db_entity, "stop_health_task", True)
|
||||||
|
|
||||||
|
# save changes in db
|
||||||
|
db.add(db_entity)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_entity)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def set_attached_by_entity_did(
|
||||||
|
db: Session, entity_did: str, attached: bool
|
||||||
|
) -> None:
|
||||||
|
db_entity = get_entity_by_did(db, entity_did)
|
||||||
|
if db_entity is None:
|
||||||
|
raise ClanError(f"Entity with did '{entity_did}' not found")
|
||||||
|
|
||||||
|
setattr(db_entity, "attached", attached)
|
||||||
|
|
||||||
# save changes in db
|
# save changes in db
|
||||||
db.add(db_entity)
|
db.add(db_entity)
|
||||||
db.commit()
|
db.commit()
|
||||||
db.refresh(db_entity)
|
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:
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Entity(Base):
|
|||||||
ip = Column(String, index=True)
|
ip = Column(String, index=True)
|
||||||
attached = Column(Boolean, index=True)
|
attached = Column(Boolean, index=True)
|
||||||
visible = Column(Boolean, index=True)
|
visible = Column(Boolean, index=True)
|
||||||
|
stop_health_task = Column(Boolean)
|
||||||
|
|
||||||
## Non queryable body ##
|
## Non queryable body ##
|
||||||
# In here we deposit: Network, Roles, Visible, etc.
|
# In here we deposit: Network, Roles, Visible, etc.
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from typing import Any, Dict, List
|
|||||||
|
|
||||||
class Tags(Enum):
|
class Tags(Enum):
|
||||||
services = "services"
|
services = "services"
|
||||||
clients = "clients"
|
|
||||||
entities = "entities"
|
entities = "entities"
|
||||||
repositories = "repositories"
|
repositories = "repositories"
|
||||||
resolutions = "resolution"
|
resolutions = "resolution"
|
||||||
@@ -18,10 +17,6 @@ tags_metadata: List[Dict[str, Any]] = [
|
|||||||
"name": str(Tags.services),
|
"name": str(Tags.services),
|
||||||
"description": "Operations on a service.",
|
"description": "Operations on a service.",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": str(Tags.clients),
|
|
||||||
"description": "Operations on a client.",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": str(Tags.entities),
|
"name": str(Tags.entities),
|
||||||
"description": "Operations on an entity.",
|
"description": "Operations on an entity.",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N 127.0.0.1 5555 ; done
|
while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N 127.0.0.1 7002 ; done
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ from openapi_client.models.machine import Machine
|
|||||||
from openapi_client.models.resolution import Resolution
|
from openapi_client.models.resolution import Resolution
|
||||||
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.services_by_name import ServicesByName
|
|
||||||
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
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class EntitiesApi:
|
|||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def attach_entity(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> Dict[str, str]: # noqa: E501
|
def attach_entity(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> Dict[str, str]: # noqa: E501
|
||||||
"""Attach Entity # noqa: E501
|
"""Attach Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -55,7 +55,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.attach_entity(entity_did, skip, limit, async_req=True)
|
>>> thread = api.attach_entity(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -79,7 +79,7 @@ class EntitiesApi:
|
|||||||
return self.attach_entity_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
return self.attach_entity_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def attach_entity_with_http_info(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
def attach_entity_with_http_info(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Attach Entity # noqa: E501
|
"""Attach Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -88,7 +88,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.attach_entity_with_http_info(entity_did, skip, limit, async_req=True)
|
>>> thread = api.attach_entity_with_http_info(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -152,12 +152,12 @@ class EntitiesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
if _params.get('skip') is not None: # noqa: E501
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
_query_params.append(('skip', _params['skip']))
|
_query_params.append(('skip', _params['skip']))
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ class EntitiesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/attach', 'POST',
|
'/api/v1/attach', 'POST',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
@@ -347,7 +347,7 @@ class EntitiesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def delete_entity(self, entity_did : StrictStr, **kwargs) -> Dict[str, str]: # noqa: E501
|
def delete_entity(self, entity_did : Optional[StrictStr] = None, **kwargs) -> Dict[str, str]: # noqa: E501
|
||||||
"""Delete Entity # noqa: E501
|
"""Delete Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -356,7 +356,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.delete_entity(entity_did, async_req=True)
|
>>> thread = api.delete_entity(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -376,7 +376,7 @@ class EntitiesApi:
|
|||||||
return self.delete_entity_with_http_info(entity_did, **kwargs) # noqa: E501
|
return self.delete_entity_with_http_info(entity_did, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def delete_entity_with_http_info(self, entity_did : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
|
def delete_entity_with_http_info(self, entity_did : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Delete Entity # noqa: E501
|
"""Delete Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -385,7 +385,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.delete_entity_with_http_info(entity_did, async_req=True)
|
>>> thread = api.delete_entity_with_http_info(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -443,12 +443,12 @@ class EntitiesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
# process the header parameters
|
# process the header parameters
|
||||||
_header_params = dict(_params.get('_headers', {}))
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
# process the form parameters
|
# process the form parameters
|
||||||
@@ -469,7 +469,7 @@ class EntitiesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/entity', 'DELETE',
|
'/api/v1/entity', 'DELETE',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
@@ -486,7 +486,7 @@ class EntitiesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def detach_entity(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> Entity: # noqa: E501
|
def detach_entity(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> Entity: # noqa: E501
|
||||||
"""Detach Entity # noqa: E501
|
"""Detach Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -495,7 +495,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.detach_entity(entity_did, skip, limit, async_req=True)
|
>>> thread = api.detach_entity(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -519,7 +519,7 @@ class EntitiesApi:
|
|||||||
return self.detach_entity_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
return self.detach_entity_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def detach_entity_with_http_info(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
def detach_entity_with_http_info(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Detach Entity # noqa: E501
|
"""Detach Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -528,7 +528,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.detach_entity_with_http_info(entity_did, skip, limit, async_req=True)
|
>>> thread = api.detach_entity_with_http_info(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -592,12 +592,12 @@ class EntitiesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
if _params.get('skip') is not None: # noqa: E501
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
_query_params.append(('skip', _params['skip']))
|
_query_params.append(('skip', _params['skip']))
|
||||||
|
|
||||||
@@ -624,7 +624,7 @@ class EntitiesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/detach', 'POST',
|
'/api/v1/detach', 'POST',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
@@ -935,7 +935,7 @@ class EntitiesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_entity_by_did(self, entity_did : StrictStr, **kwargs) -> Entity: # noqa: E501
|
def get_entity_by_did(self, entity_did : Optional[StrictStr] = None, **kwargs) -> Entity: # noqa: E501
|
||||||
"""Get Entity By Did # noqa: E501
|
"""Get Entity By Did # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -944,7 +944,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.get_entity_by_did(entity_did, async_req=True)
|
>>> thread = api.get_entity_by_did(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -964,7 +964,7 @@ class EntitiesApi:
|
|||||||
return self.get_entity_by_did_with_http_info(entity_did, **kwargs) # noqa: E501
|
return self.get_entity_by_did_with_http_info(entity_did, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_entity_by_did_with_http_info(self, entity_did : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
|
def get_entity_by_did_with_http_info(self, entity_did : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Get Entity By Did # noqa: E501
|
"""Get Entity By Did # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -973,7 +973,7 @@ class EntitiesApi:
|
|||||||
>>> thread = api.get_entity_by_did_with_http_info(entity_did, async_req=True)
|
>>> thread = api.get_entity_by_did_with_http_info(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -1031,12 +1031,12 @@ class EntitiesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
# process the header parameters
|
# process the header parameters
|
||||||
_header_params = dict(_params.get('_headers', {}))
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
# process the form parameters
|
# process the form parameters
|
||||||
@@ -1057,7 +1057,7 @@ class EntitiesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/entity', 'GET',
|
'/api/v1/entity', 'GET',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ 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.services_by_name import ServicesByName
|
|
||||||
|
|
||||||
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
|
||||||
@@ -193,7 +192,7 @@ class ServicesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def delete_service(self, entity_did : StrictStr, **kwargs) -> Dict[str, str]: # noqa: E501
|
def delete_service(self, entity_did : Optional[StrictStr] = None, **kwargs) -> Dict[str, str]: # noqa: E501
|
||||||
"""Delete Service # noqa: E501
|
"""Delete Service # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -202,7 +201,7 @@ class ServicesApi:
|
|||||||
>>> thread = api.delete_service(entity_did, async_req=True)
|
>>> thread = api.delete_service(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -222,7 +221,7 @@ class ServicesApi:
|
|||||||
return self.delete_service_with_http_info(entity_did, **kwargs) # noqa: E501
|
return self.delete_service_with_http_info(entity_did, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def delete_service_with_http_info(self, entity_did : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
|
def delete_service_with_http_info(self, entity_did : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Delete Service # noqa: E501
|
"""Delete Service # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -231,7 +230,7 @@ class ServicesApi:
|
|||||||
>>> thread = api.delete_service_with_http_info(entity_did, async_req=True)
|
>>> thread = api.delete_service_with_http_info(entity_did, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
:param async_req: Whether to execute the request asynchronously.
|
||||||
:type async_req: bool, optional
|
:type async_req: bool, optional
|
||||||
@@ -289,12 +288,12 @@ class ServicesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
# process the header parameters
|
# process the header parameters
|
||||||
_header_params = dict(_params.get('_headers', {}))
|
_header_params = dict(_params.get('_headers', {}))
|
||||||
# process the form parameters
|
# process the form parameters
|
||||||
@@ -315,7 +314,7 @@ class ServicesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/service', 'DELETE',
|
'/api/v1/service', 'DELETE',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
@@ -479,7 +478,7 @@ class ServicesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_service_by_did(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
|
def get_service_by_did(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
|
||||||
"""Get Service By Did # noqa: E501
|
"""Get Service By Did # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -488,7 +487,7 @@ class ServicesApi:
|
|||||||
>>> thread = api.get_service_by_did(entity_did, skip, limit, async_req=True)
|
>>> thread = api.get_service_by_did(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -512,7 +511,7 @@ class ServicesApi:
|
|||||||
return self.get_service_by_did_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
return self.get_service_by_did_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_service_by_did_with_http_info(self, entity_did : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
def get_service_by_did_with_http_info(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Get Service By Did # noqa: E501
|
"""Get Service By Did # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
@@ -521,7 +520,7 @@ class ServicesApi:
|
|||||||
>>> thread = api.get_service_by_did_with_http_info(entity_did, skip, limit, async_req=True)
|
>>> thread = api.get_service_by_did_with_http_info(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_did: (required)
|
:param entity_did:
|
||||||
:type entity_did: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
@@ -585,12 +584,12 @@ class ServicesApi:
|
|||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
_path_params = {}
|
_path_params = {}
|
||||||
if _params['entity_did']:
|
|
||||||
_path_params['entity_did'] = _params['entity_did']
|
|
||||||
|
|
||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
if _params.get('skip') is not None: # noqa: E501
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
_query_params.append(('skip', _params['skip']))
|
_query_params.append(('skip', _params['skip']))
|
||||||
|
|
||||||
@@ -617,7 +616,7 @@ class ServicesApi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/{entity_did}/service', 'GET',
|
'/api/v1/service', 'GET',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
@@ -634,17 +633,17 @@ class ServicesApi:
|
|||||||
_request_auth=_params.get('_request_auth'))
|
_request_auth=_params.get('_request_auth'))
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_services_by_name(self, entity_name : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ServicesByName: # noqa: E501
|
def get_services_without_entity(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> List[Service]: # noqa: E501
|
||||||
"""Get Services By Name # noqa: E501
|
"""Get Services Without Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
>>> thread = api.get_services_by_name(entity_name, skip, limit, async_req=True)
|
>>> thread = api.get_services_without_entity(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_name: (required)
|
:param entity_did:
|
||||||
:type entity_name: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
:param limit:
|
:param limit:
|
||||||
@@ -658,26 +657,26 @@ class ServicesApi:
|
|||||||
:return: Returns the result object.
|
:return: Returns the result object.
|
||||||
If the method is called asynchronously,
|
If the method is called asynchronously,
|
||||||
returns the request thread.
|
returns the request thread.
|
||||||
:rtype: ServicesByName
|
:rtype: List[Service]
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = True
|
||||||
if '_preload_content' in kwargs:
|
if '_preload_content' in kwargs:
|
||||||
message = "Error! Please call the get_services_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
message = "Error! Please call the get_services_without_entity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
||||||
raise ValueError(message)
|
raise ValueError(message)
|
||||||
return self.get_services_by_name_with_http_info(entity_name, skip, limit, **kwargs) # noqa: E501
|
return self.get_services_without_entity_with_http_info(entity_did, skip, limit, **kwargs) # noqa: E501
|
||||||
|
|
||||||
@validate_arguments
|
@validate_arguments
|
||||||
def get_services_by_name_with_http_info(self, entity_name : StrictStr, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
def get_services_without_entity_with_http_info(self, entity_did : Optional[StrictStr] = None, skip : Optional[StrictInt] = None, limit : Optional[StrictInt] = None, **kwargs) -> ApiResponse: # noqa: E501
|
||||||
"""Get Services By Name # noqa: E501
|
"""Get Services Without Entity # noqa: E501
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
|
||||||
>>> thread = api.get_services_by_name_with_http_info(entity_name, skip, limit, async_req=True)
|
>>> thread = api.get_services_without_entity_with_http_info(entity_did, skip, limit, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param entity_name: (required)
|
:param entity_did:
|
||||||
:type entity_name: str
|
:type entity_did: str
|
||||||
:param skip:
|
:param skip:
|
||||||
:type skip: int
|
:type skip: int
|
||||||
:param limit:
|
:param limit:
|
||||||
@@ -704,13 +703,13 @@ class ServicesApi:
|
|||||||
:return: Returns the result object.
|
:return: Returns the result object.
|
||||||
If the method is called asynchronously,
|
If the method is called asynchronously,
|
||||||
returns the request thread.
|
returns the request thread.
|
||||||
:rtype: tuple(ServicesByName, status_code(int), headers(HTTPHeaderDict))
|
:rtype: tuple(List[Service], status_code(int), headers(HTTPHeaderDict))
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_params = locals()
|
_params = locals()
|
||||||
|
|
||||||
_all_params = [
|
_all_params = [
|
||||||
'entity_name',
|
'entity_did',
|
||||||
'skip',
|
'skip',
|
||||||
'limit'
|
'limit'
|
||||||
]
|
]
|
||||||
@@ -731,7 +730,7 @@ class ServicesApi:
|
|||||||
if _key not in _all_params:
|
if _key not in _all_params:
|
||||||
raise ApiTypeError(
|
raise ApiTypeError(
|
||||||
"Got an unexpected keyword argument '%s'"
|
"Got an unexpected keyword argument '%s'"
|
||||||
" to method get_services_by_name" % _key
|
" to method get_services_without_entity" % _key
|
||||||
)
|
)
|
||||||
_params[_key] = _val
|
_params[_key] = _val
|
||||||
del _params['kwargs']
|
del _params['kwargs']
|
||||||
@@ -743,8 +742,8 @@ class ServicesApi:
|
|||||||
|
|
||||||
# process the query parameters
|
# process the query parameters
|
||||||
_query_params = []
|
_query_params = []
|
||||||
if _params.get('entity_name') is not None: # noqa: E501
|
if _params.get('entity_did') is not None: # noqa: E501
|
||||||
_query_params.append(('entity_name', _params['entity_name']))
|
_query_params.append(('entity_did', _params['entity_did']))
|
||||||
|
|
||||||
if _params.get('skip') is not None: # noqa: E501
|
if _params.get('skip') is not None: # noqa: E501
|
||||||
_query_params.append(('skip', _params['skip']))
|
_query_params.append(('skip', _params['skip']))
|
||||||
@@ -767,12 +766,12 @@ class ServicesApi:
|
|||||||
_auth_settings = [] # noqa: E501
|
_auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
_response_types_map = {
|
_response_types_map = {
|
||||||
'200': "ServicesByName",
|
'200': "List[Service]",
|
||||||
'422': "HTTPValidationError",
|
'422': "HTTPValidationError",
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
'/api/v1/services_by_entity_name', 'GET',
|
'/api/v1/services_without_entity', 'GET',
|
||||||
_path_params,
|
_path_params,
|
||||||
_query_params,
|
_query_params,
|
||||||
_header_params,
|
_header_params,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# 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
|
||||||
|
[**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 +42,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
|
||||||
@@ -56,19 +57,17 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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)
|
||||||
|
|
||||||
# **health**
|
# **health**
|
||||||
|
|
||||||
> Machine health()
|
> Machine health()
|
||||||
|
|
||||||
Health
|
Health
|
||||||
@@ -104,8 +103,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
|
||||||
@@ -118,19 +118,17 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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
|
||||||
@@ -155,7 +153,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.DefaultApi(api_client)
|
api_instance = openapi_client.DefaultApi(api_client)
|
||||||
path_name = 'path_name_example' # str |
|
path_name = 'path_name_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Root
|
# Root
|
||||||
@@ -164,11 +162,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
|
||||||
|
|
||||||
@@ -180,14 +180,14 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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,21 +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) | **POST** /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) | **POST** /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**](EntitiesApi.md#get_entity_by_name) | **GET** /api/v1/entity_by_name | Get Entity By Name
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| ----------------------------------------------------------------- | -------------------------------------- | --------------------- |
|
|
||||||
| [**attach_entity**](EntitiesApi.md#attach_entity) | **POST** /api/v1/{entity_did}/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_did}/entity | Delete Entity |
|
|
||||||
| [**detach_entity**](EntitiesApi.md#detach_entity) | **POST** /api/v1/{entity_did}/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_did}/entity | Get Entity By Did |
|
|
||||||
| [**get_entity_by_name**](EntitiesApi.md#get_entity_by_name) | **GET** /api/v1/entity_by_name | Get Entity By Name |
|
|
||||||
|
|
||||||
# **attach_entity**
|
# **attach_entity**
|
||||||
|
> Dict[str, str] attach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
> Dict[str, str] attach_entity(entity_did, skip=skip, limit=limit)
|
|
||||||
|
|
||||||
Attach Entity
|
Attach Entity
|
||||||
|
|
||||||
@@ -39,26 +39,28 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
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)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Attach Entity
|
# Attach Entity
|
||||||
api_response = api_instance.attach_entity(entity_did, skip=skip, limit=limit)
|
api_response = api_instance.attach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
print("The response of EntitiesApi->attach_entity:\n")
|
print("The response of EntitiesApi->attach_entity:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
| **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
|
||||||
|
|
||||||
@@ -70,20 +72,18 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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
|
||||||
@@ -110,7 +110,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_create = openapi_client.EntityCreate() # EntityCreate |
|
entity_create = openapi_client.EntityCreate() # EntityCreate |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create Entity
|
# Create Entity
|
||||||
@@ -121,11 +121,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
|
||||||
|
|
||||||
@@ -137,21 +139,19 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
- **Content-Type**: application/json
|
||||||
- **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)
|
|
||||||
|
|
||||||
Delete Entity
|
Delete Entity
|
||||||
|
|
||||||
@@ -175,22 +175,24 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete Entity
|
# Delete Entity
|
||||||
api_response = api_instance.delete_entity(entity_did)
|
api_response = api_instance.delete_entity(entity_did=entity_did)
|
||||||
print("The response of EntitiesApi->delete_entity:\n")
|
print("The response of EntitiesApi->delete_entity:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -202,21 +204,19 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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**
|
||||||
|
> Entity detach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
> Entity detach_entity(entity_did, skip=skip, limit=limit)
|
|
||||||
|
|
||||||
Detach Entity
|
Detach Entity
|
||||||
|
|
||||||
@@ -241,26 +241,28 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
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)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Detach Entity
|
# Detach Entity
|
||||||
api_response = api_instance.detach_entity(entity_did, skip=skip, limit=limit)
|
api_response = api_instance.detach_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
print("The response of EntitiesApi->detach_entity:\n")
|
print("The response of EntitiesApi->detach_entity:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
| **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,20 +274,18 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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
|
||||||
@@ -323,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
|
||||||
|
|
||||||
@@ -340,20 +342,18 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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
|
||||||
@@ -391,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
|
||||||
|
|
||||||
@@ -408,21 +410,19 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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)
|
|
||||||
|
|
||||||
Get Entity By Did
|
Get Entity By Did
|
||||||
|
|
||||||
@@ -447,22 +447,24 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get Entity By Did
|
# Get Entity By Did
|
||||||
api_response = api_instance.get_entity_by_did(entity_did)
|
api_response = api_instance.get_entity_by_did(entity_did=entity_did)
|
||||||
print("The response of EntitiesApi->get_entity_by_did:\n")
|
print("The response of EntitiesApi->get_entity_by_did:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -474,20 +476,18 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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_name**
|
# **get_entity_by_name**
|
||||||
|
|
||||||
> Entity get_entity_by_name(entity_name)
|
> Entity get_entity_by_name(entity_name)
|
||||||
|
|
||||||
Get Entity By Name
|
Get Entity By Name
|
||||||
@@ -513,7 +513,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_name = 'entity_name_example' # str |
|
entity_name = 'entity_name_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get Entity By Name
|
# Get Entity By Name
|
||||||
@@ -524,11 +524,13 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling EntitiesApi->get_entity_by_name: %s\n" % e)
|
print("Exception when calling EntitiesApi->get_entity_by_name: %s\n" % e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
Name | Type | Description | Notes
|
||||||
| --------------- | ------- | ----------- | ----- |
|
------------- | ------------- | ------------- | -------------
|
||||||
| **entity_name** | **str** | |
|
**entity_name** | **str**| |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -540,14 +542,14 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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,15 +1,15 @@
|
|||||||
# Entity
|
# Entity
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ------------ | ---------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **did** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **name** | **str** | |
|
**did** | **str** | |
|
||||||
| **ip** | **str** | |
|
**name** | **str** | |
|
||||||
| **visible** | **bool** | |
|
**ip** | **str** | |
|
||||||
| **other** | **object** | |
|
**visible** | **bool** | |
|
||||||
| **attached** | **bool** | |
|
**other** | **object** | |
|
||||||
|
**attached** | **bool** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -28,5 +28,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,14 +1,14 @@
|
|||||||
# EntityCreate
|
# EntityCreate
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
## Properties
|
||||||
| ----------- | ---------- | ----------- | ----- |
|
Name | Type | Description | Notes
|
||||||
| **did** | **str** | |
|
------------ | ------------- | ------------- | -------------
|
||||||
| **name** | **str** | |
|
**did** | **str** | |
|
||||||
| **ip** | **str** | |
|
**name** | **str** | |
|
||||||
| **visible** | **bool** | |
|
**ip** | **str** | |
|
||||||
| **other** | **object** | |
|
**visible** | **bool** | |
|
||||||
|
**other** | **object** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -27,5 +27,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,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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# openapi_client.RepositoriesApi
|
# openapi_client.RepositoriesApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
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
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| ------------------------------------------------------------------- | ---------------------------- | -------------------- |
|
|
||||||
| [**get_all_repositories**](RepositoriesApi.md#get_all_repositories) | **GET** /api/v1/repositories | Get All Repositories |
|
|
||||||
|
|
||||||
# **get_all_repositories**
|
# **get_all_repositories**
|
||||||
|
|
||||||
> List[Service] get_all_repositories(skip=skip, limit=limit)
|
> List[Service] get_all_repositories(skip=skip, limit=limit)
|
||||||
|
|
||||||
Get All Repositories
|
Get All Repositories
|
||||||
@@ -45,12 +45,14 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|||||||
print("Exception when calling RepositoriesApi->get_all_repositories: %s\n" % e)
|
print("Exception when calling RepositoriesApi->get_all_repositories: %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
|
||||||
|
|
||||||
@@ -62,14 +64,14 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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,15 +1,15 @@
|
|||||||
# 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** | |
|
||||||
|
**id** | **int** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -28,5 +28,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
|
||||||
|
|
||||||
@@ -62,14 +64,14 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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,17 +1,17 @@
|
|||||||
# 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** | |
|
**status** | **str** | |
|
||||||
| **entity_did** | **str** | |
|
**other** | **object** | |
|
||||||
| **entity** | [**Entity**](Entity.md) | |
|
**entity_did** | **str** | |
|
||||||
|
**entity** | [**Entity**](Entity.md) | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -30,5 +30,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,16 @@
|
|||||||
# 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** | |
|
**status** | **str** | |
|
||||||
| **entity_did** | **str** | |
|
**other** | **object** | |
|
||||||
|
**entity_did** | **str** | |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -29,5 +29,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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
# openapi_client.ServicesApi
|
# openapi_client.ServicesApi
|
||||||
|
|
||||||
All URIs are relative to _http://localhost_
|
All URIs are relative to *http://localhost*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**create_service**](ServicesApi.md#create_service) | **POST** /api/v1/service | Create Service
|
||||||
|
[**delete_service**](ServicesApi.md#delete_service) | **DELETE** /api/v1/service | Delete Service
|
||||||
|
[**get_all_services**](ServicesApi.md#get_all_services) | **GET** /api/v1/services | Get All Services
|
||||||
|
[**get_service_by_did**](ServicesApi.md#get_service_by_did) | **GET** /api/v1/service | Get Service By Did
|
||||||
|
[**get_services_without_entity**](ServicesApi.md#get_services_without_entity) | **GET** /api/v1/services_without_entity | Get Services Without Entity
|
||||||
|
|
||||||
| Method | HTTP request | Description |
|
|
||||||
| --------------------------------------------------------------- | --------------------------------------- | -------------------- |
|
|
||||||
| [**create_service**](ServicesApi.md#create_service) | **POST** /api/v1/service | Create Service |
|
|
||||||
| [**delete_service**](ServicesApi.md#delete_service) | **DELETE** /api/v1/{entity_did}/service | Delete Service |
|
|
||||||
| [**get_all_services**](ServicesApi.md#get_all_services) | **GET** /api/v1/services | Get All Services |
|
|
||||||
| [**get_service_by_did**](ServicesApi.md#get_service_by_did) | **GET** /api/v1/{entity_did}/service | Get Service By Did |
|
|
||||||
| [**get_services_by_name**](ServicesApi.md#get_services_by_name) | **GET** /api/v1/services_by_entity_name | Get Services By Name |
|
|
||||||
|
|
||||||
# **create_service**
|
# **create_service**
|
||||||
|
|
||||||
> Service create_service(service_create)
|
> Service create_service(service_create)
|
||||||
|
|
||||||
Create Service
|
Create Service
|
||||||
@@ -38,7 +38,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)
|
||||||
service_create = openapi_client.ServiceCreate() # ServiceCreate |
|
service_create = openapi_client.ServiceCreate() # ServiceCreate |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create Service
|
# Create Service
|
||||||
@@ -49,11 +49,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
|
||||||
|
|
||||||
@@ -65,21 +67,19 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
- **Content-Type**: application/json
|
||||||
- **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)
|
|
||||||
|
|
||||||
Delete Service
|
Delete Service
|
||||||
|
|
||||||
@@ -103,22 +103,24 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete Service
|
# Delete Service
|
||||||
api_response = api_instance.delete_service(entity_did)
|
api_response = api_instance.delete_service(entity_did=entity_did)
|
||||||
print("The response of ServicesApi->delete_service:\n")
|
print("The response of ServicesApi->delete_service:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -130,20 +132,18 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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 +181,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
|
||||||
|
|
||||||
@@ -198,21 +200,19 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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, skip=skip, limit=limit)
|
|
||||||
|
|
||||||
Get Service By Did
|
Get Service By Did
|
||||||
|
|
||||||
@@ -237,26 +237,28 @@ 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 = 'entity_did_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
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)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get Service By Did
|
# Get Service By Did
|
||||||
api_response = api_instance.get_service_by_did(entity_did, skip=skip, limit=limit)
|
api_response = api_instance.get_service_by_did(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
print("The response of ServicesApi->get_service_by_did:\n")
|
print("The response of ServicesApi->get_service_by_did:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
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** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
| **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
|
||||||
|
|
||||||
@@ -268,23 +270,21 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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_services_by_name**
|
# **get_services_without_entity**
|
||||||
|
> List[Service] get_services_without_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
|
|
||||||
> ServicesByName get_services_by_name(entity_name, skip=skip, limit=limit)
|
Get Services Without Entity
|
||||||
|
|
||||||
Get Services By Name
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ Get Services By Name
|
|||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import openapi_client
|
import openapi_client
|
||||||
from openapi_client.models.services_by_name import ServicesByName
|
from openapi_client.models.service import Service
|
||||||
from openapi_client.rest import ApiException
|
from openapi_client.rest import ApiException
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
@@ -307,30 +307,32 @@ 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_name = 'entity_name_example' # str |
|
entity_did = 'did:sov:test:1234' # str | (optional) (default to 'did:sov:test:1234')
|
||||||
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)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get Services By Name
|
# Get Services Without Entity
|
||||||
api_response = api_instance.get_services_by_name(entity_name, skip=skip, limit=limit)
|
api_response = api_instance.get_services_without_entity(entity_did=entity_did, skip=skip, limit=limit)
|
||||||
print("The response of ServicesApi->get_services_by_name:\n")
|
print("The response of ServicesApi->get_services_without_entity:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Exception when calling ServicesApi->get_services_by_name: %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_name** | **str** | |
|
**entity_did** | **str**| | [optional] [default to 'did:sov:test:1234']
|
||||||
| **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
|
||||||
|
|
||||||
[**ServicesByName**](ServicesByName.md)
|
[**List[Service]**](Service.md)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
@@ -338,14 +340,14 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **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,28 +0,0 @@
|
|||||||
# ServicesByName
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
|
||||||
| ------------ | ------------------------------- | ----------- | ----- |
|
|
||||||
| **entity** | [**Entity**](Entity.md) | |
|
|
||||||
| **services** | [**List[Service]**](Service.md) | |
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
from openapi_client.models.services_by_name import ServicesByName
|
|
||||||
|
|
||||||
# TODO update the JSON string below
|
|
||||||
json = "{}"
|
|
||||||
# create an instance of ServicesByName from a JSON string
|
|
||||||
services_by_name_instance = ServicesByName.from_json(json)
|
|
||||||
# print the JSON string representation of the object
|
|
||||||
print ServicesByName.to_json()
|
|
||||||
|
|
||||||
# convert the object into a dict
|
|
||||||
services_by_name_dict = services_by_name_instance.to_dict()
|
|
||||||
# create an instance of ServicesByName from a dict
|
|
||||||
services_by_name_form_dict = services_by_name.from_dict(services_by_name_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)
|
|
||||||
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from openapi_client.models.machine import Machine
|
|||||||
from openapi_client.models.resolution import Resolution
|
from openapi_client.models.resolution import Resolution
|
||||||
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.services_by_name import ServicesByName
|
|
||||||
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
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
# 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 typing import List
|
|
||||||
from pydantic import BaseModel, Field, conlist
|
|
||||||
from openapi_client.models.entity import Entity
|
|
||||||
from openapi_client.models.service import Service
|
|
||||||
|
|
||||||
class ServicesByName(BaseModel):
|
|
||||||
"""
|
|
||||||
ServicesByName
|
|
||||||
"""
|
|
||||||
entity: Entity = Field(...)
|
|
||||||
services: conlist(Service) = Field(...)
|
|
||||||
__properties = ["entity", "services"]
|
|
||||||
|
|
||||||
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) -> ServicesByName:
|
|
||||||
"""Create an instance of ServicesByName 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)
|
|
||||||
# override the default output from pydantic by calling `to_dict()` of entity
|
|
||||||
if self.entity:
|
|
||||||
_dict['entity'] = self.entity.to_dict()
|
|
||||||
# override the default output from pydantic by calling `to_dict()` of each item in services (list)
|
|
||||||
_items = []
|
|
||||||
if self.services:
|
|
||||||
for _item in self.services:
|
|
||||||
if _item:
|
|
||||||
_items.append(_item.to_dict())
|
|
||||||
_dict['services'] = _items
|
|
||||||
return _dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, obj: dict) -> ServicesByName:
|
|
||||||
"""Create an instance of ServicesByName from a dict"""
|
|
||||||
if obj is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if not isinstance(obj, dict):
|
|
||||||
return ServicesByName.parse_obj(obj)
|
|
||||||
|
|
||||||
_obj = ServicesByName.parse_obj({
|
|
||||||
"entity": Entity.from_dict(obj.get("entity")) if obj.get("entity") is not None else None,
|
|
||||||
"services": [Service.from_dict(_item) for _item in obj.get("services")] if obj.get("services") is not None else None
|
|
||||||
})
|
|
||||||
return _obj
|
|
||||||
|
|
||||||
|
|
||||||
@@ -54,10 +54,10 @@ class TestServicesApi(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_get_services_by_name(self) -> None:
|
def test_get_services_without_entity(self) -> None:
|
||||||
"""Test case for get_services_by_name
|
"""Test case for get_services_without_entity
|
||||||
|
|
||||||
Get Services By Name # noqa: E501
|
Get Services Without Entity # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,99 +0,0 @@
|
|||||||
# 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 unittest
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from openapi_client.models.services_by_name import ServicesByName # noqa: E501
|
|
||||||
|
|
||||||
class TestServicesByName(unittest.TestCase):
|
|
||||||
"""ServicesByName unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ServicesByName:
|
|
||||||
"""Test ServicesByName
|
|
||||||
include_option is a boolean, when False only required
|
|
||||||
params are included, when True both required and
|
|
||||||
optional params are included """
|
|
||||||
# uncomment below to create an instance of `ServicesByName`
|
|
||||||
"""
|
|
||||||
model = ServicesByName() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ServicesByName(
|
|
||||||
entity = openapi_client.models.entity.Entity(
|
|
||||||
did = 'did:sov:test:1234',
|
|
||||||
name = 'C1',
|
|
||||||
ip = '127.0.0.1',
|
|
||||||
visible = True,
|
|
||||||
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
|
|
||||||
attached = True, ),
|
|
||||||
services = [
|
|
||||||
openapi_client.models.service.Service(
|
|
||||||
uuid = '8e285c0c-4e40-430a-a477-26b3b81e30df',
|
|
||||||
service_name = 'Carlos Printing',
|
|
||||||
service_type = '3D Printing',
|
|
||||||
endpoint_url = 'http://127.0.0.1:8000',
|
|
||||||
status = 'unknown',
|
|
||||||
other = {action=[register, deregister, delete, create]},
|
|
||||||
entity_did = 'did:sov:test:1234',
|
|
||||||
entity = openapi_client.models.entity.Entity(
|
|
||||||
did = 'did:sov:test:1234',
|
|
||||||
name = 'C1',
|
|
||||||
ip = '127.0.0.1',
|
|
||||||
visible = True,
|
|
||||||
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
|
|
||||||
attached = True, ), )
|
|
||||||
]
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
return ServicesByName(
|
|
||||||
entity = openapi_client.models.entity.Entity(
|
|
||||||
did = 'did:sov:test:1234',
|
|
||||||
name = 'C1',
|
|
||||||
ip = '127.0.0.1',
|
|
||||||
visible = True,
|
|
||||||
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
|
|
||||||
attached = True, ),
|
|
||||||
services = [
|
|
||||||
openapi_client.models.service.Service(
|
|
||||||
uuid = '8e285c0c-4e40-430a-a477-26b3b81e30df',
|
|
||||||
service_name = 'Carlos Printing',
|
|
||||||
service_type = '3D Printing',
|
|
||||||
endpoint_url = 'http://127.0.0.1:8000',
|
|
||||||
status = 'unknown',
|
|
||||||
other = {action=[register, deregister, delete, create]},
|
|
||||||
entity_did = 'did:sov:test:1234',
|
|
||||||
entity = openapi_client.models.entity.Entity(
|
|
||||||
did = 'did:sov:test:1234',
|
|
||||||
name = 'C1',
|
|
||||||
ip = '127.0.0.1',
|
|
||||||
visible = True,
|
|
||||||
other = {network=Carlos Home Network, roles=[service repository, service prosumer]},
|
|
||||||
attached = True, ), )
|
|
||||||
],
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
|
|
||||||
def testServicesByName(self):
|
|
||||||
"""Test ServicesByName"""
|
|
||||||
# inst_req_only = self.make_instance(include_optional=False)
|
|
||||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -45,7 +45,7 @@ export default function AccessPoint() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
onRefresh();
|
onRefresh();
|
||||||
}, 1000);
|
}, 5000);
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|||||||
@@ -10,13 +10,112 @@ import {
|
|||||||
CardHeader,
|
CardHeader,
|
||||||
Snackbar,
|
Snackbar,
|
||||||
Typography,
|
Typography,
|
||||||
|
CircularProgress,
|
||||||
|
IconButton,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import CopyToClipboard from "@/components/copy_to_clipboard";
|
import CopyToClipboard from "@/components/copy_to_clipboard";
|
||||||
import { useGetServicesByName } from "@/api/services/services";
|
import {
|
||||||
import { attachEntity, detachEntity } from "@/api/entities/entities";
|
attachEntity,
|
||||||
|
detachEntity,
|
||||||
|
isAttached,
|
||||||
|
} from "@/api/entities/entities";
|
||||||
import { mutate } from "swr";
|
import { mutate } from "swr";
|
||||||
import { Skeleton } from "@mui/material";
|
import { Skeleton } from "@mui/material";
|
||||||
import { Service } from "@/api/model";
|
import { Entity, Service } from "@/api/model";
|
||||||
|
import useGetEntityByNameOrDid from "@/components/hooks/useGetEntityByNameOrDid";
|
||||||
|
import { useGetAllServices } from "@/api/services/services";
|
||||||
|
import axios from "axios";
|
||||||
|
import { NoDataOverlay } from "@/components/noDataOverlay";
|
||||||
|
import { DashboardCard } from "@/components/card";
|
||||||
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
|
|
||||||
|
interface SnackMessage {
|
||||||
|
message: string;
|
||||||
|
severity: "success" | "error";
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RecentActivity = (entity: Entity) => {
|
||||||
|
return (
|
||||||
|
<DashboardCard title="Recent Activity">
|
||||||
|
<div className="flex w-full justify-center align-middle">
|
||||||
|
<NoDataOverlay label="No Activity yet" />
|
||||||
|
</div>
|
||||||
|
</DashboardCard>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
type AttachButtonProps = {
|
||||||
|
entity?: Entity;
|
||||||
|
setSnackbarMessage: (message: SnackMessage) => void;
|
||||||
|
setSnackbarOpen: (open: boolean) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
const AttachButton = ({
|
||||||
|
entity,
|
||||||
|
setSnackbarMessage,
|
||||||
|
setSnackbarOpen,
|
||||||
|
}: AttachButtonProps) => {
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handleClick = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
// Call the attach or detach function depending on the isAttached value
|
||||||
|
// and await for the result
|
||||||
|
try {
|
||||||
|
let response = await (entity?.attached
|
||||||
|
? detachEntity({ entity_did: entity?.did })
|
||||||
|
: attachEntity({ entity_did: entity?.did }));
|
||||||
|
|
||||||
|
if (!entity?.attached) {
|
||||||
|
console.log("calling isAttached");
|
||||||
|
response = await isAttached({ entity_did: entity?.did });
|
||||||
|
console.log("response: ", response);
|
||||||
|
}
|
||||||
|
const msg = {
|
||||||
|
message: response.data.message,
|
||||||
|
severity: "success",
|
||||||
|
} as SnackMessage;
|
||||||
|
setSnackbarMessage(msg);
|
||||||
|
setSnackbarOpen(true);
|
||||||
|
} catch (error) {
|
||||||
|
if (axios.isAxiosError(error)) {
|
||||||
|
// Extract the error message from the error object
|
||||||
|
const errorMessage = error.response?.data.detail[0].msg;
|
||||||
|
|
||||||
|
const msg = {
|
||||||
|
message: `${errorMessage}`,
|
||||||
|
severity: "error",
|
||||||
|
} as SnackMessage;
|
||||||
|
setSnackbarMessage(msg);
|
||||||
|
setSnackbarOpen(true);
|
||||||
|
} else {
|
||||||
|
console.error("error: ", error);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
onClick={handleClick}
|
||||||
|
className="mr-6"
|
||||||
|
variant="contained"
|
||||||
|
// Disable the button while loading
|
||||||
|
disabled={loading}
|
||||||
|
>
|
||||||
|
{loading ? (
|
||||||
|
<CircularProgress size={24} />
|
||||||
|
) : entity?.attached ? (
|
||||||
|
"Detach"
|
||||||
|
) : (
|
||||||
|
"Attach"
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default function Client({
|
export default function Client({
|
||||||
params,
|
params,
|
||||||
@@ -25,18 +124,16 @@ export default function Client({
|
|||||||
}) {
|
}) {
|
||||||
const { client_name } = params;
|
const { client_name } = params;
|
||||||
|
|
||||||
|
const { entity: entity } = useGetEntityByNameOrDid(client_name);
|
||||||
const {
|
const {
|
||||||
data: services,
|
data: services,
|
||||||
isLoading: services_loading,
|
isLoading: services_loading,
|
||||||
swrKey: entityKeyFunc,
|
swrKey: entityKeyFunc,
|
||||||
} = useGetServicesByName({
|
} = useGetAllServices();
|
||||||
entity_name: client_name,
|
|
||||||
});
|
|
||||||
|
|
||||||
const entity = services?.data?.entity;
|
|
||||||
const clients: Service[] = useMemo(() => {
|
const clients: Service[] = useMemo(() => {
|
||||||
if (services?.data?.services) {
|
if (services?.data) {
|
||||||
return services.data.services.filter((service) => {
|
return services.data.filter((service) => {
|
||||||
if (service.entity_did !== entity?.did) return true;
|
if (service.entity_did !== entity?.did) return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -60,47 +157,15 @@ export default function Client({
|
|||||||
|
|
||||||
const cardContentRef = useRef(null);
|
const cardContentRef = useRef(null);
|
||||||
const [snackbarOpen, setSnackbarOpen] = useState(false);
|
const [snackbarOpen, setSnackbarOpen] = useState(false);
|
||||||
const [snackbarMessage, setSnackbarMessage] = useState("");
|
const [snackbarMessage, setSnackbarMessage] = useState<
|
||||||
const [isAttached, setIsAttached] = useState(entity?.attached);
|
SnackMessage | undefined
|
||||||
|
>(undefined);
|
||||||
|
|
||||||
const closeSnackBar = () => {
|
const closeSnackBar = () => {
|
||||||
setSnackbarMessage("");
|
setSnackbarMessage(undefined);
|
||||||
setSnackbarOpen(false);
|
setSnackbarOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onAttachEntity = async () => {
|
|
||||||
try {
|
|
||||||
if (entity) {
|
|
||||||
const response = await attachEntity(entity.did);
|
|
||||||
setSnackbarMessage(response.data.message);
|
|
||||||
setSnackbarOpen(true);
|
|
||||||
} else {
|
|
||||||
console.error("no entity");
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
setIsAttached(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onDetachEntity = async () => {
|
|
||||||
try {
|
|
||||||
if (entity) {
|
|
||||||
const response = await detachEntity(entity.did);
|
|
||||||
console.log(response);
|
|
||||||
setSnackbarMessage("Entity detached successfully.");
|
|
||||||
setSnackbarOpen(true);
|
|
||||||
} else {
|
|
||||||
console.error("no entity");
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
setIsAttached(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (services_loading) return <Skeleton height={500} />;
|
if (services_loading) return <Skeleton height={500} />;
|
||||||
if (!services) return <Alert severity="error">Client not found</Alert>;
|
if (!services) return <Alert severity="error">Client not found</Alert>;
|
||||||
|
|
||||||
@@ -113,25 +178,13 @@ export default function Client({
|
|||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<h2>Client 1</h2>
|
<h2>Entity {entity?.name}</h2>
|
||||||
<div>
|
<div>
|
||||||
{isAttached === false ? (
|
<AttachButton
|
||||||
<Button
|
entity={entity}
|
||||||
onClick={onAttachEntity}
|
setSnackbarMessage={setSnackbarMessage}
|
||||||
className="mr-6"
|
setSnackbarOpen={setSnackbarOpen}
|
||||||
variant="contained"
|
></AttachButton>
|
||||||
>
|
|
||||||
Attach
|
|
||||||
</Button>
|
|
||||||
) : (
|
|
||||||
<Button
|
|
||||||
onClick={onDetachEntity}
|
|
||||||
className="mr-6"
|
|
||||||
variant="contained"
|
|
||||||
>
|
|
||||||
Detach
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Button onClick={onRefresh} variant="contained">
|
<Button onClick={onRefresh} variant="contained">
|
||||||
Refresh
|
Refresh
|
||||||
@@ -169,7 +222,7 @@ export default function Client({
|
|||||||
<h4>Service View</h4>
|
<h4>Service View</h4>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
loading={services_loading}
|
loading={services_loading}
|
||||||
data={services?.data?.services}
|
data={services?.data}
|
||||||
configuration={ServiceTableConfig}
|
configuration={ServiceTableConfig}
|
||||||
tkey="service-table"
|
tkey="service-table"
|
||||||
/>
|
/>
|
||||||
@@ -178,10 +231,25 @@ export default function Client({
|
|||||||
onClose={closeSnackBar}
|
onClose={closeSnackBar}
|
||||||
anchorOrigin={{ vertical: "top", horizontal: "center" }}
|
anchorOrigin={{ vertical: "top", horizontal: "center" }}
|
||||||
open={snackbarOpen}
|
open={snackbarOpen}
|
||||||
autoHideDuration={1000}
|
autoHideDuration={5000}
|
||||||
>
|
>
|
||||||
<Alert severity="success" sx={{ width: "100%" }}>
|
<Alert
|
||||||
{snackbarMessage}
|
severity={snackbarMessage?.severity}
|
||||||
|
// Add some margin or padding to the Alert component
|
||||||
|
sx={{ width: "100%", margin: 1, padding: 2 }}
|
||||||
|
// Add an IconButton component with a CloseIcon inside the Alert component
|
||||||
|
action={
|
||||||
|
<IconButton
|
||||||
|
size="small"
|
||||||
|
aria-label="close"
|
||||||
|
color="inherit"
|
||||||
|
onClick={closeSnackBar}
|
||||||
|
>
|
||||||
|
<CloseIcon fontSize="small" />
|
||||||
|
</IconButton>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{snackbarMessage?.message}
|
||||||
</Alert>
|
</Alert>
|
||||||
</Snackbar>
|
</Snackbar>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import { AppContext } from "./useAppContext";
|
import { AppContext } from "./useAppContext";
|
||||||
|
|
||||||
const useGetEntityByName = (nameOrDid: string) => {
|
const useGetEntityByNameOrDid = (nameOrDid: string) => {
|
||||||
const { data } = useContext(AppContext);
|
const { data } = useContext(AppContext);
|
||||||
const allEntities = data.allEntities;
|
const allEntities = data.allEntities;
|
||||||
|
|
||||||
@@ -16,4 +16,4 @@ const useGetEntityByName = (nameOrDid: string) => {
|
|||||||
return { entity, isLoading: false };
|
return { entity, isLoading: false };
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useGetEntityByName;
|
export default useGetEntityByNameOrDid;
|
||||||
@@ -36,7 +36,6 @@ 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);
|
||||||
|
|
||||||
console.log("renderTableCell key", cellKey);
|
|
||||||
return (
|
return (
|
||||||
<StyledTableCell key={cellKey} align="left">
|
<StyledTableCell key={cellKey} align="left">
|
||||||
{renderedValue}
|
{renderedValue}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ export const ServiceTableConfig = [
|
|||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
console.log("render", renderedValue);
|
|
||||||
return renderedValue;
|
return renderedValue;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user