diff options
author | Ole Troan <otroan@employees.org> | 2024-01-23 18:56:23 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2024-01-29 22:57:31 +0000 |
commit | ac0babd412e3b5282136a5c5c5be2c4cc4be6895 (patch) | |
tree | 5c58249463d7121a163534e55b1d5f6f27ae7967 /src/tools/vppapigen/generate_json.py | |
parent | f34b6800de78d99192dc5757a4845e2668749c40 (diff) |
api: provide api definition over api
This patch allows a client to bootstrap itself by downloading the
JSON API definitions over the API itself.
This patch enables it for Python (probably need a dynamic language).
Call VPPApiClient with the new bootstrapapi=True parameter.
Example (Python):
from vpp_papi import VPPApiClient
vpp = VPPApiClient(bootstrapapi=True)
rv = vpp.connect("foobar")
assert rv == 0
print(f'SHOW VERSION: {vpp.api.show_version()}')
vpp.disconnect()
Type: feature
Change-Id: Id903fdccc82b2e22aa1994331d2c150253f2ccae
Signed-off-by: Ole Troan <otroan@employees.org>
Diffstat (limited to 'src/tools/vppapigen/generate_json.py')
-rwxr-xr-x | src/tools/vppapigen/generate_json.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/vppapigen/generate_json.py b/src/tools/vppapigen/generate_json.py index 610f84f5533..dc5cf9c1bbf 100755 --- a/src/tools/vppapigen/generate_json.py +++ b/src/tools/vppapigen/generate_json.py @@ -110,6 +110,15 @@ def main(): ], f.name, ), + "outputdir": "%s/%s/" + % ( + output_path, + output_dir_map[ + f.as_posix().split("/")[ + src_dir_depth + BASE_DIR.count("/") - 1 + ] + ], + ), "input_file": f.as_posix(), "includedir": [src_dir.as_posix()], "output_module": "JSON", |