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/cmake/api.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmake') diff --git a/src/cmake/api.cmake b/src/cmake/api.cmake index 831c2b1e32d..0e273a7d4dc 100644 --- a/src/cmake/api.cmake +++ b/src/cmake/api.cmake @@ -64,7 +64,7 @@ function(vpp_generate_api_json_header file dir component) add_custom_command (OUTPUT ${output_name} COMMAND mkdir -p ${output_dir} COMMAND ${PYENV} ${VPP_APIGEN} - ARGS ${includedir} --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} JSON --output ${output_name} + ARGS ${includedir} --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} JSON --outputdir ${output_dir} --output ${output_name} DEPENDS ${VPP_APIGEN} ${CMAKE_CURRENT_SOURCE_DIR}/${file} COMMENT "Generating API header ${output_name}" ) -- cgit 1.2.3-korg