generated from Luis/nextjs-python-web-template
Added http request to emulate_fastapi for GET resolutions
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import urllib
|
import urllib
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse, JSONResponse
|
||||||
|
|
||||||
|
from clan_cli.webui.schemas import Resolution
|
||||||
|
|
||||||
from .config import config
|
from .config import config
|
||||||
|
|
||||||
@@ -19,13 +22,8 @@ apps = [
|
|||||||
(app_c2, config.port_client_base + 1),
|
(app_c2, config.port_client_base + 1),
|
||||||
]
|
]
|
||||||
|
|
||||||
# bash tests: curl localhost:6600/ap_list_of_services
|
|
||||||
# curl localhost:7001/consume_service_from_other_entity
|
|
||||||
|
|
||||||
|
|
||||||
#### HEALTH
|
|
||||||
|
|
||||||
|
|
||||||
|
#### HEALTHCHECK
|
||||||
@app_c1.get("/health")
|
@app_c1.get("/health")
|
||||||
async def healthcheck_c1() -> str:
|
async def healthcheck_c1() -> str:
|
||||||
return "200 OK"
|
return "200 OK"
|
||||||
@@ -88,127 +86,74 @@ async def consume_service_from_other_entity_c2() -> HTMLResponse:
|
|||||||
return HTMLResponse(content=html_content, status_code=200)
|
return HTMLResponse(content=html_content, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
#### ap_list_of_services
|
@app_ap.get("/ap_list_of_services", response_class=JSONResponse)
|
||||||
|
async def ap_list_of_services() -> JSONResponse:
|
||||||
|
res = [
|
||||||
|
{
|
||||||
|
"uuid": "98ae4334-6c12-ace8-ae34-0454cac5b68c",
|
||||||
|
"service_name": "Carlos Printing46",
|
||||||
|
"service_type": "3D Printing",
|
||||||
|
"endpoint_url": "127.0.0.1:6600/v1/print_daemon46",
|
||||||
|
"status": "unknown",
|
||||||
|
"other": {"action": ["register", "deregister", "delete", "create"]},
|
||||||
|
"entity_did": "did:sov:test:6600",
|
||||||
|
"entity": {
|
||||||
|
"did": "did:sov:test:6600",
|
||||||
|
"name": "AP",
|
||||||
|
"ip": "127.0.0.1:6600",
|
||||||
|
"network": "255.255.0.0",
|
||||||
|
"visible": True,
|
||||||
|
"other": {},
|
||||||
|
"attached": False,
|
||||||
|
"stop_health_task": False,
|
||||||
|
"roles": ["AP"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "988c24c9-61b1-cd22-6280-1c4510435a10",
|
||||||
|
"service_name": "Carlos Printing47",
|
||||||
|
"service_type": "3D Printing",
|
||||||
|
"endpoint_url": "127.0.0.1:6600/v1/print_daemon47",
|
||||||
|
"status": "unknown",
|
||||||
|
"other": {"action": ["register", "deregister", "delete", "create"]},
|
||||||
|
"entity_did": "did:sov:test:6600",
|
||||||
|
"entity": {
|
||||||
|
"did": "did:sov:test:6600",
|
||||||
|
"name": "AP",
|
||||||
|
"ip": "127.0.0.1:6600",
|
||||||
|
"network": "255.255.0.0",
|
||||||
|
"visible": True,
|
||||||
|
"other": {},
|
||||||
|
"attached": False,
|
||||||
|
"stop_health_task": False,
|
||||||
|
"roles": ["AP"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
# resp = json.dumps(obj=res)
|
||||||
|
return JSONResponse(content=res, status_code=200)
|
||||||
|
|
||||||
|
|
||||||
@app_ap.get("/ap_list_of_services", response_class=HTMLResponse)
|
@app_dlg.get("/dlg_list_of_did_resolutions", response_model=list[Resolution])
|
||||||
async def ap_list_of_services() -> HTMLResponse:
|
async def dlg_list_of_did_resolutions() -> list[Resolution]:
|
||||||
html_content = b"""HTTP/1.1 200 OK\r\n\r\n[[
|
res = []
|
||||||
{
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uuid": "8e285c0c-4e40-430a-a477-26b3b81e30d1",
|
|
||||||
"service_name": "Luiss Fax",
|
|
||||||
"service_type": "Fax",
|
|
||||||
"endpoint_url": "http://127.0.0.1:8000",
|
|
||||||
"status": "unknown",
|
|
||||||
"other": {
|
|
||||||
"action": [
|
|
||||||
"register",
|
|
||||||
"deregister",
|
|
||||||
"delete",
|
|
||||||
"create"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"entity_did": "did:sov:test:1235"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uuid": "8e285c0c-4e40-430a-a477-26b3b81e30d2",
|
|
||||||
"service_name": "Erdems VR-Stream",
|
|
||||||
"service_type": "VR-Stream",
|
|
||||||
"endpoint_url": "http://127.0.0.1:8000",
|
|
||||||
"status": "unknown",
|
|
||||||
"other": {
|
|
||||||
"action": [
|
|
||||||
"register",
|
|
||||||
"deregister",
|
|
||||||
"delete",
|
|
||||||
"create"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"entity_did": "did:sov:test:1236"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uuid": "8e285c0c-4e40-430a-a477-26b3b81e30d3",
|
|
||||||
"service_name": "Onurs gallary",
|
|
||||||
"service_type": "gallary",
|
|
||||||
"endpoint_url": "http://127.0.0.1:8000",
|
|
||||||
"status": "unknown",
|
|
||||||
"other": {
|
|
||||||
"action": [
|
|
||||||
"register",
|
|
||||||
"deregister",
|
|
||||||
"delete",
|
|
||||||
"create"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"entity_did": "did:sov:test:1237"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uuid": "8e285c0c-4e40-430a-a477-26b3b81e30d4",
|
|
||||||
"service_name": "Saras Game-Shop",
|
|
||||||
"service_type": "Game-Shop",
|
|
||||||
"endpoint_url": "http://127.0.0.1:8000",
|
|
||||||
"status": "unknown",
|
|
||||||
"other": {
|
|
||||||
"action": [
|
|
||||||
"register",
|
|
||||||
"deregister",
|
|
||||||
"delete",
|
|
||||||
"create"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"entity_did": "did:sov:test:1238"
|
|
||||||
}
|
|
||||||
]]"""
|
|
||||||
return HTMLResponse(content=html_content, status_code=200)
|
|
||||||
|
|
||||||
|
res.append(
|
||||||
@app_dlg.get("/dlg_list_of_did_resolutions", response_class=HTMLResponse)
|
Resolution(
|
||||||
async def dlg_list_of_did_resolutions() -> HTMLResponse:
|
timestamp=datetime.fromisoformat("2021-10-12T12:52:00.000Z"),
|
||||||
html_content = b"""HTTP/1.1 200 OK\r\n\r\n
|
requester_name="C1",
|
||||||
[
|
requester_did="did:sov:test:1122",
|
||||||
{
|
resolved_did="did:sov:test:1234",
|
||||||
"did": "did:sov:test:1234",
|
other={"test": "test"},
|
||||||
"name": "C1",
|
)
|
||||||
"ip": "127.0.0.1:5100",
|
)
|
||||||
"attached": false,
|
res.append(
|
||||||
"visible": true,
|
Resolution(
|
||||||
"other": {
|
timestamp=datetime.fromisoformat("2021-10-12T12:53:00.000Z"),
|
||||||
"network": "Carlo1's Home Network",
|
requester_name="C2",
|
||||||
"roles": [
|
requester_did="did:sov:test:1123",
|
||||||
"service repository",
|
resolved_did="did:sov:test:1234",
|
||||||
"service consumer"
|
other={"test": "test"},
|
||||||
]
|
)
|
||||||
}
|
)
|
||||||
},
|
return res
|
||||||
{
|
|
||||||
"did": "did:sov:test:1235",
|
|
||||||
"name": "C2",
|
|
||||||
"ip": "127.0.0.1:5100",
|
|
||||||
"attached": false,
|
|
||||||
"visible": true,
|
|
||||||
"other": {
|
|
||||||
"network": "Carlo2's Home Network",
|
|
||||||
"roles": [
|
|
||||||
"service repository",
|
|
||||||
"service prosumer"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]"""
|
|
||||||
return HTMLResponse(content=html_content, status_code=200)
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
@@ -49,7 +48,7 @@ def get_all_services(
|
|||||||
|
|
||||||
@router.get("/api/v1/service", response_model=List[Service], tags=[Tags.services])
|
@router.get("/api/v1/service", response_model=List[Service], tags=[Tags.services])
|
||||||
def get_service_by_did(
|
def get_service_by_did(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
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),
|
||||||
@@ -64,7 +63,7 @@ def get_service_by_did(
|
|||||||
tags=[Tags.services],
|
tags=[Tags.services],
|
||||||
)
|
)
|
||||||
def get_services_without_entity(
|
def get_services_without_entity(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
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),
|
||||||
@@ -75,7 +74,7 @@ def get_services_without_entity(
|
|||||||
|
|
||||||
@router.delete("/api/v1/service", tags=[Tags.services])
|
@router.delete("/api/v1/service", tags=[Tags.services])
|
||||||
def delete_service(
|
def delete_service(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
sql_crud.delete_service_by_entity_did(db, entity_did)
|
sql_crud.delete_service_by_entity_did(db, entity_did)
|
||||||
@@ -126,7 +125,7 @@ def get_all_entities(
|
|||||||
|
|
||||||
@router.get("/api/v1/entity", response_model=Optional[Entity], tags=[Tags.entities])
|
@router.get("/api/v1/entity", response_model=Optional[Entity], tags=[Tags.entities])
|
||||||
def get_entity_by_did(
|
def get_entity_by_did(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> Optional[sql_models.Entity]:
|
) -> Optional[sql_models.Entity]:
|
||||||
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
@@ -148,7 +147,7 @@ def get_attached_entities(
|
|||||||
@router.put("/api/v1/detach", tags=[Tags.entities])
|
@router.put("/api/v1/detach", tags=[Tags.entities])
|
||||||
def detach_entity(
|
def detach_entity(
|
||||||
background_tasks: BackgroundTasks,
|
background_tasks: BackgroundTasks,
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
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),
|
||||||
@@ -163,7 +162,7 @@ def detach_entity(
|
|||||||
@router.put("/api/v1/attach", tags=[Tags.entities])
|
@router.put("/api/v1/attach", tags=[Tags.entities])
|
||||||
def attach_entity(
|
def attach_entity(
|
||||||
background_tasks: BackgroundTasks,
|
background_tasks: BackgroundTasks,
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
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),
|
||||||
@@ -180,7 +179,7 @@ def attach_entity(
|
|||||||
|
|
||||||
@router.get("/api/v1/is_attached", tags=[Tags.entities])
|
@router.get("/api/v1/is_attached", tags=[Tags.entities])
|
||||||
def is_attached(
|
def is_attached(
|
||||||
entity_did: str = "did:sov:test:1234", db: Session = Depends(sql_db.get_db)
|
entity_did: str = "did:sov:test:120", db: Session = Depends(sql_db.get_db)
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
entity = sql_crud.get_entity_by_did(db, did=entity_did)
|
||||||
|
|
||||||
@@ -229,8 +228,8 @@ def attach_entity_loc(db: Session, entity_did: str) -> None:
|
|||||||
|
|
||||||
|
|
||||||
@router.delete("/api/v1/entity", tags=[Tags.entities])
|
@router.delete("/api/v1/entity", tags=[Tags.entities])
|
||||||
async def delete_entity(
|
def delete_entity(
|
||||||
entity_did: str = "did:sov:test:1234",
|
entity_did: str = "did:sov:test:120",
|
||||||
db: Session = Depends(sql_db.get_db),
|
db: Session = Depends(sql_db.get_db),
|
||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
sql_crud.delete_entity_by_did_recursive(db, did=entity_did)
|
sql_crud.delete_entity_by_did_recursive(db, did=entity_did)
|
||||||
@@ -245,21 +244,27 @@ async def delete_entity(
|
|||||||
@router.get(
|
@router.get(
|
||||||
"/api/v1/resolutions", response_model=List[Resolution], tags=[Tags.resolutions]
|
"/api/v1/resolutions", response_model=List[Resolution], tags=[Tags.resolutions]
|
||||||
)
|
)
|
||||||
async def get_all_resolutions(
|
def get_all_resolutions(
|
||||||
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[Resolution]:
|
) -> List[Resolution]:
|
||||||
# TODO: Get resolutions from DLG entity
|
matching_entities = sql_crud.get_entity_by_role(db, roles=[Role("DLG")])
|
||||||
|
if matching_entities is None:
|
||||||
|
raise ClanError("No DLG found")
|
||||||
|
if len(matching_entities) > 1:
|
||||||
|
raise ClanError("More than one DLG found")
|
||||||
|
dlg = matching_entities[0]
|
||||||
|
|
||||||
return [
|
url = f"http://{dlg.ip}/dlg_list_of_did_resolutions"
|
||||||
Resolution(
|
try:
|
||||||
requester_name="C1",
|
response = httpx.get(url, timeout=2)
|
||||||
requester_did="did:sov:test:1122",
|
except httpx.HTTPError as e:
|
||||||
resolved_did="did:sov:test:1234",
|
raise ClanError(f"DLG not reachable at {url}") from e
|
||||||
other={"test": "test"},
|
|
||||||
timestamp=datetime.now(),
|
if response.status_code != 200:
|
||||||
id=1,
|
raise ClanError(f"DLG returned {response.status_code}")
|
||||||
)
|
|
||||||
]
|
resolutions = response.json()
|
||||||
|
return resolutions
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
@@ -267,12 +272,10 @@ async def get_all_resolutions(
|
|||||||
# Eventmessage #
|
# Eventmessage #
|
||||||
# #
|
# #
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
|
|
||||||
@router.post(
|
@router.post(
|
||||||
"/api/v1/event_message", response_model=Eventmessage, tags=[Tags.eventmessages]
|
"/api/v1/event_message", response_model=Eventmessage, tags=[Tags.eventmessages]
|
||||||
)
|
)
|
||||||
async def create_eventmessage(
|
def create_eventmessage(
|
||||||
eventmsg: EventmessageCreate, db: Session = Depends(sql_db.get_db)
|
eventmsg: EventmessageCreate, db: Session = Depends(sql_db.get_db)
|
||||||
) -> EventmessageCreate:
|
) -> EventmessageCreate:
|
||||||
return sql_crud.create_eventmessage(db, eventmsg)
|
return sql_crud.create_eventmessage(db, eventmsg)
|
||||||
@@ -283,7 +286,7 @@ async def create_eventmessage(
|
|||||||
response_model=List[Eventmessage],
|
response_model=List[Eventmessage],
|
||||||
tags=[Tags.eventmessages],
|
tags=[Tags.eventmessages],
|
||||||
)
|
)
|
||||||
async def get_all_eventmessages(
|
def get_all_eventmessages(
|
||||||
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.Eventmessage]:
|
) -> List[sql_models.Eventmessage]:
|
||||||
eventmessages = sql_crud.get_eventmessages(db, skip=skip, limit=limit)
|
eventmessages = sql_crud.get_eventmessages(db, skip=skip, limit=limit)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class EntityRoles(EntityRolesBase):
|
|||||||
|
|
||||||
|
|
||||||
class EntityBase(BaseModel):
|
class EntityBase(BaseModel):
|
||||||
did: str = Field(..., example="did:sov:test:1234")
|
did: str = Field(..., example="did:sov:test:120")
|
||||||
name: str = Field(..., example="C1")
|
name: str = Field(..., example="C1")
|
||||||
ip: str = Field(..., example="127.0.0.1")
|
ip: str = Field(..., example="127.0.0.1")
|
||||||
network: str = Field(..., example="255.255.0.0")
|
network: str = Field(..., example="255.255.0.0")
|
||||||
@@ -93,7 +93,7 @@ class ServiceBase(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class ServiceCreate(ServiceBase):
|
class ServiceCreate(ServiceBase):
|
||||||
entity_did: str = Field(..., example="did:sov:test:1234")
|
entity_did: str = Field(..., example="did:sov:test:120")
|
||||||
|
|
||||||
|
|
||||||
class Service(ServiceCreate):
|
class Service(ServiceCreate):
|
||||||
@@ -119,7 +119,7 @@ class ServicesByName(BaseModel):
|
|||||||
class ResolutionBase(BaseModel):
|
class ResolutionBase(BaseModel):
|
||||||
requester_name: str = Field(..., example="C1")
|
requester_name: str = Field(..., example="C1")
|
||||||
requester_did: str = Field(..., example="did:sov:test:1122")
|
requester_did: str = Field(..., example="did:sov:test:1122")
|
||||||
resolved_did: str = Field(..., example="did:sov:test:1234")
|
resolved_did: str = Field(..., example="did:sov:test:120")
|
||||||
other: dict = Field(..., example={"test": "test"})
|
other: dict = Field(..., example={"test": "test"})
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +129,6 @@ class ResolutionCreate(ResolutionBase):
|
|||||||
|
|
||||||
class Resolution(ResolutionCreate):
|
class Resolution(ResolutionCreate):
|
||||||
timestamp: datetime
|
timestamp: datetime
|
||||||
id: int
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
orm_mode = True
|
orm_mode = True
|
||||||
@@ -148,7 +147,7 @@ class EventmessageBase(BaseModel):
|
|||||||
) # specific to one group needed to enable visually nested groups
|
) # specific to one group needed to enable visually nested groups
|
||||||
msg_type: int = Field(..., example=1) # message type for the label
|
msg_type: int = Field(..., example=1) # message type for the label
|
||||||
src_did: str = Field(..., example="did:sov:test:2234")
|
src_did: str = Field(..., example="did:sov:test:2234")
|
||||||
des_did: str = Field(..., example="did:sov:test:1234")
|
des_did: str = Field(..., example="did:sov:test:120")
|
||||||
|
|
||||||
|
|
||||||
class EventmessageCreate(EventmessageBase):
|
class EventmessageCreate(EventmessageBase):
|
||||||
|
|||||||
@@ -135,7 +135,11 @@ def start_server(args: argparse.Namespace) -> None:
|
|||||||
proc = mp.Process(
|
proc = mp.Process(
|
||||||
target=uvicorn.run,
|
target=uvicorn.run,
|
||||||
args=(app,),
|
args=(app,),
|
||||||
kwargs={"host": args.host, "port": port, "log_level": "info"},
|
kwargs={
|
||||||
|
"host": args.host,
|
||||||
|
"port": port,
|
||||||
|
"log_level": args.log_level,
|
||||||
|
},
|
||||||
daemon=True,
|
daemon=True,
|
||||||
)
|
)
|
||||||
proc.start()
|
proc.start()
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def create_entities(num: int = 10, role: str = "entity") -> list[EntityCreate]:
|
|||||||
dlg = EntityCreate(
|
dlg = EntityCreate(
|
||||||
did=f"did:sov:test:{port_dlg}",
|
did=f"did:sov:test:{port_dlg}",
|
||||||
name="DLG",
|
name="DLG",
|
||||||
ip=f"{host}:{port_dlg}/health",
|
ip=f"{host}:{port_dlg}",
|
||||||
network="255.255.0.0",
|
network="255.255.0.0",
|
||||||
roles=[Role("DLG")],
|
roles=[Role("DLG")],
|
||||||
visible=True,
|
visible=True,
|
||||||
@@ -64,7 +64,7 @@ def create_entities(num: int = 10, role: str = "entity") -> list[EntityCreate]:
|
|||||||
ap = EntityCreate(
|
ap = EntityCreate(
|
||||||
did=f"did:sov:test:{port_ap}",
|
did=f"did:sov:test:{port_ap}",
|
||||||
name="AP",
|
name="AP",
|
||||||
ip=f"{host}:{port_ap}/health",
|
ip=f"{host}:{port_ap}",
|
||||||
network="255.255.0.0",
|
network="255.255.0.0",
|
||||||
roles=[Role("AP")],
|
roles=[Role("AP")],
|
||||||
visible=True,
|
visible=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user