Documentation
¶
Index ¶
- Constants
- Variables
- func HumanizeTime(now, then time.Time) string
- func Render[TIn In, TOut Out[TIn]](now time.Time, output OutputType, w io.Writer, in TIn, out TOut) error
- func RenderTable(headers []string, data [][]string) string
- func Run[TIn In, TOut Out[TIn]](ctx context.Context, f Func[TIn, TOut], args Args, in TIn, w io.Writer) error
- type AccessIn
- type AccessOut
- type AgentState
- type Args
- type BGPIn
- type BGPOut
- type ConnectionIn
- type ConnectionOut
- type ConnectionOutPort
- type FabricIn
- type FabricOut
- type FabricOutSwitch
- type Func
- type IPIn
- type IPOut
- type IPOutConnection
- type IPOutDHCPLease
- type IPOutExternalPeering
- type IPOutSwitch
- type IPOutVPCSubnet
- type In
- type LLDPIn
- type LLDPOut
- type MACIn
- type MACOut
- type MACOutDHCPLease
- type Out
- type OutLoopbackWorkaround
- type OutputType
- type PortIn
- type PortOut
- type ServerIn
- type ServerOut
- type SwitchIn
- type SwitchOut
- type SwitchOutPort
- type VPCIn
- type VPCOut
- type WithErrors
Constants ¶
View Source
const (
NativeVLAN = "native"
)
Variables ¶
View Source
var OutputTypes = []OutputType{OutputTypeText, OutputTypeJSON, OutputTypeYAML}
Functions ¶
func HumanizeTime ¶ added in v0.72.0
func RenderTable ¶
Types ¶
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"`
}
type AgentState ¶
type AgentState struct {
Summary string `json:"summary,omitempty"`
DesiredGen int64 `json:"desiredGen,omitempty"`
LastHeartbeat kmetav1.Time `json:"lastHeartbeat,omitempty"`
LastAttemptTime kmetav1.Time `json:"lastAttemptTime,omitempty"`
LastAttemptGen int64 `json:"lastAttemptGen,omitempty"`
LastAppliedTime kmetav1.Time `json:"lastAppliedTime,omitempty"`
LastAppliedGen int64 `json:"lastAppliedGen,omitempty"`
}
type Args ¶
type Args struct {
Verbose bool
Output OutputType
}
type BGPOut ¶ added in v0.59.0
type BGPOut struct {
Neighbors map[string]map[string]map[string]apiutil.BGPNeighborStatus `json:"neighbors"`
Errs []error `json:"errors"`
}
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 kclient.Reader, in ConnectionIn) (*ConnectionOut, error)
func (*ConnectionOut) MarshalText ¶
func (out *ConnectionOut) MarshalText(_ ConnectionIn, now time.Time) (string, error)
type ConnectionOutPort ¶
type ConnectionOutPort struct {
Name string `json:"name,omitempty"`
State *agentapi.SwitchStateInterface `json:"state,omitempty"`
}
type FabricOut ¶
type FabricOut struct {
Summary string `json:"summary,omitempty"`
Switches []*FabricOutSwitch `json:"switches,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 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
}
type IPOutConnection ¶
type IPOutConnection struct {
Name string `json:"name,omitempty"`
wiringapi.ConnectionSpec `json:",inline"`
}
type IPOutDHCPLease ¶
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 LLDPOut ¶ added in v0.59.0
type LLDPOut struct {
Neighbors map[string]map[string]apiutil.LLDPNeighborStatus `json:"neighbors"`
Errs []error `json:"errors"`
}
type MACOut ¶
type MACOut struct {
Ports []string `json:"ports,omitempty"`
DHCPLeases []*MACOutDHCPLease `json:"dhcpLeases,omitempty"`
}
type MACOutDHCPLease ¶
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 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"`
TransceiverState *agentapi.SwitchStateTransceiver `json:"transceiverState,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
}
type ServerOut ¶
type ServerOut struct {
Name string `json:"name,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"`
}
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"`
Firmware map[string]string `json:"firmware,omitempty"`
}
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"`
TransceiverState *agentapi.SwitchStateTransceiver `json:"transceiverState,omitempty"`
}
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"`
}
type WithErrors ¶ added in v0.59.2
type WithErrors interface {
Errors() []error
}
Click to show internal directories.
Click to hide internal directories.