mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-08-03 12:16:22 -04:00
Add veilid_features API and logging
This commit is contained in:
parent
ec887d3bec
commit
81b265e4bf
21 changed files with 140 additions and 8 deletions
|
@ -44,6 +44,13 @@ async def test_version(api_connection: veilid.VeilidAPI):
|
|||
print(f"veilid_version_string: {vstr}")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_features(api_connection: veilid.VeilidAPI):
|
||||
features = await api_connection.veilid_features()
|
||||
print(f"veilid_features: {features}")
|
||||
assert isinstance(features, list)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_config(api_connection: veilid.VeilidAPI):
|
||||
cfgstr = await api_connection.default_veilid_config()
|
||||
|
|
|
@ -462,6 +462,10 @@ class VeilidAPI(ABC):
|
|||
async def veilid_version_string(self) -> str:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def veilid_features(self) -> list[str]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def veilid_version(self) -> types.VeilidVersion:
|
||||
pass
|
||||
|
|
|
@ -490,6 +490,9 @@ class _JsonVeilidAPI(VeilidAPI):
|
|||
v = await self.send_ndjson_request(Operation.VEILID_VERSION)
|
||||
return VeilidVersion(v["major"], v["minor"], v["patch"])
|
||||
|
||||
async def veilid_features(self) -> list[str]:
|
||||
return raise_api_result(await self.send_ndjson_request(Operation.VEILID_FEATURES))
|
||||
|
||||
async def default_veilid_config(self) -> str:
|
||||
return raise_api_result(await self.send_ndjson_request(Operation.DEFAULT_VEILID_CONFIG))
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class Operation(StrEnum):
|
|||
DEBUG = "Debug"
|
||||
VEILID_VERSION_STRING = "VeilidVersionString"
|
||||
VEILID_VERSION = "VeilidVersion"
|
||||
VEILID_FEATURES = "VeilidFeatures"
|
||||
DEFAULT_VEILID_CONFIG = "DefaultVeilidConfig"
|
||||
|
||||
|
||||
|
|
|
@ -2479,6 +2479,27 @@
|
|||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"op",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"op": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"VeilidFeatures"
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": [
|
||||
|
|
|
@ -1617,6 +1617,20 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"op"
|
||||
],
|
||||
"properties": {
|
||||
"op": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"VeilidFeatures"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue