restplugin

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

README

REST API Plugin

The restplugin is a core Agent Plugin used of exposing REST API for the following:

  • Run VPP CLI commands
  • Exposes existing Northbound objects
  • Provides logging mechanism so that the VPPCLI command and response can be searched in elastic search

VPP CLI commands

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

Exposing existing Northbound objects

curl http://0.0.0.0:9191/interfaces
curl http://0.0.0.0:9191/bridgedomainids
curl http://0.0.0.0:9191/bridgedomains
curl http://0.0.0.0:9191/fibs
curl http://0.0.0.0:9191/xconnectpairs
curl http://0.0.0.0:9191/staticroutes

curl -H "Content-Type: application/json" -X POST -d '{"swIndex":"0"}' http://0.0.0.0:9191/interface/acl

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".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTAPIPlugin

type RESTAPIPlugin struct {
	Deps RESTAPIPluginDeps
}

RESTAPIPlugin - registers VPP REST API Plugin

func (*RESTAPIPlugin) AfterInit

func (plugin *RESTAPIPlugin) AfterInit() (err error)

AfterInit - used to register HTTP handlers

func (*RESTAPIPlugin) Close

func (plugin *RESTAPIPlugin) Close() (err error)

Close - used to clean up resources used by RESTAPIPlugin

func (*RESTAPIPlugin) Init

func (plugin *RESTAPIPlugin) Init() (err error)

Init - initializes the RESTAPIPlugin

type RESTAPIPluginDeps

type RESTAPIPluginDeps struct {
	local.PluginInfraDeps
	HTTPHandlers rest.HTTPHandlers
	GoVppmux     govppmux.API
}

RESTAPIPluginDeps - dependencies of RESTAPIPlugin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL