Documentation
¶
Overview ¶
Package openconfig implements provider support for OpenConfig-compliant devices using gNMI (e.g. Nokia SR Linux, Arista EOS).
Index ¶
- Constants
- func NewProvider() provider.Provider
- type AAAAccountingConfig
- type AAAAuthenticationConfig
- type AAAContainer
- type AAAMethodType
- type AAAServer
- type AAAServerConfig
- type AAAServerGroup
- type AAAServerGroupConfig
- type AAAServerGroupType
- type AAAServerTACACS
- type AAAServerTACACSConfig
- type AAAServers
- type ACLEntries
- type ACLEntry
- type ACLEntryActions
- type ACLEntryActionsConfig
- type ACLEntryConfig
- type ACLForwardingAction
- type ACLIPv4
- type ACLIPv4Config
- type ACLIPv6
- type ACLIPv6Config
- type ACLProtocol
- type ACLSet
- type ACLSetConfig
- type ACLType
- type AddressFamily
- type AggregationSwitchedVlan
- type BGP
- type BGPAfiSafi
- type BGPAfiSafiConfig
- type BGPAfiSafiType
- type BGPAfiSafis
- type BGPEbgpMultipath
- type BGPEbgpMultipathConfig
- type BGPGlobal
- type BGPGlobalConfig
- type BGPIbgpMultipath
- type BGPIbgpMultipathConfig
- type BGPNeighbor
- type BGPNeighborAfiSafi
- type BGPNeighborAfiSafiConfig
- type BGPNeighborAfiSafis
- type BGPNeighborApplyPolicy
- type BGPNeighborApplyPolicyConfig
- type BGPNeighborConfig
- type BGPNeighborState
- type BGPNeighborTransport
- type BGPNeighborTransportConfig
- type BGPPeerGroup
- type BGPPeerGroupConfig
- type BGPProtocol
- type BGPProtocolConfig
- type BGPSessionState
- type BGPUseMultiplePaths
- type Banner
- type BannerType
- type ChassisComponentState
- type DNS
- type DNSConfig
- type DNSServer
- type DNSServerConfig
- type DNSServers
- type EthernetFECMode
- type EthernetSpeed
- type EthernetSwitchedVlan
- type GRPCServer
- type IPv4Address
- type IPv4AddressConfig
- type IPv4AddressType
- type IPv4Addresses
- type IPv4Unnumbered
- type IPv6Address
- type IPv6AddressConfig
- type IPv6AddressType
- type IPv6Addresses
- type ISIS
- type ISISAf
- type ISISAfConfig
- type ISISAfiName
- type ISISAfiSafi
- type ISISGlobal
- type ISISGlobalConfig
- type ISISInterface
- type ISISInterfaceConfig
- type ISISLevelCapability
- type ISISLspBit
- type ISISOverloadBit
- type ISISOverloadBitConfig
- type ISISProtocol
- type ISISProtocolConfig
- type ISISSafiName
- type Interface
- type InterfaceAggregation
- type InterfaceAggregationConfig
- type InterfaceConfig
- type InterfaceEthernet
- type InterfaceEthernetConfig
- type InterfaceIPv4
- type InterfaceIPv4Config
- type InterfaceIPv6
- type InterfaceIPv6Config
- type InterfaceOperState
- type InterfaceOperStatus
- type InterfaceTPID
- type InterfaceType
- type LLDPConfig
- type LLDPInterfaceConfig
- type LLDPState
- type LagType
- type MatchSetOption
- type NTP
- type NTPConfig
- type NTPServer
- type NTPServerConfig
- type NTPServers
- type NetworkInstance
- type NetworkInstanceConfig
- type NetworkInstanceType
- type PhysicalEthernetState
- type PhysicalInterfaceEntry
- type PhysicalInterfaceEthernet
- type PhysicalInterfaceState
- type PhysicalInterfaces
- type PolicyDefinition
- type PolicyDefinitionConfig
- type PolicyMatchPrefixSet
- type PolicyMatchPrefixSetConfig
- type PolicyResult
- type PolicyStatementActions
- type PolicyStatementActionsConfig
- type PolicyStatementConditions
- type PolicyStatementConfig
- type PolicyStatementElement
- type PolicyStatements
- type PolicyType
- type PrefixSetConfig
- type PrefixSetElement
- type PrefixSetPrefix
- type PrefixSetPrefixConfig
- type PrefixSetPrefixes
- type Provider
- func (p *Provider) Connect(ctx context.Context, conn *deviceutil.Connection) (err error)
- func (p *Provider) DeleteAAA(ctx context.Context, req *provider.DeleteAAARequest) error
- func (p *Provider) DeleteACL(ctx context.Context, req *provider.DeleteACLRequest) error
- func (p *Provider) DeleteBGP(ctx context.Context, req *provider.DeleteBGPRequest) error
- func (p *Provider) DeleteBGPPeer(ctx context.Context, req *provider.DeleteBGPPeerRequest) error
- func (p *Provider) DeleteBanner(ctx context.Context, req *provider.DeleteBannerRequest) error
- func (p *Provider) DeleteDNS(ctx context.Context) error
- func (p *Provider) DeleteISIS(ctx context.Context, req *provider.DeleteISISRequest) error
- func (p *Provider) DeleteInterface(ctx context.Context, req *provider.DeleteInterfaceRequest) error
- func (p *Provider) DeleteLLDP(ctx context.Context) error
- func (p *Provider) DeleteManagementAccess(ctx context.Context, req *provider.DeleteManagementAccessRequest) error
- func (p *Provider) DeleteNTP(ctx context.Context) error
- func (p *Provider) DeletePrefixSet(ctx context.Context, req *provider.DeletePrefixSetRequest) error
- func (p *Provider) DeleteRoutingPolicy(ctx context.Context, req *provider.DeleteRoutingPolicyRequest) error
- func (p *Provider) DeleteSyslog(ctx context.Context) error
- func (p *Provider) DeleteUser(ctx context.Context, req *provider.DeleteUserRequest) error
- func (p *Provider) DeleteVRF(ctx context.Context, req *provider.DeleteVRFRequest) error
- func (p *Provider) Disconnect(_ context.Context, _ *deviceutil.Connection) error
- func (p *Provider) EnsureAAA(ctx context.Context, req *provider.EnsureAAARequest) error
- func (p *Provider) EnsureACL(ctx context.Context, req *provider.ACLRequest) error
- func (p *Provider) EnsureBGP(ctx context.Context, req *provider.EnsureBGPRequest) error
- func (p *Provider) EnsureBGPPeer(ctx context.Context, req *provider.EnsureBGPPeerRequest) error
- func (p *Provider) EnsureBanner(ctx context.Context, req *provider.EnsureBannerRequest) error
- func (p *Provider) EnsureDNS(ctx context.Context, req *provider.EnsureDNSRequest) error
- func (p *Provider) EnsureISIS(ctx context.Context, req *provider.EnsureISISRequest) error
- func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInterfaceRequest) error
- func (p *Provider) EnsureLLDP(ctx context.Context, req *provider.LLDPRequest) error
- func (p *Provider) EnsureManagementAccess(ctx context.Context, req *provider.EnsureManagementAccessRequest) error
- func (p *Provider) EnsureNTP(ctx context.Context, req *provider.EnsureNTPRequest) error
- func (p *Provider) EnsurePrefixSet(ctx context.Context, req *provider.PrefixSetRequest) error
- func (p *Provider) EnsureRoutingPolicy(ctx context.Context, req *provider.EnsureRoutingPolicyRequest) error
- func (p *Provider) EnsureSubinterface(ctx context.Context, req *provider.EnsureInterfaceRequest) error
- func (p *Provider) EnsureSyslog(ctx context.Context, req *provider.EnsureSyslogRequest) error
- func (p *Provider) EnsureUser(ctx context.Context, req *provider.EnsureUserRequest) error
- func (p *Provider) EnsureVRF(ctx context.Context, req *provider.VRFRequest) error
- func (p *Provider) GetDeviceInfo(ctx context.Context) (*provider.DeviceInfo, error)
- func (p *Provider) GetInterfaceStatus(ctx context.Context, req *provider.InterfaceRequest) (provider.InterfaceStatus, error)
- func (p *Provider) GetLLDPStatus(ctx context.Context, _ *provider.LLDPRequest) (provider.LLDPStatus, error)
- func (p *Provider) GetLastRebootTime(ctx context.Context) (time.Time, error)
- func (p *Provider) GetPeerStatus(ctx context.Context, req *provider.BGPPeerStatusRequest) (provider.BGPPeerStatus, error)
- func (*Provider) InterfaceNameEqual(_ context.Context, a, b string) (bool, error)
- func (p *Provider) ListPorts(ctx context.Context) ([]provider.DevicePort, error)
- func (p *Provider) LoopbackInterfaceName(id int) (string, error)
- type RoutedVlan
- type RoutedVlanConfig
- type SSHServer
- type Subinterface
- type SubinterfaceConfig
- type SubinterfaceEntry
- type SubinterfaceVlan
- type SubinterfaceVlanDoubleTagged
- type SubinterfaceVlanDoubleTaggedConfig
- type SubinterfaceVlanMatch
- type SubinterfaceVlanSingleTagged
- type SubinterfaceVlanSingleTaggedConfig
- type Subinterfaces
- type SwitchedVlanConfig
- type SwitchportMode
- type SyslogContainer
- type SyslogFacility
- type SyslogRemoteServer
- type SyslogRemoteServerConfig
- type SyslogSelector
- type SyslogSelectorConfig
- type SyslogSelectors
- type SyslogSeverity
- type SystemState
- type TableConnection
- type TableConnectionConfig
- type TrunkVlans
- type UnnumberedInterfaceRef
- type UnnumberedInterfaceRefConfig
- type User
- type UserConfig
Constants ¶
const DefaultNetworkInstance = "default"
DefaultNetworkInstance is the OpenConfig network-instance name for the default VRF.
const MaskLengthRangeExact = "exact"
MaskLengthRangeExact is the mask-length-range value for exact prefix matches.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
NewProvider creates a new OpenConfig provider.
Types ¶
type AAAAccountingConfig ¶
type AAAAccountingConfig struct {
Methods []AAAMethodType `json:"accounting-method"`
}
AAAAccountingConfig targets aaa/accounting/config.
func (*AAAAccountingConfig) XPath ¶
func (*AAAAccountingConfig) XPath() string
type AAAAuthenticationConfig ¶
type AAAAuthenticationConfig struct {
Methods []AAAMethodType `json:"authentication-method"`
}
AAAAuthenticationConfig targets aaa/authentication/config.
func (*AAAAuthenticationConfig) XPath ¶
func (*AAAAuthenticationConfig) XPath() string
type AAAContainer ¶
type AAAContainer struct{}
AAAContainer targets the full AAA container for deletion.
func (*AAAContainer) XPath ¶
func (*AAAContainer) XPath() string
type AAAMethodType ¶
type AAAMethodType string
AAAMethodType represents the AAA authentication/accounting method string.
const ( AAAMethodTypeLocal AAAMethodType = "local" AAAMethodTypeNone AAAMethodType = "none" )
type AAAServer ¶
type AAAServer struct {
Address string `json:"address"`
Config *AAAServerConfig `json:"config,omitempty"`
TACACS *AAAServerTACACS `json:"tacacs,omitempty"`
}
AAAServer represents a single server entry.
type AAAServerConfig ¶
type AAAServerConfig struct {
Address string `json:"address"`
Timeout uint16 `json:"timeout,omitempty"`
}
AAAServerConfig holds the server config.
type AAAServerGroup ¶
type AAAServerGroup struct {
Name string `json:"-"`
Config *AAAServerGroupConfig `json:"config,omitempty"`
Servers *AAAServers `json:"servers,omitempty"`
}
AAAServerGroup targets a server-group entry.
func (*AAAServerGroup) XPath ¶
func (g *AAAServerGroup) XPath() string
type AAAServerGroupConfig ¶
type AAAServerGroupConfig struct {
Name string `json:"name"`
Type AAAServerGroupType `json:"type"`
}
AAAServerGroupConfig holds the server-group config.
type AAAServerGroupType ¶
type AAAServerGroupType string
AAAServerGroupType represents the OpenConfig AAA server group type identity.
const (
AAAServerGroupTypeTACACS AAAServerGroupType = "openconfig-aaa:TACACS"
)
type AAAServerTACACS ¶
type AAAServerTACACS struct {
Config *AAAServerTACACSConfig `json:"config,omitempty"`
}
AAAServerTACACS holds the tacacs container.
type AAAServerTACACSConfig ¶
type AAAServerTACACSConfig struct {
Port uint16 `json:"port,omitempty"`
SecretKey string `json:"secret-key,omitempty"`
}
AAAServerTACACSConfig holds tacacs config. SecretKey is write-only — the device returns an encrypted form that would never match the plaintext, so we exclude it from unmarshal to avoid perpetual diffs.
func (*AAAServerTACACSConfig) UnmarshalJSON ¶
func (c *AAAServerTACACSConfig) UnmarshalJSON(data []byte) error
type AAAServers ¶
AAAServers holds the server list.
type ACLEntries ¶
ACLEntries holds the acl-entry list.
type ACLEntry ¶
type ACLEntry struct {
SequenceID uint32 `json:"sequence-id"`
Config *ACLEntryConfig `json:"config,omitempty"`
IPv4 *ACLIPv4 `json:"ipv4,omitempty"`
IPv6 *ACLIPv6 `json:"ipv6,omitempty"`
Actions *ACLEntryActions `json:"actions,omitempty"`
}
ACLEntry represents a single ACL entry.
type ACLEntryActions ¶
type ACLEntryActions struct {
Config *ACLEntryActionsConfig `json:"config,omitempty"`
}
ACLEntryActions holds the actions for an ACL entry.
type ACLEntryActionsConfig ¶
type ACLEntryActionsConfig struct {
ForwardingAction ACLForwardingAction `json:"forwarding-action"`
}
ACLEntryActionsConfig holds the actions config.
type ACLEntryConfig ¶
type ACLEntryConfig struct {
SequenceID uint32 `json:"sequence-id"`
Description string `json:"description,omitempty"`
}
ACLEntryConfig holds the entry config.
type ACLForwardingAction ¶
type ACLForwardingAction string
ACLForwardingAction represents the OpenConfig ACL forwarding action.
const ( ACLForwardingActionAccept ACLForwardingAction = "openconfig-acl:ACCEPT" ACLForwardingActionDrop ACLForwardingAction = "openconfig-acl:DROP" )
type ACLIPv4 ¶
type ACLIPv4 struct {
Config *ACLIPv4Config `json:"config,omitempty"`
}
ACLIPv4 holds the IPv4 match criteria.
type ACLIPv4Config ¶
type ACLIPv4Config struct {
SourceAddress string `json:"source-address,omitempty"`
DestinationAddress string `json:"destination-address,omitempty"`
Protocol ACLProtocol `json:"protocol,omitempty"`
}
ACLIPv4Config holds IPv4 match config.
type ACLIPv6 ¶
type ACLIPv6 struct {
Config *ACLIPv6Config `json:"config,omitempty"`
}
ACLIPv6 holds the IPv6 match criteria.
type ACLIPv6Config ¶
type ACLIPv6Config struct {
SourceAddress string `json:"source-address,omitempty"`
DestinationAddress string `json:"destination-address,omitempty"`
Protocol ACLProtocol `json:"protocol,omitempty"`
}
ACLIPv6Config holds IPv6 match config.
type ACLProtocol ¶
type ACLProtocol string
ACLProtocol represents an IP protocol number used in ACL entries.
const ( ACLProtocolICMP ACLProtocol = "1" ACLProtocolTCP ACLProtocol = "6" ACLProtocolUDP ACLProtocol = "17" ACLProtocolOSPF ACLProtocol = "89" ACLProtocolPIM ACLProtocol = "103" )
type ACLSet ¶
type ACLSet struct {
Name string `json:"-"`
ACLType ACLType `json:"-"`
Config *ACLSetConfig `json:"config,omitempty"`
Entries *ACLEntries `json:"acl-entries,omitempty"`
}
ACLSet represents an OC acl-set list entry.
type ACLSetConfig ¶
ACLSetConfig holds the acl-set config.
type AddressFamily ¶
type AddressFamily string
AddressFamily represents the OpenConfig address-family identity for table connections.
const ( AddressFamilyIPv4 AddressFamily = "openconfig-types:IPV4" AddressFamilyIPv6 AddressFamily = "openconfig-types:IPV6" )
type AggregationSwitchedVlan ¶
type AggregationSwitchedVlan struct {
Config *SwitchedVlanConfig `json:"config,omitempty"`
}
AggregationSwitchedVlan holds the switched-vlan container for aggregation.
type BGP ¶
type BGP struct {
Global *BGPGlobal `json:"global,omitempty"`
}
BGP holds the bgp container.
type BGPAfiSafi ¶
type BGPAfiSafi struct {
AfiSafiName BGPAfiSafiType `json:"afi-safi-name"`
Config *BGPAfiSafiConfig `json:"config,omitempty"`
UseMultiplePaths *BGPUseMultiplePaths `json:"use-multiple-paths,omitempty"`
}
BGPAfiSafi represents a single afi-safi list entry.
func (*BGPAfiSafi) Key ¶
func (a *BGPAfiSafi) Key() string
type BGPAfiSafiConfig ¶
type BGPAfiSafiConfig struct {
AfiSafiName BGPAfiSafiType `json:"afi-safi-name"`
Enabled bool `json:"enabled"`
}
BGPAfiSafiConfig holds afi-safi/config.
type BGPAfiSafiType ¶
type BGPAfiSafiType string
BGPAfiSafiType represents the OpenConfig BGP AFI-SAFI type identity.
const ( BGPAfiSafiTypeIPv4Unicast BGPAfiSafiType = "openconfig-bgp-types:IPV4_UNICAST" BGPAfiSafiTypeIPv6Unicast BGPAfiSafiType = "openconfig-bgp-types:IPV6_UNICAST" )
type BGPAfiSafis ¶
type BGPAfiSafis struct {
AfiSafi gnmiext.List[string, *BGPAfiSafi] `json:"afi-safi,omitempty"`
}
BGPAfiSafis holds the afi-safis container.
type BGPEbgpMultipath ¶
type BGPEbgpMultipath struct {
Config *BGPEbgpMultipathConfig `json:"config,omitempty"`
}
BGPEbgpMultipath holds use-multiple-paths/ebgp.
type BGPEbgpMultipathConfig ¶
type BGPEbgpMultipathConfig struct {
AllowMultipleAS bool `json:"allow-multiple-as,omitempty"`
MaximumPaths uint32 `json:"maximum-paths,omitempty"`
}
BGPEbgpMultipathConfig holds use-multiple-paths/ebgp/config.
type BGPGlobal ¶
type BGPGlobal struct {
Config *BGPGlobalConfig `json:"config,omitempty"`
AfiSafis *BGPAfiSafis `json:"afi-safis,omitempty"`
}
BGPGlobal holds the bgp/global container.
type BGPGlobalConfig ¶
BGPGlobalConfig holds bgp/global/config.
type BGPIbgpMultipath ¶
type BGPIbgpMultipath struct {
Config *BGPIbgpMultipathConfig `json:"config,omitempty"`
}
BGPIbgpMultipath holds use-multiple-paths/ibgp.
type BGPIbgpMultipathConfig ¶
type BGPIbgpMultipathConfig struct {
MaximumPaths uint32 `json:"maximum-paths,omitempty"`
}
BGPIbgpMultipathConfig holds use-multiple-paths/ibgp/config.
type BGPNeighbor ¶
type BGPNeighbor struct {
NetworkInstance string `json:"-"`
NeighborAddress string `json:"-"`
Config *BGPNeighborConfig `json:"config,omitempty"`
Transport *BGPNeighborTransport `json:"transport,omitempty"`
AfiSafis *BGPNeighborAfiSafis `json:"afi-safis,omitempty"`
}
BGPNeighbor targets a neighbor entry.
func (*BGPNeighbor) XPath ¶
func (n *BGPNeighbor) XPath() string
type BGPNeighborAfiSafi ¶
type BGPNeighborAfiSafi struct {
AfiSafiName BGPAfiSafiType `json:"afi-safi-name"`
Config *BGPNeighborAfiSafiConfig `json:"config,omitempty"`
ApplyPolicy *BGPNeighborApplyPolicy `json:"apply-policy,omitempty"`
}
BGPNeighborAfiSafi represents a per-neighbor afi-safi.
func (*BGPNeighborAfiSafi) Key ¶
func (a *BGPNeighborAfiSafi) Key() string
type BGPNeighborAfiSafiConfig ¶
type BGPNeighborAfiSafiConfig struct {
AfiSafiName BGPAfiSafiType `json:"afi-safi-name"`
Enabled bool `json:"enabled"`
}
BGPNeighborAfiSafiConfig holds per-neighbor afi-safi config.
type BGPNeighborAfiSafis ¶
type BGPNeighborAfiSafis struct {
AfiSafi gnmiext.List[string, *BGPNeighborAfiSafi] `json:"afi-safi,omitempty"`
}
BGPNeighborAfiSafis holds the per-neighbor afi-safis.
type BGPNeighborApplyPolicy ¶
type BGPNeighborApplyPolicy struct {
Config *BGPNeighborApplyPolicyConfig `json:"config,omitempty"`
}
BGPNeighborApplyPolicy holds apply-policy for a neighbor afi-safi.
type BGPNeighborApplyPolicyConfig ¶
type BGPNeighborApplyPolicyConfig struct {
ImportPolicy []string `json:"import-policy,omitempty"`
ExportPolicy []string `json:"export-policy,omitempty"`
}
BGPNeighborApplyPolicyConfig holds apply-policy config.
type BGPNeighborConfig ¶
type BGPNeighborConfig struct {
NeighborAddress string `json:"neighbor-address"`
PeerAS uint32 `json:"peer-as"`
PeerGroup string `json:"peer-group"`
Enabled bool `json:"enabled"`
Description string `json:"description,omitempty"`
LocalAS uint32 `json:"local-as,omitempty"`
}
BGPNeighborConfig holds neighbor config.
type BGPNeighborState ¶
type BGPNeighborState struct {
NetworkInstance string `json:"-"`
NeighborAddress string `json:"-"`
SessionState string `json:"session-state,omitempty"`
LastEstablished time.Time `json:"last-established,omitzero"`
}
BGPNeighborState reads neighbor state for session-state.
func (*BGPNeighborState) XPath ¶
func (s *BGPNeighborState) XPath() string
type BGPNeighborTransport ¶
type BGPNeighborTransport struct {
Config *BGPNeighborTransportConfig `json:"config,omitempty"`
}
BGPNeighborTransport holds transport config.
type BGPNeighborTransportConfig ¶
type BGPNeighborTransportConfig struct {
LocalAddress string `json:"local-address,omitempty"`
}
BGPNeighborTransportConfig holds transport/config.
type BGPPeerGroup ¶
type BGPPeerGroup struct {
NetworkInstance string `json:"-"`
PeerGroupName string `json:"-"`
Config *BGPPeerGroupConfig `json:"config,omitempty"`
}
BGPPeerGroup targets a peer-group entry.
func (*BGPPeerGroup) XPath ¶
func (pg *BGPPeerGroup) XPath() string
type BGPPeerGroupConfig ¶
type BGPPeerGroupConfig struct {
PeerGroupName string `json:"peer-group-name"`
}
BGPPeerGroupConfig holds peer-group config.
type BGPProtocol ¶
type BGPProtocol struct {
NetworkInstance string `json:"-"`
Config *BGPProtocolConfig `json:"config,omitempty"`
BGP *BGP `json:"bgp,omitempty"`
}
BGPProtocol represents the OC protocol[identifier=BGP] list entry.
func (*BGPProtocol) XPath ¶
func (b *BGPProtocol) XPath() string
type BGPProtocolConfig ¶
type BGPProtocolConfig struct {
Identifier PolicyType `json:"identifier"`
Name string `json:"name"`
}
BGPProtocolConfig holds the config for the protocol list entry.
type BGPSessionState ¶
type BGPSessionState string
BGPSessionState represents the OpenConfig BGP session state.
const ( BGPSessionStateIdle BGPSessionState = "IDLE" BGPSessionStateConnect BGPSessionState = "CONNECT" BGPSessionStateActive BGPSessionState = "ACTIVE" BGPSessionStateOpenSent BGPSessionState = "OPENSENT" BGPSessionStateOpenConfirm BGPSessionState = "OPENCONFIRM" BGPSessionStateEstablished BGPSessionState = "ESTABLISHED" )
type BGPUseMultiplePaths ¶
type BGPUseMultiplePaths struct {
Ebgp *BGPEbgpMultipath `json:"ebgp,omitempty"`
Ibgp *BGPIbgpMultipath `json:"ibgp,omitempty"`
}
BGPUseMultiplePaths holds the use-multiple-paths container.
type Banner ¶
type Banner struct {
// Type is used only for XPath construction.
Type BannerType `json:"-"`
Message string `json:"-"`
}
Banner targets a single banner leaf in the system config.
func (*Banner) MarshalJSON ¶
func (*Banner) UnmarshalJSON ¶
type BannerType ¶
type BannerType string
BannerType represents the OpenConfig banner leaf type.
const ( BannerTypeLogin BannerType = "login-banner" BannerTypeMOTD BannerType = "motd-banner" )
type ChassisComponentState ¶
type ChassisComponentState struct {
MfgName string `json:"mfg-name,omitempty"`
ModelName string `json:"model-name,omitempty"`
SerialNo string `json:"serial-no,omitempty"`
}
ChassisComponentState maps the openconfig platform Chassis component state.
func (*ChassisComponentState) XPath ¶
func (*ChassisComponentState) XPath() string
type DNS ¶
type DNS struct {
Config *DNSConfig `json:"config,omitempty"`
Servers *DNSServers `json:"servers,omitempty"`
}
DNS represents the OpenConfig /system/dns container.
type DNSConfig ¶
type DNSConfig struct {
Search []string `json:"search,omitempty"`
}
DNSConfig holds the config container for DNS.
type DNSServer ¶
type DNSServer struct {
Address string `json:"address"`
Config *DNSServerConfig `json:"config,omitempty"`
}
DNSServer represents a single DNS server entry.
type DNSServerConfig ¶
type DNSServerConfig struct {
Address string `json:"address"`
}
DNSServerConfig holds the config container for a DNS server.
type DNSServers ¶
DNSServers holds the servers container for DNS.
type EthernetFECMode ¶
type EthernetFECMode string
EthernetFECMode represents the forward error correction mode.
const ( EthernetFECModeFC EthernetFECMode = "FEC_FC" EthernetFECModeRS528 EthernetFECMode = "FEC_RS528" EthernetFECModeDisabled EthernetFECMode = "FEC_DISABLED" )
type EthernetSpeed ¶
type EthernetSpeed string
EthernetSpeed represents the YANG identity for ethernet port speed.
const ( EthernetSpeed10MB EthernetSpeed = "openconfig-if-ethernet:SPEED_10MB" EthernetSpeed100MB EthernetSpeed = "openconfig-if-ethernet:SPEED_100MB" EthernetSpeed1GB EthernetSpeed = "openconfig-if-ethernet:SPEED_1GB" EthernetSpeed2500MB EthernetSpeed = "openconfig-if-ethernet:SPEED_2500MB" EthernetSpeed5GB EthernetSpeed = "openconfig-if-ethernet:SPEED_5GB" EthernetSpeed10GB EthernetSpeed = "openconfig-if-ethernet:SPEED_10GB" EthernetSpeed25GB EthernetSpeed = "openconfig-if-ethernet:SPEED_25GB" EthernetSpeed40GB EthernetSpeed = "openconfig-if-ethernet:SPEED_40GB" EthernetSpeed50GB EthernetSpeed = "openconfig-if-ethernet:SPEED_50GB" EthernetSpeed100GB EthernetSpeed = "openconfig-if-ethernet:SPEED_100GB" EthernetSpeed200GB EthernetSpeed = "openconfig-if-ethernet:SPEED_200GB" EthernetSpeed400GB EthernetSpeed = "openconfig-if-ethernet:SPEED_400GB" EthernetSpeed600GB EthernetSpeed = "openconfig-if-ethernet:SPEED_600GB" EthernetSpeed800GB EthernetSpeed = "openconfig-if-ethernet:SPEED_800GB" EthernetSpeed1600GB EthernetSpeed = "openconfig-if-ethernet:SPEED_1600GB" EthernetSpeedUnknown EthernetSpeed = "openconfig-if-ethernet:SPEED_UNKNOWN" )
func (EthernetSpeed) Short ¶
func (s EthernetSpeed) Short() string
Short returns the speed without the module prefix (e.g. "25GB").
type EthernetSwitchedVlan ¶
type EthernetSwitchedVlan struct {
Config *SwitchedVlanConfig `json:"config,omitempty"`
}
EthernetSwitchedVlan holds the switched-vlan container for Ethernet.
type GRPCServer ¶
type GRPCServer struct {
Name string `json:"name"`
Enable bool `json:"enable"`
Port int32 `json:"port"`
CertificateID string `json:"certificate-id,omitempty"`
NetworkInstance string `json:"network-instance,omitempty"`
}
GRPCServer targets the OpenConfig grpc-server list item config container.
func (*GRPCServer) XPath ¶
func (g *GRPCServer) XPath() string
type IPv4Address ¶
type IPv4Address struct {
IP string `json:"ip"`
Config *IPv4AddressConfig `json:"config,omitempty"`
}
IPv4Address represents a single IPv4 address entry.
func (*IPv4Address) Key ¶
func (a *IPv4Address) Key() string
type IPv4AddressConfig ¶
type IPv4AddressConfig struct {
IP string `json:"ip"`
PrefixLength uint8 `json:"prefix-length"`
Type IPv4AddressType `json:"type,omitempty"`
}
IPv4AddressConfig holds the config for a single IPv4 address.
type IPv4AddressType ¶
type IPv4AddressType string
IPv4AddressType represents the type of an IPv4 address.
const ( IPv4AddressTypePrimary IPv4AddressType = "PRIMARY" IPv4AddressTypeSecondary IPv4AddressType = "SECONDARY" )
type IPv4Addresses ¶
type IPv4Addresses struct {
Address gnmiext.List[string, *IPv4Address] `json:"address,omitempty"`
}
IPv4Addresses holds the IPv4 address list container.
type IPv4Unnumbered ¶
type IPv4Unnumbered struct {
InterfaceRef *UnnumberedInterfaceRef `json:"interface-ref,omitempty"`
}
IPv4Unnumbered holds the unnumbered container for IPv4.
type IPv6Address ¶
type IPv6Address struct {
IP string `json:"ip"`
Config *IPv6AddressConfig `json:"config,omitempty"`
}
IPv6Address represents a single IPv6 address entry.
func (*IPv6Address) Key ¶
func (a *IPv6Address) Key() string
type IPv6AddressConfig ¶
type IPv6AddressConfig struct {
IP string `json:"ip"`
PrefixLength uint8 `json:"prefix-length"`
Type IPv6AddressType `json:"type,omitempty"`
}
IPv6AddressConfig holds the config for a single IPv6 address.
type IPv6AddressType ¶
type IPv6AddressType string
IPv6AddressType represents the type of an IPv6 address. Unlike IPv4, IPv6 has no primary/secondary addresses. Only global unicast is ever configured here: link-local addresses are rejected by the webhook in favour of spec.ipv6.useLinkLocalOnly, which this provider does not support.
const (
IPv6AddressTypeGlobalUnicast IPv6AddressType = "GLOBAL_UNICAST"
)
type IPv6Addresses ¶
type IPv6Addresses struct {
Address gnmiext.List[string, *IPv6Address] `json:"address,omitempty"`
}
IPv6Addresses holds the IPv6 address list container.
type ISIS ¶
type ISIS struct {
Global *ISISGlobal `json:"global,omitempty"`
}
ISIS holds the isis container.
type ISISAf ¶
type ISISAf struct {
AfiName ISISAfiName `json:"afi-name"`
SafiName ISISSafiName `json:"safi-name"`
Config *ISISAfConfig `json:"config,omitempty"`
}
ISISAf represents an ISIS afi-safi entry.
type ISISAfConfig ¶
type ISISAfConfig struct {
AfiName ISISAfiName `json:"afi-name"`
SafiName ISISSafiName `json:"safi-name"`
Enabled bool `json:"enabled"`
}
ISISAfConfig holds isis af config.
type ISISAfiName ¶
type ISISAfiName string
ISISAfiName represents the ISIS address family identifier.
const ( ISISAfiNameIPv4 ISISAfiName = "openconfig-isis-types:IPV4" ISISAfiNameIPv6 ISISAfiName = "openconfig-isis-types:IPV6" )
type ISISAfiSafi ¶
ISISAfiSafi holds isis/global/afi-safi.
type ISISGlobal ¶
type ISISGlobal struct {
Config *ISISGlobalConfig `json:"config,omitempty"`
AfiSafi *ISISAfiSafi `json:"afi-safi,omitempty"`
LspBit *ISISLspBit `json:"lsp-bit,omitempty"`
}
ISISGlobal holds isis/global.
type ISISGlobalConfig ¶
type ISISGlobalConfig struct {
LevelCapability ISISLevelCapability `json:"level-capability"`
Net []string `json:"net"`
}
ISISGlobalConfig holds isis/global/config.
type ISISInterface ¶
type ISISInterface struct {
NetworkInstance string `json:"-"`
ProtocolName string `json:"-"`
InterfaceID string `json:"-"`
Config *ISISInterfaceConfig `json:"config,omitempty"`
}
ISISInterface targets an ISIS interface config.
func (*ISISInterface) XPath ¶
func (i *ISISInterface) XPath() string
type ISISInterfaceConfig ¶
type ISISInterfaceConfig struct {
InterfaceID string `json:"interface-id"`
Enabled bool `json:"enabled"`
}
ISISInterfaceConfig holds the per-interface config.
type ISISLevelCapability ¶
type ISISLevelCapability string
ISISLevelCapability represents the ISIS level capability identity.
const ( ISISLevelCapabilityLevel1 ISISLevelCapability = "LEVEL_1" ISISLevelCapabilityLevel2 ISISLevelCapability = "LEVEL_2" ISISLevelCapabilityLevel1_2 ISISLevelCapability = "LEVEL_1_2" )
type ISISLspBit ¶
type ISISLspBit struct {
OverloadBit *ISISOverloadBit `json:"overload-bit,omitempty"`
}
ISISLspBit holds isis/global/lsp-bit.
type ISISOverloadBit ¶
type ISISOverloadBit struct {
Config *ISISOverloadBitConfig `json:"config,omitempty"`
}
ISISOverloadBit holds overload-bit container.
type ISISOverloadBitConfig ¶
type ISISOverloadBitConfig struct {
SetBit bool `json:"set-bit"`
}
ISISOverloadBitConfig holds overload-bit/config.
type ISISProtocol ¶
type ISISProtocol struct {
NetworkInstance string `json:"-"`
Name string `json:"-"`
Config *ISISProtocolConfig `json:"config,omitempty"`
ISIS *ISIS `json:"isis,omitempty"`
}
ISISProtocol represents the OC protocol[identifier=ISIS] entry.
func (*ISISProtocol) XPath ¶
func (i *ISISProtocol) XPath() string
type ISISProtocolConfig ¶
type ISISProtocolConfig struct {
Identifier PolicyType `json:"identifier"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
}
ISISProtocolConfig holds the protocol config.
type ISISSafiName ¶
type ISISSafiName string
ISISSafiName represents the ISIS sub-address family identifier.
const (
ISISSafiNameUnicast ISISSafiName = "openconfig-isis-types:UNICAST"
)
type Interface ¶
type Interface struct {
Name string `json:"-"`
Config *InterfaceConfig `json:"config,omitempty"`
Subinterfaces *Subinterfaces `json:"subinterfaces,omitempty"`
Ethernet *InterfaceEthernet `json:"openconfig-if-ethernet:ethernet,omitempty"`
Aggregation *InterfaceAggregation `json:"openconfig-if-aggregate:aggregation,omitempty"`
RoutedVlan *RoutedVlan `json:"openconfig-vlan:routed-vlan,omitempty"`
}
Interface represents an OpenConfig interface list entry.
func (*Interface) SetSwitchport ¶
func (i *Interface) SetSwitchport(sp *v1alpha1.Switchport, ifType v1alpha1.InterfaceType) error
type InterfaceAggregation ¶
type InterfaceAggregation struct {
Config *InterfaceAggregationConfig `json:"config,omitempty"`
SwitchedVlan *AggregationSwitchedVlan `json:"openconfig-vlan:switched-vlan,omitempty"`
}
InterfaceAggregation holds the openconfig-if-aggregate augmentation.
type InterfaceAggregationConfig ¶
type InterfaceAggregationConfig struct {
LagType LagType `json:"lag-type,omitempty"`
MinLinks *uint16 `json:"min-links,omitempty"`
}
InterfaceAggregationConfig holds the config container for aggregation.
type InterfaceConfig ¶
type InterfaceConfig struct {
Name string `json:"name"`
Type InterfaceType `json:"type"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
MTU uint16 `json:"mtu,omitempty"`
TPID InterfaceTPID `json:"tpid,omitempty"`
}
InterfaceConfig holds the config container for an interface.
type InterfaceEthernet ¶
type InterfaceEthernet struct {
Config *InterfaceEthernetConfig `json:"config,omitempty"`
SwitchedVlan *EthernetSwitchedVlan `json:"openconfig-vlan:switched-vlan,omitempty"`
}
InterfaceEthernet holds the openconfig-if-ethernet augmentation.
type InterfaceEthernetConfig ¶
type InterfaceEthernetConfig struct {
FECMode EthernetFECMode `json:"fec-mode,omitempty"`
AggregateID string `json:"openconfig-if-aggregate:aggregate-id,omitempty"`
}
InterfaceEthernetConfig holds the config container for Ethernet.
type InterfaceIPv4 ¶
type InterfaceIPv4 struct {
Addresses *IPv4Addresses `json:"addresses,omitempty"`
Unnumbered *IPv4Unnumbered `json:"unnumbered,omitempty"`
Config *InterfaceIPv4Config `json:"config,omitempty"`
}
InterfaceIPv4 holds the IPv4 container for a subinterface.
type InterfaceIPv4Config ¶
type InterfaceIPv4Config struct {
Enabled bool `json:"enabled"`
}
InterfaceIPv4Config holds the config container for IPv4.
type InterfaceIPv6 ¶
type InterfaceIPv6 struct {
Addresses *IPv6Addresses `json:"addresses"`
Config *InterfaceIPv6Config `json:"config"`
}
InterfaceIPv6 holds the IPv6 container of a subinterface.
type InterfaceIPv6Config ¶
type InterfaceIPv6Config struct {
Enabled bool `json:"enabled"`
}
InterfaceIPv6Config holds the config container for IPv6.
type InterfaceOperState ¶
type InterfaceOperState struct {
Name string `json:"-"`
OperStatus InterfaceOperStatus `json:"oper-status,omitempty"`
}
InterfaceOperState retrieves the operational state of an interface.
func (*InterfaceOperState) XPath ¶
func (s *InterfaceOperState) XPath() string
type InterfaceOperStatus ¶
type InterfaceOperStatus string
InterfaceOperStatus represents the operational state of an interface.
const ( InterfaceOperStatusUp InterfaceOperStatus = "UP" InterfaceOperStatusDown InterfaceOperStatus = "DOWN" InterfaceOperStatusTesting InterfaceOperStatus = "TESTING" InterfaceOperStatusUnknown InterfaceOperStatus = "UNKNOWN" InterfaceOperStatusDormant InterfaceOperStatus = "DORMANT" InterfaceOperStatusNotPresent InterfaceOperStatus = "NOT_PRESENT" InterfaceOperStatusLowerLayerDown InterfaceOperStatus = "LOWER_LAYER_DOWN" )
type InterfaceTPID ¶
type InterfaceTPID string
InterfaceTPID represents the tag protocol identifier.
const (
InterfaceTPIDDot1Q InterfaceTPID = "TPID_0X8100"
)
type InterfaceType ¶
type InterfaceType string
InterfaceType represents the YANG identity for the interface type.
const ( InterfaceTypeEthernetCsmacd InterfaceType = "iana-if-type:ethernetCsmacd" InterfaceTypeSoftwareLoopback InterfaceType = "iana-if-type:softwareLoopback" InterfaceTypeIEEE8023adLag InterfaceType = "iana-if-type:ieee8023adLag" InterfaceTypeL3IPVlan InterfaceType = "iana-if-type:l3ipvlan" )
type LLDPConfig ¶
type LLDPConfig struct {
Enabled bool `json:"enabled"`
}
LLDPConfig targets openconfig-lldp:lldp/config.
func (*LLDPConfig) XPath ¶
func (*LLDPConfig) XPath() string
type LLDPInterfaceConfig ¶
LLDPInterfaceConfig targets a per-interface LLDP config.
func (*LLDPInterfaceConfig) XPath ¶
func (l *LLDPInterfaceConfig) XPath() string
type LLDPState ¶
type LLDPState struct {
Enabled bool `json:"enabled"`
}
LLDPState reads lldp/state for oper status.
type LagType ¶
type LagType string
LagType represents the OpenConfig LAG type identity.
const (
LagTypeLACP LagType = "LACP"
)
type MatchSetOption ¶
type MatchSetOption string
MatchSetOption represents the match-set-options identity.
const (
MatchSetOptionAny MatchSetOption = "ANY"
)
type NTP ¶
type NTP struct {
Config *NTPConfig `json:"config"`
Servers *NTPServers `json:"servers"`
}
DNS represents the OpenConfig /system/ntp container.
type NTPConfig ¶
type NTPConfig struct {
Enabled bool `json:"enabled"`
}
NTPConfig holds the config container for NTP.
type NTPServer ¶
type NTPServer struct {
Address string `json:"address"`
Config *NTPServerConfig `json:"config"`
}
NTPServer represents a single NTP server entry.
type NTPServerConfig ¶
type NTPServerConfig struct {
Address string `json:"address"`
Prefer bool `json:"prefer"`
NetworkInstance string `json:"network-instance,omitempty"` // Maps to VrfName
SourceAddress string `json:"source-address,omitempty"`
}
NTPServerConfig holds the config container for a NTP server.
type NTPServers ¶
NTPServers holds the servers container for NTP.
type NetworkInstance ¶
type NetworkInstance struct {
Name string `json:"-"`
Config *NetworkInstanceConfig `json:"config,omitempty"`
}
NetworkInstance represents an OC network-instance list entry.
func (*NetworkInstance) XPath ¶
func (ni *NetworkInstance) XPath() string
type NetworkInstanceConfig ¶
type NetworkInstanceConfig struct {
Name string `json:"name"`
Type NetworkInstanceType `json:"type"`
Description string `json:"description,omitempty"`
}
NetworkInstanceConfig holds config for a network-instance.
type NetworkInstanceType ¶
type NetworkInstanceType string
NetworkInstanceType represents the OpenConfig network-instance type identity.
const ( NetworkInstanceTypeL3VRF NetworkInstanceType = "openconfig-network-instance-types:L3VRF" NetworkInstanceTypeDefaultInstance NetworkInstanceType = "openconfig-network-instance-types:DEFAULT_INSTANCE" )
type PhysicalEthernetState ¶
type PhysicalEthernetState struct {
PortSpeed EthernetSpeed `json:"port-speed,omitempty"`
}
PhysicalEthernetState holds ethernet state fields.
type PhysicalInterfaceEntry ¶
type PhysicalInterfaceEntry struct {
Name string `json:"name"`
State *PhysicalInterfaceState `json:"state,omitempty"`
Ethernet *PhysicalInterfaceEthernet `json:"openconfig-if-ethernet:ethernet,omitempty"`
}
PhysicalInterfaceEntry represents a single interface for port listing.
func (*PhysicalInterfaceEntry) PortSpeed ¶
func (e *PhysicalInterfaceEntry) PortSpeed() EthernetSpeed
PortSpeed returns the ethernet port speed, or EthernetSpeedUnknown if unavailable.
type PhysicalInterfaceEthernet ¶
type PhysicalInterfaceEthernet struct {
State *PhysicalEthernetState `json:"state,omitempty"`
}
PhysicalInterfaceEthernet holds ethernet state for port speed discovery.
type PhysicalInterfaceState ¶
type PhysicalInterfaceState struct {
Type InterfaceType `json:"type,omitempty"`
}
PhysicalInterfaceState holds the state container for port discovery.
type PhysicalInterfaces ¶
type PhysicalInterfaces struct {
Interface []*PhysicalInterfaceEntry `json:"interface,omitempty"`
}
PhysicalInterfaces retrieves the interface list for port discovery.
func (*PhysicalInterfaces) XPath ¶
func (*PhysicalInterfaces) XPath() string
type PolicyDefinition ¶
type PolicyDefinition struct {
Name string `json:"-"`
Config *PolicyDefinitionConfig `json:"config,omitempty"`
Statements *PolicyStatements `json:"statements,omitempty"`
}
PolicyDefinition targets a policy-definition entry.
func (*PolicyDefinition) XPath ¶
func (pd *PolicyDefinition) XPath() string
type PolicyDefinitionConfig ¶
type PolicyDefinitionConfig struct {
Name string `json:"name"`
}
PolicyDefinitionConfig holds policy-definition/config.
type PolicyMatchPrefixSet ¶
type PolicyMatchPrefixSet struct {
Config *PolicyMatchPrefixSetConfig `json:"config,omitempty"`
}
PolicyMatchPrefixSet holds match-prefix-set.
type PolicyMatchPrefixSetConfig ¶
type PolicyMatchPrefixSetConfig struct {
PrefixSet string `json:"prefix-set"`
MatchSetOptions MatchSetOption `json:"match-set-options"`
}
PolicyMatchPrefixSetConfig holds match-prefix-set config.
type PolicyResult ¶
type PolicyResult string
PolicyResult represents the OpenConfig routing policy result action.
const ( PolicyResultAcceptRoute PolicyResult = "ACCEPT_ROUTE" PolicyResultRejectRoute PolicyResult = "REJECT_ROUTE" )
type PolicyStatementActions ¶
type PolicyStatementActions struct {
Config *PolicyStatementActionsConfig `json:"config,omitempty"`
}
PolicyStatementActions holds statement actions.
type PolicyStatementActionsConfig ¶
type PolicyStatementActionsConfig struct {
PolicyResult PolicyResult `json:"policy-result"`
}
PolicyStatementActionsConfig holds actions config.
type PolicyStatementConditions ¶
type PolicyStatementConditions struct {
MatchPrefixSet *PolicyMatchPrefixSet `json:"match-prefix-set,omitempty"`
}
PolicyStatementConditions holds statement conditions.
type PolicyStatementConfig ¶
type PolicyStatementConfig struct {
Name string `json:"name"`
}
PolicyStatementConfig holds statement config.
type PolicyStatementElement ¶
type PolicyStatementElement struct {
Name string `json:"name"`
Config *PolicyStatementConfig `json:"config,omitempty"`
Conditions *PolicyStatementConditions `json:"conditions,omitempty"`
Actions *PolicyStatementActions `json:"actions,omitempty"`
}
PolicyStatementElement represents a single statement.
func (*PolicyStatementElement) Key ¶
func (s *PolicyStatementElement) Key() string
type PolicyStatements ¶
type PolicyStatements struct {
Statement gnmiext.List[string, *PolicyStatementElement] `json:"statement,omitempty"`
}
PolicyStatements holds the statement list.
type PolicyType ¶
type PolicyType string
PolicyType represents the OpenConfig policy-types protocol identity.
const ( PolicyTypeBGP PolicyType = "openconfig-policy-types:BGP" PolicyTypeISIS PolicyType = "openconfig-policy-types:ISIS" PolicyTypeDirectlyConnected PolicyType = "openconfig-policy-types:DIRECTLY_CONNECTED" )
type PrefixSetConfig ¶
type PrefixSetConfig struct {
Name string `json:"name"`
}
PrefixSetConfig holds the prefix-set config.
type PrefixSetElement ¶
type PrefixSetElement struct {
Name string `json:"-"`
Config *PrefixSetConfig `json:"config,omitempty"`
Prefixes *PrefixSetPrefixes `json:"prefixes,omitempty"`
}
PrefixSetElement targets a prefix-set entry.
func (*PrefixSetElement) XPath ¶
func (ps *PrefixSetElement) XPath() string
type PrefixSetPrefix ¶
type PrefixSetPrefix struct {
IPPrefix string `json:"ip-prefix"`
MaskLenRange string `json:"masklength-range"`
Config *PrefixSetPrefixConfig `json:"config,omitempty"`
}
PrefixSetPrefix represents a single prefix entry.
func (*PrefixSetPrefix) Key ¶
func (p *PrefixSetPrefix) Key() string
type PrefixSetPrefixConfig ¶
type PrefixSetPrefixConfig struct {
IPPrefix string `json:"ip-prefix"`
MaskLenRange string `json:"masklength-range"`
}
PrefixSetPrefixConfig holds prefix config.
type PrefixSetPrefixes ¶
type PrefixSetPrefixes struct {
Prefix gnmiext.List[string, *PrefixSetPrefix] `json:"prefix,omitempty"`
}
PrefixSetPrefixes holds the prefix list.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the OpenConfig provider using gnmiext.Client.
func (*Provider) Connect ¶
func (p *Provider) Connect(ctx context.Context, conn *deviceutil.Connection) (err error)
Connect establishes a gRPC connection and negotiates gNMI capabilities.
func (*Provider) DeleteBGPPeer ¶
func (*Provider) DeleteBanner ¶
func (*Provider) DeleteISIS ¶
func (*Provider) DeleteInterface ¶
func (*Provider) DeleteManagementAccess ¶
func (*Provider) DeletePrefixSet ¶
func (*Provider) DeleteRoutingPolicy ¶
func (*Provider) DeleteUser ¶
func (*Provider) Disconnect ¶
func (p *Provider) Disconnect(_ context.Context, _ *deviceutil.Connection) error
Disconnect closes the underlying gRPC connection.
func (*Provider) EnsureBGPPeer ¶
func (*Provider) EnsureBanner ¶
func (*Provider) EnsureISIS ¶
func (*Provider) EnsureInterface ¶
func (*Provider) EnsureLLDP ¶
func (*Provider) EnsureManagementAccess ¶
func (*Provider) EnsurePrefixSet ¶
func (*Provider) EnsureRoutingPolicy ¶
func (*Provider) EnsureSubinterface ¶
func (*Provider) EnsureSyslog ¶
func (*Provider) EnsureUser ¶
func (*Provider) GetDeviceInfo ¶
func (*Provider) GetInterfaceStatus ¶
func (p *Provider) GetInterfaceStatus(ctx context.Context, req *provider.InterfaceRequest) (provider.InterfaceStatus, error)
func (*Provider) GetLLDPStatus ¶
func (p *Provider) GetLLDPStatus(ctx context.Context, _ *provider.LLDPRequest) (provider.LLDPStatus, error)
func (*Provider) GetLastRebootTime ¶
func (*Provider) GetPeerStatus ¶
func (p *Provider) GetPeerStatus(ctx context.Context, req *provider.BGPPeerStatusRequest) (provider.BGPPeerStatus, error)
func (*Provider) InterfaceNameEqual ¶
type RoutedVlan ¶
type RoutedVlan struct {
Config *RoutedVlanConfig `json:"config,omitempty"`
}
RoutedVlan holds the routed-vlan container.
type RoutedVlanConfig ¶
type RoutedVlanConfig struct {
Vlan uint16 `json:"vlan,omitempty"`
}
RoutedVlanConfig holds the config for routed-vlan.
type Subinterface ¶
type Subinterface struct {
Index uint32 `json:"index"`
Config *SubinterfaceConfig `json:"config,omitempty"`
IPv4 *InterfaceIPv4 `json:"openconfig-if-ip:ipv4,omitempty"`
IPv6 *InterfaceIPv6 `json:"openconfig-if-ip:ipv6,omitempty"`
}
Subinterface represents a single subinterface entry.
func (*Subinterface) Key ¶
func (s *Subinterface) Key() uint32
type SubinterfaceConfig ¶
SubinterfaceConfig holds the config container for a subinterface.
type SubinterfaceEntry ¶
type SubinterfaceEntry struct {
ParentName string `json:"-"`
Index uint32 `json:"index"`
Config *SubinterfaceConfig `json:"config,omitempty"`
IPv4 *InterfaceIPv4 `json:"openconfig-if-ip:ipv4,omitempty"`
IPv6 *InterfaceIPv6 `json:"openconfig-if-ip:ipv6,omitempty"`
Vlan *SubinterfaceVlan `json:"openconfig-vlan:vlan,omitempty"`
}
SubinterfaceEntry targets a specific subinterface under a parent interface.
func (*SubinterfaceEntry) XPath ¶
func (s *SubinterfaceEntry) XPath() string
type SubinterfaceVlan ¶
type SubinterfaceVlan struct {
Match *SubinterfaceVlanMatch `json:"match,omitempty"`
}
SubinterfaceVlan holds the VLAN encapsulation for a subinterface.
type SubinterfaceVlanDoubleTagged ¶
type SubinterfaceVlanDoubleTagged struct {
Config *SubinterfaceVlanDoubleTaggedConfig `json:"config,omitempty"`
}
SubinterfaceVlanDoubleTagged holds the double-tag match config.
type SubinterfaceVlanDoubleTaggedConfig ¶
type SubinterfaceVlanDoubleTaggedConfig struct {
InnerVlanID uint16 `json:"inner-vlan-id,omitempty"`
OuterVlanID uint16 `json:"outer-vlan-id,omitempty"`
}
SubinterfaceVlanDoubleTaggedConfig holds inner/outer VLAN IDs for QinQ.
type SubinterfaceVlanMatch ¶
type SubinterfaceVlanMatch struct {
SingleTagged *SubinterfaceVlanSingleTagged `json:"single-tagged,omitempty"`
DoubleTagged *SubinterfaceVlanDoubleTagged `json:"double-tagged,omitempty"`
}
SubinterfaceVlanMatch holds the VLAN match criteria.
type SubinterfaceVlanSingleTagged ¶
type SubinterfaceVlanSingleTagged struct {
Config *SubinterfaceVlanSingleTaggedConfig `json:"config,omitempty"`
}
SubinterfaceVlanSingleTagged holds the single-tagged VLAN match config.
type SubinterfaceVlanSingleTaggedConfig ¶
type SubinterfaceVlanSingleTaggedConfig struct {
VlanID uint16 `json:"vlan-id,omitempty"`
}
SubinterfaceVlanSingleTaggedConfig holds the VLAN ID for single-tagged match.
type Subinterfaces ¶
type Subinterfaces struct {
Subinterface gnmiext.List[uint32, *Subinterface] `json:"subinterface,omitempty"`
}
Subinterfaces holds the subinterface list container.
type SwitchedVlanConfig ¶
type SwitchedVlanConfig struct {
InterfaceMode SwitchportMode `json:"interface-mode,omitempty"`
AccessVlan uint16 `json:"access-vlan,omitempty"`
NativeVlan uint16 `json:"native-vlan,omitempty"`
TrunkVlans []any `json:"trunk-vlans,omitempty"`
}
SwitchedVlanConfig holds the config for switched-vlan.
type SwitchportMode ¶
type SwitchportMode string
SwitchportMode represents the switchport interface mode.
const ( SwitchportModeAccess SwitchportMode = "ACCESS" SwitchportModeTrunk SwitchportMode = "TRUNK" )
type SyslogContainer ¶
type SyslogContainer struct{}
SyslogContainer targets the full logging container for deletion.
func (*SyslogContainer) XPath ¶
func (*SyslogContainer) XPath() string
type SyslogFacility ¶
type SyslogFacility string
SyslogFacility represents the OpenConfig syslog facility identity.
const (
SyslogFacilityAll SyslogFacility = "ALL"
)
type SyslogRemoteServer ¶
type SyslogRemoteServer struct {
Host string `json:"-"`
Config *SyslogRemoteServerConfig `json:"config,omitempty"`
Selectors *SyslogSelectors `json:"selectors,omitempty"`
}
SyslogRemoteServer targets a specific remote-server entry.
func (*SyslogRemoteServer) XPath ¶
func (s *SyslogRemoteServer) XPath() string
type SyslogRemoteServerConfig ¶
type SyslogRemoteServerConfig struct {
Host string `json:"host"`
RemotePort uint16 `json:"remote-port,omitempty"`
}
SyslogRemoteServerConfig holds the remote server config.
type SyslogSelector ¶
type SyslogSelector struct {
Facility SyslogFacility `json:"facility"`
Severity SyslogSeverity `json:"severity"`
Config *SyslogSelectorConfig `json:"config,omitempty"`
}
SyslogSelector represents a facility+severity selector.
func (*SyslogSelector) Key ¶
func (s *SyslogSelector) Key() string
type SyslogSelectorConfig ¶
type SyslogSelectorConfig struct {
Facility SyslogFacility `json:"facility"`
Severity SyslogSeverity `json:"severity"`
}
SyslogSelectorConfig holds selector config.
type SyslogSelectors ¶
type SyslogSelectors struct {
Selector gnmiext.List[string, *SyslogSelector] `json:"selector,omitempty"`
}
SyslogSelectors holds the selector list.
type SyslogSeverity ¶
type SyslogSeverity string
SyslogSeverity represents the OpenConfig syslog severity identity.
const ( SyslogSeverityDebug SyslogSeverity = "DEBUG" SyslogSeverityInformational SyslogSeverity = "INFORMATIONAL" SyslogSeverityNotice SyslogSeverity = "NOTICE" SyslogSeverityWarning SyslogSeverity = "WARNING" SyslogSeverityError SyslogSeverity = "ERROR" SyslogSeverityCritical SyslogSeverity = "CRITICAL" SyslogSeverityAlert SyslogSeverity = "ALERT" SyslogSeverityEmergency SyslogSeverity = "EMERGENCY" )
type SystemState ¶
type SystemState struct {
Hostname string `json:"hostname,omitempty"`
BootTime string `json:"boot-time,omitempty"`
SoftwareVersion string `json:"software-version,omitempty"`
}
SystemState maps the openconfig system state container.
func (*SystemState) XPath ¶
func (*SystemState) XPath() string
type TableConnection ¶
type TableConnection struct {
NetworkInstance string `json:"-"`
SrcProtocol PolicyType `json:"-"`
DstProtocol PolicyType `json:"-"`
AddressFamily AddressFamily `json:"-"`
Config *TableConnectionConfig `json:"config,omitempty"`
}
TableConnection represents a table-connection list entry for route redistribution.
func (*TableConnection) XPath ¶
func (tc *TableConnection) XPath() string
type TableConnectionConfig ¶
type TableConnectionConfig struct {
SrcProtocol PolicyType `json:"src-protocol"`
DstProtocol PolicyType `json:"dst-protocol"`
AddressFamily AddressFamily `json:"address-family"`
ImportPolicy []string `json:"import-policy,omitempty"`
}
TableConnectionConfig holds table-connection/config.
type TrunkVlans ¶
type TrunkVlans struct {
InterfaceName string `json:"-"`
InterfaceType v1alpha1.InterfaceType `json:"-"`
Vlans []any `json:"-"`
}
func (TrunkVlans) MarshalJSON ¶
func (t TrunkVlans) MarshalJSON() ([]byte, error)
func (*TrunkVlans) UnmarshalJSON ¶
func (t *TrunkVlans) UnmarshalJSON(b []byte) error
func (*TrunkVlans) XPath ¶
func (t *TrunkVlans) XPath() string
type UnnumberedInterfaceRef ¶
type UnnumberedInterfaceRef struct {
Config *UnnumberedInterfaceRefConfig `json:"config,omitempty"`
}
UnnumberedInterfaceRef holds the interface-ref container.
type UnnumberedInterfaceRefConfig ¶
type UnnumberedInterfaceRefConfig struct {
Interface string `json:"interface,omitempty"`
}
UnnumberedInterfaceRefConfig holds the config for an unnumbered interface ref.
type User ¶
type User struct {
Username string `json:"-"`
Config *UserConfig `json:"config"`
}
User targets an OpenConfig user entry.
type UserConfig ¶
type UserConfig struct {
Username string `json:"username"`
Role string `json:"role,omitempty"`
PasswordHashed string `json:"password-hashed"`
SSHKey string `json:"ssh-key,omitempty"`
}
UserConfig holds the user config container leaves. PasswordHashed uses the password-hashed field which is stored by the device, enabling idempotent reconciliation.