fabric

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	KeyTier              = "tier"
	KeyPosition          = "position"
	KeyPodIndex          = "podIndex"
	KeyPlaneIndex        = "planeIndex"
	KeyRelativeNodeIndex = "relativeNodeIndex"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fabric

type Fabric interface {
	GetNodes() []Node
	GetLinks() []Link
	PrintNodes()
	PrintLinks()
	PrintGraph()
	GenerateJsonFile() error

	SetLogger(logger logging.Logger)
	SetClient(c client.Client)
	SetLocation(l *topov1alpha1.Location)
}

func New

func New(t *topov1alpha1.Template, opts ...Option) (Fabric, error)
type Link interface {
	From() graph.Node
	To() graph.Node
	ReversedLine() graph.Line
	ID() int64
	String() string

	FromNodeName() string
	ToNodeName() string
	FromIfName() string
	ToIfName() string

	Attributes() []encoding.Attribute
	SetLabel(label map[string]string) error
	UpdateLabel(label map[string]string) error
	GetLabels() labels.Set
}
func NewLink(l graph.Line) Link

type Node

type Node interface {
	ID() int64
	String() string
	DOTID() string
	GetPosition() string
	GetRelativeNodeIndex() string
	GetPlaneIndex() string
	GetPodIndex() string
	GetVendorType() targetv1.VendorType
	GetPlatform() string
	GetUplinkPerNode() uint32
	GetInterfaceName(idx uint32) string
	GetInterfaceNameWithPlatfromOffset(idx uint32) string
	IsToBeDeployed() bool
	GetLocation() *topov1alpha1.Location

	Attributes() []encoding.Attribute
	SetLabel(label map[string]string) error
	UpdateLabel(label map[string]string) error
	GetLabels() labels.Set
}

func NewNode

func NewNode(nodeInfo *nodeInfo) (Node, error)

type Option

type Option func(Fabric)

Option can be used to manipulate Fabric config.

func WithClient added in v0.0.2

func WithClient(c client.Client) Option

WithClient specifies the fabric to use within the client.

func WithLocation added in v0.0.14

func WithLocation(l *topov1alpha1.Location) Option

WithClient specifies the fabric to use within the client.

func WithLogger

func WithLogger(log logging.Logger) Option

WithLogger specifies how the Fabric logs messages.

type TopologyJsonFile added in v0.0.14

type TopologyJsonFile struct {
	Nodes []*TopologyJsonNode `json:"nodes,omitempty"`
	Edges []*TopologyJsonLink `json:"edges,omitempty"`
}
type TopologyJsonLink struct {
	From int `json:"from"`
	To   int `json:"to"`
}

type TopologyJsonNode added in v0.0.14

type TopologyJsonNode struct {
	ID    int                   `json:"id"`
	Label string                `json:"label"`
	Level int                   `json:"level"`
	Nos   string                `json:"nos,omitempty"`
	Cid   string                `json:"cid"`
	Data  *TopologyJsonNodedata `json:"data,omitempty"`
}

type TopologyJsonNodedata added in v0.0.14

type TopologyJsonNodedata struct {
	ExpectedSWVersion string `json:"expectedSWVersion,omitempty"`
	MgmtIP            string `json:"mgmtIp,omitempty"`
	Model             string `json:"model,omitempty"`
}

Jump to

Keyboard shortcuts

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