Documentation ¶
Index ¶
- Constants
- Variables
- func RenderTable(headers []string, data [][]string) string
- func Run[TIn In, TOut Out](ctx context.Context, f Func[TIn, TOut], args Args, in TIn, w io.Writer) error
- type AccessIn
- type AccessOut
- type AgentState
- type Args
- type ConnectionIn
- type ConnectionOut
- type ConnectionOutPort
- type FabricIn
- type FabricOut
- type FabricOutControl
- type FabricOutSwitch
- type Func
- type IPIn
- type IPOut
- type IPOutConnection
- type IPOutDHCPLease
- type IPOutExternalPeering
- type IPOutSwitch
- type IPOutVPCSubnet
- type In
- 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
Constants ¶
View Source
const (
NativeVLAN = "native"
)
Variables ¶
View Source
var OutputTypes = []OutputType{OutputTypeText, OutputTypeJSON, OutputTypeYAML}
Functions ¶
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"` }
func (*AccessOut) MarshalText ¶
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 FabricOut ¶
type FabricOut struct { Summary string `json:"summary,omitempty"` ControlNodes []*FabricOutControl `json:"controlNodes,omitempty"` Switches []*FabricOutSwitch `json:"switches,omitempty"` }
func (*FabricOut) MarshalText ¶
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 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 (*IPOut) MarshalText ¶
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 MACOut ¶
type MACOut struct { Ports []string `json:"ports,omitempty"` DHCPLeases []*MACOutDHCPLease `json:"dhcpLeases,omitempty"` }
func (*MACOut) MarshalText ¶
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"` 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 (*PortOut) MarshalText ¶
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 (*ServerOut) MarshalText ¶
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 (*SwitchOut) MarshalText ¶
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 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 (*VPCOut) MarshalText ¶
Click to show internal directories.
Click to hide internal directories.