mgmt

package
v0.0.0-...-487a084 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mgmt defines a client-server management protocol through AMQP RPC. mgmt is used by the plugin to grant to the VNFM a simple interface to check and manage Pop instances.

Index

Constants

View Source
const (
	// DefaultTimeout is the default timeout for RPC requests.
	DefaultTimeout = vnfmAMQP.DefaultTimeout

	// MgmtExchange is the default exchange to be used.
	MgmtExchange = vnfmAMQP.ExchangeDefault
)

Variables

View Source
var (
	// ErrInternal represents an internal failure.
	ErrInternal = errors.New("internal error")

	// ErrTooFewParams is returned when a request has too few parameters for the
	// requested function.
	ErrTooFewParams = errors.New("not enough parameters for function")

	// ErrMalformedParams generically notifies the caller of malformed parameters.
	ErrMalformedParams = errors.New("malformed parameters")
)
View Source
var (
	ErrConnClosed = errors.New("connection has closed")
)

Functions

This section is empty.

Types

type AMQPChannelAccessor

type AMQPChannelAccessor func() (*amqp.Channel, error)

AMQPChannelAccessor is a function type that represents a function that allows to access an instance of an *amqp.Channel.

type Handler

type Handler interface {
	// AddMetadata sets the given entries as metadata for the server specified by the given
	// id, merging them with existing ones. An empty value will erase the key from the metadata.
	AddMetadata(id string, entries map[string]string) error

	// Check checks if a Server with the given ID is up in the VIM.
	Check(id string) (*catalogue.Server, error)

	// Start starts an already created Server with the given ID.
	Start(id string) error
}

Handler is an interface that represents the concrete functions to be remotely invoked. The Manager primary task is to deliver requests to the Handler and send its responses to the caller.

type VIMConnector

type VIMConnector interface {
	AddMetadata(id string, entries map[string]string) error
	Check(id string) (*catalogue.Server, error)
	Start(id string) error
}

VIMConnector is a client for a remote VIM instance. Its methods mirror those of Handler; invoking one of them actually invokes the method on the remote handler.

func NewConnector

func NewConnector(vimname string, acc AMQPChannelAccessor) VIMConnector

NewConnector creates a new Connector to the Manager for the given VIM instance.

type VIMManager

type VIMManager interface {
	Stop()
}

VIMManager represents a management instance. A VIMManager is associated with a VIM instance, and runs in the background until its Stop() method is called.

func NewManager

func NewManager(
	vimname string,
	h Handler,
	accessor AMQPChannelAccessor,
	l *log.Logger,
) VIMManager

NewManager starts a new VIMManager for the specified VIM Instance.

Jump to

Keyboard shortcuts

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