Documentation ¶
Index ¶
- Constants
- func MarshalPortSpeed(speed string) (oc.E_OpenconfigIfEthernet_ETHERNET_SPEED, bool)
- func SafeSprintf(format string, key any) string
- func UnmarshalPortBreakout(mode string) string
- func UnmarshalPortSpeed(speedRaw oc.E_OpenconfigIfEthernet_ETHERNET_SPEED) *string
- func ValueOrNil[Value dozer.SpecPart, Result any](actual, desired Value, getter func(Value) Result) (Result, Result)
- type Action
- type ActionQueue
- type ActionType
- type ActionWeight
- type BroadcomProcessor
- func (p *BroadcomProcessor) ApplyActions(ctx context.Context, actions []dozer.Action) ([]string, error)
- func (p *BroadcomProcessor) CalculateActions(_ context.Context, actual, desired *dozer.Spec) ([]dozer.Action, error)
- func (p *BroadcomProcessor) EnsureControlLink(_ context.Context, agent *agentapi.Agent) error
- func (p *BroadcomProcessor) FactoryReset(_ context.Context) error
- func (p *BroadcomProcessor) LoadActualState(ctx context.Context) (*dozer.Spec, error)
- func (p *BroadcomProcessor) PlanDesiredState(_ context.Context, agent *agentapi.Agent) (*dozer.Spec, error)
- func (p *BroadcomProcessor) Reboot(ctx context.Context, _ bool) error
- func (p *BroadcomProcessor) Reinstall(ctx context.Context) error
- func (p *BroadcomProcessor) UpdateSwitchState(ctx context.Context, agent *agentapi.Agent, reg *switchstate.Registry) error
- func (p *BroadcomProcessor) WaitReady(ctx context.Context) error
- type DefaultMapEnforcer
- type DefaultValueEnforcer
- type ValueEnforcer
Constants ¶
View Source
const ( MCLAGDomainID = 100 MCLAGPeerLinkPortChannelID = 250 MCLAGSessionLinkPortChannelID = 251 MCLAGPeerLinkTrunkVLANRange = "2..4094" // TODO do we need to configure it? MCLAGSessionIP1 = "172.30.5.0" // TODO move to config MCLAGSessionIP2 = "172.30.5.1" // TODO move to config MCLAGSessionIPPrefixLen = 31 // TODO move to config AgentUser = "hhagent" LoopbackSwitch = "Loopback0" LoopbackProto = "Loopback1" LoopbackVTEP = "Loopback2" VRFDefault = "default" VTEPFabric = "vtepfabric" EVPNNVO = "nvo1" AnycastMAC = "00:00:00:11:11:11" RouteMapMaxStatement = 65535 RouteMapBlockEVPNDefaultRemote = "evpn-default-remote-block" PrefixListAny = "any-prefix" PrefixListVPCLoopback = "vpc-loopback-prefix" NoCommunity = "no-community" LSTGroupSpineLink = "spinelink" BGPCommListAllExternals = "all-externals" )
View Source
const ( IfacePrefixManagement = "Management" IfacePrefixPhysical = "Ethernet" IfacePrefixVLAN = "Vlan" IfacePrefixPortChannel = "PortChannel" IfaceDisabledDescription = "Disabled by Fabric" )
Variables ¶
This section is empty.
Functions ¶
func MarshalPortSpeed ¶
func MarshalPortSpeed(speed string) (oc.E_OpenconfigIfEthernet_ETHERNET_SPEED, bool)
func SafeSprintf ¶
func UnmarshalPortBreakout ¶
func UnmarshalPortSpeed ¶
func UnmarshalPortSpeed(speedRaw oc.E_OpenconfigIfEthernet_ETHERNET_SPEED) *string
func ValueOrNil ¶
Types ¶
type Action ¶
type Action struct { Weight ActionWeight `json:"weight,omitempty"` ASummary string `json:"summary,omitempty"` Type ActionType `json:"type,omitempty"` Path string `json:"path,omitempty"` Value ygot.ValidatedGoStruct `json:"value,omitempty"` CustomFunc func() error WarningOnError bool }
type ActionQueue ¶
type ActionQueue struct {
// contains filtered or unexported fields
}
func (*ActionQueue) Add ¶
func (q *ActionQueue) Add(action *Action) error
func (*ActionQueue) Sort ¶
func (q *ActionQueue) Sort()
type ActionType ¶
type ActionType string
const ( ActionTypeUpdate ActionType = "update" ActionTypeReplace ActionType = "replace" ActionTypeDelete ActionType = "delete" )
type ActionWeight ¶
type ActionWeight uint8
const ( ActionWeightUnset ActionWeight = iota // keep it first ActionWeightSystemZTP ActionWeightSystemHostname ActionWeightLLDP ActionWeightUser ActionWeightUserAuthorizedKeys ActionWeightPortGroup ActionWeightPortBreakout ActionWeightPrefixListUpdate ActionWeightPrefixListEntryDelete ActionWeightPrefixListEntryUpdate ActionWeightCommunityListUpdate ActionWeightInterfaceBasePortChannelsUpdate ActionWeightInterfaceBaseUpdate ActionWeightVRFBaseUpdate ActionWeightVRFVNIUpdate ActionWeightRouteMapUpdate ActionWeightRouteMapStatementDelete ActionWeightRouteMapStatementUpdate ActionWeightInterfaceVLANIPsUpdate ActionWeightInterfacePortChannelSwitchedAccessUpdate ActionWeightInterfacePortChannelSwitchedTrunkUpdate ActionWeightInterfaceEthernetBaseUpdate ActionWeightInterfaceEthernetSwitchedAccessUpdate ActionWeightInterfaceEthernetSwitchedTrunkUpdate ActionWeightInterfaceVLANAnycastGatewayUpdate ActionWeightInterfaceNATZoneUpdate ActionWeightPortChannelConfigMACUpdate ActionWeightPortChannelConfigFallbackUpdate ActionWeightInterfaceSubinterfaceIPsDelete ActionWeightVRFInterfaceDelete ActionWeightACLInterfaceDelete ActionWeightInterfaceSubinterfaceDelete ActionWeightInterfaceSubinterfaceUpdate ActionWeightVRFInterfaceUpdate ActionWeightInterfaceSubinterfaceIPsUpdate ActionWeightLLDPInterfaceUpdate ActionWeightNTP ActionWeightNTPServerUpdate ActionWeightMCLAGDomainUpdate ActionWeightMCLAGInterfaceUpdate ActionWeightACLBaseUpdate ActionWeightACLInterfaceUpdate ActionWeightACLEntryDelete ActionWeightACLEntryUpdate ActionWeightNATBaseUpdate ActionWeightNATPoolUpdate ActionWeightNATBindingUpdate ActionWeightNATEntryUpdate ActionWeightSuppressVLANNeighUpdate ActionWeightVRFStaticRouteDelete // it seems like it's better to first remove routes and then add new ones ActionWeightVRFStaticRouteUpdate ActionWeightVRFBGPBaseUpdate ActionWeightVRFSAGUpdate ActionWeightVRFEVPNMHUpdate ActionWeightVRFEthernetSegmentUpdate ActionWeightLSTGroupUpdate ActionWeightLSTInterfaceUpdate ActionWeightVXLANTunnelMapDelete ActionWeightVXLANTunnelUpdate ActionWeightVXLANEVPNNVODelete ActionWeightVXLANEVPNNVOUpdate ActionWeightVXLANTunnelDelete ActionWeightVXLANTunnelMapUpdate ActionWeightVRFBGPNeighborUpdate ActionWeightVRFBGPNetworkUpdate ActionWrightVRFTableConnectionUpdate ActionWeightVRFBGPImportVRFPolicyUpdate ActionWeightVRFBGPImportVRFUpdate ActionWeightDHCPRelayUpdate ActionWeightDHCPRelayDelete ActionWeightVRFBGPImportVRFDelete ActionWeightVRFBGPImportVRFPolicyDelete ActionWeightVRFVNIDelete ActionWeightLSTInterfaceDelete ActionWeightLSTGroupDelete ActionWeightVRFEthernetSegmentDelete ActionWeightVRFEVPNMHDelete ActionWrightVRFTableConnectionDelete ActionWeightVRFBGPNetworkDelete ActionWeightVRFBGPNeighborDelete ActionWeightVRFSAGDelete ActionWeightVRFBGPBaseDelete ActionWeightVRFBaseDelete ActionWeightSuppressVLANNeighDelete ActionWeightNATEntryDelete ActionWeightNATBindingDelete ActionWeightNATPoolDelete ActionWeightNATBaseDelete ActionWeightLLDPInterfaceDelete ActionWeightNTPServerDelete ActionWeightMCLAGInterfaceDelete ActionWeightMCLAGDomainDelete ActionWeightPortChannelConfigMACDelete ActionWeightPortChannelConfigFallbackDelete ActionWeightInterfaceEthernetSwitchedAccessDelete ActionWeightInterfaceEthernetSwitchedTrunkDelete ActionWeightInterfaceEthernetBaseDelete ActionWeightInterfacePortChannelSwitchedAccessDelete ActionWeightInterfacePortChannelSwitchedTrunkDelete ActionWeightInterfaceNATZoneDelete ActionWeightInterfaceVLANIPsDelete ActionWeightInterfaceVLANAnycastGatewayDelete ActionWeightACLBaseDelete ActionWeightInterfaceBaseDelete ActionWeightRouteMapDelete ActionWeightPrefixListDelete ActionWeightCommunityListDelete ActionWeightMax // keep it last )
type BroadcomProcessor ¶ added in v0.34.0
type BroadcomProcessor struct {
// contains filtered or unexported fields
}
func Processor ¶
func Processor(client *gnmi.Client) *BroadcomProcessor
func (*BroadcomProcessor) ApplyActions ¶ added in v0.34.0
func (*BroadcomProcessor) CalculateActions ¶ added in v0.34.0
func (*BroadcomProcessor) EnsureControlLink ¶ added in v0.34.0
func (*BroadcomProcessor) FactoryReset ¶ added in v0.34.0
func (p *BroadcomProcessor) FactoryReset(_ context.Context) error
func (*BroadcomProcessor) LoadActualState ¶ added in v0.34.0
func (*BroadcomProcessor) PlanDesiredState ¶ added in v0.34.0
func (*BroadcomProcessor) Reboot ¶ added in v0.34.0
func (p *BroadcomProcessor) Reboot(ctx context.Context, _ bool) error
func (*BroadcomProcessor) Reinstall ¶ added in v0.34.0
func (p *BroadcomProcessor) Reinstall(ctx context.Context) error
func (*BroadcomProcessor) UpdateSwitchState ¶ added in v0.35.0
func (p *BroadcomProcessor) UpdateSwitchState(ctx context.Context, agent *agentapi.Agent, reg *switchstate.Registry) error
type DefaultMapEnforcer ¶
type DefaultMapEnforcer[Key cmp.Ordered, Value dozer.SpecPart] struct { Summary string CustomHandler func(basePath string, actual, desired map[Key]Value, actions *ActionQueue) error ValueHandler ValueEnforcer[Key, Value] // used by default map handler }
func (*DefaultMapEnforcer[Key, Value]) Handle ¶
func (h *DefaultMapEnforcer[Key, Value]) Handle(basePath string, actualMap, desiredMap map[Key]Value, actions *ActionQueue) error
type DefaultValueEnforcer ¶
type DefaultValueEnforcer[Key comparable, Value dozer.SpecPart] struct { Summary string Skip func(key Key, actual, desired Value) bool // skip if true Getter func(key Key, value Value) any // nil to use Value for comparision or it should return values to compart NoReplace bool // replace instead of update MutateActual func(key Key, actual Value) Value // Mutates actual value before comparision MutateDesired func(key Key, desired Value) Value // Mutates desired value before comparision CustomHandler func(basePath string, key Key, actual, desired Value, actions *ActionQueue) error // will be used instead of default one Path string // used by default value handler CreatePath string PathFunc func(key Key, value Value) string Marshal func(key Key, value Value) (ygot.ValidatedGoStruct, error) // used by default value handler Weight ActionWeight UpdateWeight ActionWeight DeleteWeight ActionWeight WarningOnError bool SkipDelete bool RecreateOnUpdate bool }
func (*DefaultValueEnforcer[Key, Value]) Handle ¶
func (h *DefaultValueEnforcer[Key, Value]) Handle(basePath string, key Key, actual, desired Value, actions *ActionQueue) error
type ValueEnforcer ¶
Source Files ¶
- control_link.go
- enforcer.go
- plan.go
- plan_virtual_edge.go
- processor.go
- spec.go
- spec_acl.go
- spec_comm_lists.go
- spec_dhcp.go
- spec_interface.go
- spec_lldp.go
- spec_lst.go
- spec_mclag.go
- spec_nat.go
- spec_ntp.go
- spec_pc_config.go
- spec_prefix_lists.go
- spec_route_maps.go
- spec_system.go
- spec_vrf.go
- spec_vxlan.go
- state.go
- util.go
Click to show internal directories.
Click to hide internal directories.