cogs

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HarborNet holds the DNS name of the harbor network
	HarborNet = "harbor.net"
	// HarborSvcAddr holds the service address of the harbor network
	HarborSvcAddr = "172.31.0.2" //XXX hardcode
	// HarborVindex holds the virtual network index of the harbor network
	HarborVindex = 2
	// HarborInfraVNI holds the VXLAN VNI of the harbor infrastructure network
	HarborInfraVNI = 2
	// HarborInfraVID holds the VLAN VID of the harbor infrastructure netwrok
	HarborInfraVID = 2
	// HarborXpVNI holds the VXLAN VNI of the harbor experiment network
	HarborXpVNI = 2
)
View Source
const (

	// ContainerKind is a command family that manages containers
	ContainerKind = "container"
	// LaunchCtr launches a container
	LaunchCtr = "launch"
	// PullCtrImage pulls an image for a container
	PullCtrImage = "pull-image"
	// CreateCtr creates a container
	CreateCtr = "create"
	// CreateCtrTask launches a container's task
	CreateCtrTask = "create-task"
	// CreateCtrNs creates a container namespace
	CreateCtrNs = "create-ns"
	// ConfigCtrLo creates a loopback network device for a container
	ConfigCtrLo = "config-lo"
	// CreateCtrRecord creates a container record in the database
	CreateCtrRecord = "create-record"
	// DeleteCtr deletes a container
	DeleteCtr = "delete"
	// DeleteCtrTask deletes a container task
	DeleteCtrTask = "delete-task"
	// DeleteCtrImg deletes a container image
	DeleteCtrImg = "delete-img"
	// DeleteCtrRecord deletes a contianer record from the database
	DeleteCtrRecord = "delete-record"
	// DeleteCtrNS deletes a container namespace
	DeleteCtrNS = "delete-ctr-ns"

	// NodeSetupKind is a command family that manages nodes
	NodeSetupKind = "NodeSetup"
	// NodeRecycleKind recycles a node
	NodeRecycleKind = "NodeRecycle"

	// PlumbingKind is a comand family that manages network plumbing
	PlumbingKind = "plumbing"
	// CreateEnclave creates a new enclave
	CreateEnclave = "create-enclave"
	// DestroyEnclave destroys an existing enclave
	DestroyEnclave = "destroy-enclave"
	// AdvertiseInterfaceMac advertises the mac address of an interface on an EVPN
	// network
	AdvertiseInterfaceMac = "advertise-interface-mac"
	// AdvertiseMac advertises a MAC on an EVPN network
	AdvertiseMac = "advertise-mac"
	// WithdrawMac withdraws a MAC from an EVPN network
	WithdrawMac = "withdraw-mac"
	// DeleteNS deletes a network namespace
	DeleteNS = "delete-ns"

	// NexKind is a command family that manages nex DHCP/DNS services
	NexKind = "Nex"
	// CreateNexNetwork creates a nex network
	CreateNexNetwork = "CreateNetwork"
	// DeleteNexNetwork deletes a nex network
	DeleteNexNetwork = "DeleteNetwork"
	// DeleteNexMembers deletes members from a nex netwok
	DeleteNexMembers = "DeleteMembers"
	// AddNexMembers adds members to a nex network
	AddNexMembers = "AddMembers"

	// CanopyKind is a command family that manages canopy virtual networks
	CanopyKind = "Canopy"
	// SetCanopyLinks sets up links on canopy enabled devices
	SetCanopyLinks = "SetLinks"
	// SetCanopyServiceVtep creates a service VTEP on canopy enabled devices
	SetCanopyServiceVtep = "SetServiceVtep"
	// RemoveCanopyServiceVtep removes a service VTEP from canopy enabled devices
	RemoveCanopyServiceVtep = "RemoveServiceVtep"
	// RemoveCanopyLinks removes links from canopy enabled devices
	RemoveCanopyLinks = "RemoveLinks"

	// MoaKind is a command family that manages Moa network emulator instances
	MoaKind = "Moa"
	// LaunchEmulation creates and launches a new Moa network emulation
	LaunchEmulation = "LaunchEmulation"
	// TeardownEmulation stops and discards a running Moa network emulation
	TeardownEmulation = "TeardownEmulation"

	// BookkeepingKind is a command family for tracking objects in the cogs
	// datastore
	BookkeepingKind = "bookkeeping"
	// DeleteMzinfo deletes materialization info from the cogs datastore
	DeleteMzinfo = "DeleteMzinfo"
	// SetStatus updates materialization object status in the cogs datastore
	SetStatus = "UpdateStatus"
)
View Source
const (
	// InfraCanopyHost is the name of the host that infrapods enter the network
	// on. We currently assume this is the same host rex is running on.
	InfraCanopyHost = "localhost"

	// Svcbr is the name of the service bridge that connects an infrastructure
	// host to infrapod containers
	Svcbr = "svcbr"
)
View Source
const (
	// FoundryImage is foundry container image URI used by the cogs
	FoundryImage = "docker.io/mergetb/foundry:latest"
	// FoundryCertMountName is the name of the foundry TLS cert container mount
	// point
	FoundryCertMountName = "foundry-cert"
	// FoundryCertMountSource is the host location of the foundry TLS cert
	FoundryCertMountSource = "/etc/foundry/manage.pem"
	// FoundryCertMountDest is the container filesystem location of the foundry
	// TLS cert
	FoundryCertMountDest = "/etc/foundry/manage.pem"
	// FoundryKeyMountName is the name of the foundry TLS key container mount
	// point
	FoundryKeyMountName = "foundry-key"
	// FoundryKeyMountSource is the host location of the foundry TLS key
	FoundryKeyMountSource = "/etc/foundry/manage-key.pem"
	// FoundryKeyMountDest is the container filesystem location of the foundry TLS
	// key
	FoundryKeyMountDest = "/etc/foundry/manage-key.pem"
	// FoundryEnv is the environment variable used to pass args to foundry
	FoundryEnv = "FOUNDRYD_ARGS"
	// FoundryArgs are the args passed to the foundry infrapod container
	FoundryArgs = "-no-auth"
)
View Source
const (
	// NexImage is the container image used to launch nex containers in infrapods.
	NexImage = "docker.io/mergetb/nex:v0.4.8"
	// NexMountName is the name of the mount used for mounting nex configs.
	NexMountName = "nex-config"
	// NexMountSource is the host location for the nex container config mount.
	NexMountSource = "/etc/cogs/nex.yml"
	// NexMountDest is the container location for the nex container config mount.
	NexMountDest = "/etc/nex/nex.yml"
	// NexDomainEnv is the nex domain name environment variable key.
	NexDomainEnv = "DOMAIN"
)
View Source
const (
	// InfrapodMznIfx is the name of the materialization interface in an infrapod
	InfrapodMznIfx = "ceth0"
	// InfrapodSvcIfx is the name of the service interface in an infrapod
	InfrapodSvcIfx = "ceth1"
	// DefaultInternalGateway is the infrapod default internal gateway
	DefaultInternalGateway = "172.30.0.1"
	// DefaultInternalGatewayCIDR is the infrapod default internal gateway CIDR
	DefaultInternalGatewayCIDR = "172.30.0.1/16"
	// DefaultServiceGateway is the default service gateway for an infrapod
	DefaultServiceGateway = "172.31.0.1"

	// HarborVni is the VXLAN VNI used for the harbor
	HarborVni = 2
	// HarborVid is the VLAN VID used for the harbor
	HarborVid = 2
	// MaxSystemVindex is the maximum value that can be used for system-level
	// virtual network indices.
	MaxSystemVindex = 100

	// VindexKey is the datastore key used to access the vindex counter
	VindexKey = "vindex"
	// InfraVniKey is the datastore key used to access the infrapod VXLAN VNI
	// counter
	InfraVniKey = "ivni"
	// InfraVidKey is the datastore key used to access the infrapod VLAN VID
	// counter
	InfraVidKey = "ivid"
	// XpVniKey is the datastore key used to access the experiment VXLAN VNI
	// counter
	XpVniKey = "xvni"
	// XpVidKey is the datastore key used to access the experiment VLAN VID
	// counter
	XpVidKey = "xvid"

	// HarborControlAddr is the address used to access harbor infrapod containers
	// from the host
	HarborControlAddr = "172.31.0.2"

	// HarborMzid is the materialization name of the harbor
	HarborMzid = "harbor.mergetb.io" //TODO XXX change to harbor.mergetb.io

	// MoaInterfaceType defines the type of interface moa is to use
	MoaInterfaceType = "xdpinterface"
	// MoaXDPMode defines the express data path mode Moa should use
	MoaXDPMode = "skb"
)
View Source
const (
	// TimeFormat is the format used by the cogs in logs.
	TimeFormat = "2 Jan 06 15:04:05.00 MST"
	// IDAlphabet is the alphabet used for task UUIDs
	IDAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@"
)
View Source
const (
	// DefaultMountType specifies the default way in which files and directories
	// are mounted into containers.
	DefaultMountType = "bind"
)
View Source
const (
	// EtcdImage is the container image used for the etcd container in infrapods
	EtcdImage = "docker.io/mergetb/etcd:latest"
)
View Source
const (
	// RetryWait is how long to wait for various gRPC operations
	RetryWait = 1 * time.Second
)
View Source
const (
	// TxnFailedPrefix is the prefix message for all transaction failure errors.
	TxnFailedPrefix = "txn failed"
)

Variables

View Source
var (
	GobgpdPort = flag.Int("gobgpd-port", 50051, "gobgpd listening port")
	BgpAddr    = flag.String("bgp-addr", "10.99.0.254/32", "bgp address")
	BgpAS      = flag.Int("bgp-as", 64799, "bgp autonomus system number")
	//TODO get from tbxir file instead
	MoaBgpAddr = flag.String("moa-bgp-addr", "10.99.0.20/32", "moa bgp address")
	MoaAS      = flag.Int("moa-as", 67420, "moa autonomous system number")
)

user flags

View Source
var (
	// DefaultMountOptions specifies the default options for file and directory
	// mounts for infrapod containers.
	DefaultMountOptions = []string{"rbind", "ro"}
)
View Source
var (
	// ErrAlreadyWorking indicates that an action cannot be executed because a
	// coglet is already working on it.
	ErrAlreadyWorking = fmt.Errorf("cog already running")
)
View Source
var ErrNotFound = fmt.Errorf("not found")

ErrNotFound means an object was not found.

View Source
var Version = "undefined"

Version contains the cogs version string

Functions

func AllResourceIDs added in v0.3.1

func AllResourceIDs(net *xir.Net) []string

AllResourceIDs returns all the resource IDs in a network.

func CancelTask

func CancelTask(prefix string) error

CancelTask cancels the tasks with the specified prefix

func CheckForTasks

func CheckForTasks(
	etcd *clientv3.Client,
	doTask func(*Task) error,
) error

CheckForTasks checks the cogs data store for tasks that are awaiting execution.

func Cmdr

func Cmdr(cfg common.Config, f func(cm.CommanderClient) error) error

Cmdr executes a function against the local commander with automatic connection lifetime management.

func CogletID added in v0.3.1

func CogletID() string

CogletID returns the ID of the running coglet.

func CommanderClient

func CommanderClient(cfg common.Config) (
	*grpc.ClientConn, cm.CommanderClient, error)

CommanderClient creates a Merge Commander client based on the config spec of the cogs environment.

func ContainerdClient

func ContainerdClient() (*containerd.Client, error)

ContainerdClient connects to the local containerd socket interface, returning a client.

func CreateContainer

func CreateContainer(ctr *ContainerSpec) error

CreateContainer creates a container based on the provided specification.

func CreateContainerRecord

func CreateContainerRecord(spec *ContainerSpec) error

CreateContainerRecord stores a record of the provided container spec in the cogs datastore.

func CreateContainerTask

func CreateContainerTask(ctr *ContainerSpec) error

CreateContainerTask loads the container from the provided specification and creates a task for it.

func CreateIfx

func CreateIfx(netns string, ifx *EnclaveVeth, save bool) error

CreateIfx creates the specified virtual ethernet device in the provided netns.

func CreateInfrapodNS

func CreateInfrapodNS(name string) error

CreateInfrapodNS creates a network namespace for an infrapod.

func CreateLinks(mzid, instance string, fragments []*site.MzFragment) error

CreateLinks creates a set of virtual links for the specified materialization ID given a set of materialization fragments that are link specs.

func CreateTask

func CreateTask(
	ctx context.Context, ctr containerd.Container, ns, name string) error

CreateTask starts a task for the specified container, e.g. it runs the container.

func DelEnclaveBridge added in v0.2.19

func DelEnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error

DelEnclaveBridge deletes the materialization bridge from an enclave.

func DelEnclaveIptables added in v0.2.19

func DelEnclaveIptables(mzid string, spec *EnclaveSpec) error

DelEnclaveIptables deletes double NAT rules from an enclave

func Delete

func Delete(obj Object) error

Delete deletes an object from the datastore.

func DeleteContainer

func DeleteContainer(name, namespace string) error

DeleteContainer deletes a container.

func DeleteContainerIfx

func DeleteContainerIfx(namespace, name string) error

DeleteContainerIfx loads the virtual ethernet interface identified by name within the provided namespace and deletes it.

func DeleteContainerImg

func DeleteContainerImg(name, namespace string) error

DeleteContainerImg deletes an image form a container namespace.

func DeleteContainerNs

func DeleteContainerNs(name string) error

DeleteContainerNs deletes a container namespace.

func DeleteContainerRecord

func DeleteContainerRecord(name, namespace string) error

DeleteContainerRecord locates a record for for the container identified by name in the provided namespace and removes it from the cogs data store.

func DeleteContainerTask

func DeleteContainerTask(name, namespace string) error

DeleteContainerTask loads the container identified by the provided name / namespace combo and deletes its associated task.

func DeleteIfx

func DeleteIfx(netns string, ifx *EnclaveVeth) error

DeleteIfx removes a virtual ethernet device from a network namespace.

func DeleteInfrapodNS

func DeleteInfrapodNS(name string) error

DeleteInfrapodNS deletes the network namespace associated with the infrapod identified by name.

func DeleteObjects

func DeleteObjects(objs []Object) error

DeleteObjects deletes a set of objects from the datastore.

func DeleteTask

func DeleteTask(ctx context.Context, container containerd.Container) error

DeleteTask deletes a container's task.

func DestroyLinks(mzid, instance string, fragments []*site.MzFragment) error

DestroyLinks destroys a set of virtual links for the specofied materialization ID given a set of materialization fragments that are links specs.

func DestroyNetNS

func DestroyNetNS(netns *NetNS) error

DestroyNetNS deletes a network namespace.

func EnclaveBridge added in v0.2.19

func EnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error

EnclaveBridge creates the materialization enclave bridge. This bridge connects the enclave to a materializtions infrastructure network.

func EnclaveIptables added in v0.2.19

func EnclaveIptables(mzid string, spec *EnclaveSpec) error

EnclaveIptables implements the double nat rules for an enclave so testbed nodes can access the internet through the infrastructure network.

func EnsureEtcd

func EnsureEtcd(etcdp **clientv3.Client) error

EnsureEtcd Make sure we always have an etcd connection

func EtcdConnect

func EtcdConnect() (*clientv3.Client, error)

EtcdConnect Try to get a etcd client- assumption EtcdClient is async until used

func EvpnAdvertiseMac

func EvpnAdvertiseMac(addr, router, mac string, asn, vni, vindex int) error

EvpnAdvertiseMac advertises the specified MAC on the specified VNI and updates associted vindex counters.

func EvpnAdvertiseMulticast

func EvpnAdvertiseMulticast(addr, router string, asn, vni, vindex int) error

EvpnAdvertiseMulticast sends out a type-3 multicast EVPN advertisement

func EvpnWithdrawMac

func EvpnWithdrawMac(addr, router, mac string, asn, vni, vindex int) error

EvpnWithdrawMac withdraws the specified MAC on the specified VNI and updates associated vindex counters.

func EvpnWithdrawMulticast

func EvpnWithdrawMulticast(addr, router string, asn, vni, vindex int) error

EvpnWithdrawMulticast sends out a type-3 multicast EVPN withdraw

func Exec

func Exec(etcdp **clientv3.Client, cog string, doTask func(*Task) error) error

Exec is the primary lower half subroutine. It is designed to be executed in an infinite loop by lower half implementations.

func ExtractConstraint

func ExtractConstraint(props map[string]interface{}, key string) *xir.Constraint

ExtractConstraint extracts the constraint at the specified key as an XIR constraint object.

func FromJSON added in v0.3.1

func FromJSON(o Object, b []byte)

FromJSON reads reads on object from byte array encoded json. If the object is a protobuf, then protobuf is used instead.

func GetInfraEndpoint

func GetInfraEndpoint(n *xir.Node) *xir.Endpoint

GetInfraEndpoint tries to find an endpoint from the specified node on an infrastructure network. If one can not be found nil is returned.

func GetIntLike

func GetIntLike(x interface{}) (int, error)

GetIntLike is needed for data that gets cross-serialized and the number format is uncertain. This function works for both float64 and int underlying data types.

func GetNodeLeaf

func GetNodeLeaf(nodeEndpoint *xir.Endpoint) *xir.Endpoint

GetNodeLeaf gets the leaf switch attached to a node. If no leaf switch is attached to the node, nil is returned.

func HandleIncoming

func HandleIncoming(rq *cm.IncomingRequest) error

HandleIncoming handles an incoming request from Merge. In the case of an incoming setup request a materialization infrapod is setup. In the case of an incoming teardown a materialization infrapod is torn down.

func HandleLinkCreate

func HandleLinkCreate(rq *cm.MzRequest) error

HandleLinkCreate handles a Merge link create request.

func HandleLinkDestroy

func HandleLinkDestroy(rq *cm.MzRequest) error

HandleLinkDestroy handles a Merge link destroy request.

func HandleNodeRecycle

func HandleNodeRecycle(rq *cm.MzRequest) error

HandleNodeRecycle handles a Merge node recycle request.

func HandleNodeSetup

func HandleNodeSetup(rq *cm.MzRequest) error

HandleNodeSetup handles a Merge node setup request.

func HandleStatus

func HandleStatus(rq *cm.StatusRequest) (*cm.StatusResponse, error)

HandleStatus handles a Merge status request.

func HandleTask

func HandleTask(
	etcd *etcd.Client,
	task *Task,
	lease etcd.LeaseID,
	doTask func(*Task) error,
)

HandleTask attempts to execute the provided task. The datastore is updated with task state evolution as the stages and actions are executed.

func Init

func Init()

Init performs basic cog setup.

func InitInfranet

func InitInfranet(mzinfo *MzInfo, props map[string]interface{}) error

InitInfranet creates an enclave for an infranet and then deploys and configures the base containers within that enclave: foundry, etcd, nex

func IsTxnFailed

func IsTxnFailed(err error) bool

IsTxnFailed detects if an error is a transaction failure error.

func KeepLeaseAlive

func KeepLeaseAlive(etcd *clientv3.Client, lease clientv3.LeaseID) (
	chan bool, error)

KeepLeaseAlive keeps the specified lease alive indefinitely.

func LaunchTask

func LaunchTask(task *Task) error

LaunchTask launches the specified task

func LeaseTask

func LeaseTask(c *etcd.Client, t *Task) (etcd.LeaseID, error)

LeaseTask attempts to take a lease out on a task. A coglet may not execute a task until it has a lease on the task.

func ListContainers

func ListContainers(ctx context.Context) ([]containerd.Container, error)

ListContainers lists the containers in the specified context.

func ListNamespaces

func ListNamespaces() ([]string, error)

ListNamespaces lists current namespace names.

func LoadXIR

func LoadXIR() (*xir.Net, error)

LoadXIR loads the testbed xir description from the file system.

func Merge2Local

func Merge2Local(devID string) (string, error)

Merge2Local transforms a Merge node ID into a node label

func NodeRecycle

func NodeRecycle(mzid, instance string, fragments []*site.MzFragment) error

NodeRecycle launches a set of tasks that collectively recycle a node.

func NodeSetup

func NodeSetup(mzid, instance string, fragments []*site.MzFragment) error

NodeSetup launches a set of tasks that collectively setup a node.

func NsDefaultRoute added in v0.2.19

func NsDefaultRoute(mzid string, spec *EnclaveSpec) error

NsDefaultRoute sets up a default route in an infrapod namespace

func PullContainerImage

func PullContainerImage(namespace, image string) error

PullContainerImage pulls the specified container image into the specified namespace.

func RUC added in v0.2.16

func RUC(o Object, update func(o Object)) error

RUC performs a read-update-commit on the provided object using the specified update function.

func Read

func Read(obj Object) error

Read reads an object from the datastore

func ReadNew

func ReadNew(obj Object) error

ReadNew reads an object form the datastore, and does not throw an error if the object is not found.

func ReadObjects

func ReadObjects(objs []Object) (int, error)

ReadObjects reads a set of objects from the datastore in a one-shot transaction.

func ReadWait

func ReadWait(obj Object, timer *ReadTimer) error

ReadWait attempts to read an object repeatedly until a timeout threshold is reached defined by timer. If timer is nil the defaults of 30 seconds with a retry period of 250 milliseconds is applied

func RegisterCoglet

func RegisterCoglet(c *etcd.Client, cog string) (etcd.LeaseID, error)

RegisterCoglet registers this process as a coglet.

func RegisterWithCommander

func RegisterWithCommander()

RegisterWithCommander registers the cogs Merge driver implementation with the local commander. This function registers all nodes and links in the testbed to the cogs driver.

func RevokeLease

func RevokeLease(etcd *clientv3.Client, lease clientv3.LeaseID)

RevokeLease revokes the specified lease.

func RunObjectTx

func RunObjectTx(otx ObjectTx) error

RunObjectTx runs an object transaction.

func SetupContainerLo

func SetupContainerLo(namespace string) error

SetupContainerLo sets up a loopback network interface in the specified network namespace.

func SvcAddress

func SvcAddress(vindex int) string

SvcAddress returns the IP address of a CIDR given the associated virtual network index.

func SvcCidr

func SvcCidr(vindex int) string

SvcCidr returns the CIDR of a service given the associated virtual network index.

func TeardownInfranet

func TeardownInfranet(mzinfo *MzInfo, props map[string]interface{}) error

TeardownInfranet tears down an infrapod. This deletes the network enclave and the containers within the enclave.

func ToJSON added in v0.3.1

func ToJSON(o Object) string

ToJSON marshals an object to JSON form. If the object is a protobuf, protobuf is used instead.

func TxnFailed

func TxnFailed(message string) error

TxnFailed an error message for transaction failures with the proper formatting.

func WithCogCNI

func WithCogCNI(netns string) oci.SpecOpts

WithCogCNI is an OCI specification operator that binds a container to a network namespace.

func WithCtrMounts

func WithCtrMounts(mounts []*ContainerMount) oci.SpecOpts

WithCtrMounts is an OCI specifier that can be used on container creation to plumb in the set of provided container mount points.

func WithEtcd added in v0.2.18

func WithEtcd(f func(*clientv3.Client) error) error

WithEtcd executes a function against an etcd client with a managed connection lifetime.

func Write

func Write(obj Object, opts ...etcd.OpOption) error

Write persists an object to the datastore.

func WriteObjects

func WriteObjects(objs []Object, fresh bool, opts ...etcd.OpOption) error

WriteObjects writes objects to the datastore in a single shot transaction. If fresh is true, then all objects must be the most recent version, or the write will fail.

Types

type Action

type Action struct {
	Kind       string
	Mzid       string
	MzOp       MzOperation
	MzInstance string
	Action     string
	Data       interface{}
	Complete   bool
	Error      *string
	Masked     bool
	// contains filtered or unexported fields
}

An Action is the basic unit of coglet execution. It defines a single task that a coglet thread executes until completion or failure.

func NexCreateMembers

func NexCreateMembers(mzid string, endpoints []Endpoint) *Action

NexCreateMembers adds the specified endpoints as nex DHCP/DNS members on the network identified by the provided mzid.

func NexDeleteMembers

func NexDeleteMembers(mzid string, endpoints []Endpoint) *Action

NexDeleteMembers deletes the specified endpoints from the nex DHCP/DNS network identified by the provided mzid.

func NexDeleteNetwork

func NexDeleteNetwork(name string) *Action

NexDeleteNetwork deletes the specified nex DHCP/DNS network by name.

func (*Action) SetStage

func (a *Action) SetStage(s *Stage)

SetStage sets the parent stage of an action.

func (*Action) SetTask

func (a *Action) SetTask(t *Task)

SetTask sets the parent task of an action.

func (*Action) Stage

func (a *Action) Stage() *Stage

Stage returns the parent stage of an action.

func (*Action) Task

func (a *Action) Task() *Task

Task returns the parent task of an action.

type BelugaSpec

type BelugaSpec struct {
	Soft  bool
	Nodes []string
}

BelugaSpec encapsulates required data for beluga power control commands.

type CogletInfo

type CogletInfo struct {
	ID   string
	Cog  string
	Host string
	Pid  int
	// contains filtered or unexported fields
}

CogletInfo contains bookkeeping information about a coglet replica.

func ListCoglets

func ListCoglets() ([]*CogletInfo, error)

ListCoglets lists the coglets currently registered with the cogs datastore

func (*CogletInfo) GetVersion

func (c *CogletInfo) GetVersion() int64

GetVersion gets the datastore replica version information

func (*CogletInfo) Key

func (c *CogletInfo) Key() string

Key returns the datastore key for this coglet's info

func (*CogletInfo) SetVersion

func (c *CogletInfo) SetVersion(v int64)

SetVersion sets the datastore replica version information

func (*CogletInfo) Value

func (c *CogletInfo) Value() interface{}

Value returns this coglet as an interface object

type Container

type Container struct {
	Name      string
	Namespace string
	Vindex    int
	Image     string
	// contains filtered or unexported fields
}

Container tracks container parameters in the datastore

func (*Container) GetVersion

func (x *Container) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*Container) Key

func (x *Container) Key() string

Key returns the datastore key for this object.

func (*Container) SetVersion

func (x *Container) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*Container) Value

func (x *Container) Value() interface{}

Value returns this object as an interface{}

type ContainerImageData

type ContainerImageData struct {
	Image     string
	Namespace string
}

ContainerImageData encapsulates data needed to pull or remove a container image.

type ContainerMount

type ContainerMount struct {
	Name        string
	specs.Mount `mapstructure:",squash" yaml:",inline"`

	CtrComponent `mapstructure:",squash" yaml:",inline"`
	// contains filtered or unexported fields
}

ContainerMount tracks information about container mounts.

func (*ContainerMount) GetVersion

func (x *ContainerMount) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*ContainerMount) Key

func (x *ContainerMount) Key() string

Key returns the datastore key for this object.

func (*ContainerMount) SetVersion

func (x *ContainerMount) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*ContainerMount) Value

func (x *ContainerMount) Value() interface{}

Value returns this object as an interface{}

type ContainerSpec

type ContainerSpec struct {
	Container `mapstructure:",squash" yaml:",inline"`
	//Interfaces  []*ContainerInterface
	Mounts      []*ContainerMount
	Environment map[string]string
	// contains filtered or unexported fields
}

ContainerSpec tracks information about containers.

func (*ContainerSpec) Env

func (ctr *ContainerSpec) Env() []string

Env returns the environment of a container spec as a list of strings.

type CountSet

type CountSet struct {
	Name   string `json:"name"`
	Size   int    `json:"size,omitempty"`
	Values []int  `json:"values"`
	Offset int    `json:"offset"`
	// contains filtered or unexported fields
}

A CountSet is a dense counter. When the counter is incremented the lowest unused index is returned. When an index is deleted, it's available for use again.

func (CountSet) Add

func (cs CountSet) Add() (int, CountSet, error)

Add increments the counter and returns the created index value.

func (*CountSet) GetVersion

func (c *CountSet) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*CountSet) Key

func (c *CountSet) Key() string

Key returns the datastore key for this object.

func (CountSet) Next

func (cs CountSet) Next() (int, int)

Next returns the nex available index.

func (CountSet) Remove

func (cs CountSet) Remove(i int) CountSet

Remove removes an index from the counter, freeing it for future use.

func (*CountSet) SetVersion

func (c *CountSet) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*CountSet) Value

func (c *CountSet) Value() interface{}

Value returns this object as an interface{}

type CtrComponent

type CtrComponent struct {
	CtrName      string `yaml:",omitempty"`
	CtrNamespace string `yaml:",omitempty"`
}

CtrComponent tracks low level containerd properties

type DeleteContainerData

type DeleteContainerData struct {
	Name      string
	Namespace string
}

DeleteContainerData encapsulates information needed to delete a container.

type DeleteContainerIfxData

type DeleteContainerIfxData struct {
	Name         string
	EvpnWithdraw bool
}

DeleteContainerIfxData encapsulates data needed to delete a container interface.

type DeleteContainerNsData

type DeleteContainerNsData struct {
	Name string
}

DeleteContainerNsData encapsulates data needed to delete a container namespace.

type Destination

type Destination struct {
	Paths []*Path
}

Destination is a set of paths.

func (*Destination) MarshalJSON

func (d *Destination) MarshalJSON() ([]byte, error)

MarshalJSON creates a JSON representation of a destination.

type EnclaveSpec

type EnclaveSpec struct {
	Mzid            string
	Vindex          int
	ExternalIfx     string
	ExternalGateway string
	ExternalSubnet  string
	InternalGateway string
	NatSourceIP     string
	Interfaces      []*EnclaveVeth
	// contains filtered or unexported fields
}

An EnclaveSpec describes a network enclave in which an infrapod lives.

func (*EnclaveSpec) GetVersion

func (e *EnclaveSpec) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*EnclaveSpec) Key

func (e *EnclaveSpec) Key() string

Key returns the datastore key for this object.

func (*EnclaveSpec) SetVersion

func (e *EnclaveSpec) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*EnclaveSpec) Value

func (e *EnclaveSpec) Value() interface{}

Value returns this object as an interface{}

type EnclaveVeth

type EnclaveVeth struct {
	Inner         string
	Outer         string
	Vni           int  `yaml:",omitempty"`
	Vid           int  `yaml:",omitempty"`
	Vindex        int  `yaml:",omitempty"`
	EvpnAdvertise bool `yaml:",omitempty"`
	Bridge        string
	Address       string
	HostMac       string `yaml:",omitempty"`
	CtrMac        string `yaml:",omitempty"`
	// contains filtered or unexported fields
}

EnclaveVeth tracks information about virtual ethernet interfaces for infrapod enclaves.

func (*EnclaveVeth) GetVersion

func (x *EnclaveVeth) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*EnclaveVeth) Key

func (x *EnclaveVeth) Key() string

Key returns the datastore key for this object.

func (*EnclaveVeth) SetVersion

func (x *EnclaveVeth) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*EnclaveVeth) Value

func (x *EnclaveVeth) Value() interface{}

Value returns this object as an interface{}

type Endpoint

type Endpoint struct {
	// The node being connected
	Node string
	// The interface being connected
	Interface string
	// Whether or not the interface multiplexes multiple virtual links
	Multidegree bool
}

An Endpoint describes how a testbed node connects to a virtual network.

type EvpnInfo

type EvpnInfo struct {
	BgpIP net.IP
	Rd    bgp.RouteDistinguisherInterface
	Rt    bgp.ExtendedCommunityInterface
}

EvpnInfo encapsulates commonly used EVPN advertisement info.

type EvpnWithdrawData

type EvpnWithdrawData struct {
	Asn    int    `yaml:",omitempty"`
	Addr   string `yaml:",omitempty"`
	Vindex int    `yaml:",omitempty"`
	Vni    int    `yaml:",omitempty"`
}

EvpnWithdrawData encapsulates information necessary to send an EVPN withdraw request

type FoundrySetSpec

type FoundrySetSpec struct {
	Endpoint string
	Machines []*foundry.MachineConfig
}

A FoundrySetSpec encapsulates the information needed to configure a set of machines using foundry.

type ImageBinding

type ImageBinding struct {
	Image *sled.Image // image storage information
	Kexec *sled.Kexec // local kexec after initial sled write
}

An ImageBinding contains the required information to bind an image to a node using sled.

type ImageDefaults

type ImageDefaults struct {
	Image sled.Image
	// contains filtered or unexported fields
}

ImageDefaults contains default image information for a node type.

func (*ImageDefaults) GetVersion

func (d *ImageDefaults) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*ImageDefaults) Key

func (d *ImageDefaults) Key() string

Key returns the datastore key for this object.

func (*ImageDefaults) SetVersion

func (d *ImageDefaults) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*ImageDefaults) Value

func (d *ImageDefaults) Value() interface{}

Value returns this object as an interface{}

type ImageSpec

type ImageSpec struct {
	Endpoint string // location of sledb
	List     []ImageBinding
	NoVerify bool
}

An ImageSpec contains all the information needed to create a set of image bindings through sled.

type InterfaceMacAdvSpec added in v0.3.1

type InterfaceMacAdvSpec struct {
	Netns     string
	Interface string
	Vni       int
	Vindex    int
}

A InterfaceMacAdvSpec describes an interface to derive a type-2 EVPN (MACADV) advertisement from..

type LinkInfo

type LinkInfo struct {
	Mzid string
	Vlid string // virtual link identifier from merge

	Vni int
	Vid int
	// contains filtered or unexported fields
}

LinkInfo contains various information about virtual links.

func (*LinkInfo) GetVersion

func (l *LinkInfo) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*LinkInfo) Key

func (l *LinkInfo) Key() string

Key returns the datastore key for this object.

func (*LinkInfo) SetVersion

func (l *LinkInfo) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*LinkInfo) Value

func (l *LinkInfo) Value() interface{}

Value returns this object as an interface{}

type LinkKind

type LinkKind string

LinkKind represents a canopy link kind

const (
	// InfraLink is an infrastructure link
	InfraLink LinkKind = "infra"
	// XpLink is an experiment link
	XpLink LinkKind = "xp"
	// MoaLink is a Moa emulated link
	MoaLink LinkKind = "moa"
)

type LinkSpec

type LinkSpec struct {
	Kind      LinkKind
	Vni       int
	Vid       int
	Xlid      string
	Links     []string
	Endpoints []Endpoint
}

LinkSpec encapsulates required data for canopy link commands.

func FragmentToLinkSpec added in v0.2.17

func FragmentToLinkSpec(
	topo *xir.Net, mzid string, fragment *site.MzFragment, action string,
	li *LinkInfo, model xir.Props, lnk *site.LinkModel, suffix string,
) (*LinkSpec, error)

FragmentToLinkSpec extracts a link specification from a materialization fragment.

type MacAdvSpec

type MacAdvSpec struct {
	Mac    string
	Vni    int
	Vindex int
	Router string
	Addr   string
	Asn    int
}

A MacAdvSpec describes a type-2 EVPN (MACADV) advertisement.

type MoaEmulationSpec added in v0.3.1

type MoaEmulationSpec struct {
	ID            int
	EmulationHost string
	Vnis          []int
	//Objects       []moa.Object
	Links []moa.DuplexLink
	MPLs  []moa.MPL
}

A MoaEmulationSpec aggregates a set of objects that collectively define a Moa emulation

type MzInfo

type MzInfo struct {
	Mzid     string
	Instance string
	Vindex   int
	Vni      int
	Vid      int

	Status MzStatus

	IncomingTaskID string
	TeardownTaskID string

	NodeSetupTaskID   string
	NodeRecycleTaskID string

	LinkCreateTaskID  string
	LinkDestroyTaskID string

	NodeInfo map[string]NodeInfo
	LinkInfo []LinkSpec
	// contains filtered or unexported fields
}

MzInfo contains various information about a materialization

func ListMaterializations

func ListMaterializations(prefix string) ([]*MzInfo, error)

ListMaterializations lists all materializations with the given prefix.

func (*MzInfo) GetVersion

func (m *MzInfo) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*MzInfo) Key

func (m *MzInfo) Key() string

Key returns the datastore key for this object.

func (*MzInfo) SetVersion

func (m *MzInfo) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*MzInfo) Value

func (m *MzInfo) Value() interface{}

Value returns this object as an interface{}

type MzOperation

type MzOperation string

MzOperation indicates the type of a materialization operation an action is a part of.

const (
	// MzOutgoing indicates a dematerialization process.
	MzOutgoing MzOperation = "outgoing"
	// MzIncoming indicates a materialization process.
	MzIncoming MzOperation = "incoming"
	// MzMod indicates that a materialization is being modified.
	MzMod MzOperation = "mod"
)

type MzStatus added in v0.2.20

type MzStatus int

MzStatus indicates the overal status of a materialization

const (
	// MzNone indicates that there is no materialization status
	MzNone MzStatus = iota
	// Materializing indicates that a materialization is in progress
	Materializing
	// Active indicates that all materialization tasks have finished
	Active
	// Dematerializing indicates a dematerialization is in progress
	Dematerializing
)

func (MzStatus) String added in v0.3.1

func (s MzStatus) String() string

String returns the string form of an MzStatus

type MzfIndex

type MzfIndex struct {
	Resource string
	Fragment *site.MzFragment
	// contains filtered or unexported fields
}

MzfIndex tracks materialization fragments.

func (*MzfIndex) GetVersion

func (x *MzfIndex) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*MzfIndex) Key

func (x *MzfIndex) Key() string

Key returns the datastore key for this object.

func (*MzfIndex) SetVersion

func (x *MzfIndex) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*MzfIndex) Value

func (x *MzfIndex) Value() interface{}

Value returns this object as an interface{}

type NetNS

type NetNS struct {
	Name       string
	Containers []string
	// contains filtered or unexported fields
}

NetNS is a network namespace record that tracks containers in the netns.

func (*NetNS) GetVersion

func (x *NetNS) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*NetNS) Key

func (x *NetNS) Key() string

Key returns the datastore key for this object.

func (*NetNS) RemoveContainer

func (x *NetNS) RemoveContainer(ctr string)

RemoveContainer removes a container from a netns object

func (*NetNS) SetVersion

func (x *NetNS) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*NetNS) Value

func (x *NetNS) Value() interface{}

Value returns this object as an interface{}

type NexMemberSpec

type NexMemberSpec struct {
	nex.MemberList `mapstructure:",squash" yaml:",inline"`
	Endpoint       string
}

NexMemberSpec is a wrapper around a nex member list that adds an endpoint at which the nex service may be reached.

type NexNetworkSpec

type NexNetworkSpec struct {
	// Core Nex data
	Network nex.Network

	// Nex endpoint address
	Endpoint string
}

NexNetworkSpec is a wrapper around a nex network specification that adds an endpoint at which the nex service may be reached.

type NodeInfo

type NodeInfo struct {
	XpName string
	Image  *ImageBinding
	Config *foundry.MachineConfig
	Nex    *nex.Member
}

NodeInfo contains various information about a testbed node

type NodeInfraInfo

type NodeInfraInfo struct {
	Endpoint Endpoint
	Image    string
	Mac      string
	Name     string
}

NodeInfraInfo something struct

type NodeSpec

type NodeSpec struct {
	Resource    string
	Xname       string
	Mac         string
	Interface   string
	Multidegree bool
	SvcEndpoint string
	Infranet    *TargetNetwork
	Binding     *ImageBinding
	Config      *foundry.MachineConfig
}

A NodeSpec encapsulates the data needed to provision or recycle a testbed node.

type NodeState added in v0.2.20

type NodeState struct {
	Name   string
	Mzid   string
	Status NodeStatus
	// contains filtered or unexported fields
}

NodeState tracks the state of individual testbed nodes.

func ListNodes

func ListNodes() ([]*NodeState, error)

ListNodes lists the node state of all nodes in a testbed.

func (*NodeState) GetVersion added in v0.2.20

func (n *NodeState) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*NodeState) Key added in v0.2.20

func (n *NodeState) Key() string

Key returns the datastore key for this object.

func (*NodeState) SetVersion added in v0.2.20

func (n *NodeState) SetVersion(x int64)

SetVersion sets the current datastore version of the object

func (*NodeState) Value added in v0.2.20

func (n *NodeState) Value() interface{}

Value returns this object as an interface{}

type NodeStatus

type NodeStatus int

NodeStatus indicates the state of a node.

const (
	// NodeNone indicates that there is no available state for a node
	NodeNone NodeStatus = iota
	// Setup indicates a node is being setup
	Setup
	// Recycling indicates a node is being recycled
	Recycling
	// Ready indicates a node has been setup and is ready for use
	Ready
	// Clean indicates a node has been recycled
	Clean
)

type NsnatSpec

type NsnatSpec struct {
	Src     string
	Dst     string
	Addr    string
	Gateway string
}

NsnatSpec tracks specification information about network namespace double NATs.

type Object

type Object interface {
	Key() string
	GetVersion() int64
	SetVersion(int64)
	Value() interface{}
}

Object defines an interface for cogs datastore objects.

type ObjectTx

type ObjectTx struct {
	Put    []Object
	Delete []Object
}

ObjectTx encapsulates a set of put and delete operations into a single transaction.

type Path

type Path struct {
	Nlri       bgp.AddrPrefixInterface      `json:"nlri"`
	Age        int64                        `json:"age"`
	Best       bool                         `json:"best"`
	Attrs      []bgp.PathAttributeInterface `json:"attrs"`
	Stale      bool                         `json:"stale"`
	Withdrawal bool                         `json:"withdrawal,omitempty"`
	SourceID   net.IP                       `json:"source-id,omitempty"`
	NeighborIP net.IP                       `json:"neighbor-ip,omitempty"`
}

Path is a workaround. This for the json format compatibility. Once we update senario tests, we can remove this.

type PortMode added in v0.2.13

type PortMode int

PortMode defines the VLAN mode of a port.

const (
	// Access indicates VLAN access mode for a port
	Access PortMode = iota
	// Trunk indicates VLAN trunk mode for a port
	Trunk
)

type PortObj added in v0.2.13

type PortObj struct {
	Mzid string
	Host string
	Port string
	Mode PortMode
	Vids []int
	Up   bool
	// contains filtered or unexported fields
}

PortObj tracks various switch port properties.

func (*PortObj) GetVersion added in v0.2.13

func (x *PortObj) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*PortObj) Key added in v0.2.13

func (x *PortObj) Key() string

Key returns the datastore key for this object.

func (*PortObj) SetVersion added in v0.2.13

func (x *PortObj) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*PortObj) Value added in v0.2.13

func (x *PortObj) Value() interface{}

Value returns this object as an interface{}

type ReadTimer

type ReadTimer struct {
	Period  time.Duration
	Timeout time.Duration
}

ReadTimer tracks timing information about a read.

type Stage

type Stage struct {
	Actions []*Action
	Next    *Stage `json:"-" yaml:"-" mapstructure:"-"`
}

A Stage is a collection of actions. Actions within a stage are executed concurrently.

func NewStage

func NewStage(actions ...*Action) *Stage

NewStage creates a new stage.

func (*Stage) Mzid

func (s *Stage) Mzid() string

Mzid returns the materialization id of a stage.

type TargetNetwork

type TargetNetwork struct {
	Vni int
	Vid int
}

TargetNetwork describes the infrastructure network a testbed node will attach to.

type Task

type Task struct {
	ID        string `yaml:",omitempty"`
	Coglet    string `yaml:",omitempty"`
	Stages    []*Stage
	Deps      []string `yaml:",omitempty"`
	Timestamp string
	// contains filtered or unexported fields
}

A Task is a collecion of stages that are executed in sequence by a coglet.

func ListTasks

func ListTasks() ([]*Task, error)

ListTasks all tasks

func NewTask

func NewTask(stages ...*Stage) *Task

NewTask creates a new task from the specified set of stages.

func ReadTask

func ReadTask(file string) (*Task, error)

ReadTask reads a task from a YAML file.

func (*Task) AddDep

func (t *Task) AddDep(id string)

AddDep adds a dependency to a task. The id argument must be a UUID for an existing task. Once added, this task will be ignored by coglets until the specified UUID has completed successfully, or is masked.

func (*Task) AddStage

func (t *Task) AddStage(s *Stage) *Stage

AddStage adds a stage to a task at the end of the stage list.

func (*Task) ClearErrors

func (t *Task) ClearErrors()

ClearErrors clears all errors from the underlying actions in a task. This means that it will become elegible for execution by a coglet again.

func (*Task) Complete

func (t *Task) Complete() bool

Complete returns if the task is complete. A task is considered complete if all its actions are either complete or masked.

func (*Task) DepsSatisfied

func (t *Task) DepsSatisfied() bool

DepsSatisfied calculates if all dependencies of a task are satisfied.

func (*Task) Failed

func (t *Task) Failed() []*Action

Failed returns if a task has failed.

func (*Task) GetVersion

func (t *Task) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*Task) Init

func (t *Task) Init()

Init initializes a task. In particular if creates the linked list for stages.

func (*Task) InsertStage

func (t *Task) InsertStage(after *Stage, new *Stage) *Stage

InsertStage adds a stage to a task after the specified 'after' stage.

func (*Task) Key

func (t *Task) Key() string

Key returns the datastore key for this object.

func (*Task) MaskAction

func (t *Task) MaskAction(stage, action int)

MaskAction masks any error condition on an action. This makes a failed task appear complete from the perspective of dependency resolution.

func (*Task) Mzid

func (t *Task) Mzid() string

Mzid returns the materialization ID of a task.

func (*Task) Reset

func (t *Task) Reset()

Reset marks all actions in a task as incomplete and clears any errors.

func (*Task) SetVersion

func (t *Task) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*Task) Value

func (t *Task) Value() interface{}

Value returns this object as an interface{}

func (*Task) Wait

func (t *Task) Wait() error

Wait blocks until a task is either complete or failed.

type VLMap

type VLMap struct {
	Mzid    string
	Entries map[int]*VLMentry
	// contains filtered or unexported fields
}

VLMap maps virtual link identifers to VLMentries

func (*VLMap) GetVersion

func (v *VLMap) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*VLMap) Key

func (v *VLMap) Key() string

Key returns the datastore key for this object.

func (*VLMap) SetVersion

func (v *VLMap) SetVersion(x int64)

SetVersion sets the current datastore version of the object

func (*VLMap) Value

func (v *VLMap) Value() interface{}

Value returns this object as an interface{}

type VLMentry

type VLMentry struct {
	Vni int
	Vid int
}

VLMentry captures information about a virtual link materialization

type VLinkEdge

type VLinkEdge int

VLinkEdge defines how a virtual link terminates at its edge.

const (
	// VlanAccess indicates a virtual link terminates as a VLAN access port
	VlanAccess VLinkEdge = iota
	// VlanTrunk indicates a virtual link terminates as a VLAN trunk port
	VlanTrunk
	// Vxlan indicates a virtual link terminates as a VXLAN VTEP
	Vxlan
)

type Vtep

type Vtep struct {
	Node     string
	Dev      string
	Bridge   string
	TunnelIP string
}

Vtep encapsulates required data for canopy VTEP commands.

type VtepObj added in v0.2.13

type VtepObj struct {
	Mzid string
	Host string
	Name string
	Vni  int
	Vid  int
	// contains filtered or unexported fields
}

VtepObj tracks VTEP parameters in the datastore

func (*VtepObj) GetVersion added in v0.2.13

func (x *VtepObj) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*VtepObj) Key added in v0.2.13

func (x *VtepObj) Key() string

Key returns the datastore key for this object.

func (*VtepObj) SetVersion added in v0.2.13

func (x *VtepObj) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*VtepObj) Value added in v0.2.13

func (x *VtepObj) Value() interface{}

Value returns this object as an interface{}

type VtepSpec

type VtepSpec struct {
	Vni   int
	Vid   int
	Vteps []Vtep
}

VtepSpec encapsulates a canopy VTEP specification.

type VxLan

type VxLan struct {
	Vni        int
	Interfaces []string
	// contains filtered or unexported fields
}

VxLan Record

func (*VxLan) GetVersion

func (x *VxLan) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*VxLan) Key

func (x *VxLan) Key() string

Key returns the datastore key for this object.

func (*VxLan) RemoveInterface

func (x *VxLan) RemoveInterface(mac string)

RemoveInterface removes an interface from a VxLan record

func (*VxLan) SetVersion

func (x *VxLan) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*VxLan) Value

func (x *VxLan) Value() interface{}

Value returns this object as an interface{}

Jump to

Keyboard shortcuts

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