pluginsdk

package
v0.0.0-...-1d1d6d3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Plugin SDK for Open Baton Managers. Uses the sdk package passing specific implementation of certain functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProtocolFail error = plugError{"protocol error, NFVO and plugin are out of sync"}
)

Functions

func GetBaseVimInstance

func GetBaseVimInstance(vimInstance interface{}) (*catalogue.BaseVimInstance, error)

Obtain a Generic vim instance from a interfaced struct

func GetConcrete

func GetConcrete(jsonArg json.RawMessage, destType interface{}) reflect.Value

Unmarshal the json raw message to the right struct type for the Network and Image types

func GetDockerVimInstance

func GetDockerVimInstance(vimInstance interface{}) (*catalogue.DockerVimInstance, error)

Obtain a Docker vim instance from a interfaced struct

func GetOpenstackVimInstance

func GetOpenstackVimInstance(vimInstance interface{}) (*catalogue.OpenstackVimInstance, error)

Obtain a Openstack vim instance from a interfaced struct

func GetVimInstance

func GetVimInstance(jsonArg json.RawMessage, argValue map[string]interface{}) interface{}

Unmarshal the json raw message to the right struct type for the Vim Instance types

func Start

func Start(confPath string, h HandlerVim, name string, net catalogue.BaseNetworkInt, img catalogue.BaseImageInt) error

Start the plugin using the configuration file

func StartWithConfig

func StartWithConfig(typ, username, password, loglevel, brokerip string, workers, brokerPort, timeout int, h HandlerVim, name string, net catalogue.BaseNetworkInt, img catalogue.BaseImageInt) error

Start the plugin with specific configuration

Types

type HandlerVim

type HandlerVim interface {
	AddFlavour(vimInstance interface{}, deploymentFlavour *catalogue.DeploymentFlavour) (*catalogue.DeploymentFlavour, error)

	AddImage(vimInstance interface{}, image catalogue.BaseImageInt, imageFile []byte) (catalogue.BaseImageInt, error)

	AddImageFromURL(vimInstance interface{}, image catalogue.BaseImageInt, imageURL string) (catalogue.BaseImageInt, error)

	CopyImage(vimInstance interface{}, image catalogue.BaseImageInt, imageFile []byte) (catalogue.BaseImageInt, error)

	CreateNetwork(vimInstance interface{}, network catalogue.BaseNetworkInt) (catalogue.BaseNetworkInt, error)

	CreateSubnet(vimInstance interface{}, createdNetwork catalogue.BaseNetworkInt, subnet *catalogue.Subnet) (*catalogue.Subnet, error)

	DeleteFlavour(vimInstance interface{}, extID string) (bool, error)

	DeleteImage(vimInstance interface{}, image catalogue.BaseImageInt) (bool, error)

	DeleteNetwork(vimInstance interface{}, extID string) (bool, error)

	DeleteServerByIDAndWait(vimInstance interface{}, id string) error

	DeleteSubnet(vimInstance interface{}, existingSubnetExtID string) (bool, error)

	Refresh(vimInstance interface{}) (interface{}, error)

	LaunchInstance(
		vimInstance interface{},
		name, image, Flavour, keypair string,
		network []*catalogue.VNFDConnectionPoint,
		secGroup []string,
		userData string) (*catalogue.Server, error)

	LaunchInstanceAndWait(
		vimInstance interface{},
		hostname, image, extID, keyPair string,
		network []*catalogue.VNFDConnectionPoint,
		securityGroups []string,
		s string) (*catalogue.Server, error)

	LaunchInstanceAndWaitWithIPs(
		vimInstance interface{},
		hostname, image, extID, keyPair string,
		network []*catalogue.VNFDConnectionPoint,
		securityGroups []string,
		s string,
		floatingIps map[string]string,
		keys []*catalogue.Key) (*catalogue.Server, error)

	ListFlavours(vimInstance interface{}) ([]*catalogue.DeploymentFlavour, error)

	ListImages(vimInstance interface{}) (catalogue.BaseImageInt, error)

	ListNetworks(vimInstance interface{}) (catalogue.BaseNetworkInt, error)

	ListServer(vimInstance interface{}) ([]*catalogue.Server, error)

	NetworkByID(vimInstance interface{}, id string) (catalogue.BaseNetworkInt, error)

	Quota(vimInstance interface{}) (*catalogue.Quota, error)

	SubnetsExtIDs(vimInstance interface{}, networkExtID string) ([]string, error)

	Type(vimInstance interface{}) (string, error)

	UpdateFlavour(vimInstance interface{}, deploymentFlavour *catalogue.DeploymentFlavour) (*catalogue.DeploymentFlavour, error)

	UpdateImage(vimInstance interface{}, image catalogue.BaseImageInt) (catalogue.BaseImageInt, error)

	UpdateNetwork(vimInstance interface{}, network catalogue.BaseNetworkInt) (catalogue.BaseNetworkInt, error)

	UpdateSubnet(vimInstance interface{}, createdNetwork catalogue.BaseNetworkInt, subnet *catalogue.Subnet) (*catalogue.Subnet, error)

	RebuildServer(vimInstance interface{}, serverId string, imageId string) (*catalogue.Server, error)
}

The Handler interface defines an abstraction of the operations that a VNFM should provide.

type PluginConfig

type PluginConfig struct {
	Type       string `toml:"type"`
	Workers    int    `toml:"workers"`
	Username   string `toml:"username"`
	Password   string `toml:"password"`
	LogLevel   string `toml:"logLevel"`
	BrokerIp   string `toml:"brokerIp"`
	BrokerPort int    `toml:"brokerPort"`
	Timeout    int    `toml:"timeout"`
}

The Config struct for a plugin

Jump to

Keyboard shortcuts

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