Documentation ¶
Overview ¶
Package payload implement processing of Cisco SD-WAN api responses
Index ¶
- Constants
- Variables
- func GetDevicesMetadata(namespace string, devices []client.Device) []devicemetadata.DeviceMetadata
- func GetDevicesStatus(devices []client.Device) map[string]float64
- func GetDevicesTags(namespace string, devices []client.Device) map[string][]string
- func GetDevicesUptime(devices []client.Device) map[string]float64
- func GetIPAddressesMetadata(namespace string, interfaces []CiscoInterface) []devicemetadata.IPAddressMetadata
- func GetInterfacesMetadata(namespace string, interfaces []CiscoInterface) ([]devicemetadata.InterfaceMetadata, map[string]CiscoInterface)
- type CEdgeInterface
- func (itf *CEdgeInterface) AdminStatus() devicemetadata.IfAdminStatus
- func (itf *CEdgeInterface) GetSpeedMbps() float64
- func (itf *CEdgeInterface) ID() string
- func (itf *CEdgeInterface) IPV4AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
- func (itf *CEdgeInterface) IPV6AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
- func (itf *CEdgeInterface) Index() (int32, error)
- func (itf *CEdgeInterface) Metadata(namespace string) (devicemetadata.InterfaceMetadata, error)
- func (itf *CEdgeInterface) OperStatus() devicemetadata.IfOperStatus
- type CiscoInterface
- type VEdgeInterface
- func (itf *VEdgeInterface) AdminStatus() devicemetadata.IfAdminStatus
- func (itf *VEdgeInterface) GetSpeedMbps() float64
- func (itf *VEdgeInterface) ID() string
- func (itf *VEdgeInterface) IPV4AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
- func (itf *VEdgeInterface) IPV6AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
- func (itf *VEdgeInterface) Index() (int32, error)
- func (itf *VEdgeInterface) Metadata(namespace string) (devicemetadata.InterfaceMetadata, error)
- func (itf *VEdgeInterface) OperStatus() devicemetadata.IfOperStatus
Constants ¶
const DeviceUserTagResourcePrefix = "dd.internal.resource:ndm_device_user_tags"
DeviceUserTagResourcePrefix contains the REDAPL table to store device user tags
Variables ¶
var TimeNow = time.Now
TimeNow useful for mocking
Functions ¶
func GetDevicesMetadata ¶
func GetDevicesMetadata(namespace string, devices []client.Device) []devicemetadata.DeviceMetadata
GetDevicesMetadata process devices API payloads to build metadata
func GetDevicesStatus ¶
GetDevicesStatus process devices API payloads to get status
func GetDevicesTags ¶
GetDevicesTags process devices API payloads to build device tags
func GetDevicesUptime ¶
GetDevicesUptime process devices API payloads to compute uptimes
func GetIPAddressesMetadata ¶
func GetIPAddressesMetadata(namespace string, interfaces []CiscoInterface) []devicemetadata.IPAddressMetadata
GetIPAddressesMetadata process interfaces API payloads to build IP addresses metadata
func GetInterfacesMetadata ¶
func GetInterfacesMetadata(namespace string, interfaces []CiscoInterface) ([]devicemetadata.InterfaceMetadata, map[string]CiscoInterface)
GetInterfacesMetadata process interfaces API payloads to build interfaces metadata and tags
Types ¶
type CEdgeInterface ¶
type CEdgeInterface struct {
client.CEdgeInterfaceState
}
CEdgeInterface is an implementation of CiscoInterface for cEdge devices
func (*CEdgeInterface) AdminStatus ¶
func (itf *CEdgeInterface) AdminStatus() devicemetadata.IfAdminStatus
AdminStatus returns the interface admin status
func (*CEdgeInterface) GetSpeedMbps ¶
func (itf *CEdgeInterface) GetSpeedMbps() float64
GetSpeedMbps returns the interface speed
func (*CEdgeInterface) ID ¶
func (itf *CEdgeInterface) ID() string
ID returns an unique interface ID
func (*CEdgeInterface) IPV4AddressMetadata ¶
func (itf *CEdgeInterface) IPV4AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
IPV4AddressMetadata returns the metadata for this interface's IPV4 addresses
func (*CEdgeInterface) IPV6AddressMetadata ¶
func (itf *CEdgeInterface) IPV6AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
IPV6AddressMetadata returns the metadata for this interface's IPV6 addresses
func (*CEdgeInterface) Index ¶
func (itf *CEdgeInterface) Index() (int32, error)
Index returns the interface index
func (*CEdgeInterface) Metadata ¶
func (itf *CEdgeInterface) Metadata(namespace string) (devicemetadata.InterfaceMetadata, error)
Metadata returns the interface metadata
func (*CEdgeInterface) OperStatus ¶
func (itf *CEdgeInterface) OperStatus() devicemetadata.IfOperStatus
OperStatus returns the interface oper status
type CiscoInterface ¶
type CiscoInterface interface { // ID returns an unique interface ID ID() string // Index returns the interface index Index() (int32, error) // GetSpeedMbps returns the interface speed in megabits per second GetSpeedMbps() float64 // OperStatus returns the interface oper status OperStatus() devicemetadata.IfOperStatus // AdminStatus returns the interface admin status AdminStatus() devicemetadata.IfAdminStatus // Metadata returns the interface metadata Metadata(namespace string) (devicemetadata.InterfaceMetadata, error) // IPV4AddressMetadata returns the metadata for this interface's IPV4 addresses IPV4AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error) // IPV6AddressMetadata returns the metadata for this interface's IPV6 addresses IPV6AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error) }
CiscoInterface is an interface to abstract the underlying network interface object (vEdge vs cEdge)
func ConvertInterfaces ¶
func ConvertInterfaces(vEdgeInterfaces []client.InterfaceState, cEdgeInterfaces []client.CEdgeInterfaceState) []CiscoInterface
ConvertInterfaces converts API responses to an abstracted interface
type VEdgeInterface ¶
type VEdgeInterface struct {
client.InterfaceState
}
VEdgeInterface is an implementation of CiscoInterface for vEdge devices
func (*VEdgeInterface) AdminStatus ¶
func (itf *VEdgeInterface) AdminStatus() devicemetadata.IfAdminStatus
AdminStatus returns the interface admin
func (*VEdgeInterface) GetSpeedMbps ¶
func (itf *VEdgeInterface) GetSpeedMbps() float64
GetSpeedMbps returns the interface speed
func (*VEdgeInterface) ID ¶
func (itf *VEdgeInterface) ID() string
ID returns an unique interface ID
func (*VEdgeInterface) IPV4AddressMetadata ¶
func (itf *VEdgeInterface) IPV4AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
IPV4AddressMetadata returns the metadata for this interface's IPV4 addresses
func (*VEdgeInterface) IPV6AddressMetadata ¶
func (itf *VEdgeInterface) IPV6AddressMetadata(namespace string) (*devicemetadata.IPAddressMetadata, error)
IPV6AddressMetadata returns the metadata for this interface's IPV6 addresses
func (*VEdgeInterface) Index ¶
func (itf *VEdgeInterface) Index() (int32, error)
Index returns the interface index
func (*VEdgeInterface) Metadata ¶
func (itf *VEdgeInterface) Metadata(namespace string) (devicemetadata.InterfaceMetadata, error)
Metadata returns the interface metadata
func (*VEdgeInterface) OperStatus ¶
func (itf *VEdgeInterface) OperStatus() devicemetadata.IfOperStatus
OperStatus returns the interface oper status