Documentation
¶
Index ¶
- Constants
- func SpecTextDiff(actual, desired []byte) ([]byte, error)
- type Action
- type Processor
- type Spec
- type SpecACL
- type SpecACLEntry
- type SpecACLEntryAction
- type SpecACLEntryProtocol
- type SpecACLInterface
- type SpecBFDProfile
- type SpecCommunityList
- type SpecDHCPRelay
- type SpecInterface
- type SpecInterfaceIP
- type SpecInterfaceIPv6
- type SpecLLDP
- type SpecLLDPInterface
- type SpecLSTGroup
- type SpecLSTInterface
- type SpecMCLAGDomain
- type SpecMCLAGInterface
- type SpecNTP
- type SpecNTPServer
- type SpecPart
- type SpecPortBreakout
- type SpecPortChannelConfig
- type SpecPortGroup
- type SpecPrefixList
- type SpecPrefixListAction
- type SpecPrefixListEntry
- type SpecPrefixListPrefix
- type SpecProxyARP
- type SpecRouteMap
- type SpecRouteMapConditions
- type SpecRouteMapResult
- type SpecRouteMapStatement
- type SpecStaticARP
- type SpecSubinterface
- type SpecSuppressVLANNeigh
- type SpecUser
- type SpecVRF
- type SpecVRFAttachedHost
- type SpecVRFBGP
- type SpecVRFBGPIPv4Unicast
- type SpecVRFBGPImportVRF
- type SpecVRFBGPL2VPNEVPN
- type SpecVRFBGPNeighbor
- type SpecVRFBGPNetwork
- type SpecVRFEVPNMH
- type SpecVRFEthernetSegment
- type SpecVRFInterface
- type SpecVRFStaticRoute
- type SpecVRFStaticRouteNextHop
- type SpecVRFTableConnection
- type SpecVRFVNIEntry
- type SpecVXLANEVPNNVO
- type SpecVXLANTunnel
- type SpecVXLANTunnelMap
Constants ¶
View Source
const ( SpecVRFBGPNeighborPeerTypeInternal = "internal" SpecVRFBGPNeighborPeerTypeExternal = "external" )
View Source
const ( SpecVRFBGPTableConnectionConnected = "connected" SpecVRFBGPTableConnectionStatic = "static" SpecVRFBGPTableConnectionAttachedHost = "attachedhost" )
Variables ¶
This section is empty.
Functions ¶
func SpecTextDiff ¶
Types ¶
type Processor ¶
type Processor interface {
EnsureControlLink(ctx context.Context, agent *agentapi.Agent) error
WaitReady(ctx context.Context) error
LoadActualState(ctx context.Context, agent *agentapi.Agent) (*Spec, error)
PlanDesiredState(ctx context.Context, agent *agentapi.Agent) (*Spec, error)
CalculateActions(ctx context.Context, actual, desired *Spec) ([]Action, error)
ApplyActions(ctx context.Context, actions []Action) ([]string, error) // warnings
UpdateSwitchState(ctx context.Context, agent *agentapi.Agent, reg *switchstate.Registry) error
Reboot(ctx context.Context, force bool) error
Reinstall(ctx context.Context) error
FactoryReset(ctx context.Context) error
GetRoCE(ctx context.Context) (bool, error)
SetRoCE(ctx context.Context, enable bool) error
}
type Spec ¶
type Spec struct {
ZTP *bool `json:"ztp,omitempty"`
Hostname *string `json:"hostname,omitempty"`
LLDP *SpecLLDP `json:"lldp,omitempty"`
LLDPInterfaces map[string]*SpecLLDPInterface `json:"lldpInterfaces,omitempty"`
NTP *SpecNTP `json:"ntp,omitempty"`
NTPServers map[string]*SpecNTPServer `json:"ntpServers,omitempty"`
Users map[string]*SpecUser `json:"users,omitempty"`
PortGroups map[string]*SpecPortGroup `json:"portGroupSpeeds,omitempty"`
PortBreakouts map[string]*SpecPortBreakout `json:"portBreakouts,omitempty"`
Interfaces map[string]*SpecInterface `json:"interfaces,omitempty"`
MCLAGs map[uint32]*SpecMCLAGDomain `json:"mclags,omitempty"`
MCLAGInterfaces map[string]*SpecMCLAGInterface `json:"mclagInterfaces,omitempty"`
VRFs map[string]*SpecVRF `json:"vrfs,omitempty"`
RouteMaps map[string]*SpecRouteMap `json:"routeMaps,omitempty"`
PrefixLists map[string]*SpecPrefixList `json:"prefixLists,omitempty"`
CommunityLists map[string]*SpecCommunityList `json:"communityLists,omitempty"`
DHCPRelays map[string]*SpecDHCPRelay `json:"dhcpRelays,omitempty"`
ACLs map[string]*SpecACL `json:"acls,omitempty"`
ACLInterfaces map[string]*SpecACLInterface `json:"aclInterfaces,omitempty"`
VXLANTunnels map[string]*SpecVXLANTunnel `json:"vxlanTunnels,omitempty"`
VXLANEVPNNVOs map[string]*SpecVXLANEVPNNVO `json:"vxlanEVPNNVOs,omitempty"`
VXLANTunnelMap map[string]*SpecVXLANTunnelMap `json:"vxlanTunnelMap,omitempty"` // e.g. map_5011_Vlan1000 -> 5011 + Vlan1000
VRFVNIMap map[string]*SpecVRFVNIEntry `json:"vrfVNIMap,omitempty"`
SuppressVLANNeighs map[string]*SpecSuppressVLANNeigh `json:"suppressVLANNeighs,omitempty"`
PortChannelConfigs map[string]*SpecPortChannelConfig `json:"portChannelConfigs,omitempty"`
LSTGroups map[string]*SpecLSTGroup `json:"lstGroups,omitempty"`
LSTInterfaces map[string]*SpecLSTInterface `json:"lstInterfaces,omitempty"`
ECMPRoCEQPN *bool `json:"ecmpRoCEQPN,omitempty"`
BFDProfiles map[string]*SpecBFDProfile `json:"bfdProfiles,omitempty"`
}
func (*Spec) CleanupSensetive ¶
func (s *Spec) CleanupSensetive()
func (*Spec) MarshalYAML ¶
type SpecACL ¶
type SpecACL struct {
Description *string `json:"description,omitempty"`
Entries map[uint32]*SpecACLEntry `json:"entries,omitempty"`
}
type SpecACLEntry ¶
type SpecACLEntry struct {
Description *string `json:"description,omitempty"`
Action SpecACLEntryAction `json:"action,omitempty"`
Protocol SpecACLEntryProtocol `json:"protocol,omitempty"`
SourceAddress *string `json:"sourceAddress,omitempty"`
SourcePort *uint16 `json:"sourcePort,omitempty"`
DestinationAddress *string `json:"destinationAddress,omitempty"`
DestinationPort *uint16 `json:"destinationPort,omitempty"`
}
func (*SpecACLEntry) IsNil ¶
func (s *SpecACLEntry) IsNil() bool
type SpecACLEntryAction ¶
type SpecACLEntryAction string
const ( SpecACLEntryActionAccept SpecACLEntryAction = "ACCEPT" // permit SpecACLEntryActionDrop SpecACLEntryAction = "DROP" // deny SpecACLEntryActionDiscard SpecACLEntryAction = "DISCARD" // discard SpecACLEntryActionTransit SpecACLEntryAction = "TRANSIT" // transit )
type SpecACLEntryProtocol ¶
type SpecACLEntryProtocol string
const ( SpecACLEntryProtocolUnset SpecACLEntryProtocol = "" SpecACLEntryProtocolUDP SpecACLEntryProtocol = "UDP" )
type SpecACLInterface ¶
type SpecACLInterface struct {
Ingress *string `json:"ingress,omitempty"`
Egress *string `json:"egress,omitempty"`
}
func (*SpecACLInterface) IsNil ¶
func (s *SpecACLInterface) IsNil() bool
type SpecBFDProfile ¶ added in v0.84.0
type SpecBFDProfile struct {
PassiveMode *bool `json:"passiveMode,omitempty"`
RequiredMinimumReceive *uint32 `json:"requiredMinimumReceive,omitempty"`
DesiredMinimumTxInterval *uint32 `json:"desiredMinimumTxInterval,omitempty"`
DetectionMultiplier *uint8 `json:"detectionMultiplier,omitempty"`
}
func (*SpecBFDProfile) IsNil ¶ added in v0.84.0
func (s *SpecBFDProfile) IsNil() bool
type SpecCommunityList ¶
type SpecCommunityList struct {
Members []string `json:"members,omitempty"`
}
func (*SpecCommunityList) IsNil ¶
func (s *SpecCommunityList) IsNil() bool
type SpecDHCPRelay ¶
type SpecDHCPRelay struct {
SourceInterface *string `json:"sourceInterface,omitempty"`
RelayAddress []string `json:"relayAddress,omitempty"`
LinkSelect bool `json:"linkSelect,omitempty"`
VRFSelect bool `json:"vrfSelect,omitempty"`
}
func (*SpecDHCPRelay) IsNil ¶
func (s *SpecDHCPRelay) IsNil() bool
type SpecInterface ¶
type SpecInterface struct {
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
PortChannel *string `json:"portChannel,omitempty"`
AccessVLAN *uint16 `json:"accessVLAN,omitempty"`
TrunkVLANs []string `json:"trunkVLANs,omitempty"`
MTU *uint16 `json:"mtu,omitempty"`
Speed *string `json:"speed,omitempty"`
AutoNegotiate *bool `json:"autoNegotiate,omitempty"`
VLANIPs map[string]*SpecInterfaceIP `json:"vlanIPs,omitempty"`
VLANAnycastGateway []string `json:"vlanAnycastGateway,omitempty"`
Subinterfaces map[uint32]*SpecSubinterface `json:"subinterfaces,omitempty"`
ProxyARP *SpecProxyARP `json:"proxyARP,omitempty"`
StaticARPs map[string]*SpecStaticARP `json:"staticARPs,omitempty"`
}
func (*SpecInterface) IsNil ¶
func (s *SpecInterface) IsNil() bool
type SpecInterfaceIP ¶
type SpecInterfaceIP struct {
PrefixLen *uint8 `json:"prefixLen,omitempty"`
Secondary *bool `json:"secondary,omitempty"`
}
func (*SpecInterfaceIP) IsNil ¶
func (s *SpecInterfaceIP) IsNil() bool
type SpecInterfaceIPv6 ¶ added in v0.101.0
type SpecInterfaceIPv6 struct {
Enabled *bool `json:"ipv6Enabled,omitempty"`
}
func (*SpecInterfaceIPv6) IsNil ¶ added in v0.101.0
func (s *SpecInterfaceIPv6) IsNil() bool
type SpecLLDP ¶
type SpecLLDPInterface ¶
type SpecLLDPInterface struct {
Enabled *bool `json:"enabled,omitempty"`
ManagementIPv4 *string `json:"managementIPv4,omitempty"`
}
func (*SpecLLDPInterface) IsNil ¶
func (s *SpecLLDPInterface) IsNil() bool
type SpecLSTGroup ¶
type SpecLSTGroup struct {
AllEVPNESDownstream *bool `json:"allEvpnEsDownstream,omitempty"`
AllMCLAGDownstream *bool `json:"allMclagDownstream,omitempty"`
Timeout *uint16 `json:"timeout,omitempty"`
}
func (*SpecLSTGroup) IsNil ¶
func (s *SpecLSTGroup) IsNil() bool
type SpecLSTInterface ¶
type SpecLSTInterface struct {
Groups []string `json:"groups,omitempty"`
}
func (*SpecLSTInterface) IsNil ¶
func (s *SpecLSTInterface) IsNil() bool
type SpecMCLAGDomain ¶
type SpecMCLAGDomain struct {
SourceIP string `json:"sourceIP,omitempty"`
PeerIP string `json:"peerIP,omitempty"`
PeerLink string `json:"peerLink,omitempty"`
}
func (*SpecMCLAGDomain) IsNil ¶
func (s *SpecMCLAGDomain) IsNil() bool
type SpecMCLAGInterface ¶
type SpecMCLAGInterface struct {
DomainID uint32 `json:"domainID,omitempty"`
}
func (*SpecMCLAGInterface) IsNil ¶
func (s *SpecMCLAGInterface) IsNil() bool
type SpecNTPServer ¶
type SpecNTPServer struct {
Prefer *bool `json:"prefer,omitempty"`
}
func (*SpecNTPServer) IsNil ¶
func (s *SpecNTPServer) IsNil() bool
type SpecPortBreakout ¶
type SpecPortBreakout struct {
Mode string `json:"mode,omitempty"`
}
func (*SpecPortBreakout) IsNil ¶
func (s *SpecPortBreakout) IsNil() bool
type SpecPortChannelConfig ¶
type SpecPortChannelConfig struct {
SystemMAC *string `json:"systemMAC,omitempty"`
Fallback *bool `json:"fallback,omitempty"`
}
func (*SpecPortChannelConfig) IsNil ¶
func (s *SpecPortChannelConfig) IsNil() bool
type SpecPortGroup ¶
type SpecPortGroup struct {
Speed *string
}
func (*SpecPortGroup) IsNil ¶
func (s *SpecPortGroup) IsNil() bool
type SpecPrefixList ¶
type SpecPrefixList struct {
Prefixes map[uint32]*SpecPrefixListEntry `json:"prefixes,omitempty"`
}
func (*SpecPrefixList) IsNil ¶
func (s *SpecPrefixList) IsNil() bool
type SpecPrefixListAction ¶
type SpecPrefixListAction string
const ( SpecPrefixListActionUnset SpecPrefixListAction = "" SpecPrefixListActionPermit SpecPrefixListAction = "permit" SpecPrefixListActionDeny SpecPrefixListAction = "deny" )
type SpecPrefixListEntry ¶
type SpecPrefixListEntry struct {
Prefix SpecPrefixListPrefix `json:"prefix,omitempty"`
Action SpecPrefixListAction `json:"action,omitempty"`
}
func (*SpecPrefixListEntry) IsNil ¶
func (s *SpecPrefixListEntry) IsNil() bool
type SpecPrefixListPrefix ¶
type SpecProxyARP ¶ added in v0.101.0
type SpecProxyARP struct {
All bool `json:"all,omitempty"`
}
func (*SpecProxyARP) IsNil ¶ added in v0.101.0
func (s *SpecProxyARP) IsNil() bool
type SpecRouteMap ¶
type SpecRouteMap struct {
Statements map[string]*SpecRouteMapStatement `json:"statements,omitempty"`
}
func (*SpecRouteMap) IsNil ¶
func (s *SpecRouteMap) IsNil() bool
type SpecRouteMapConditions ¶
type SpecRouteMapConditions struct {
AttachedHost *bool `json:"attachedHost,omitempty"`
DirectlyConnected *bool `json:"directlyConnected,omitempty"`
MatchEVPNDefaultRoute *bool `json:"matchEvpnDefaultRoute,omitempty"`
MatchEVPNVNI *uint32 `json:"matchEvpnVni,omitempty"`
MatchPrefixList *string `json:"matchPrefixLists,omitempty"`
MatchNextHopPrefixList *string `json:"matchNextHopPrefixLists,omitempty"`
MatchCommunityList *string `json:"matchCommunityLists,omitempty"`
MatchSourceVRF *string `json:"matchSourceVrf,omitempty"`
Call *string `json:"call,omitempty"`
}
type SpecRouteMapResult ¶
type SpecRouteMapResult string
const ( SpecRouteMapResultAccept SpecRouteMapResult = "accept" SpecRouteMapResultReject SpecRouteMapResult = "reject" )
type SpecRouteMapStatement ¶
type SpecRouteMapStatement struct {
Conditions SpecRouteMapConditions `json:"conditions,omitempty"`
SetCommunities []string `json:"setCommunities,omitempty"`
SetLocalPreference *uint32 `json:"setLocalPreference,omitempty"`
Result SpecRouteMapResult `json:"result,omitempty"`
}
func (*SpecRouteMapStatement) IsNil ¶
func (s *SpecRouteMapStatement) IsNil() bool
type SpecStaticARP ¶ added in v0.101.0
func (*SpecStaticARP) IsNil ¶ added in v0.101.0
func (s *SpecStaticARP) IsNil() bool
type SpecSubinterface ¶
type SpecSubinterface struct {
VLAN *uint16 `json:"vlan,omitempty"`
IPs map[string]*SpecInterfaceIP `json:"ips,omitempty"`
AnycastGateways []string `json:"anycastGateways,omitempty"`
ProxyARP *SpecProxyARP `json:"proxyARP,omitempty"`
StaticARPs map[string]*SpecStaticARP `json:"staticARPs,omitempty"`
IPv6 *SpecInterfaceIPv6 `json:"ipv6,omitempty"`
}
func (*SpecSubinterface) IsNil ¶
func (s *SpecSubinterface) IsNil() bool
type SpecSuppressVLANNeigh ¶
type SpecSuppressVLANNeigh struct{}
func (*SpecSuppressVLANNeigh) IsNil ¶
func (s *SpecSuppressVLANNeigh) IsNil() bool
type SpecUser ¶
type SpecVRF ¶
type SpecVRF struct {
Enabled *bool `json:"enabled,omitempty"`
Description *string `json:"description,omitempty"`
AnycastMAC *string `json:"anycastMAC,omitempty"`
Interfaces map[string]*SpecVRFInterface `json:"interfaces,omitempty"`
BGP *SpecVRFBGP `json:"bgp,omitempty"`
TableConnections map[string]*SpecVRFTableConnection `json:"tableConnections,omitempty"`
StaticRoutes map[string]*SpecVRFStaticRoute `json:"staticRoutes,omitempty"`
EthernetSegments map[string]*SpecVRFEthernetSegment `json:"ethernetSegments,omitempty"`
EVPNMH SpecVRFEVPNMH `json:"evpnMH,omitempty"`
AttachedHosts map[string]*SpecVRFAttachedHost `json:"attachedHosts,omitempty"`
}
type SpecVRFAttachedHost ¶ added in v0.78.0
type SpecVRFAttachedHost struct{}
func (*SpecVRFAttachedHost) IsNil ¶ added in v0.78.0
func (s *SpecVRFAttachedHost) IsNil() bool
type SpecVRFBGP ¶
type SpecVRFBGP struct {
AS *uint32 `json:"as,omitempty"`
RouterID *string `json:"routerID,omitempty"`
NetworkImportCheck *bool `json:"networkImportCheck,omitempty"`
IPv4Unicast SpecVRFBGPIPv4Unicast `json:"ipv4Unicast,omitempty"`
L2VPNEVPN SpecVRFBGPL2VPNEVPN `json:"l2vpnEvpn,omitempty"`
Neighbors map[string]*SpecVRFBGPNeighbor `json:"neighbors,omitempty"`
}
func (*SpecVRFBGP) IsNil ¶
func (s *SpecVRFBGP) IsNil() bool
type SpecVRFBGPIPv4Unicast ¶
type SpecVRFBGPIPv4Unicast struct {
Enabled bool `json:"enable,omitempty"`
MaxPaths *uint32 `json:"maxPaths,omitempty"`
MaxPathsIBGP *uint32 `json:"maxPathsIBGP,omitempty"`
Networks map[string]*SpecVRFBGPNetwork `json:"networks,omitempty"`
ImportVRFs map[string]*SpecVRFBGPImportVRF `json:"importVRFs,omitempty"`
ImportPolicy *string `json:"importPolicy,omitempty"`
TableMap *string `json:"tableMap,omitempty"`
}
type SpecVRFBGPImportVRF ¶
type SpecVRFBGPImportVRF struct{}
func (*SpecVRFBGPImportVRF) IsNil ¶
func (s *SpecVRFBGPImportVRF) IsNil() bool
type SpecVRFBGPL2VPNEVPN ¶
type SpecVRFBGPL2VPNEVPN struct {
Enabled bool `json:"enable,omitempty"`
AdvertiseAllVNI *bool `json:"advertiseAllVnis,omitempty"`
AdvertiseIPv4Unicast *bool `json:"advertiseIPv4Unicast,omitempty"`
AdvertiseIPv4UnicastRouteMaps []string `json:"advertiseIPv4UnicastRouteMaps,omitempty"`
AdvertiseDefaultGw *bool `json:"advertiseDefaultGw,omitempty"`
}
type SpecVRFBGPNeighbor ¶
type SpecVRFBGPNeighbor struct {
Enabled *bool `json:"enabled,omitempty"`
Description *string `json:"description,omitempty"`
RemoteAS *uint32 `json:"remoteAS,omitempty"`
PeerType *string `json:"peerType,omitempty"`
IPv4Unicast *bool `json:"ipv4Unicast,omitempty"`
IPv4UnicastImportPolicies []string `json:"ipv4UnicastImportPolicies,omitempty"`
IPv4UnicastExportPolicies []string `json:"ipv4UnicastExportPolicies,omitempty"`
IPv4ASOverride *bool `json:"ipv4ASOverride,omitempty"`
L2VPNEVPN *bool `json:"l2vpnEvpn,omitempty"`
L2VPNEVPNImportPolicies []string `json:"l2vpnEvpnImportPolicies,omitempty"`
L2VPNEVPNAllowOwnAS *bool `json:"l2vpnEvpnAllowOwnAS,omitempty"`
BFDProfile *string `json:"bfdProfile,omitempty"`
DisableConnectedCheck *bool `json:"disableConnectedCheck,omitempty"`
UpdateSource *string `json:"updateSource,omitempty"`
ExtendedNexthop *bool `json:"extendedNexthop,omitempty"`
}
func (*SpecVRFBGPNeighbor) IsNil ¶
func (s *SpecVRFBGPNeighbor) IsNil() bool
type SpecVRFBGPNetwork ¶
type SpecVRFBGPNetwork struct{}
func (*SpecVRFBGPNetwork) IsNil ¶
func (s *SpecVRFBGPNetwork) IsNil() bool
type SpecVRFEVPNMH ¶
type SpecVRFEthernetSegment ¶
type SpecVRFEthernetSegment struct {
ESI string `json:"esi,omitempty"`
}
func (*SpecVRFEthernetSegment) IsNil ¶
func (s *SpecVRFEthernetSegment) IsNil() bool
type SpecVRFInterface ¶
type SpecVRFInterface struct{}
func (*SpecVRFInterface) IsNil ¶
func (s *SpecVRFInterface) IsNil() bool
type SpecVRFStaticRoute ¶
type SpecVRFStaticRoute struct {
NextHops []SpecVRFStaticRouteNextHop `json:"nextHops,omitempty"`
}
func (*SpecVRFStaticRoute) IsNil ¶
func (s *SpecVRFStaticRoute) IsNil() bool
type SpecVRFTableConnection ¶
type SpecVRFTableConnection struct {
ImportPolicies []string `json:"importPolicies,omitempty"`
}
func (*SpecVRFTableConnection) IsNil ¶
func (s *SpecVRFTableConnection) IsNil() bool
type SpecVRFVNIEntry ¶
type SpecVRFVNIEntry struct {
VNI *uint32 `json:"vni,omitempty"`
}
func (*SpecVRFVNIEntry) IsNil ¶
func (s *SpecVRFVNIEntry) IsNil() bool
type SpecVXLANEVPNNVO ¶
type SpecVXLANEVPNNVO struct {
SourceVTEP *string `json:"sourceVtep,omitempty"`
}
func (*SpecVXLANEVPNNVO) IsNil ¶
func (s *SpecVXLANEVPNNVO) IsNil() bool
type SpecVXLANTunnel ¶
type SpecVXLANTunnel struct {
SourceIP *string `json:"sourceIP,omitempty"`
SourceInterface *string `json:"sourceInterface,omitempty"`
QoSUniform *bool `json:"qosUniform,omitempty"`
}
func (*SpecVXLANTunnel) IsNil ¶
func (s *SpecVXLANTunnel) IsNil() bool
type SpecVXLANTunnelMap ¶
type SpecVXLANTunnelMap struct {
VTEP *string `json:"vtep,omitempty"` // name
VNI *uint32 `json:"vni,omitempty"`
VLAN *uint16 `json:"vlan,omitempty"`
}
func (*SpecVXLANTunnelMap) IsNil ¶
func (s *SpecVXLANTunnelMap) IsNil() bool
Click to show internal directories.
Click to hide internal directories.