3 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 vpp = require "vpp-lapi"
20 root_dir = "/home/ubuntu/vpp"
21 pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
23 vpp:init({ pneum_path = pneum_path })
25 vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
30 reply = vpp:api_call("show_version")
31 print("Version: ", reply[1].version)
32 print(vpp.hex_dump(reply[1].version))
33 print(vpp.dump(reply))
37 reply = vpp:api_call("cli_inband", { cmd = "show vers" })
38 print(vpp.dump(reply))