inspect

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NativeVLAN = "native"
)

Variables

Functions

func RenderTable

func RenderTable(headers []string, data [][]string) string

func Run

func Run[TIn In, TOut Out](ctx context.Context, f Func[TIn, TOut], args Args, in TIn, w io.Writer) error

Types

type AccessIn

type AccessIn struct {
	Source      string
	Destination string
}

type AccessOut

type AccessOut struct {
	SourceSubnets           []string            `json:"sourceSubnets,omitempty"`
	DestinationSubnets      []string            `json:"destinationSubnets,omitempty"`
	DestinationExternal     string              `json:"destinationExternal,omitempty"`
	Reachable               map[string][]string `json:"reachable,omitempty"`
	ExternalReachable       map[string]bool     `json:"externalReachable,omitempty"`
	StaticExternalReachable map[string]bool     `json:"staticExternalReachable,omitempty"`
}

func Access

func Access(ctx context.Context, kube client.Reader, in AccessIn) (*AccessOut, error)

func (*AccessOut) MarshalText

func (out *AccessOut) MarshalText() (string, error)

type AgentState

type AgentState struct {
	Summary         string      `json:"summary,omitempty"`
	DesiredGen      int64       `json:"desiredGen,omitempty"`
	LastHeartbeat   metav1.Time `json:"lastHeartbeat,omitempty"`
	LastAttemptTime metav1.Time `json:"lastAttemptTime,omitempty"`
	LastAttemptGen  int64       `json:"lastAttemptGen,omitempty"`
	LastAppliedTime metav1.Time `json:"lastAppliedTime,omitempty"`
	LastAppliedGen  int64       `json:"lastAppliedGen,omitempty"`
}

type Args

type Args struct {
	Verbose bool
	Output  OutputType
}

type ConnectionIn

type ConnectionIn struct {
	Name string
}

type ConnectionOut

type ConnectionOut struct {
	Spec                wiringapi.ConnectionSpec                  `json:"spec,omitempty"`
	Ports               []*ConnectionOutPort                      `json:"ports,omitempty"`
	VPCAttachments      map[string]*vpcapi.VPCAttachmentSpec      `json:"vpcAttachments,omitempty"`      // if server-facing conn
	AttachedVPCs        map[string]*vpcapi.VPCSpec                `json:"attachedVPCs,omitempty"`        // if server-facing conn
	ExternalAttachments map[string]*vpcapi.ExternalAttachmentSpec `json:"externalAttachments,omitempty"` // if External conn
	LoopbackWorkarounds map[string]*OutLoopbackWorkaround         `json:"loopbackWorkarounds,omitempty"` // if VPCLoopback conn
}

func Connection

func Connection(ctx context.Context, kube client.Reader, in ConnectionIn) (*ConnectionOut, error)

func (*ConnectionOut) MarshalText

func (out *ConnectionOut) MarshalText() (string, error)

type ConnectionOutPort

type ConnectionOutPort struct {
	Name  string                         `json:"name,omitempty"`
	State *agentapi.SwitchStateInterface `json:"state,omitempty"`
}

type FabricIn

type FabricIn struct {
	PortMapping bool
}

type FabricOut

type FabricOut struct {
	Summary      string              `json:"summary,omitempty"`
	ControlNodes []*FabricOutControl `json:"controlNodes,omitempty"`
	Switches     []*FabricOutSwitch  `json:"switches,omitempty"`
}

func Fabric

func Fabric(ctx context.Context, kube client.Reader, _ FabricIn) (*FabricOut, error)

func (*FabricOut) MarshalText

func (out *FabricOut) MarshalText() (string, error)

type FabricOutControl

type FabricOutControl struct {
	Name  string      `json:"name,omitempty"`
	State *AgentState `json:"state,omitempty"`
}

type FabricOutSwitch

type FabricOutSwitch struct {
	Name               string      `json:"name,omitempty"`
	Serial             string      `json:"serial,omitempty"`
	Software           string      `json:"software,omitempty"`
	ProfileDisplayName string      `json:"profileDisplayName,omitempty"`
	State              *AgentState `json:"state,omitempty"`
	Role               string      `json:"role,omitempty"`
	Groups             []string    `json:"groups,omitempty"`
}

type Func

type Func[TIn In, TOut Out] func(ctx context.Context, kube client.Reader, in TIn) (TOut, error)

type IPIn

type IPIn struct {
	IP string
}

type IPOut

type IPOut struct {
	IPv4Namespace    *string                `json:"ipv4Namespace,omitempty"`
	VPCSubnet        *IPOutVPCSubnet        `json:"vpcSubnet,omitempty"`
	Switch           *IPOutSwitch           `json:"switch,omitempty"`
	Connections      []IPOutConnection      `json:"connections,omitempty"`
	ExternalPeerings []IPOutExternalPeering `json:"externalPeerings,omitempty"`
	// contains filtered or unexported fields
}

func IP

func IP(ctx context.Context, kube client.Reader, in IPIn) (*IPOut, error)

func (*IPOut) MarshalText

func (out *IPOut) MarshalText() (string, error)

type IPOutConnection

type IPOutConnection struct {
	Name                     string `json:"name,omitempty"`
	wiringapi.ConnectionSpec `json:",inline"`
}

type IPOutDHCPLease

type IPOutDHCPLease struct {
	MAC      string      `json:"mac,omitempty"`
	Expiry   metav1.Time `json:"expiry,omitempty"`
	Hostname string      `json:"hostname,omitempty"`
}

type IPOutExternalPeering

type IPOutExternalPeering struct {
	Name                       string `json:"name,omitempty"`
	vpcapi.ExternalPeeringSpec `json:",inline"`
}

type IPOutSwitch

type IPOutSwitch struct {
	Name                 string `json:"name,omitempty"`
	wiringapi.SwitchSpec `json:",inline"`
}

type IPOutVPCSubnet

type IPOutVPCSubnet struct {
	Name             string `json:"name,omitempty"`
	vpcapi.VPCSubnet `json:",inline"`
	DHCPLease        *IPOutDHCPLease `json:"dhcpLease,omitempty"`
}

type In

type In interface{}

type MACIn

type MACIn struct {
	Value string
}

type MACOut

type MACOut struct {
	Ports      []string           `json:"ports,omitempty"`
	DHCPLeases []*MACOutDHCPLease `json:"dhcpLeases,omitempty"`
}

func MAC

func MAC(ctx context.Context, kube client.Reader, in MACIn) (*MACOut, error)

func (*MACOut) MarshalText

func (out *MACOut) MarshalText() (string, error)

type MACOutDHCPLease

type MACOutDHCPLease struct {
	Subnet   string      `json:"subnet,omitempty"`
	Expiry   metav1.Time `json:"expiry,omitempty"`
	Hostname string      `json:"hostname,omitempty"`
}

type Out

type Out interface {
	MarshalText() (string, error)
}

type OutLoopbackWorkaround

type OutLoopbackWorkaround struct {
	Link             wiringapi.SwitchToSwitchLink           `json:"link,omitempty"`
	VPCPeerings      map[string]*vpcapi.VPCPeeringSpec      `json:"vpcPeerings,omitempty"`
	ExternalPeerings map[string]*vpcapi.ExternalPeeringSpec `json:"externalPeerings,omitempty"`
}

type OutputType

type OutputType string
const (
	OutputTypeUndefined OutputType = ""
	OutputTypeText      OutputType = "text"
	OutputTypeJSON      OutputType = "json"
	OutputTypeYAML      OutputType = "yaml"
)

type PortIn

type PortIn struct {
	Port string
}

type PortOut

type PortOut struct {
	ConnectionName      *string                                   `json:"connectionName,omitempty"`
	Connection          *wiringapi.ConnectionSpec                 `json:"connection,omitempty"`
	InterfaceState      *agentapi.SwitchStateInterface            `json:"interfaceState,omitempty"`
	BreakoutState       *agentapi.SwitchStateBreakout             `json:"breakoutState,omitempty"`
	VPCAttachments      map[string]*vpcapi.VPCAttachmentSpec      `json:"vpcAttachments,omitempty"`
	AttachedVPCs        map[string]*vpcapi.VPCSpec                `json:"attachedVPCs,omitempty"`
	ExternalAttachments map[string]*vpcapi.ExternalAttachmentSpec `json:"externalAttachments,omitempty"` // if External conn
	LoopbackWorkarounds map[string]*OutLoopbackWorkaround         `json:"loopbackWorkarounds,omitempty"` // if VPCLoopback conn
}

func Port

func Port(ctx context.Context, kube client.Reader, in PortIn) (*PortOut, error)

func (*PortOut) MarshalText

func (out *PortOut) MarshalText() (string, error)

type ServerIn

type ServerIn struct {
	Name string
}

type ServerOut

type ServerOut struct {
	Name           string                               `json:"name,omitempty"`
	Control        bool                                 `json:"control,omitempty"`
	ControlState   *AgentState                          `json:"controlState,omitempty"`
	Connections    map[string]*wiringapi.ConnectionSpec `json:"connections,omitempty"`
	VPCAttachments map[string]*vpcapi.VPCAttachmentSpec `json:"vpcAttachments,omitempty"`
	AttachedVPCs   map[string]*vpcapi.VPCSpec           `json:"attachedVPCs,omitempty"`
}

func Server

func Server(ctx context.Context, kube client.Reader, in ServerIn) (*ServerOut, error)

func (*ServerOut) MarshalText

func (out *ServerOut) MarshalText() (string, error)

type SwitchIn

type SwitchIn struct {
	Name string
}

type SwitchOut

type SwitchOut struct {
	Name     string                       `json:"name,omitempty"`
	State    *AgentState                  `json:"state,omitempty"`
	Spec     *wiringapi.SwitchSpec        `json:"spec,omitempty"`
	Profile  *wiringapi.SwitchProfileSpec `json:"profile,omitempty"`
	Ports    []*SwitchOutPort             `json:"ports,omitempty"`
	Serial   string                       `json:"serial,omitempty"`
	Software string                       `json:"software,omitempty"`
}

func Switch

func Switch(ctx context.Context, kube client.Reader, in SwitchIn) (*SwitchOut, error)

func (*SwitchOut) MarshalText

func (out *SwitchOut) MarshalText() (string, error)

type SwitchOutPort

type SwitchOutPort struct {
	PortName       string                         `json:"portName,omitempty"`
	ConnectionName string                         `json:"connectionName,omitempty"`
	ConnectionType string                         `json:"connectionType,omitempty"`
	InterfaceState *agentapi.SwitchStateInterface `json:"interfaceState,omitempty"`
	BreakoutState  *agentapi.SwitchStateBreakout  `json:"breakoutState,omitempty"`
}

type VPCIn

type VPCIn struct {
	Name   string
	Subnet string
}

type VPCOut

type VPCOut struct {
	Name             string                                  `json:"name,omitempty"`
	Subnet           string                                  `json:"subnet,omitempty"`
	Spec             vpcapi.VPCSpec                          `json:"spec,omitempty"`
	VPCAttachments   map[string]*vpcapi.VPCAttachmentSpec    `json:"vpcAttachments,omitempty"`
	VPCPeerings      map[string]*vpcapi.VPCPeeringSpec       `json:"vpcPeerings,omitempty"`
	ExternalPeerings map[string]*vpcapi.ExternalPeeringSpec  `json:"externalPeerings,omitempty"`
	Access           map[string]*apiutil.ReachableFromSubnet `json:"access,omitempty"`
}

func VPC

func VPC(ctx context.Context, kube client.Reader, in VPCIn) (*VPCOut, error)

func (*VPCOut) MarshalText

func (out *VPCOut) MarshalText() (string, error)

Jump to

Keyboard shortcuts

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