module

package
v0.0.0-...-502b8e8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractBaseEntity

type AbstractBaseEntity struct {
	// contains filtered or unexported fields
}

AbstractBaseEntity object for all resources to derive from

This AbstractBaseEntity object should not be directly instatiated. It is designed to be implemented by all resource classes to provide common methods. Attributes:

node (Node): The node instance this resource will perform operations
             against for configuration
config (Config): Returns an instance of Config with the nodes
                 current running configuration
error (CommandError): Holds the latest Error exception
                  instance if raised

func (*AbstractBaseEntity) CommandBuilder

func (b *AbstractBaseEntity) CommandBuilder(cmd string, value string, def bool,
	enable bool) string

CommandBuilder builds a command with keywords

Args:

cmd (string): The Command string
value (string): The configuration setting to substitute into the command
                string.
def (bool):    Specifies if command should use default keyword argument
enable (bool): Specifies if command is enabled or disabled

Returns:

A command string that can be used to configure the node

func (*AbstractBaseEntity) Config

func (b *AbstractBaseEntity) Config() string

Config returns the current running configuration Returns:

String: running config

func (*AbstractBaseEntity) Configure

func (b *AbstractBaseEntity) Configure(commands ...string) bool

Configure sends the commands list to the node in config mode

This method performs configuration the node using the array of commands specified.

Args:

commands (list): A list of commands to be sent to the node in
                 config mode

Returns:

True if the commands are executed without exception otherwise
False is returned

func (*AbstractBaseEntity) ConfigureInterface

func (b *AbstractBaseEntity) ConfigureInterface(name string, commands ...string) bool

ConfigureInterface Configures the specified interface with the commands

Args:

name (str): The interface name to configure
commands: The commands to configure in the interface

Returns:

True if the commands completed successfully

func (*AbstractBaseEntity) Error

func (b *AbstractBaseEntity) Error() error

Error returns the current error exception Returns:

Error: current error

func (*AbstractBaseEntity) GetBlock

func (b *AbstractBaseEntity) GetBlock(parent string) (string, error)

GetBlock scans the config and returns a block of code

Args:

parent (str): The parent string to search the config for and
              return the block

Returns:

A string that represents the block from the config.  If
the parent string is not found, then this method will
return None.

func (*AbstractBaseEntity) Version

func (b *AbstractBaseEntity) Version() string

Version returns the current running version Returns:

String: version

type AclConfig

type AclConfig struct {
	// contains filtered or unexported fields
}

AclConfig represents an Acl Config entry with a name, type, and individual entries in AclEntryMap

func (AclConfig) Entries

func (a AclConfig) Entries() AclEntryMap

Entries returns a map[string] of AclConfigs each keyed entry being the name/label of the AclConfig

func (AclConfig) Name

func (a AclConfig) Name() string

Name returns a string of the ACL Config name

func (AclConfig) Type

func (a AclConfig) Type() string

Type returns a string of the ACL type

type AclEntity

type AclEntity struct {
	*AbstractBaseEntity
}

AclEntity provides a configuration resource for Acl

func Acl

func Acl(node *goeapi.Node) *AclEntity

Acl factory function to initiallize Acl resource given a Node

func (*AclEntity) AddEntry

func (a *AclEntity) AddEntry(name string, action string, addr string,
	prefixlen string, log bool) bool

AddEntry will add an entry to the specified ACL with the passed in parameters.

EosVersion
    4.13.7M

name (string): The ACL name to update on the node.
action (string): The action triggered by the ACL. Valid
                 values are 'permit', 'deny', or 'remark'
addr (string): The IP address to permit or deny.
prefixlen (string):  The prefixlen for the IP address.
log (bool): Triggers an informational log message to the console
            about the matching packet.

Returns:

returns true if the command complete successfully

func (*AclEntity) Create

func (a *AclEntity) Create(name string) bool

Create will create a new ACL resource in the nodes current configuration with the specified name. If the create method is called and the ACL already exists, this method will still return true. The ACL will not have any entries. Use add_entry to add entries to the ACL.

EosVersion
    4.13.7M

Args:

name (string): The ACL name to create on the node. Must begin
           with an alphabetic character. Cannot contain spaces or
           quotation marks.

Returns:

returns true if the command completed successfully

func (*AclEntity) Default

func (a *AclEntity) Default(name string) bool

Default will configure the ACL using the default keyword. This command has the same effect as deleting the ACL from the nodes running configuration.

EosVersion
    4.13.7M

Args:

name (string): The ACL name to set to the default value
               on the node.

Returns:

returns true if the command complete successfully

func (*AclEntity) Delete

func (a *AclEntity) Delete(name string) bool

Delete will delete an existing ACL resource from the nodes current running configuration. If the delete method is called and the ACL does not exist, this method will succeed.

EosVersion
    4.13.7M

Args:
    name (string): The ACL name to delete on the node.

Returns:

returns true if the command completed successfully

func (*AclEntity) Get

func (a *AclEntity) Get(name string) (*AclConfig, error)

Get returns the specified AclEntity from the nodes current configuration.

Args:

name (string): The ACL name

Returns:

Returns AclConfig object

func (*AclEntity) GetAll

func (a *AclEntity) GetAll() map[string]*AclConfig

GetAll returns the collection of ACLs from the nodes running configuration as a hash. The ACL resource collection hash is keyed by the ACL name.

Returns: Returns a hash that represents the entire ACL collection from

the nodes running configuration. If there are no ACLs configured,
this method will return an empty hash.

func (*AclEntity) GetSection

func (a *AclEntity) GetSection(name string) string

GetSection returns the specified Acl Entry for the name specified.

Args:

name (string): The ACL name

Returns:

Returns string representation of Acl config entry

func (*AclEntity) RemoveEntry

func (a *AclEntity) RemoveEntry(name string, seqno int) bool

RemoveEntry will remove the entry specified by the seqno for the ACL specified by name.

EosVersion:
    4.13.7M

Args:

name (string): The ACL name to update on the node.
seqno (int): The sequence number of the entry in the ACL to remove.

Returns:

returns true if the command complete successfully

func (*AclEntity) UpdateEntry

func (a *AclEntity) UpdateEntry(name string, seqno string, action string, addr string,
	prefixlen string, log bool) bool

UpdateEntry will update an entry, identified by the seqno in the ACL specified by name, with the passed in parameters.

EosVersion
    4.13.7M

name (string): The ACL name to update on the node.
seqno (string): The sequence number of the entry in the ACL to update.
action (string): The action triggered by the ACL. Valid
                 values are 'permit', 'deny', or 'remark'
addr (string): The IP address to permit or deny.
prefixlen (string):  The prefixlen for the IP address.
log (bool): Triggers an informational log message to the console
            about the matching packet.

Returns:

returns true if the command complete successfully

type AclEntry

type AclEntry map[string]string

AclEntry represents a parsed Acl entry of the form

{
    "action"  : ""
    "srcaddr" : ""
    "srclen"  : ""
    "log"     : ""
}

func (AclEntry) Action

func (a AclEntry) Action() string

Action returns the action for the AclEntry

func (AclEntry) Log

func (a AclEntry) Log() string

Log returns log is configured for the AclEntry

func (AclEntry) SrcAddr

func (a AclEntry) SrcAddr() string

SrcAddr returns the source address for the AclEntry

func (AclEntry) SrcLen

func (a AclEntry) SrcLen() string

SrcLen returns the source mask length for the AclEntry

type AclEntryMap

type AclEntryMap map[string]AclEntry

AclEntryMap is a key/value

type BGPEntity

type BGPEntity struct {
	*AbstractBaseEntity
	// contains filtered or unexported fields
}

BGPEntity provides a configuration resource for Bgp

func Bgp

func Bgp(node *goeapi.Node) *BGPEntity

Bgp factory function to initiallize BGPEntity resource given a Node

func (*BGPEntity) AddNetwork

func (b *BGPEntity) AddNetwork(prefix string, maskLen string) bool

AddNetwork configures BGP network using supplied network prefix and mask length. Returns true(bool) if the commands complete successfully

func (*BGPEntity) AddNetworkWithRouteMap

func (b *BGPEntity) AddNetworkWithRouteMap(prefix string, maskLen string, routeMap string) bool

AddNetworkWithRouteMap configures BGP network using supplied network prefix, mask length, and route-map Returns true(bool) if the commands complete successfully

func (*BGPEntity) ConfigureBgp

func (b *BGPEntity) ConfigureBgp(cmd string) bool

ConfigureBgp configures the BGP Entity with the given command. Returns true (bool) if the commands complete successfully

func (*BGPEntity) Create

func (b *BGPEntity) Create(bgpAS int) bool

Create creates a BGP instance on the node using the given AS value. Returns true(bool) if the commands complete successfully

func (*BGPEntity) Default

func (b *BGPEntity) Default() bool

Default sets the default config for BGP instance on the node. Returns true(bool) if the commands complete successfully

func (*BGPEntity) Delete

func (b *BGPEntity) Delete() bool

Delete deletes the BGP instance on the node. Returns true(bool) if the commands complete successfully

func (*BGPEntity) Get

func (b *BGPEntity) Get() *BgpConfig

Get the BGP Config for the current entity. Returns a BgpConfig object

func (*BGPEntity) GetSection

func (b *BGPEntity) GetSection() string

GetSection returns the BGP config section as a string.

func (*BGPEntity) Neighbors

func (b *BGPEntity) Neighbors() *BgpNeighborsEntity

Neighbors returns the instance of the BgpNeighborsEntity for this BGPEntity

func (*BGPEntity) RemoveNetwork

func (b *BGPEntity) RemoveNetwork(prefix string, maskLen string) bool

RemoveNetwork removes the configured BGP network config using the supplied network prefix and mask length Returns true(bool) if the commands complete successfully

func (*BGPEntity) RemoveNetworkWithRouteMap

func (b *BGPEntity) RemoveNetworkWithRouteMap(prefix string, maskLen string, routeMap string) bool

RemoveNetworkWithRouteMap removes the configured BGP network config using the supplied network prefix, mask length, and route-map Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetMaximumPaths

func (b *BGPEntity) SetMaximumPaths(maxPath int) bool

SetMaximumPaths sets the BGP maximum path using the provided maxPath value. Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetMaximumPathsDefault

func (b *BGPEntity) SetMaximumPathsDefault() bool

SetMaximumPathsDefault resets the maximum paths configuration to its default values Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetMaximumPathsWithEcmp

func (b *BGPEntity) SetMaximumPathsWithEcmp(maxPath int, maxEcmp int) bool

SetMaximumPathsWithEcmp set the BGP maximum path / max Ecmp configuration for this entity. Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetRouterID

func (b *BGPEntity) SetRouterID(value string) bool

SetRouterID configures the router-id using the provided value. Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetRouterIDDefault

func (b *BGPEntity) SetRouterIDDefault() bool

SetRouterIDDefault sets the default router-id value Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetShutdown

func (b *BGPEntity) SetShutdown(enable bool) bool

SetShutdown configures this BGP entity to be 'shutdown' (true), or 'no shutdown' (false) Returns true(bool) if the commands complete successfully

func (*BGPEntity) SetShutdownDefault

func (b *BGPEntity) SetShutdownDefault() bool

SetShutdownDefault configures the default shutdown configuration for this BGPEntity Returns true(bool) if the commands complete successfully

type BGPNeighborSummary

type BGPNeighborSummary struct {
	MsgSent             int     `json:"msgSent"`
	InMsgQueue          int     `json:"inMsgQueue"`
	PrefixReceived      int     `json:"prefixReceived"`
	UpDownTime          float64 `json:"upDownTime"`
	Version             int     `json:"version"`
	MsgReceived         int     `json:"msgReceived"`
	PrefixAccepted      int     `json:"prefixAccepted"`
	PeerState           string  `json:"peerState"`
	PeerStateIdleReason string  `json:"peerStateIdleReason,omitempty"`
	OutMsgQueue         int     `json:"outMsgQueue"`
	UnderMaintenance    bool    `json:"underMaintenance"`
	ASN                 int64   `json:"asn"`
}

type BaseInterfaceEntity

type BaseInterfaceEntity struct {
	*AbstractBaseEntity
}

BaseInterfaceEntity provides a configuration resource for Interface

func Interface

func Interface(node *goeapi.Node) *BaseInterfaceEntity

Interface factory function to initiallize BaseInterfaceEntity resource given a Node

func (*BaseInterfaceEntity) Create

func (i *BaseInterfaceEntity) Create(name string) bool

Create creates a new interface on the node

func (*BaseInterfaceEntity) Default

func (i *BaseInterfaceEntity) Default(name string) bool

Default reverts back to default config for interface

func (*BaseInterfaceEntity) Delete

func (i *BaseInterfaceEntity) Delete(name string) bool

Delete removes an interface from the node

func (*BaseInterfaceEntity) Get

Get returns the interface config for the given interface name(string)

func (*BaseInterfaceEntity) SetDescription

func (i *BaseInterfaceEntity) SetDescription(name string, value string) bool

SetDescription sets the description on the interface name(sting) to value(string)

func (*BaseInterfaceEntity) SetDescriptionDefault

func (i *BaseInterfaceEntity) SetDescriptionDefault(name string) bool

SetDescriptionDefault reverts back to the default description value

func (*BaseInterfaceEntity) SetShutdown

func (i *BaseInterfaceEntity) SetShutdown(name string, shut bool) bool

SetShutdown sets the interface name(string) to shutdown(true) or no-shutdown(false)

func (*BaseInterfaceEntity) SetShutdownDefault

func (i *BaseInterfaceEntity) SetShutdownDefault(name string) bool

SetShutdownDefault reverts back to the default shutdown config for interface

type BgpConfig

type BgpConfig struct {
	// contains filtered or unexported fields
}

BgpConfig represents the parsed Bgp config for an interface

func (*BgpConfig) BgpAs

func (b *BgpConfig) BgpAs() string

BgpAs returns the BGP config AS number Empty string is returned if no value set.

func (*BgpConfig) MaximumEcmpPaths

func (b *BgpConfig) MaximumEcmpPaths() string

MaximumEcmpPaths returns the configured value for BGP max ECMP paths. Empty string is returned if no value set.

func (*BgpConfig) MaximumPaths

func (b *BgpConfig) MaximumPaths() string

MaximumPaths returns the BGP config value for maximum paths. Empty string is returned if no value set.

func (*BgpConfig) Networks

func (b *BgpConfig) Networks() []BgpNetworkEntry

Networks returns a list of configured network statements Each entry represents a bgp network entry. Entry formed as follows: [

  	{
		"prefix":"",
		"masklen":"",
		"route_map":"",
	},
	{..

]

func (*BgpConfig) RouterID

func (b *BgpConfig) RouterID() string

RouterID returns the BGP config Router-id Empty string is returned if no value set.

func (*BgpConfig) Shutdown

func (b *BgpConfig) Shutdown() string

Shutdown returns 'true'(string) if shutdown. Otherwise 'false'(string)

type BgpNeighborCollection

type BgpNeighborCollection map[string]BgpNeighborConfig

BgpNeighborCollection is a collection of BgpNeighborConfigs. Each key entry of the collection is a unique neighbor(key:string) mapping to its respective BGPNeighborConfig: Example:

{
	"172.16.10.1" : BgpNeighborConfig
				{
					"peer_group"    : "",
					"remote_as"     : "",
					...
				},
}

type BgpNeighborConfig

type BgpNeighborConfig map[string]string

BgpNeighborConfig represents the parsed Bgp neighbor config

{
		"peer_group"		: "peer1",
		"remote_as"			: "99",
		"send_community"	: "true",
		"shutdown"			: "false",
		"description"		: "This is a bgp entity",
		"next_hop_self"		: "1.1.1.1",
		"route_in_map"		: "in-map",
		"route_out_map"		: "out-map",
}

type BgpNeighborsEntity

type BgpNeighborsEntity struct {
	*AbstractBaseEntity
}

BgpNeighborsEntity provides a configuration resource for Bgp neighbors

func BgpNeighbors

func BgpNeighbors(node *goeapi.Node) *BgpNeighborsEntity

BgpNeighbors factory function to initiallize BgpNeighborsEntity resource given a Node

func (*BgpNeighborsEntity) CommandBuilder

func (b *BgpNeighborsEntity) CommandBuilder(name string, cmd string,
	value string, def bool, shut bool) string

CommandBuilder (redefined from base) Builds proper bgp neighbot configuration command based on provided arguments:

name(string) - neighbor name
cmd(string) - command to use
value(string) - additional parameters for command
def(bool) - If true, Default configuration needed
shut(bool) - If true, negate configure command

Returns compiled command. If def is 'true', command is returned with 'default' prepended. If shut is 'true', command is returned with 'no' prepended.

func (*BgpNeighborsEntity) Configure

func (b *BgpNeighborsEntity) Configure(cmd string) bool

Configure (redefined from base) Configures router bgp instance. Returns true(bool) if the commands complete successfully, false if configure fails or device BGP instance doesn't exsist.

func (*BgpNeighborsEntity) Create

func (b *BgpNeighborsEntity) Create(name string) bool

Create creates a neighbor entry in the shutdown state. Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) Delete

func (b *BgpNeighborsEntity) Delete(name string) bool

Delete removes the neighbor name(string) entry. Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) Get

Get the BGP Neighbot Config for the current entity. Returns a BgpNeighborConfig object

func (*BgpNeighborsEntity) GetAll

GetAll returns the BGP Neighbor Collection

func (*BgpNeighborsEntity) SetDescription

func (b *BgpNeighborsEntity) SetDescription(name string, value string) bool

SetDescription sets the neighbor name(string) using the provided value(string) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetDescriptionDefault

func (b *BgpNeighborsEntity) SetDescriptionDefault(name string) bool

SetDescriptionDefault sets the default configuration value for the neighbor description configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetNextHopSelf

func (b *BgpNeighborsEntity) SetNextHopSelf(name string, enabled bool) bool

SetNextHopSelf sets the neighbor name(string) next-hop-self to enabled(true) or disabled(false) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetNextHopSelfDefault

func (b *BgpNeighborsEntity) SetNextHopSelfDefault(name string) bool

SetNextHopSelfDefault sets the default configuration value for the neighbor next-hop-self configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetPeerGroup

func (b *BgpNeighborsEntity) SetPeerGroup(name string, value string) bool

SetPeerGroup sets the neighbor(string) peer-group value(string) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetPeerGroupDefault

func (b *BgpNeighborsEntity) SetPeerGroupDefault(name string) bool

SetPeerGroupDefault sets the default configuration value for neighbor peer-group configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRemoteAS

func (b *BgpNeighborsEntity) SetRemoteAS(name string, value string) bool

SetRemoteAS sets the neighbor name(string) remote-as configuration to value(string) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRemoteASDefault

func (b *BgpNeighborsEntity) SetRemoteASDefault(name string) bool

SetRemoteASDefault sets the default configuration value for the neighbor remote-as configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRouteMapIn

func (b *BgpNeighborsEntity) SetRouteMapIn(name string, value string) bool

SetRouteMapIn sets the neighbor name(string) inbound route-map entry using value(string) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRouteMapInDefault

func (b *BgpNeighborsEntity) SetRouteMapInDefault(name string) bool

SetRouteMapInDefault sets the default configuration value for the neighbor inbound route-map configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRouteMapOut

func (b *BgpNeighborsEntity) SetRouteMapOut(name string, value string) bool

SetRouteMapOut sets the neighbor name(string) outbound route-map entry using value(string) Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetRouteMapOutDefault

func (b *BgpNeighborsEntity) SetRouteMapOutDefault(name string) bool

SetRouteMapOutDefault sets the default configuration value for the neighbor outbound route-map configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetSendCommunity

func (b *BgpNeighborsEntity) SetSendCommunity(name string, enable bool) bool

SetSendCommunity sets the neighbor name(string) send-community configuration to value(string). Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetSendCommunityDefault

func (b *BgpNeighborsEntity) SetSendCommunityDefault(name string) bool

SetSendCommunityDefault sets the default configuration value for the neighbor send-community configuration Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetShutdown

func (b *BgpNeighborsEntity) SetShutdown(name string, shut bool) bool

SetShutdown set the neighbor name(string) shutdown state to

shut(boo) - true:shutdown,    false:no shutdown

Returns true(bool) if the commands complete successfully

func (*BgpNeighborsEntity) SetShutdownDefault

func (b *BgpNeighborsEntity) SetShutdownDefault(name string) bool

SetShutdownDefault sets the default configuration value for the neighbor shutdown configuration Returns true(bool) if the commands complete successfully

type BgpNetworkEntry

type BgpNetworkEntry map[string]string

BgpNetworkEntry represents a BGP network config entry

func (BgpNetworkEntry) MaskLen

func (b BgpNetworkEntry) MaskLen() string

MaskLen returns the masklen data for this BgpNetworkEntry

func (BgpNetworkEntry) Prefix

func (b BgpNetworkEntry) Prefix() string

Prefix returns the prefix data for this BgpNetworkEntry

func (BgpNetworkEntry) RouteMap

func (b BgpNetworkEntry) RouteMap() string

RouteMap returns the routemap data for this BgpNetworkEntry

type EthInterfaceCounters

type EthInterfaceCounters struct {
	CounterRefreshTime float64
	InBroadcastPkts    int
	InDiscards         int
	InMulticastPkts    int
	InOctets           int
	InUcastPkts        int
	InputErrorsDetail  PhysicalInputErrors
	LastClear          float64
	LinkStatusChanges  int
	OutBroadcastPkts   int
	OutDiscards        int
	OutMulticastPkts   int
	OutOctets          int
	OutUcastPkts       int
	OutErrorsDetail    PhysicalOutputErrors
	TotalInErrors      int
	TotalOutErrors     int
}

EthInterfaceCounters defined data structure for mapping JSON response of 'show interface' to manageable object

type EthernetInterfaceEntity

type EthernetInterfaceEntity struct {
	*BaseInterfaceEntity
}

EthernetInterfaceEntity provides a configuration resource for Ethernet Interface

func EthernetInterface

func EthernetInterface(node *goeapi.Node) *EthernetInterfaceEntity

EthernetInterface factory function to initiallize EthernetInterfaceEntity resource given a Node

func (*EthernetInterfaceEntity) Create

func (e *EthernetInterfaceEntity) Create(name string) bool

Create not supported

func (*EthernetInterfaceEntity) Delete

func (e *EthernetInterfaceEntity) Delete(name string) bool

Delete not supported

func (*EthernetInterfaceEntity) DisableFlowcontrolReceive

func (e *EthernetInterfaceEntity) DisableFlowcontrolReceive(name string) bool

DisableFlowcontrolReceive disables the interface flowcontrol receive value

func (*EthernetInterfaceEntity) DisableFlowcontrolSend

func (e *EthernetInterfaceEntity) DisableFlowcontrolSend(name string) bool

DisableFlowcontrolSend disables the interface flowcontrol send value

func (*EthernetInterfaceEntity) Get

Get returns interface as a set of key/value pairs in InterfaceConfig

func (*EthernetInterfaceEntity) SetFlowcontrolReceive

func (e *EthernetInterfaceEntity) SetFlowcontrolReceive(name string, value bool) bool

SetFlowcontrolReceive configures the interface flowcontrol receive value(true: on)

func (*EthernetInterfaceEntity) SetFlowcontrolSend

func (e *EthernetInterfaceEntity) SetFlowcontrolSend(name string, value bool) bool

SetFlowcontrolSend configures the interface flowcontrol send value(true: on)

func (*EthernetInterfaceEntity) SetSflow

func (e *EthernetInterfaceEntity) SetSflow(name string, value bool) bool

SetSflow configures the sFlow state (true:enable, false:disable) on the interface name(string)

func (*EthernetInterfaceEntity) SetSflowDefault

func (e *EthernetInterfaceEntity) SetSflowDefault(name string) bool

SetSflowDefault configures the defalt sFlow state on the interface name(string)

type GlobalMlagConfig

type GlobalMlagConfig map[string]string

GlobalMlagConfig represents a parsed Global Mlag entry

{
		"domain_id"      : "2",
		"local_interface": "1.1.1.1",
		"peer_address"   : "2.2.2.2",
		"peer_link"      : "Ethernet1",
		"shutdown"       : "false",
}

type IPAddress

type IPAddress struct {
	Address string
	MaskLen int
}

IPAddress defined data structure for mapping JSON response of 'show interface' to manageable object

type IPInterfaceConfig

type IPInterfaceConfig map[string]string

IPInterfaceConfig represents a parsed IPInterface entry

func (IPInterfaceConfig) Address

func (i IPInterfaceConfig) Address() string

Address returns the address of the Ip Interface Config

func (IPInterfaceConfig) Mtu

func (i IPInterfaceConfig) Mtu() string

Mtu returns the mtu within Ip Interface Config

func (IPInterfaceConfig) Name

func (i IPInterfaceConfig) Name() string

Name returns the name of the Ip Interface

type IPInterfaceConfigMap

type IPInterfaceConfigMap map[string]IPInterfaceConfig

IPInterfaceConfigMap represents a hash of various IPInterfaceConfig's

type IPInterfaceEntity

type IPInterfaceEntity struct {
	*AbstractBaseEntity
}

IPInterfaceEntity provides a configuration resource for IpInterfaces

func IPInterface

func IPInterface(node *goeapi.Node) *IPInterfaceEntity

IPInterface factory function to initiallize IPInterface resource given a Node

func (*IPInterfaceEntity) Create

func (i *IPInterfaceEntity) Create(name string) bool

Create Creates a new IP interface instance This method will create a new logical IP interface for the specified physical interface. If a logical IP interface already exists then this operation will have no effect.

Note:

Configuring a logical IP interface on a physical interface will
remove any existing logical switchports have have been created

Args:

name (string): The interface identifier to create the logical
layer 3 IP interface for.  The name must be the full interface
name and not an abbreviated interface name (eg Ethernet1, not
Et1).

Returns:

True if the create operation succeeds otherwise False.  If the
specified interface is already created the this method will
have no effect but will still return True

func (*IPInterfaceEntity) Delete

func (i *IPInterfaceEntity) Delete(name string) bool

Delete Deletes an IP interface instance from the running configuration This method will delete the logical IP interface for the specified physical interface. If the interface does not have a logical IP interface defined, then this method will have no effect.

Args:

name (string): The interface identifier to create the logical
layer 3 IP interface for.  The name must be the full interface
name and not an abbreviated interface name (eg Ethernet1, not
Et1).

Returns:

True if the delete operation succeeds otherwise False.

func (*IPInterfaceEntity) Get

Get Returns the specific IP interface properties The IPinterface resource returns the following:

  • name (str): The name of the interface
  • address (str): The IP address of the interface in the form of A.B.C.D/E
  • mtu (int): The configured value for IP MTU.

Args:

name (string): The interface identifier to retrieve the
               configuration for

Return:

An IPInterfaceConfig object of key/value pairs that represents
the current configuration of the node.  If the specified
interface does not exist then nil is returned.

func (*IPInterfaceEntity) GetAll

GetAll Returns all of the IP interfaces found in the running-config Example:

{
    'Ethernet1': {...},
    'Ethernet2': {...}
}

Returns:

A map'd object of key/value pairs keyed by interface
name that represents all of the IP interfaces on
the current node.

func (*IPInterfaceEntity) GetEthInterfaces

func (i *IPInterfaceEntity) GetEthInterfaces() []string

GetEthInterfaces Returns all of the Interfaces found in the running-config Returns:

[]string of interfaces

func (*IPInterfaceEntity) SetAddress

func (i *IPInterfaceEntity) SetAddress(name string, value string) bool

SetAddress Configures the interface IP address Args:

name (string): The interface identifier to apply the interface
               config to
value (string): The IP address and mask to set the interface to.
                The value should be in the format of A.B.C.D/E
                Value of "" deconfigured ip address

Returns:

True if the operation succeeds

func (*IPInterfaceEntity) SetAddressDefault

func (i *IPInterfaceEntity) SetAddressDefault(name string) bool

SetAddressDefault Configures the default interface IP address Args:

name (string): The interface identifier to apply the interface
               config to

Returns:

True if the operation succeeds

func (*IPInterfaceEntity) SetMtu

func (i *IPInterfaceEntity) SetMtu(name string, value int) bool

SetMtu Configures the interface IP MTU Args:

name (string): The interface identifier to apply the interface
               config to
value (integer): The MTU value to set the interface to.  Accepted
                 values include 68 to 65535

Returns:

True if the operation succeeds otherwise False.

func (*IPInterfaceEntity) SetMtuDefault

func (i *IPInterfaceEntity) SetMtuDefault(name string) bool

SetMtuDefault Configures the default interface IP MTU Args:

name (string): The interface identifier to apply the interface
               config to

Returns:

True if the operation succeeds otherwise False.

type IPv4Neighbor

type IPv4Neighbor struct {
	HWAddress string `json:"hwAddress"`
	Address   string `json:"address"`
	Interface string `json:"interface"`
	Age       int    `json:"age"`
}

type InterfaceAddress

type InterfaceAddress struct {
	BroadcastAddress       string
	PrimaryIP              IPAddress
	SecondaryIPs           interface{}
	SecondaryIPOrderedList []IPAddress
	VirtualIP              IPAddress
}

InterfaceAddress defined data structure for mapping JSON response of 'show interface' to manageable object

type InterfaceConfig

type InterfaceConfig map[string]string

InterfaceConfig represents the parsed Interface config

{
		"name"			: "ethernet1",
		"type"			: "generic",
		"shutdown"		: "false",
		"description"	: "Backhaul-to-East",
}

type InterfaceMlagConfig

type InterfaceMlagConfig map[string]string

InterfaceMlagConfig represents the parsed Mlag config for all interfaces

{
		"Port-Channel1" : "2",
		"Port-Channel10" : "5",
		...
}

type InterfaceStatistics

type InterfaceStatistics struct {
	InBitsRate     float64
	OutBitsRate    float64
	InPktsRate     float64
	UpdateInterval float64
	OutPktsRate    float64
}

InterfaceStatistics defined data structure for mapping JSON response of 'show interface' to manageable object

type LLDPNeighbor

type LLDPNeighbor struct {
	TTL            int    `json:"ttl"`
	NeighborDevice string `json:"neighborDevice"`
	NeighborPort   string `json:"neighborPort"`
	Port           string `json:"port"`
}

type MACAddressTableEntry

type MACAddressTableEntry struct {
	MACAddress string
	LastMove   float64
	Interface  string
	Moves      int
	EntryType  string
	VlanID     int
}

type MlagConfig

type MlagConfig struct {
	// contains filtered or unexported fields
}

MlagConfig represents an Mlag Config entry

func (MlagConfig) DomainID

func (m MlagConfig) DomainID() string

DomainID returns the mlag global domain id Empty string is returned if not found

func (MlagConfig) InterfaceConfig

func (m MlagConfig) InterfaceConfig(intf string) string

InterfaceConfig returns the mlag ID for the given interface. Empty string is returned if not found

func (MlagConfig) LocalInterface

func (m MlagConfig) LocalInterface() string

LocalInterface returns the mlag local inteface Empty string is returned if not found

func (MlagConfig) PeerAddress

func (m MlagConfig) PeerAddress() string

PeerAddress returns the mlag peer address Empty string is returned if not found

func (m MlagConfig) PeerLink() string

PeerLink returns configured peer-link Empty string is returned if not found

func (MlagConfig) Shutdown

func (m MlagConfig) Shutdown() string

Shutdown returns string 'true' if mlag shutdown

type MlagEntity

type MlagEntity struct {
	*AbstractBaseEntity
}

MlagEntity provides a configuration resource for Mlags

func Mlag

func Mlag(node *goeapi.Node) *MlagEntity

Mlag factory function to initiallize MlagEntity resource given a Node

func (*MlagEntity) ConfigureMlag

func (m *MlagEntity) ConfigureMlag(cmd string, value string, def bool, enable bool) bool

ConfigureMlag is a config wrapper for initial mlag config command

Args:

cmd (string): command to issue
value (string): The value to configure the mlag
default (bool): Configures using the default keyword

Returns:

bool: True if the commands complete successfully

func (*MlagEntity) Get

func (m *MlagEntity) Get() *MlagConfig

Get ...

func (*MlagEntity) GetSection

func (m *MlagEntity) GetSection() string

GetSection returns the specified Mlag Entry for the name specified.

Args:

name (string): The Mlag name

Returns:

Returns string representation of Mlag config entry

func (*MlagEntity) SetDomainID

func (m *MlagEntity) SetDomainID(value string) bool

SetDomainID Configures the mlag domain-id value

Args:

value (str): The value to configure the domain-id

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetDomainIDDefault

func (m *MlagEntity) SetDomainIDDefault() bool

SetDomainIDDefault Configures the default mlag domain-id value

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetLocalInterface

func (m *MlagEntity) SetLocalInterface(value string) bool

SetLocalInterface Configures the mlag local-interface value

Args:

value (str): The value to configure the local-interface

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetLocalInterfaceDefault

func (m *MlagEntity) SetLocalInterfaceDefault() bool

SetLocalInterfaceDefault Configures the default mlag local-interface value

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetMlagID

func (m *MlagEntity) SetMlagID(name string, value string) bool

SetMlagID Configures the interface mlag value for the specified interface

Args:

name (str): The interface to configure.  Valid values for the
            name arg include Port-Channel*
value (str): The mlag identifier to cofigure on the interface

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetMlagIDDefault

func (m *MlagEntity) SetMlagIDDefault(name string) bool

SetMlagIDDefault Configures the default interface mlag value for the specified interface

Args:

name (str): The interface to configure.  Valid values for the
            name arg include Port-Channel*
value (str): The mlag identifier to cofigure on the interface

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetPeerAddress

func (m *MlagEntity) SetPeerAddress(value string) bool

SetPeerAddress Configures the mlag peer-address value

Args:

value (str): The value to configure the peer-address
default (bool): Configures the peer-address using the

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetPeerAddressDefault

func (m *MlagEntity) SetPeerAddressDefault() bool

SetPeerAddressDefault Configures the default mlag peer-address value

Returns:

bool: Returns True if the commands complete successfully
func (m *MlagEntity) SetPeerLink(value string) bool

SetPeerLink Configures the mlag peer-link value

Args:

value (str): The value to configure the peer-link
default (bool): Configures the peer-link using the
                default keyword

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetPeerLinkDefault

func (m *MlagEntity) SetPeerLinkDefault() bool

SetPeerLinkDefault Configures the default mlag peer-link value

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetShutdown

func (m *MlagEntity) SetShutdown(enable bool) bool

SetShutdown Configures the mlag shutdown value Args:

enable (bool): true for enabled, false for shutdown

Returns:

bool: Returns True if the commands complete successfully

func (*MlagEntity) SetShutdownDefault

func (m *MlagEntity) SetShutdownDefault() bool

SetShutdownDefault Configures the mlag default shutdown value

Returns:

bool: Returns True if the commands complete successfully

type PTPEntity

type PTPEntity struct {
	*AbstractBaseEntity
	// contains filtered or unexported fields
}

PTPEntity provides a configuration resource for ptp

func Ptp

func Ptp(node *goeapi.Node) *PTPEntity

Ptp factory function to initiallize PTPEntity resource given a Node

func (*PTPEntity) ConfigurePtp

func (p *PTPEntity) ConfigurePtp(cmd string) bool

ConfigurePtp configures the PTP Entity with the given command. Returns true (bool) if the commands complete successfully

func (*PTPEntity) Get

func (p *PTPEntity) Get() *PtpConfig

Get the PTP Config for the current entity. Returns a Ptponfig object

func (*PTPEntity) Interfaces

func (p *PTPEntity) Interfaces() *PTPInterfaceEntity

Interfaces returns the STPInterfaces instance

func (*PTPEntity) SetMode

func (p *PTPEntity) SetMode(value string) bool

SetMode configures the ptp mode using the provided value. Returns true(bool) if the commands complete successfully

func (*PTPEntity) SetSourceIP

func (p *PTPEntity) SetSourceIP(value string) bool

SetSourceIP configures the source ip using the provided value. Returns true(bool) if the commands complete successfully

func (*PTPEntity) SetTTL

func (p *PTPEntity) SetTTL(value string) bool

SetTTL configures the ptp ttl using the provided value. Returns true(bool) if the commands complete successfully

type PTPInterfaceCollection

type PTPInterfaceCollection map[string]PTPInterfaceConfig

PTPInterfaceCollection is a collection of PTPInterfaceConfigs mapped by interface name:

{
		"Ethernet49/1" : PTPInterfaceConfig {
							"enabled"   : "false",
							"role"      : "dynamic",
							"transport" : "layer2",
						  },
		   "Ethernet1" : ...
}

type PTPInterfaceConfig

type PTPInterfaceConfig map[string]string

PTPInterfaceConfig represents the parsed PTP interface config

{
		"enabled"     : "true",
		"role"        : "dynamic",
		"transport"   : "layer2",
}

func (PTPInterfaceConfig) GetPTPAdminStatus

func (p PTPInterfaceConfig) GetPTPAdminStatus() string

GetPTPAdminStatus returns "true" if ptp enabled on this interfaces

type PTPInterfaceEntity

type PTPInterfaceEntity struct {
	*AbstractBaseEntity
}

PTPInterfaceEntity provides a configuration resource for PTP

func PTPInterfaces

func PTPInterfaces(node *goeapi.Node) *PTPInterfaceEntity

PTPInterfaces factory function to initiallize PTPInterfaceEntity resource given a Node

func (*PTPInterfaceEntity) Get

Get returns an PTPInterfaceConfig type for a given interface name(string).

func (*PTPInterfaceEntity) GetAll

GetAll returns a collection of PTPInterfaceConfigs key'd by interface name.

func (*PTPInterfaceEntity) SetEnable

func (p *PTPInterfaceEntity) SetEnable(name string, enable bool) bool

SetEnable enables(true) or disables(false) ptp for the interface name(string). Returns true(bool) if configuration successful

type PhysicalInputErrors

type PhysicalInputErrors struct {
	AlignmentErrots int
	FcsErrors       int
	GiantFrames     int
	RuntFrames      int
	RxPause         int
	SymbolErrors    int
}

PhysicalInputErrors defined data structure for mapping JSON response of 'show interface' to manageable object

type PhysicalOutputErrors

type PhysicalOutputErrors struct {
	Collisions            int
	DeferredTransmissions int
	LateCollisions        int
	TxPause               int
}

PhysicalOutputErrors defined data structure for mapping JSON response of 'show interface' to manageable object

type PortChannelInterfaceEntity

type PortChannelInterfaceEntity struct {
	*BaseInterfaceEntity
}

PortChannelInterfaceEntity provides a configuration resource for PortChannel

func PortChannel

func PortChannel(node *goeapi.Node) *PortChannelInterfaceEntity

PortChannel factory function to initiallize VxlanInterfaceEntity resource given a Node

func (*PortChannelInterfaceEntity) Get

Get returns the PortChannel interface config for the interface name(string) given. Returned is a InterfaceConfig type

func (*PortChannelInterfaceEntity) SetLacpMode

func (p *PortChannelInterfaceEntity) SetLacpMode(name string, mode string) bool

SetLacpMode configures the LACP mode of the member interfaces

func (*PortChannelInterfaceEntity) SetMembers

func (p *PortChannelInterfaceEntity) SetMembers(name string, members ...string) bool

SetMembers configures the array of member interfaces for the Port-Channel

func (p *PortChannelInterfaceEntity) SetMinimumLinks(name string, value int) bool

SetMinimumLinks configures the Port-Channel min-links value

func (*PortChannelInterfaceEntity) SetMinimumLinksDefault

func (p *PortChannelInterfaceEntity) SetMinimumLinksDefault(name string) bool

SetMinimumLinksDefault returns the specified interface min-links config to it's default configuration.

type PtpClockSummary

type PtpClockSummary struct {
	ClockIdentity        string  `json:"clockIdentity"`
	MeanPathDelay        int     `json:"meanPathDelay"`
	StepsRemoved         int     `json:"stepsRemoved"`
	Skew                 float64 `json:"skew"`
	GmClockIdentity      string  `json:"gmClockIdentity"`
	SlavePort            string  `json:"slavePort"`
	NumberOfMasterPorts  int     `json:"numberOfMasterPorts"`
	NumberOfSlavePorts   int     `json:"numberOfSlavePorts"`
	CurrentPtpSystemTime int     `json:"currentPtpSystemTime"`
	OffsetFromMaster     int     `json:"offsetFromMaster"`
	LastSyncTime         int     `json:"lastSyncTime"`
}

PtpClockSummary represents common data in "show ptp" output

type PtpConfig

type PtpConfig struct {
	// contains filtered or unexported fields
}

PtpConfig represents the parsed ptp config

func (*PtpConfig) Mode

func (p *PtpConfig) Mode() string

Mode returns ptp mode, either dynamic or master, which this node operates

func (*PtpConfig) SourceIP

func (p *PtpConfig) SourceIP() string

SourceIP returns source ip address of ptp packets sent by this node

func (*PtpConfig) TTL

func (p *PtpConfig) TTL() string

TTL returns time to leave number sent in ipv4 header

type PtpIntf

type PtpIntf struct {
	PortState      string `json:"portState"`
	DelayMechanism string `json:"delayMechanism"`
	TransportMode  string `json:"transportMode"`
}

PtpIntf represents inidividual interface in "show ptp" output

type Route

type Route struct {
	KernelProgrammed  bool   `json:"kernelProgrammed"`
	DirectlyConnected bool   `json:"directlyConnected"`
	Preference        int    `json:"preference"`
	RouteAction       string `json:"routeAction"`
	Vias              []struct {
		Interface   string `json:"interface"`
		NexthopAddr string `json:"nexthopAddr"`
	} `json:"vias"`
	Metric             int    `json:"metric"`
	HardwareProgrammed bool   `json:"hardwareProgrammed"`
	RouteType          string `json:"routeType"`
}

type Routes

type Routes struct {
	Routes map[string]Route `json:"routes"`
}

type STPEntity

type STPEntity struct {
	*AbstractBaseEntity
	// contains filtered or unexported fields
}

STPEntity provides a configuration resource for STP

func Stp

func Stp(node *goeapi.Node) *STPEntity

Stp factory function to initiallize STPEntity resource given a Node

func (*STPEntity) Get

func (s *STPEntity) Get()

Get ...

func (*STPEntity) Instances

func (s *STPEntity) Instances() *STPInstanceEntity

Instances returns the STPInstances resource for STP instances

func (*STPEntity) Interfaces

func (s *STPEntity) Interfaces() *STPInterfaceEntity

Interfaces returns the STPInterfaces instance

func (*STPEntity) SetMode

func (s *STPEntity) SetMode(value string) bool

SetMode sets the spanning tree mode. Valid parameters are:

mstp or none.

Returns:

bool: Returns True if the commands complete successfully

type STPInstanceEntity

type STPInstanceEntity struct {
	*AbstractBaseEntity
}

STPInstanceEntity provides a configuration resource for STPInstance

func STPInstance

func STPInstance(node *goeapi.Node) *STPInstanceEntity

STPInstance factory function to initiallize STPInstanceEntity resource given a Node

type STPInterfaceCollection

type STPInterfaceCollection map[string]STPInterfaceConfig

STPInterfaceCollection is a collection of STPInterfaceConfigs mapped by interface name:

{
		"Port-Channel1" : STPInterfaceConfig {
							"bpduguard"     : "false",
							"portfast"      : "true",
							"portfast_type" : "edge",
						  },
		   "Ethernet1" : ...
}

type STPInterfaceConfig

type STPInterfaceConfig map[string]string

STPInterfaceConfig represents the parsed STP interface config

{
		"bpduguard"     : "false",
		"portfast"      : "true",
		"portfast_type" : "edge",
}

type STPInterfaceEntity

type STPInterfaceEntity struct {
	*AbstractBaseEntity
}

STPInterfaceEntity provides a configuration resource for STP

func STPInterfaces

func STPInterfaces(node *goeapi.Node) *STPInterfaceEntity

STPInterfaces factory function to initiallize STPInterfaceEntity resource given a Node

func (*STPInterfaceEntity) ConfigureInterface

func (s *STPInterfaceEntity) ConfigureInterface(name string, cmds ...string) bool

ConfigureInterface (redefined from Base) Returns true(bool) if configuration successful

func (*STPInterfaceEntity) Get

Get returns an STPInterfaceConfig type for a given interface name(string).

func (*STPInterfaceEntity) GetAll

GetAll returns a collection of STPInterfaceConfigs key'd by interface name.

func (*STPInterfaceEntity) SetBPDUGuard

func (s *STPInterfaceEntity) SetBPDUGuard(name string, enable bool) bool

SetBPDUGuard eables(true) or disables(false) spanning-tree bpduguard for the interface name(string). Returns true(bool) if configuration successful

func (*STPInterfaceEntity) SetBPDUGuardDefault

func (s *STPInterfaceEntity) SetBPDUGuardDefault(name string) bool

SetBPDUGuardDefault sets the spanning-tree bpduguard for the interface name(string) back to the default config. Returns true(bool) if configuration successful

func (*STPInterfaceEntity) SetPortfast

func (s *STPInterfaceEntity) SetPortfast(name string, enable bool) bool

SetPortfast sets the spanning-tree portfast for the interface name(string) to be enabled(true) or disabled(false). Returns true(bool) if configuration successful

func (*STPInterfaceEntity) SetPortfastDefault

func (s *STPInterfaceEntity) SetPortfastDefault(name string) bool

SetPortfastDefault sets the spanning-tree portfast for the interface name(string) back to the default config. Returns true(bool) if configuration successful

func (*STPInterfaceEntity) SetPortfastType

func (s *STPInterfaceEntity) SetPortfastType(name string, value string) bool

SetPortfastType sets the spanning-tree portfast type for the interface name(string) to one of the following valid args:

network
edge
normal

Returns true(bool) if configuration successful

type ShowARP

type ShowARP struct {
	DynamicEntries    int            `json:"dynamicEntries"`
	IPv4Neighbors     []IPv4Neighbor `json:"ipV4Neighbors"`
	NotLearnedEntries int            `json:"notLearnedEntries"`
	TotalEntries      int            `json:"totalEntries"`
	StaticEntries     int            `json:"staticEntries"`
}

func (*ShowARP) GetCmd

func (a *ShowARP) GetCmd() string

type ShowEntity

type ShowEntity struct {
	*AbstractBaseEntity
}

ShowEntity provides a configuration resource for VLANs

func Show

func Show(node *goeapi.Node) *ShowEntity

Show factory function to initiallize Show resource given a Node

func (*ShowEntity) ShowARP

func (s *ShowEntity) ShowARP() (ShowARP, error)

func (*ShowEntity) ShowEnvironmentPower

func (s *ShowEntity) ShowEnvironmentPower() (ShowEnvironmentPower, error)

func (*ShowEntity) ShowIPBGPSummary

func (s *ShowEntity) ShowIPBGPSummary() (ShowIPBGPSummary, error)

func (*ShowEntity) ShowIPRoute

func (s *ShowEntity) ShowIPRoute() ShowIPRoute

func (*ShowEntity) ShowInterfaces

func (s *ShowEntity) ShowInterfaces() ShowInterface

ShowInterfaces returns the pre-defined structure (with "json" key in the struct field's tag value) for the decoded response from 'show interfaces' command

func (*ShowEntity) ShowInterfacesSwitchport

func (s *ShowEntity) ShowInterfacesSwitchport() ShowInterfacesSwitchport

func (*ShowEntity) ShowLLDPNeighbors

func (s *ShowEntity) ShowLLDPNeighbors() ShowLLDPNeighbors

func (*ShowEntity) ShowMACAddressTable

func (s *ShowEntity) ShowMACAddressTable() (ShowMACAddressTable, error)

func (*ShowEntity) ShowPTP

func (s *ShowEntity) ShowPTP() (ShowPTP, error)

func (*ShowEntity) ShowTrunkGroups

func (s *ShowEntity) ShowTrunkGroups() ShowTrunkGroup

ShowTrunkGroups returns the pre-defined structure (with "json" key in the struct field's tag value) for the decoded response from 'show vlan trunk group' command

func (*ShowEntity) ShowVersion

func (s *ShowEntity) ShowVersion() ShowVersion

ShowVersion returns the pre-defined structure (with "json" key in the struct field's tag value) for the decoded response from 'show version' command

type ShowEnvironmentPower

type ShowEnvironmentPower struct {
	PowerSupplies map[string]struct {
		OutputPower  float64 `json:"outputPower"`
		State        string  `json:"state"`
		ModelName    string  `json:"modelName"`
		Capacity     int     `json:"capacity"`
		InputCurrent float64 `json:"inputCurrent"`
		TempSensors  map[string]struct {
			Status      string `json:"status"`
			Temperature int    `json:"temperature"`
		} `json:"tempSensors"`
		Fans map[string]struct {
			Status string `json:"status"`
			Speed  int    `json:"speed"`
		} `json:"fans"`
		OutputCurrent float64 `json:"outputCurrent"`
		Uptime        float64 `json:"uptime"`
		Managed       bool    `json:"managed"`
	} `json:"powerSupplies"`
}

func (*ShowEnvironmentPower) GetCmd

func (b *ShowEnvironmentPower) GetCmd() string

type ShowIPBGPSummary

type ShowIPBGPSummary struct {
	VRFs map[string]VRF
}

func (*ShowIPBGPSummary) GetCmd

func (b *ShowIPBGPSummary) GetCmd() string

type ShowIPRoute

type ShowIPRoute struct {
	VRFs map[string]Routes `json:"vrfs"`
}

func (*ShowIPRoute) GetCmd

func (r *ShowIPRoute) GetCmd() string

type ShowInterface

type ShowInterface struct {
	Interfaces map[string]SwitchInterface
}

ShowInterface defined data structure for mapping JSON response of 'show interface' to manageable object

func (ShowInterface) GetCmd

func (s ShowInterface) GetCmd() string

GetCmd returns the command type this EapiCommand relates to

type ShowInterfacesSwitchport

type ShowInterfacesSwitchport struct {
	Switchports map[string]Switchport `json:"switchports"`
}

func (*ShowInterfacesSwitchport) GetCmd

func (l *ShowInterfacesSwitchport) GetCmd() string

type ShowLLDPNeighbors

type ShowLLDPNeighbors struct {
	TablesLastChangeTime float64        `json:"tablesLastChangeTime"`
	TablesAgeouts        int            `json:"tablesAgeOuts"`
	TablesInserts        int            `json:"tablesInserts"`
	TablesDeletes        int            `json:"tablesDeletes"`
	TablesDrops          int            `json:"tablesDrops"`
	LLDPNeighbors        []LLDPNeighbor `json:"lldpNeighbors"`
}

func (*ShowLLDPNeighbors) GetCmd

func (l *ShowLLDPNeighbors) GetCmd() string

type ShowMACAddressTable

type ShowMACAddressTable struct {
	MulticastTable struct {
		TableEntries []MACAddressTableEntry `json:"tableEntries"`
	} `json:"multicastTable"`
	UnicastTable struct {
		TableEntries []MACAddressTableEntry `json:"tableEntries"`
	} `json:"unicastTable"`
}

func (*ShowMACAddressTable) GetCmd

func (a *ShowMACAddressTable) GetCmd() string

type ShowPTP

type ShowPTP struct {
	PtpMode          string             `json:"ptpMode"`
	PtpClockSummary  PtpClockSummary    `json:"ptpClockSummary"`
	PtpIntfSummaries map[string]PtpIntf `json:"ptpIntfSummaries"`
}

ShowPTP represents "show ptp" output

func (*ShowPTP) GetCmd

func (b *ShowPTP) GetCmd() string

type ShowTrunkGroup

type ShowTrunkGroup struct {
	TrunkGroups map[string]struct {
		Names []string
	}
}

ShowTrunkGroup defined data structure for mapping JSON response of 'show vlan trunk group' to manageable object

func (ShowTrunkGroup) GetCmd

func (s ShowTrunkGroup) GetCmd() string

GetCmd returns the command type this EapiCommand relates to

type ShowVersion

type ShowVersion struct {
	ModelName        string
	InternalVersion  string
	SystemMacAddress string
	SerialNumber     string
	MemTotal         int
	BootupTimestamp  float64
	MemFree          int
	Version          string
	Architecture     string
	InternalBuildID  string
	HardwareRevision string
}

ShowVersion defined data structure for mapping JSON response of 'show version' to manageable object

func (ShowVersion) GetCmd

func (s ShowVersion) GetCmd() string

GetCmd returns the command type this EapiCommand relates to

type SwitchInterface

type SwitchInterface struct {
	Bandwidth                 int
	BurnedInAddress           string
	Description               string //`json:"description"`
	ForwardingModel           string
	Hardware                  string
	InterfaceAddress          []InterfaceAddress
	InterfaceCounters         EthInterfaceCounters
	InterfaceMembership       string
	InterfaceStatistics       InterfaceStatistics
	InterfaceStatus           string
	L2Mtu                     int
	LastStatusChangeTimestamp float64
	LineProtocolStatus        string
	Mtu                       int
	Name                      string
	PhysicalAddress           string
}

SwitchInterface defined data structure for mapping JSON response of 'show interface' to manageable object

type SwitchPortConfig

type SwitchPortConfig map[string]string

SwitchPortConfig represents a parsed SwitchPort entry

func (SwitchPortConfig) AccessVlan

func (s SwitchPortConfig) AccessVlan() string

AccessVlan returns the SwitchPortConfig access vlan(string)

func (SwitchPortConfig) Mode

func (s SwitchPortConfig) Mode() string

Mode returns the SwitchPortConfig mode(string)

func (SwitchPortConfig) Name

func (s SwitchPortConfig) Name() string

Name returns the SwitchPortConfig name(string)

func (SwitchPortConfig) TrunkAllowedVlans

func (s SwitchPortConfig) TrunkAllowedVlans() string

TrunkAllowedVlans returns the SwitchPortConfig allowed trunk vlans(string)

func (SwitchPortConfig) TrunkGroups

func (s SwitchPortConfig) TrunkGroups() string

TrunkGroups returns the SwitchPortConfig trunk groups(string) comma delimited string

func (SwitchPortConfig) TrunkNativeVlan

func (s SwitchPortConfig) TrunkNativeVlan() string

TrunkNativeVlan returns the SwitchPortConfig native vlan(string)

type SwitchPortConfigMap

type SwitchPortConfigMap map[string]SwitchPortConfig

SwitchPortConfigMap represents a parsed SwitchPort entry

type SwitchPortEntity

type SwitchPortEntity struct {
	*AbstractBaseEntity
}

SwitchPortEntity provides a configuration resource for SwitchPorts

Logical layer 2 interfaces built on top of physical Ethernet and bundled Port-Channel interfaces can be configured and managed with an instance of Switchport. The Switchport object is a resource collection and supports get and getall methods. The Switchports class is derived from the AbstractBaseEntity object

func SwitchPort

func SwitchPort(node *goeapi.Node) *SwitchPortEntity

SwitchPort factory function to initiallize SwitchPortEntity resource given a Node

func (*SwitchPortEntity) AddTrunkGroup

func (s *SwitchPortEntity) AddTrunkGroup(intf string, value string) bool

AddTrunkGroup Adds the specified trunk group to the interface

Args:

intf (string): The interface name to apply the trunk group to
value (string): The trunk group value to apply to the interface

Returns:

True if the operation as successfully applied otherwise false

func (*SwitchPortEntity) Create

func (s *SwitchPortEntity) Create(name string) bool

Create Creates a new logical layer 2 interface This method will create a new switchport for the interface specified in the arguments (name). If the logical switchport already exists then this command will have no effect

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.  If the
    interface specified in args is already a switchport then this
    method will have no effect but will still return True

func (*SwitchPortEntity) Default

func (s *SwitchPortEntity) Default(name string) bool

Default Defaults the configuration of the switchport interface This method will default the configuration state of the logical layer 2 interface.

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.  If the
    interface specified in args is already a switchport then this
    method will have no effect but will still return True

func (*SwitchPortEntity) Delete

func (s *SwitchPortEntity) Delete(name string) bool

Delete Deletes the logical layer 2 interface This method will delete the logical switchport for the interface specified in the arguments. If the interface doe not have a logical layer 2 interface defined, then this method will have no effect.

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.  If the
    interface specified in args is already a switchport then this
    method will have no effect but will still return True

func (*SwitchPortEntity) Get

Get Returns a SwitchPortConfig object that represents a switchport The Switchport resource returns the following:

  • name (string): The name of the interface
  • mode (string): The switchport mode value
  • access_vlan (string): The switchport access vlan value
  • trunk_native_vlan (string): The switchport trunk native vlan vlaue
  • trunk_allowed_vlans (string): The trunk allowed vlans value
  • trunk_groups (string): The list of trunk groups configured

Args:

name (string): The interface identifier to get.  Note: Switchports
    are only supported on Ethernet and Port-Channel interfaces

Returns:

SwitchPortConfig: An object of key/value pairs that represent
    the switchport configuration for the interface specified  If
    the specified argument is not a switchport then None
    is returned

func (*SwitchPortEntity) GetAll

GetAll Returns a mapped object to all Switchports This method will return all of the configured switchports as a SwitchPortConfigMap object keyed by the interface identifier.

Returns:

A map'd SwitchPort that represents all configured
    switchports in the current running configuration

func (*SwitchPortEntity) GetSection

func (s *SwitchPortEntity) GetSection(name string) string

GetSection returns the specified SwitchPort Entry for the name specified.

Args:

name (string): The port name

Returns:

Returns string representation of SwitchPort config entry

func (*SwitchPortEntity) RemoveTrunkGroup

func (s *SwitchPortEntity) RemoveTrunkGroup(intf string, value string) bool

RemoveTrunkGroup Removes a specified trunk group to the interface

Args:

intf (string): The interface name to remove the trunk group from
value (string): The trunk group value

Returns:

True if the operation as successfully applied otherwise false

func (*SwitchPortEntity) SetAccessVlan

func (s *SwitchPortEntity) SetAccessVlan(name string, value string) bool

SetAccessVlan Configures the switchport access vlan

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)
 value (string): The value to set the access vlan to.  The value
    must be a valid VLAN ID in the range of 1 to 4094.

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetAccessVlanDefault

func (s *SwitchPortEntity) SetAccessVlanDefault(name string) bool

SetAccessVlanDefault Configures the default switchport access vlan

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetMode

func (s *SwitchPortEntity) SetMode(name string, value string) bool

SetMode Configures the switchport mode

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)
 value (string): The value to set the mode to.  Accepted values
    for this argument are access or trunk
 default (bool): Configures the mode parameter to its default
    value using the EOS CLI

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetModeDefault

func (s *SwitchPortEntity) SetModeDefault(name string) bool

SetModeDefault Configures the switchport mode

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetTrunkAllowedVlans

func (s *SwitchPortEntity) SetTrunkAllowedVlans(name string, value string) bool

SetTrunkAllowedVlans Configures the switchport trunk allowed vlans value

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)
 value (string): The value to set the trunk allowed vlans to.  The
    value must be a valid VLAN ID in the range of 1 to 4094.

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetTrunkAllowedVlansDefault

func (s *SwitchPortEntity) SetTrunkAllowedVlansDefault(name string) bool

SetTrunkAllowedVlansDefault Configures the default switchport trunk allowed

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetTrunkGroups

func (s *SwitchPortEntity) SetTrunkGroups(intf string, value []string) bool

SetTrunkGroups Configures the switchport trunk group value

Args:

intf (string): The interface identifier to configure.
value (string): The set of values to configure the trunk group

Returns:

True if the config operation succeeds otherwise False

func (*SwitchPortEntity) SetTrunkGroupsDefault

func (s *SwitchPortEntity) SetTrunkGroupsDefault(intf string) bool

SetTrunkGroupsDefault Configures default switchport trunk group value

Args:

intf (string): The interface identifier to configure.

Returns:

True if the config operation succeeds otherwise False

func (*SwitchPortEntity) SetTrunkNativeVlan

func (s *SwitchPortEntity) SetTrunkNativeVlan(name string, value string) bool

SetTrunkNativeVlan Configures the switchport trunk native vlan value

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)
 value (string): The value to set the trunk nativevlan to.  The
    value must be a valid VLAN ID in the range of 1 to 4094.

Returns:

True if the create operation succeeds otherwise False.

func (*SwitchPortEntity) SetTrunkNativeVlanDefault

func (s *SwitchPortEntity) SetTrunkNativeVlanDefault(name string) bool

SetTrunkNativeVlanDefault Configures the default switchport trunk native vlan value

Args:

name (string): The interface identifier to create the logical
    layer 2 switchport for.  The name must be the full interface
    name and not an abbreviated interface name (eg Ethernet1, not
    Et1)

Returns:

True if the operation succeeds otherwise False.

type Switchport

type Switchport struct {
	Enabled        bool           `json:"enabled"`
	SwitchportInfo SwitchportInfo `json:"switchportInfo"`
}

type SwitchportInfo

type SwitchportInfo struct {
	AccessVlanID           int           `json:"accessVlanId"`
	AccessVlanName         string        `json:"accessVlanName"`
	DynamicAllowedVlans    struct{}      `json:"dynamicAllowedVlans"`
	DynamicTrunkGroups     []interface{} `json:"dynamicTrunkGroups"`
	MacLearning            bool          `json:"macLearning"`
	Mode                   string        `json:"mode"`
	StaticTrunkGroups      []interface{} `json:"staticTrunkGroups"`
	Tpid                   string        `json:"tpid"`
	TpidStatus             bool          `json:"tpidStatus"`
	TrunkAllowedVlans      string        `json:"trunkAllowedVlans"`
	TrunkingNativeVlanID   int           `json:"trunkingNativeVlanId"`
	TrunkingNativeVlanName string        `json:"trunkingNativeVlanName"`
}

type SystemConfig

type SystemConfig map[string]string

SystemConfig represents a parsed system entry containing

func (SystemConfig) HostName

func (s SystemConfig) HostName() string

HostName returns the hostname entry in the SystemConfig type

func (SystemConfig) IPRouting

func (s SystemConfig) IPRouting() string

IPRouting returns the ip route entry in the SystemConfig type

type SystemEntity

type SystemEntity struct {
	*AbstractBaseEntity
}

SystemEntity provides a configuration resource for System

func System

func System(node *goeapi.Node) *SystemEntity

System factory function to initiallize System resource given a Node

func (*SystemEntity) Get

func (s *SystemEntity) Get() SystemConfig

Get Returns the system configuration abstraction

The System resource returns the following:

  • hostname (str): The hostname value

Returns:

SystemConfig: Represents the node's system configuration

func (*SystemEntity) SetHostname

func (s *SystemEntity) SetHostname(hostname string) bool

SetHostname Configures the global system hostname setting

EosVersion:

4.13.7M

Args:

value (str): The hostname value
default (bool): Controls use of the default keyword

Returns:

bool: True if the commands are completed successfully

func (*SystemEntity) SetHostnameDefault

func (s *SystemEntity) SetHostnameDefault() bool

SetHostnameDefault Configures the global default system hostname setting

EosVersion:

4.13.7M

Returns:

bool: True if the commands are completed successfully

func (*SystemEntity) SetIPRouting

func (s *SystemEntity) SetIPRouting(value string, enable bool) bool

SetIPRouting Configures the state of global ip routing

EosVersion:

4.13.7M

Args:

value(bool): True if ip routing should be enabled or False if
             ip routing should be disabled

Returns:

bool: True if the commands completed successfully otherwise False

func (*SystemEntity) SetIPRoutingDefault

func (s *SystemEntity) SetIPRoutingDefault(value string) bool

SetIPRoutingDefault Configures the default tate of global ip routing

EosVersion:

4.13.7M

Returns:

bool: True if the commands completed successfully otherwise False

type UserConfig

type UserConfig map[string]string

UserConfig represents a parsed user entry containing:

  "username" : "",
 "privilege" : "",
      "role" : "",
"nopassword" : "",
    "secret" : "",
    "format" : "",
    "sshkey" : "",

func (UserConfig) Format

func (u UserConfig) Format() string

Format returns the format(string) for this UserConfig

func (UserConfig) Nopassword

func (u UserConfig) Nopassword() string

Nopassword returns 'true'(string) if nopassowrd is configured for this UserConfig

func (UserConfig) Privilege

func (u UserConfig) Privilege() string

Privilege returns the privilege mode(string) for this UserConfig

func (UserConfig) Role

func (u UserConfig) Role() string

Role returns the role for this UserConfig

func (UserConfig) SSHKey

func (u UserConfig) SSHKey() string

SSHKey returns the sshkey(string) for this UserConfig

func (UserConfig) Secret

func (u UserConfig) Secret() string

Secret returns the login secret passwd type for this UserConfig

func (UserConfig) UserName

func (u UserConfig) UserName() string

UserName returns the username(string) entry for this UserConfig

type UserConfigMap

type UserConfigMap map[string]UserConfig

UserConfigMap is a mapped entry of UserConfigs containing:

"username" : {
      "username" : "",
     "privilege" : "",
          "role" : "",
    "nopassword" : "",
        "secret" : "",
        "format" : "",
        "sshkey" : "",
}

type UserEntity

type UserEntity struct {
	*AbstractBaseEntity
}

UserEntity resource provides configuration for local user resources of an EOS node

func User

func User(node *goeapi.Node) *UserEntity

User factory function to initiallize User resource given a Node

func (*UserEntity) Create

func (u *UserEntity) Create(name string, nopassword bool, secret string,
	encryption string) (bool, error)

Create Creates a new user on the local system.

Args:

name (string):     The name of the user to craete
nopassword (bool): Configures the user to be able to authenticate
                   without a password challenage
secret (string):   The secret (password) to assign to this user
encryption (string): Specifies how the secret is encoded.  Valid
                         values are "cleartext", "md5", "sha512".
                         The default is "cleartext"

Returns:

True if the operation was successful otherwise False

func (*UserEntity) CreateWithNoPassword

func (u *UserEntity) CreateWithNoPassword(name string) bool

CreateWithNoPassword Creates a new user on the local node

Args:

name (string): The name of the user to create

Returns:

True if the operation was successful otherwise False

func (*UserEntity) CreateWithSecret

func (u *UserEntity) CreateWithSecret(name string, secret string,
	encryption string) (bool, error)

CreateWithSecret Creates a new user on the local node

Args:

name (string):       The name of the user to craete
secret (string):     The secret (password) to assign to this user
encryption (string): Specifies how the secret is encoded.  Valid
                    values are "cleartext", "md5", "sha512".  The
                    default is "cleartext"

Returns:

True if the operation was successful otherwise False

func (*UserEntity) Default

func (u *UserEntity) Default(name string) bool

Default Configures the local username using the default keyword

Args:

name (string): The name of the user to configure

Returns:

True if the operation was successful otherwise False

func (*UserEntity) Delete

func (u *UserEntity) Delete(name string) bool

Delete Deletes the local username from the config

Args:

name (string): The name of the user to delete

Returns:

True if the operation was successful otherwise False

func (*UserEntity) Get

func (u *UserEntity) Get(name string) UserConfig

Get Returns the local user configuration as a UserConfig.

Args:

name (string): The user name to return a resource for from the
              nodes configuration

Returns:

UserConfig type

func (*UserEntity) GetAll

func (u *UserEntity) GetAll() UserConfigMap

GetAll Returns the local user configuration as UserConfig

Returns:

UserConfigMap object

func (*UserEntity) GetSection

func (u *UserEntity) GetSection() string

GetSection Returns the local user configuration as string

Returns:

UserConfigMap object

func (*UserEntity) SetPrivilege

func (u *UserEntity) SetPrivilege(name string, value int) (bool, error)

SetPrivilege Configures the user privilege value in EOS

Args:

name (string): The name of the user to craete
value (int):   The privilege value to assign to the user.  Valid
               values are in the range of 0 to 15

Returns:

True if the operation was successful otherwise False

func (*UserEntity) SetRole

func (u *UserEntity) SetRole(name string, value string) bool

SetRole Configures the user role vale in EOS

Args:

name (string):  The name of the user to craete
value (string): The value to configure for the user role

Returns:

True if the operation was successful otherwise False

func (*UserEntity) SetSshkey

func (u *UserEntity) SetSshkey(name string, value string) bool

SetSshkey Configures the user sshkey

Args:

name (string):  The name of the user to add the sshkey to
value (string): The value to configure for the sshkey.

Returns:

True if the operation was successful otherwise False

type VRF

type VRF struct {
	RouterID string                        `json:"routerId"`
	Peers    map[string]BGPNeighborSummary `json:"peers"`
	VRF      string                        `json:"vrf"`
	ASN      int64                         `json:"asn"`
}

type VlanConfig

type VlanConfig map[string]string

VlanConfig represents a parsed vlan entry containing

func (VlanConfig) Name

func (v VlanConfig) Name() string

Name returns the Vlan name for this VlanConfig Null string returned if not set

func (VlanConfig) State

func (v VlanConfig) State() string

State returns the Vlan state for this VlanConfig Null string returned if not set

func (VlanConfig) TrunkGroups

func (v VlanConfig) TrunkGroups() string

TrunkGroups returns the Vlan trunk groups configured for this VlanConfig Null string returned if not set

type VlanConfigMap

type VlanConfigMap map[string]VlanConfig

VlanConfigMap represents a parsed vlan entry containing

type VlanEntity

type VlanEntity struct {
	*AbstractBaseEntity
}

VlanEntity provides a configuration resource for VLANs

func Vlan

func Vlan(node *goeapi.Node) *VlanEntity

Vlan factory function to initiallize Vlans resource given a Node

func (*VlanEntity) AddTrunkGroup

func (v *VlanEntity) AddTrunkGroup(vid string, name string) bool

AddTrunkGroup Adds a new trunk group to the Vlan in the running-config

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure
name (string): The trunk group to add to the list

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) ConfigureVlan

func (v *VlanEntity) ConfigureVlan(vid string, cmds ...string) bool

ConfigureVlan Configures the specified Vlan using commands

Args:

vid (string): The VLAN ID to configure
commands: The list of commands to configure

Returns:

True if the commands completed successfully

func (*VlanEntity) Create

func (v *VlanEntity) Create(vid string) bool

Create Creates a new VLAN resource

Args:

vid (string): The VLAN ID to create

Returns:

True if create was successful otherwise False

func (*VlanEntity) Default

func (v *VlanEntity) Default(vid string) bool

Default Defaults the VLAN configuration

.. code-block:: none

default vlan <vlanid>

Args:

vid (string): The VLAN ID to default

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) Delete

func (v *VlanEntity) Delete(vid string) bool

Delete Deletes a VLAN from the running configuration

Args:

vid (string): The VLAN ID to delete

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) Get

func (v *VlanEntity) Get(vlan string) VlanConfig

Get returns the VLAN configuration as a resource object. Args:

vid (string): The vlan identifier to retrieve from the
              running configuration.  Valid values are in the range
              of 1 to 4095

Returns:

VlanConfig object containing the VLAN attributes as
key/value pairs.

func (*VlanEntity) GetAll

func (v *VlanEntity) GetAll() VlanConfigMap

GetAll Returns a VlanConfigMap object of all Vlans in the running-config Returns:

A VlanConfigMap type of all Vlan attributes

func (*VlanEntity) GetSection

func (v *VlanEntity) GetSection(vlan string) string

GetSection returns the specified Vlan Entry for the name specified.

Args:

vlan (string): The vlan id

Returns:

Returns string representation of Vlan config entry

func (*VlanEntity) RemoveTrunkGroup

func (v *VlanEntity) RemoveTrunkGroup(vid string, name string) bool

RemoveTrunkGroup Removes a trunk group from the list of configured trunk groups for the specified VLAN ID

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure
name (string): The trunk group to add to the list

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetName

func (v *VlanEntity) SetName(vid string, name string) bool

SetName Configures the VLAN name

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to Configures
name (string): The value to configure the vlan name

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetNameDefault

func (v *VlanEntity) SetNameDefault(vid string) bool

SetNameDefault Configures the VLAN name

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to Configures

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetState

func (v *VlanEntity) SetState(vid string, value string) bool

SetState Configures the VLAN state

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure
value (string): The value to set the vlan state to

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetStateDefault

func (v *VlanEntity) SetStateDefault(vid string) bool

SetStateDefault Configures the VLAN state

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetTrunkGroup

func (v *VlanEntity) SetTrunkGroup(vid string, value []string) bool

SetTrunkGroup Configures the list of trunk groups support on a vlan

This method handles configuring the vlan trunk group value to default if the default flag is set to True. If the default flag is set to False, then this method will calculate the set of trunk group names to be added and to be removed.

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure
value (string): The list of trunk groups that should be configured
             for this vlan id.

Returns:

True if the operation was successful otherwise False

func (*VlanEntity) SetTrunkGroupDefault

func (v *VlanEntity) SetTrunkGroupDefault(vid string) bool

SetTrunkGroupDefault Configures the default list of trunk groups support on a vlan

This method handles configuring the vlan trunk group value to default if the default flag is set to True. If the default flag is set to False, then this method will calculate the set of trunk group names to be added and to be removed.

EosVersion:

4.13.7M

Args:

vid (string): The VLAN ID to configure

Returns:

True if the operation was successful otherwise False

type VxlanConfigCollection

type VxlanConfigCollection map[string]VxlanInterfaceConfig

VxlanConfigCollection is a collection of Vxlan interfaces

{
		"1" : VxlanInterfaceConfig{},
}

type VxlanInterfaceConfig

type VxlanInterfaceConfig map[string]string

VxlanInterfaceConfig represents the parsed Vxlan interface config {

		"name"				: "Vxlan1"
		"type"				: "vxlan"
		"shutdown"			: "false"
		"description"		: ""
		"source_interface"	: "Ethernet1",
		"multicast_group"	: "",
		"udp_port"			: "1024",
		"flood_list"		: "",
}

type VxlanInterfaceEntity

type VxlanInterfaceEntity struct {
	*BaseInterfaceEntity
}

VxlanInterfaceEntity provides a configuration resource for Vxlan

func Vxlan

func Vxlan(node *goeapi.Node) *VxlanInterfaceEntity

Vxlan factory function to initiallize VxlanInterfaceEntity resource given a Node

func (*VxlanInterfaceEntity) AddVtepGlobalFlood

func (v *VxlanInterfaceEntity) AddVtepGlobalFlood(name string, vtep string) bool

AddVtepGlobalFlood adds to interface name(string) a vtep(string) endpoint with the global flood list

func (*VxlanInterfaceEntity) AddVtepLocalFlood

func (v *VxlanInterfaceEntity) AddVtepLocalFlood(name string, vtep string, vlan int) bool

AddVtepLocalFlood adds to interface name(string) a vtep(string) endpoint with the local vlan(int) flood list

func (*VxlanInterfaceEntity) Get

Get returns the Vxlan interface config for the interface name(string) given. Returned is a InterfaceConfig type

func (*VxlanInterfaceEntity) RemoveVlan

func (v *VxlanInterfaceEntity) RemoveVlan(name string, vid int) bool

RemoveVlan removes a vlan vid(int) to vni mapping from a given interface name(string).

func (*VxlanInterfaceEntity) RemoveVtepGlobalFlood

func (v *VxlanInterfaceEntity) RemoveVtepGlobalFlood(name string, vtep string) bool

RemoveVtepGlobalFlood removes from interface name(string) a global vtep(string) flood list

func (*VxlanInterfaceEntity) RemoveVtepLocalFlood

func (v *VxlanInterfaceEntity) RemoveVtepLocalFlood(name string, vtep string, vlan int) bool

RemoveVtepLocalFlood removes from interface name(string) a vtep(string) endpoint from the local vlan(int) flood list

func (*VxlanInterfaceEntity) SetMulticastGroup

func (v *VxlanInterfaceEntity) SetMulticastGroup(name string, value string) bool

SetMulticastGroup sets the vxlan interface multicast-group configuration to the value specified. If empty string is specified, then default setting is used.

func (*VxlanInterfaceEntity) SetMulticastGroupDefault

func (v *VxlanInterfaceEntity) SetMulticastGroupDefault(name string) bool

SetMulticastGroupDefault sets the vxlan interface multicast-group configuration back to default settings.

func (*VxlanInterfaceEntity) SetSourceInterface

func (v *VxlanInterfaceEntity) SetSourceInterface(name string, value string) bool

SetSourceInterface sets the vxlan interface to the given value(string). If empty string is specified, then default setting is used.

func (*VxlanInterfaceEntity) SetSourceInterfaceDefault

func (v *VxlanInterfaceEntity) SetSourceInterfaceDefault(name string) bool

SetSourceInterfaceDefault sets the vxlan interface source-interface back to default settings

func (*VxlanInterfaceEntity) SetUDPPort

func (v *VxlanInterfaceEntity) SetUDPPort(name string, value int) bool

SetUDPPort sets the vxlan interface udp port to the provided port value(int)

func (*VxlanInterfaceEntity) SetUDPPortDefault

func (v *VxlanInterfaceEntity) SetUDPPortDefault(name string) bool

SetUDPPortDefault sets the vxlan interface udp port configuration to the default settings

func (*VxlanInterfaceEntity) UpdateVlan

func (v *VxlanInterfaceEntity) UpdateVlan(name string, vid int, vni int) bool

UpdateVlan adds a new vlan vid(int) to vni(int) for the interface name(string)

Jump to

Keyboard shortcuts

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