apiutil

package
v0.61.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAttachedSubnets

func GetAttachedSubnets(ctx context.Context, kube client.Reader, server string) (map[string]ServerAttachment, error)

func GetBGPNeighbors added in v0.59.0

func GetBGPNeighbors(ctx context.Context, kube client.Reader, fabCfg *meta.FabricConfig, sw *wiringapi.Switch) (map[string]map[string]BGPNeighborStatus, error)

func GetLLDPNeighbors added in v0.59.0

func GetLLDPNeighbors(ctx context.Context, kube client.Reader, sw *wiringapi.Switch) (map[string]LLDPNeighborStatus, error)

func GetReachableFrom added in v0.40.2

func GetReachableFrom(ctx context.Context, kube client.Reader, vpcName string) (map[string]*ReachableFromSubnet, error)

func IsExternalAttached added in v0.40.2

func IsExternalAttached(ctx context.Context, kube client.Reader, external string) (bool, error)

func IsExternalIPReachable added in v0.40.2

func IsExternalIPReachable(ctx context.Context, kube client.Reader, source, destIP string) (bool, error)

func IsExternalSubnetReachable

func IsExternalSubnetReachable(ctx context.Context, kube client.Reader, sourceServer, destSubnet string) (bool, error)

TODO check if allowed prefix contains destSubnet

func IsServerReachable

func IsServerReachable(ctx context.Context, kube client.Reader, sourceServer, destServer string) (bool, error)

func IsStaticExternalIPReachable added in v0.40.2

func IsStaticExternalIPReachable(ctx context.Context, kube client.Reader, source, destIP string) (bool, error)

func IsSubnetReachable

func IsSubnetReachable(ctx context.Context, kube client.Reader, source, dest string) (bool, error)

func IsSubnetReachableBetweenVPCs

func IsSubnetReachableBetweenVPCs(ctx context.Context, kube client.Reader, vpc1Name, vpc1Subnet, vpc2Name, vpc2Subnet string) (bool, error)

func IsSubnetReachableWithinVPC

func IsSubnetReachableWithinVPC(ctx context.Context, kube client.Reader, vpcName, source, dest string) (bool, error)

func IsSubnetReachableWithinVPCObj added in v0.40.2

func IsSubnetReachableWithinVPCObj(vpc *vpcapi.VPC, source, dest string) (bool, error)

func IsVPCPeeringRemoteNotEmpty added in v0.40.2

func IsVPCPeeringRemoteNotEmpty(ctx context.Context, kube client.Reader, vpcPeering *vpcapi.VPCPeering) (bool, error)

Types

type BGPNeighborStatus added in v0.59.0

type BGPNeighborStatus struct {
	RemoteName                      string          `json:"remoteName,omitempty"`
	Type                            BGPNeighborType `json:"type,omitempty"`
	Expected                        bool            `json:"expected,omitempty"`
	ConnectionName                  string          `json:"connectionName,omitempty"`
	ConnectionType                  string          `json:"connectionType,omitempty"`
	Port                            string          `json:"port,omitempty"`
	agentapi.SwitchStateBGPNeighbor `json:",inline"`
}

type BGPNeighborType added in v0.59.0

type BGPNeighborType string
const (
	BGPNeighborTypeFabric   BGPNeighborType = "fabric"
	BGPNeighborTypeMCLAG    BGPNeighborType = "mclag"
	BGPNeighborTypeExternal BGPNeighborType = "external"
)

type LLDPNeighbor added in v0.59.0

type LLDPNeighbor struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Port        string `json:"port,omitempty"`
}

type LLDPNeighborStatus added in v0.59.0

type LLDPNeighborStatus struct {
	ConnectionName string           `json:"connectionName,omitempty"`
	ConnectionType string           `json:"connectionType,omitempty"`
	Type           LLDPNeighborType `json:"type,omitempty"`
	Expected       LLDPNeighbor     `json:"expected,omitempty"`
	Actual         LLDPNeighbor     `json:"actual,omitempty"`
}

type LLDPNeighborType added in v0.59.0

type LLDPNeighborType string
const (
	LLDPNeighborTypeFabric   LLDPNeighborType = "fabric"
	LLDPNeighborTypeExternal LLDPNeighborType = "external"
	LLDPNeighborTypeServer   LLDPNeighborType = "server"
)

type ReachableFromSubnet added in v0.40.2

type ReachableFromSubnet struct {
	WithinSameSubnet *ReachableSubnet             `json:"withinSameSubnet,omitempty"`
	SameVPCSubnets   []ReachableSubnet            `json:"sameVPCSubnets,omitempty"`
	OtherVPCSubnets  map[string][]ReachableSubnet `json:"otherVPCSubnets,omitempty"`  // vpc -> []subnets
	ExternalPrefixes map[string][]string          `json:"externalPrefixes,omitempty"` // external -> []prefixes
}

type ReachableSubnet added in v0.40.2

type ReachableSubnet struct {
	Name   string `json:"name,omitempty"`
	Subnet string `json:"subnet,omitempty"`
}

type ServerAttachment

type ServerAttachment struct {
	Connection string
	Interfaces []string
	NativeVLAN bool
}

Jump to

Keyboard shortcuts

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