From ac0babd412e3b5282136a5c5c5be2c4cc4be6895 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 23 Jan 2024 18:56:23 +0100 Subject: 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 --- src/vlibapi/api_common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/vlibapi') diff --git a/src/vlibapi/api_common.h b/src/vlibapi/api_common.h index 35d3b2a110e..62a8d4c62d8 100644 --- a/src/vlibapi/api_common.h +++ b/src/vlibapi/api_common.h @@ -354,6 +354,8 @@ typedef struct api_main_t /** client message index hash table */ uword *msg_index_by_name_and_crc; + /** plugin JSON representation vector table */ + u8 **json_api_repr; /** api version list */ api_version_t *api_version_list; -- cgit 1.2.3-korg