cogs

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HarborNet      = "harbor.dcomptb.net"
	HarborMzid     = "harbor.dcomptb"
	HarborSvcAddr  = "172.31.0.2" //XXX hardcode
	HarborVindex   = 2
	HarborInfraVNI = 2
	HarborInfraVID = 2
	HarborXpVNI    = 2
)
View Source
const (
	ContainerKind   = "container"
	LaunchCtr       = "launch"
	PullCtrImage    = "pull-image"
	CreateCtr       = "create"
	CreateCtrTask   = "create-task"
	CreateCtrNs     = "create-ns"
	ConfigCtrLo     = "config-lo"
	CreateCtrRecord = "create-record"
	DeleteCtr       = "delete"
	DeleteCtrTask   = "delete-task"
	DeleteCtrRecord = "delete-record"
	DeleteNS        = "delete-ns"

	NodeSetupKind   = "NodeSetup"
	NodeRecycleKind = "NodeRecycle"

	PlumbingKind   = "plumbing"
	CreateEnclave  = "create-enclave"
	DestroyEnclave = "destroy-enclave"
	AdvertiseMac   = "advertise-mac"

	NexKind          = "Nex"
	CreateNexNetwork = "CreateNetwork"
	DeleteNexNetwork = "DeleteNetwork"
	DeleteNexMembers = "DeleteMembers"
	AddNexMembers    = "AddMembers"

	CanopyKind              = "Canopy"
	SetCanopyLinks          = "SetLinks"
	SetCanopyServiceVtep    = "SetServiceVtep"
	RemoveCanopyServiceVtep = "RemoveServiceVtep"
	RemoveCanopyLinks       = "RemoveLinks"

	BookkeepingKind = "bookkeeping"
	DeleteMzinfo    = "DeleteMzinfo"

	OtterKind = "Otter"
	SetOtter  = "Set"

	NimbusKind         = "Nimbus"
	DeleteNimbusConfig = "Delete"
	CreateNimbusConfig = "Create"

	RallyKind    = "Rally"
	RecycleRally = "Recycle"
	EnsureRally  = "Ensure"
)
View Source
const (
	//assumes rex configures the machine he's running on
	InfraCanopyHost = "localhost"
	Svcbr           = "svcbr"
)
View Source
const (
	FoundryNamespace       = "foundry"
	FoundryImage           = "docker.io/mergetb/foundry:latest"
	FoundryCertMountName   = "foundry-cert"
	FoundryCertMountSource = "/etc/foundry/manage.pem"
	FoundryCertMountDest   = "/etc/foundry/manage.pem"
	FoundryKeyMountName    = "foundry-key"
	FoundryKeyMountSource  = "/etc/foundry/manage-key.pem"
	FoundryKeyMountDest    = "/etc/foundry/manage-key.pem"
	FoundryEnv             = "FOUNDRYD_ARGS"
	FoundryArgs            = "-no-auth"
)
View Source
const (
	EtcdNamespace = "etcd"
	EtcdImage     = "docker.io/mergetb/etcd:latest"
)
View Source
const (
	NexNamespace   = "nex"
	NexImage       = "docker.io/mergetb/nex:latest"
	NexMountName   = "nex-config"
	NexMountSource = "/etc/cogs/nex.yml"
	NexMountDest   = "/etc/nex/nex.yml"
	NexDomainEnv   = "DOMAIN"
)
View Source
const (
	InfrapodMznIfx = "eth0"
	InfrapodSvcIfx = "eth1"

	DefaultInternalGateway     = "172.30.0.1"
	DefaultInternalGatewayCIDR = "172.30.0.1/16"
	DefaultServiceGateway      = "172.31.0.1"

	HarborVni = 2
	HarborVid = 2

	HarborControlAddr = "172.31.0.2"
)
View Source
const (
	TimeFormat = "2 Jan 06 15:04:05.00 MST"
	IdAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@"
)
View Source
const (
	DefaultMountType = "bind"
)
View Source
const (
	TxnFailedPrefix = "txn failed"
)
View Source
const (
	XIR_FILE_PATH = "/etc/dcomp/tb-xir.json"
)

Variables

View Source
var (
	GobgpdPort = flag.Int("gobgpd-port", 50051, "gobgpd listening port")
	BgpAddr    = flag.String("bgp-addr", "", "bgp address")
	BgpAS      = flag.Int("bgp-as", 0, "bgp autonomus system number")
)

user flags

View Source
var (
	AlreadyWorking error = fmt.Errorf("cog already running")
)
View Source
var (
	DefaultMountOptions = []string{"rbind", "ro"}
)
View Source
var NotFound error = fmt.Errorf("not found")
View Source
var Version = "undefined"

Functions

func AllResourceIds

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

func CancelTask

func CancelTask(prefix string) error

Cancel tasks with the specified prefix

func CheckForTasks

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

func Cmdr

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

func CogletId

func CogletId() string

func CommanderClient

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

func CreateContainer

func CreateContainer(ctr *ContainerSpec) error

func CreateContainerRecord

func CreateContainerRecord(spec *ContainerSpec) error

func CreateContainerTask

func CreateContainerTask(ctr *ContainerSpec) error

func CreateIfx added in v0.1.7

func CreateIfx(netns string, ifx *EnclaveVeth) error

func CreateInfrapodNS added in v0.1.7

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

func Delete

func Delete(obj Object) error

func DeleteContainer

func DeleteContainer(name, namespace string) error

func DeleteContainerIfx

func DeleteContainerIfx(namespace, name string) error

func DeleteContainerRecord

func DeleteContainerRecord(name, namespace string, a *Action) error

func DeleteContainerTask

func DeleteContainerTask(name, namespace string) error

func DeleteIfx added in v0.1.7

func DeleteIfx(netns string, ifx *EnclaveVeth) error

func DeleteInfrapodNS added in v0.1.7

func DeleteInfrapodNS(name string) error

func DeleteObjects

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

func DestroyNetNS

func DestroyNetNS(netns *NetNS) error

func EnsureEtcd

func EnsureEtcd(etcdp **clientv3.Client) error

func EtcdConnect

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

Try up to 10 times to connect to etcd

func EvpnAdvertiseMac

func EvpnAdvertiseMac(veth *rtnl.Link, vni, vindex int) error

func EvpnAdvertiseMulticast

func EvpnAdvertiseMulticast(vni, vindex int) error

func EvpnWithdrawMac

func EvpnWithdrawMac(veth *rtnl.Link, vni, vindex int) error

func EvpnWithdrawMulticast

func EvpnWithdrawMulticast(vni, vindex int) error

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

func GetInfraEndpoint

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

func GetIntLike

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

sigh, needed for data that gets cross-serialized, nfc what the number format will be, json it's int64, mapstructure+yaml its int

func GetNativeNlri

func GetNativeNlri(p *api.Path) (bgp.AddrPrefixInterface, error)

func GetNativePathAttributes

func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)

func GetNodeLeaf

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

func HandleIncoming

func HandleIncoming(rq *cm.IncomingRequest) error

func HandleLinkCreate

func HandleLinkCreate(rq *cm.MzRequest) error

func HandleLinkDestroy

func HandleLinkDestroy(rq *cm.MzRequest) error

func HandleNodeRecycle

func HandleNodeRecycle(rq *cm.MzRequest) error

func HandleNodeSetup

func HandleNodeSetup(rq *cm.MzRequest) error

func HandleStatus added in v0.1.2

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

func HandleTask

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

func Init

func Init()

func InitInfranet added in v0.2.1

func InitInfranet(mzid, instance string, props map[string]interface{}, record bool) error

func IsTxnFailed

func IsTxnFailed(err error) bool

func KeepLeaseAlive

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

func LaunchTask

func LaunchTask(task *Task) error

Launch the specified task

func LeaseTask

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

func ListContainers

func ListContainers(namespace string) ([]containerd.Container, error)

func ListMaterializations added in v0.1.2

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

func ListNamespaces added in v0.1.13

func ListNamespaces() ([]string, error)

func LoadXIR

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

func MarshalFlowSpecRules

func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) []*any.Any

func MarshalNLRI

func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any

func MarshalNLRIs

func MarshalNLRIs(values []bgp.AddrPrefixInterface) []*any.Any

func MarshalPathAttributes

func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) []*any.Any

func MarshalRD

func MarshalRD(rd bgp.RouteDistinguisherInterface) *any.Any

func MarshalRT

func MarshalRT(rt bgp.ExtendedCommunityInterface) *any.Any

func MarshalRTs

func MarshalRTs(values []bgp.ExtendedCommunityInterface) []*any.Any

func Merge2Local

func Merge2Local(devId string) (string, error)

func NewAggregatorAttributeFromNative

func NewAggregatorAttributeFromNative(a *bgp.PathAttributeAggregator) *api.AggregatorAttribute

func NewAigpAttributeFromNative

func NewAigpAttributeFromNative(a *bgp.PathAttributeAigp) *api.AigpAttribute

func NewAs4PathAttributeFromNative

func NewAs4PathAttributeFromNative(a *bgp.PathAttributeAs4Path) *api.As4PathAttribute

func NewAsPathAttributeFromNative

func NewAsPathAttributeFromNative(a *bgp.PathAttributeAsPath) *api.AsPathAttribute

func NewLocalPrefAttributeFromNative

func NewLocalPrefAttributeFromNative(a *bgp.PathAttributeLocalPref) *api.LocalPrefAttribute

func NewNextHopAttributeFromNative

func NewNextHopAttributeFromNative(a *bgp.PathAttributeNextHop) *api.NextHopAttribute

func NewOriginAttributeFromNative

func NewOriginAttributeFromNative(a *bgp.PathAttributeOrigin) *api.OriginAttribute

func NewPath

func NewPath(nlri bgp.AddrPrefixInterface, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time) *api.Path

func NewPmsiTunnelAttributeFromNative

func NewPmsiTunnelAttributeFromNative(a *bgp.PathAttributePmsiTunnel) *api.PmsiTunnelAttribute

func NewUnknownAttributeFromNative

func NewUnknownAttributeFromNative(a *bgp.PathAttributeUnknown) *api.UnknownAttribute

func NodeOps added in v0.2.8

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

func NodeRecycle added in v0.1.19

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

func NodeSetup added in v0.2.1

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

func PullContainerImage

func PullContainerImage(namespace, image string) error

func Read

func Read(obj Object) error

func ReadNew

func ReadNew(obj Object) error

func ReadObjects

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

func ReadWait added in v0.1.10

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) (error, etcd.LeaseID)

func RegisterWithCommander

func RegisterWithCommander()

func RevokeLease

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

func RunObjectTx

func RunObjectTx(otx ObjectTx) error

func SetupContainerLo

func SetupContainerLo(namespace string) error

func SvcAddress added in v0.1.8

func SvcAddress(vindex int) string

func SvcCidr added in v0.1.8

func SvcCidr(vindex int) string

func TeardownInfranet added in v0.2.1

func TeardownInfranet(mzid, instance string, props map[string]interface{}, record bool) error

func ToApiFamily

func ToApiFamily(afi uint16, safi uint8) *api.Family

func ToRouteFamily

func ToRouteFamily(f *api.Family) bgp.RouteFamily

func TxnFailed

func TxnFailed(message string) error

func UnmarshalAttribute

func UnmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error)

func UnmarshalFlowSpecRules

func UnmarshalFlowSpecRules(values []*any.Any) ([]bgp.FlowSpecComponentInterface, error)

func UnmarshalNLRI

func UnmarshalNLRI(rf bgp.RouteFamily, an *any.Any) (bgp.AddrPrefixInterface, error)

func UnmarshalNLRIs

func UnmarshalNLRIs(rf bgp.RouteFamily, values []*any.Any) ([]bgp.AddrPrefixInterface, error)

func UnmarshalPathAttributes

func UnmarshalPathAttributes(values []*any.Any) ([]bgp.PathAttributeInterface, error)

func UnmarshalRD

func UnmarshalRD(a *any.Any) (bgp.RouteDistinguisherInterface, error)

func UnmarshalRT

func UnmarshalRT(a *any.Any) (bgp.ExtendedCommunityInterface, error)

func UnmarshalRTs

func UnmarshalRTs(values []*any.Any) ([]bgp.ExtendedCommunityInterface, error)

func WithCogCNI

func WithCogCNI(netns string) oci.SpecOpts

func WithCtrMounts

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

func Write

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

func WriteObjects

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

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
}

func NexCreateMembers

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

func NexDeleteMembers

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

func NexDeleteNetwork

func NexDeleteNetwork(name string) *Action

func (*Action) SetStage

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

func (*Action) SetTask

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

func (*Action) Stage

func (a *Action) Stage() *Stage

func (*Action) Task

func (a *Action) Task() *Task

type BelugaSpec added in v0.2.4

type BelugaSpec struct {
	Soft  bool
	Nodes []string
}

type CogletInfo

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

func ListCoglets

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

func (*CogletInfo) GetVersion

func (c *CogletInfo) GetVersion() int64

func (*CogletInfo) Key

func (c *CogletInfo) Key() string

storage object implementation

func (*CogletInfo) SetVersion

func (c *CogletInfo) SetVersion(v int64)

func (*CogletInfo) Value

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

type Container

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

func (*Container) GetVersion

func (x *Container) GetVersion() int64

func (*Container) Key

func (x *Container) Key() string

func (*Container) SetVersion

func (x *Container) SetVersion(v int64)

func (*Container) Value

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

type ContainerImageData

type ContainerImageData struct {
	Image     string
	Namespace string
}

type ContainerMount

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

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

func (*ContainerMount) GetVersion

func (x *ContainerMount) GetVersion() int64

func (*ContainerMount) Key

func (x *ContainerMount) Key() string

func (*ContainerMount) SetVersion

func (x *ContainerMount) SetVersion(v int64)

func (*ContainerMount) Value

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

type ContainerSpec

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

func (*ContainerSpec) Env

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

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
}

func (CountSet) Add

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

func (*CountSet) GetVersion

func (c *CountSet) GetVersion() int64

func (*CountSet) Key

func (c *CountSet) Key() string

func (CountSet) Next

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

func (CountSet) Remove

func (cs CountSet) Remove(i int) CountSet

func (*CountSet) SetVersion

func (c *CountSet) SetVersion(v int64)

func (*CountSet) Value

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

type CtrComponent

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

type DeleteContainerData

type DeleteContainerData struct {
	Name      string
	Namespace string
}

type DeleteContainerIfxData

type DeleteContainerIfxData struct {
	Name         string
	EvpnWithdraw bool
}

type Destination

type Destination struct {
	Paths []*Path
}

func NewDestination

func NewDestination(dst *api.Destination) *Destination

func (*Destination) MarshalJSON

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

type EnclaveSpec added in v0.1.7

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

func (*EnclaveSpec) GetVersion added in v0.1.7

func (e *EnclaveSpec) GetVersion() int64

func (*EnclaveSpec) Key added in v0.1.7

func (e *EnclaveSpec) Key() string

func (*EnclaveSpec) SetVersion added in v0.1.7

func (e *EnclaveSpec) SetVersion(v int64)

func (*EnclaveSpec) Value added in v0.1.7

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

type EnclaveVeth added in v0.1.7

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
}

func (*EnclaveVeth) GetVersion added in v0.1.7

func (x *EnclaveVeth) GetVersion() int64

func (*EnclaveVeth) Key added in v0.1.7

func (x *EnclaveVeth) Key() string

func (*EnclaveVeth) SetVersion added in v0.1.7

func (x *EnclaveVeth) SetVersion(v int64)

func (*EnclaveVeth) Value added in v0.1.7

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

type Endpoint

type Endpoint struct {
	Node        string
	Interface   string
	Multidegree bool
}

type EvpnInfo

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

type EvpnWithdrawData

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

type FoundrySetSpec added in v0.1.2

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

type ImageBinding

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

type ImageDefaults added in v0.1.2

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

func (*ImageDefaults) GetVersion added in v0.1.2

func (d *ImageDefaults) GetVersion() int64

func (*ImageDefaults) Key added in v0.1.2

func (d *ImageDefaults) Key() string

func (*ImageDefaults) SetVersion added in v0.1.2

func (d *ImageDefaults) SetVersion(v int64)

func (*ImageDefaults) Value added in v0.1.2

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

type ImageSpec added in v0.1.2

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

type LeafPortMode added in v0.1.13

type LeafPortMode int
const (
	Access LeafPortMode = iota
	Trunk
)

type LeafPortState

type LeafPortState struct {
	Mzid string
	Leaf string
	Port string
	Mode LeafPortMode
	Vids []int
	// contains filtered or unexported fields
}

func (*LeafPortState) GetVersion

func (x *LeafPortState) GetVersion() int64

func (*LeafPortState) Key

func (x *LeafPortState) Key() string

func (*LeafPortState) SetVersion

func (x *LeafPortState) SetVersion(v int64)

func (*LeafPortState) Value

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

type LinkInfo

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

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

func (*LinkInfo) GetVersion

func (l *LinkInfo) GetVersion() int64

func (*LinkInfo) Key

func (l *LinkInfo) Key() string

func (*LinkInfo) SetVersion

func (l *LinkInfo) SetVersion(v int64)

func (*LinkInfo) Value

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

type LinkKind

type LinkKind string
const (
	InfraLink LinkKind = "infra"
	XpLink    LinkKind = "xp"
)

type LinkSpec

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

type MacAdvSpec added in v0.1.10

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

type MzInfo

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

	IncomingTaskId string
	TeardownTaskId string

	NodeSetupTaskId   string
	NodeRecycleTaskId string

	LinkCreateTaskId  string
	LinkDestroyTaskId string

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

func (*MzInfo) GetVersion

func (m *MzInfo) GetVersion() int64

func (*MzInfo) Key

func (m *MzInfo) Key() string

func (*MzInfo) SetVersion

func (m *MzInfo) SetVersion(v int64)

func (*MzInfo) Value

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

type MzOperation added in v0.2.7

type MzOperation string
const (
	MzOutgoing MzOperation = "outgoing"
	MzIncoming MzOperation = "incoming"
	MzMod      MzOperation = "mod"
)

type MzfIndex added in v0.1.2

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

func (*MzfIndex) GetVersion added in v0.1.2

func (l *MzfIndex) GetVersion() int64

func (*MzfIndex) Key added in v0.1.2

func (x *MzfIndex) Key() string

func (*MzfIndex) SetVersion added in v0.1.2

func (l *MzfIndex) SetVersion(v int64)

func (*MzfIndex) Value added in v0.1.2

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

type NetNS

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

Network Namespace Record

func (*NetNS) GetVersion

func (x *NetNS) GetVersion() int64

func (*NetNS) Key

func (x *NetNS) Key() string

func (*NetNS) RemoveContainer

func (x *NetNS) RemoveContainer(ctr string)

func (*NetNS) SetVersion

func (x *NetNS) SetVersion(v int64)

func (*NetNS) Value

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

type NexMemberSpec

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

type NexNetworkSpec

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

	// Nex endpoint address
	Endpoint string
}

type NimbusConfig

type NimbusConfig struct {
	Node  string
	Users []NimbusUser
}

type NimbusUser

type NimbusUser struct {
	Name              string
	Sudo              bool
	SshAuthorizedKeys []string
}

type NodeInfo added in v0.1.13

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

type NodeInfraInfo

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

NodeInfraInfo something struct

type NodeSpec added in v0.2.8

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

type NodeStatus added in v0.2.1

type NodeStatus struct {
	Name string
	Mzid string
	Sled SledStatus
	// contains filtered or unexported fields
}

func ListNodes added in v0.2.1

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

func (*NodeStatus) GetVersion added in v0.2.1

func (v *NodeStatus) GetVersion() int64

func (*NodeStatus) Key added in v0.2.1

func (n *NodeStatus) Key() string

func (*NodeStatus) SetVersion added in v0.2.1

func (v *NodeStatus) SetVersion(x int64)

func (*NodeStatus) Value added in v0.2.1

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

type NsnatSpec

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

type Object

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

all obejcts that go to and fro from the database implement this interface

type ObjectTx

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

type OtterSpec

type OtterSpec struct {
	Pubkeys   []string
	Endpoints []Endpoint
}

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"`
}

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

type RallyStore

type RallyStore struct {
	Id string
}

type ReadTimer added in v0.1.10

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

type SledStatus added in v0.2.1

type SledStatus struct {
	State string
	Time  string
}

type Stage

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

func NewStage

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

func (*Stage) Mzid added in v0.1.17

func (s *Stage) Mzid() string

type TargetNetwork added in v0.2.8

type TargetNetwork struct {
	Vni int
	Vid int
}

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
}

func ListTasks

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

List all tasks

func NewTask

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

func ReadTask

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

func (*Task) AddDep added in v0.1.17

func (t *Task) AddDep(id string)

func (*Task) AddStage

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

func (*Task) ClearErrors

func (t *Task) ClearErrors()

func (*Task) Complete

func (t *Task) Complete() bool

func (*Task) DepsSatisfied

func (t *Task) DepsSatisfied() bool

func (*Task) Failed

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

func (*Task) GetVersion

func (t *Task) GetVersion() int64

func (*Task) Init

func (t *Task) Init()

func (*Task) InsertStage

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

func (*Task) Key

func (t *Task) Key() string

func (*Task) MaskAction added in v0.2.3

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

func (*Task) Mzid added in v0.1.17

func (t *Task) Mzid() string

func (*Task) Reset added in v0.2.1

func (t *Task) Reset()

func (*Task) SetVersion

func (t *Task) SetVersion(v int64)

func (*Task) Value

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

func (*Task) Wait

func (t *Task) Wait() error

type VLMap added in v0.1.10

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

func (*VLMap) GetVersion added in v0.1.10

func (v *VLMap) GetVersion() int64

func (*VLMap) Key added in v0.1.10

func (v *VLMap) Key() string

func (*VLMap) SetVersion added in v0.1.10

func (v *VLMap) SetVersion(x int64)

func (*VLMap) Value added in v0.1.10

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

type VLMentry added in v0.1.10

type VLMentry struct {
	Vni int
	Vid int
}

type VLinkEdge added in v0.1.10

type VLinkEdge int
const (
	VlanAccess VLinkEdge = iota
	VlanTrunk
	Vxlan
)

type Vtep

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

type VtepSpec

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

type VxLan

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

Vxlan Record

func (*VxLan) GetVersion

func (x *VxLan) GetVersion() int64

func (*VxLan) Key

func (x *VxLan) Key() string

func (*VxLan) RemoveInterface

func (x *VxLan) RemoveInterface(mac string)

func (*VxLan) SetVersion

func (x *VxLan) SetVersion(v int64)

func (*VxLan) Value

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

Jump to

Keyboard shortcuts

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