package
1.9.0-alpha
Repository: https://github.com/lxlee1102/vpp-agent.git
Documentation: pkg.go.dev

# README

REST API Plugin

The restplugin is a core Agent Plugin used to expose REST API for the following:

Index page

Open http://0.0.0.0:9191/ in the browser to see index page containing list of all exposed data. Configuration items are sorted by type (ifplugin, telemetry, etc.)

Execute VPP CLI commands

curl -H "Content-Type: application/json" -X POST -d '{"vppclicommand":"show interface"}' http://0.0.0.0:9191/vpp/command

Dump NB objects

Here is the list of supported REST URLs. If configuration dump URL is used, the output is based on proto model structure for given data type together with VPP-specific data which are not a part of the model (indexes for interfaces or ACLs, internal names, etc.). Those data are in separate section labeled as Meta.

Access lists

URLs to obtain ACL IP/MACIP configuration are as follows.

curl GET http://0.0.0.0:9191/vpp/dump/v1/acl/ip
curl GET http://0.0.0.0:9191/vpp/dump/v1/acl/macip 

VPP Interfaces

REST plugin exposes configured VPP interfaces, which can be show all together, or only interfaces of specific type.

curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/loopback
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/ethernet
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/memif
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/tap
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/vxlan
curl GET http://0.0.0.0:9191/vpp/dump/v1/interfaces/afpacket

Linux Interfaces

REST plugin exposes configured Linux interfaces. All configured interfaces are dumped, together with all interfaces in default namespace

curl GET https://0.0.0.0:9191/linux/dump/v1/interfaces

BFD

REST plugin allows to dump bidirectional forwarding detection sessions, authentication keys, or the whole configuration.

curl GET http://0.0.0.0:9191/vpp/dump/v1/bfd
curl GET http://0.0.0.0:9191/vpp/dump/v1/bfd/sessions
curl GET http://0.0.0.0:9191/vpp/dump/v1/bfd/authkeys

NAT

REST plugin allows to dump NAT44 global configuration, DNAT configuration or both of them together. SNAT is currently not supported in the model, so REST dump is not available as well.

curl GET http://0.0.0.0:9191/vpp/dump/v1/nat
curl GET http://0.0.0.0:9191/vpp/dump/v1/nat/global
curl GET http://0.0.0.0:9191/vpp/dump/v1/nat/dnat

STN

Steal the NIC feature REST API contains one uri returning the list of STN rules.

curl GET http://0.0.0.0:9191/vpp/dump/v1/stn

L2 plugin

Support for bridge domains, FIBs and cross connects. It is also possible to get all the bridge domain IDs.

curl GET http://0.0.0.0:9191/vpp/dump/v1/bdid
curl GET http://0.0.0.0:9191/vpp/dump/v1/bd
curl GET http://0.0.0.0:9191/vpp/dump/v1/fib
curl GET http://0.0.0.0:9191/vpp/dump/v1/xc

L3 plugin

ARPs, proxy ARP interfaces/ranges and static routes exposed via REST:

curl GET http://0.0.0.0:9191/vpp/dump/v1/arps
curl GET http://0.0.0.0:9191/vpp/dump/v1/proxyarp/interfaces
curl GET http://0.0.0.0:9191/vpp/dump/v1/proxyarp/ranges
curl GET http://0.0.0.0:9191/vpp/dump/v1/routes

Linux L3 plugin

Linux ARP and linux routes exposed via REST:

curl GET http://0.0.0.0:9191/linux/dump/v1/arps
curl GET http://0.0.0.0:9191/linux/dump/v1/routes

L4 plugin

L4 plugin exposes session configuration:

curl GET http://0.0.0.0:9191/vpp/dump/v1/sessions

Telemetry

REST allows to get all the telemetry data, or selective using specific key:

curl GET http://0.0.0.0:9191/vpp/dump/v1/telemetry
curl GET http://0.0.0.0:9191/vpp/dump/v1/telemetry/memory
curl GET http://0.0.0.0:9191/vpp/dump/v1/telemetry/runtime
curl GET http://0.0.0.0:9191/vpp/dump/v1/telemetry/nodecount

Logging mechanism

The REST API request is logged to stdout. The log contains VPPCLI command and VPPCLI response. It is searchable in elastic search using "VPPCLI".

# Packages

No description provided by the author

# Functions

Asset loads and returns the asset for the given name.
AssetDir returns the file names below a certain directory embedded in the file by go-bindata.
AssetInfo loads and returns the asset info for the given name.
AssetNames returns the names of the assets.
MustAsset is like Asset but panics when Asset would return an error.
NewPlugin creates a new Plugin with the provides Options.
RestoreAsset restores an asset under the given directory.
RestoreAssets restores an asset under the given directory recursively.
UseDeps returns Option that can inject custom dependencies.

# Constants

REST api methods.
POST
REST api methods.

# Structs

Deps represents dependencies of Rest Plugin.
Plugin registers Rest Plugin.

# Type aliases

Option is a function that acts on a Plugin to inject Dependencies or configuration.