api: provide api definition over api 45/40245/7
authorOle Troan <otroan@employees.org>
Tue, 23 Jan 2024 17:56:23 +0000 (18:56 +0100)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Mon, 29 Jan 2024 22:57:31 +0000 (22:57 +0000)
commitac0babd412e3b5282136a5c5c5be2c4cc4be6895
tree5c58249463d7121a163534e55b1d5f6f27ae7967
parentf34b6800de78d99192dc5757a4845e2668749c40
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>
src/cmake/api.cmake
src/tools/vppapigen/generate_json.py
src/tools/vppapigen/vppapigen_c.py
src/tools/vppapigen/vppapigen_json.py
src/vlibapi/api_common.h
src/vlibmemory/memclnt.api
src/vlibmemory/memclnt_api.c
src/vpp-api/python/setup.py
src/vpp-api/python/vpp_papi/data/memclnt.api.json [new file with mode: 0644]
src/vpp-api/python/vpp_papi/vpp_papi.py