Documentation
¶
Overview ¶
SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors SPDX-License-Identifier: Apache-2.0
Package nxos implements Cisco NX-OS specific configurations.
SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func Community(c string) (string, error)
- func Exists(ctx context.Context, client gnmiext.Client, names ...string) (bool, error)
- func NewProvider() provider.Provider
- func ParsePasswordSalt(hash string) (salt [10]byte, err error)
- func Range(r []int32) string
- func Reboot(ctx context.Context, conn *grpc.ClientConn) error
- func ResetToFactoryDefaults(ctx context.Context, conn *grpc.ClientConn) error
- func RouteDistinguisher(rd string) (string, error)
- func RouteTarget(rt string) (string, error)
- func ShortName(name string) (string, error)
- func ShortNameLoopback(name string) (string, error)
- func ShortNamePhysicalInterface(name string) (string, error)
- func ShortNamePortChannel(name string) (string, error)
- func ShortNameVLAN(name string) (string, error)
- type ACL
- type ACLEntry
- type AFTYPE
- type ASCIIStr
- type Action
- type AddrDom
- type AddrItem
- type AddrList
- type AddressFamily
- type AdjChangeLogLevel
- type AdjOperSt
- type AdminSt
- type AdminSt2
- type AdminSt3
- type AdminSt4
- type AnycastPeerAddr
- type AnycastPeerItems
- type AsFormat
- type BDEVI
- type BDItems
- type BFD
- type BGP
- type BGPDom
- type BGPDomAfItem
- type BGPDomItems
- type BGPPeer
- type BGPPeerAfItem
- type BGPPeerAfOperItems
- type BGPPeerAfRtCtrlP
- type BGPPeerGroup
- type BGPPeerOperItems
- type BGPPeerOperSt
- type Banner
- type BannerType
- type BdState
- type BootPOAP
- type BootTime
- type BorderGatewayInterconnect
- type BorderGatewayPeer
- type BorderGatewayPeerType
- type BorderGatewaySettingsRequest
- type BwRefUnit
- type Certificate
- type CommItem
- type Console
- type Criteria
- type DHCPRelay
- type DHCPRelayConfig
- type DHCPRelayServer
- type DNS
- type DNSProf
- type DNSProv
- type DNSVrf
- type EncapRoutedInterface
- type EncapRoutedInterfaceOperItems
- type Encoder
- type Encrypt
- type ExtCommItem
- type FabricFwd
- type FabricFwdAnycastMAC
- type FabricFwdIf
- type Feature
- type FecMode
- type FirmwareVersion
- type FwdMode
- type GNMI
- type GRPC
- type HostReachType
- type ICMPIf
- type ISIS
- type ISISAddressFamily
- type ISISDom
- type ISISDomAf
- type ISISInterface
- type ISISLevel
- type InterLeakP
- type InterLeakPKey
- type IntfAddr
- type IntfAddrType
- type KeyPair
- type LLDP
- type LLDPIfItem
- type LLDPOper
- type Layer
- type Loopback
- type LoopbackOperItems
- type MaxLSAAction
- type Medium
- type MessageType
- type Model
- type MultisiteBorderGatewayInterface
- type MultisiteIfTracking
- type MultisiteIfTrackingItems
- type MultisiteIfTrackingMode
- type MultisiteItems
- type MultisitePeer
- type MultisitePeerItems
- type NTP
- type NTPConfig
- type NTPProvider
- type NVE
- type NVEInfraVLAN
- type NVEInfraVLANs
- type NVEOper
- type NtwType
- type OSPF
- type OSPFConfig
- type OSPFDom
- type OSPFIfAdjEpGroup
- type OSPFIfOperItems
- type OSPFInterface
- type OSPFOperItems
- type OperSt
- type Option
- type OspfBfdCtrl
- type PBKDF2
- type PIM
- type PIMDom
- type PIMIf
- type PIMIfItems
- type PassiveControl
- type PeerAsnType
- type PhysIf
- type PhysIfOperItems
- type Plain
- type Port
- type PortChannel
- type PortChannelMember
- type PortChannelMode
- type PortChannelOperItems
- type Ports
- type PrefixEntry
- type PrefixList
- type Protocol
- type ProvType
- type Provider
- func (p *Provider) Connect(ctx context.Context, conn *deviceutil.Connection) (err 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) DeleteCertificate(ctx context.Context, req *provider.DeleteCertificateRequest) error
- func (p *Provider) DeleteDHCPRelay(ctx context.Context, req *provider.DHCPRelayRequest) error
- func (p *Provider) DeleteDNS(ctx context.Context) error
- func (p *Provider) DeleteEVPNInstance(ctx context.Context, req *provider.EVPNInstanceRequest) error
- func (p *Provider) DeleteISIS(ctx context.Context, req *provider.DeleteISISRequest) error
- func (p *Provider) DeleteInterface(ctx context.Context, req *provider.InterfaceRequest) error
- func (p *Provider) DeleteLLDP(ctx context.Context, req *provider.LLDPRequest) error
- func (p *Provider) DeleteManagementAccess(ctx context.Context) error
- func (p *Provider) DeleteNTP(ctx context.Context) error
- func (p *Provider) DeleteNVE(ctx context.Context, req *provider.NVERequest) error
- func (p *Provider) DeleteOSPF(ctx context.Context, req *provider.DeleteOSPFRequest) error
- func (p *Provider) DeletePIM(ctx context.Context, _ *provider.DeletePIMRequest) error
- func (p *Provider) DeletePrefixSet(ctx context.Context, req *provider.PrefixSetRequest) error
- func (p *Provider) DeleteRoutingPolicy(ctx context.Context, req *provider.DeleteRoutingPolicyRequest) error
- func (p *Provider) DeleteSNMP(ctx context.Context, req *provider.DeleteSNMPRequest) error
- func (p *Provider) DeleteSyslog(ctx context.Context) error
- func (p *Provider) DeleteUser(ctx context.Context, req *provider.DeleteUserRequest) error
- func (p *Provider) DeleteVLAN(ctx context.Context, req *provider.VLANRequest) error
- func (p *Provider) DeleteVPCDomain(ctx context.Context) error
- func (p *Provider) DeleteVRF(ctx context.Context, req *provider.VRFRequest) error
- func (p *Provider) Disconnect(_ context.Context, _ *deviceutil.Connection) error
- func (p *Provider) EnsureACL(ctx context.Context, req *provider.EnsureACLRequest) error
- func (p *Provider) EnsureBGP(ctx context.Context, req *provider.EnsureBGPRequest) (reterr error)
- func (p *Provider) EnsureBGPPeer(ctx context.Context, req *provider.EnsureBGPPeerRequest) error
- func (p *Provider) EnsureBanner(ctx context.Context, req *provider.EnsureBannerRequest) (reterr error)
- func (p *Provider) EnsureBorderGatewaySettings(ctx context.Context, req *BorderGatewaySettingsRequest) error
- func (p *Provider) EnsureCertificate(ctx context.Context, req *provider.EnsureCertificateRequest) error
- func (p *Provider) EnsureDHCPRelay(ctx context.Context, req *provider.DHCPRelayRequest) error
- func (p *Provider) EnsureDNS(ctx context.Context, req *provider.EnsureDNSRequest) error
- func (p *Provider) EnsureEVPNInstance(ctx context.Context, req *provider.EVPNInstanceRequest) (err 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) EnsureInterfacesExist(ctx context.Context, interfaces []*v1alpha1.Interface) (names []string, err 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) EnsureNVE(ctx context.Context, req *provider.NVERequest) error
- func (p *Provider) EnsureOSPF(ctx context.Context, req *provider.EnsureOSPFRequest) error
- func (p *Provider) EnsurePIM(ctx context.Context, req *provider.EnsurePIMRequest) 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) EnsureSNMP(ctx context.Context, req *provider.EnsureSNMPRequest) error
- func (p *Provider) EnsureSyslog(ctx context.Context, req *provider.EnsureSyslogRequest) error
- func (p *Provider) EnsureSystemSettings(ctx context.Context, s *nxv1alpha1.System) error
- func (p *Provider) EnsureUser(ctx context.Context, req *provider.EnsureUserRequest) error
- func (p *Provider) EnsureVLAN(ctx context.Context, req *provider.VLANRequest) error
- func (p *Provider) EnsureVPCDomain(ctx context.Context, vpcdomain *nxv1alpha1.VPCDomain, vrf *v1alpha1.VRF, ...) (reterr error)
- func (p *Provider) EnsureVRF(ctx context.Context, req *provider.VRFRequest) error
- func (p *Provider) FactoryReset(ctx context.Context, conn *deviceutil.Connection) error
- func (p *Provider) GetDHCPRelayStatus(ctx context.Context, req *provider.DHCPRelayRequest) (provider.DHCPRelayStatus, 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, req *provider.LLDPRequest) (provider.LLDPStatus, error)
- func (p *Provider) GetLastRebootTime(ctx context.Context) (time.Time, error)
- func (p *Provider) GetNVEStatus(ctx context.Context, req *provider.NVERequest) (provider.NVEStatus, error)
- func (p *Provider) GetOSPFStatus(ctx context.Context, req *provider.OSPFStatusRequest) (provider.OSPFStatus, error)
- func (p *Provider) GetPeerStatus(ctx context.Context, req *provider.BGPPeerStatusRequest) (provider.BGPPeerStatus, error)
- func (p *Provider) GetStatusVPCDomain(ctx context.Context) (VPCDomainStatus, error)
- func (p *Provider) GetVLANStatus(ctx context.Context, req *provider.VLANRequest) (provider.VLANStatus, error)
- func (p *Provider) HashProvisioningPassword(password string) (hashed, encryptType string, err error)
- func (p *Provider) ListPorts(ctx context.Context) ([]provider.DevicePort, error)
- func (p *Provider) Patch(ctx context.Context, patches ...gnmiext.DataElement) error
- func (p *Provider) Reboot(ctx context.Context, conn *deviceutil.Connection) error
- func (p *Provider) Reprovision(ctx context.Context, conn *deviceutil.Connection) (reterr error)
- func (p *Provider) ResetBorderGatewaySettings(ctx context.Context) error
- func (p *Provider) ResetSystemSettings(ctx context.Context) error
- func (p *Provider) Update(ctx context.Context, updates ...gnmiext.DataElement) error
- func (p *Provider) VerifyProvisioned(ctx context.Context, conn *deviceutil.Connection, device *v1alpha1.Device) bool
- type PwdEncryptType
- type PwdHashType
- type RedistributionConfig
- type RouteMap
- type RouteMapEntry
- type RsRtDstAtt
- type RtCtrlDirection
- type RtExtComScope
- type RtLeakProto
- type Rtt
- type RttEntItems
- type RttEntry
- type RttEntryType
- type SNMPCommunity
- type SNMPCommunityItems
- type SNMPHost
- type SNMPHostItems
- type SNMPHostKey
- type SNMPHostVrf
- type SNMPSrcIf
- type SNMPSysInfo
- type SNMPTraps
- type SNMPTrapsItems
- type SNMPUser
- type SVIMedium
- type Scrypt
- type SecLevel
- type SerialNumber
- type SeverityLevel
- type SpanningTree
- type SpanningTreeMode
- type StaticRP
- type StaticRPGrp
- type StaticRPItems
- type StormControlItem
- type StormControlItems
- type StormControlType
- type SwitchVirtualInterface
- type SwitchVirtualInterfaceOperItems
- type SwitchportMode
- type SyslogConfig
- type SyslogFacility
- type SyslogFacilityItems
- type SyslogHistory
- type SyslogOrigin
- type SyslogRemote
- type SyslogRemoteItems
- type SyslogSrcIf
- type SystemJumboMTU
- type Transport
- type Trustpoint
- type UnixTime
- type User
- type UserDomain
- type UserFlags
- type UserRole
- type VLAN
- type VLANOperItems
- type VLANReservation
- type VLANSystem
- type VNI
- type VNIOperItems
- type VNIState
- type VPCDomain
- type VPCDomainOper
- type VPCDomainRole
- type VPCDomainStatus
- type VPCIf
- type VPCIfItems
- type VPNIPv4Address
- type VRF
- type VRFDom
- type VRFDomAf
- type VRFDomAfCtrl
- type VRFDomAfCtrlItems
- type VRFDomAfItems
- type VRFDomItems
- type VRFRttpItems
- type VTY
- type VTYAccessClass
- type VXLAN
- type Version
- type VrfMember
Constants ¶
const ( DefaultVLAN = "vlan-1" DefaultVLANRange = "1-4094" DefaultMTU = 1500 )
const ( DefaultBwRef = 40_000 // 40 Gbps DefaultDist = 110 )
const ( DefaultVRFName = "default" ManagementVRFName = "management" )
const Manufacturer = "Cisco"
const RouteReflectorClient = "rr-client"
Variables ¶
var CiscoEncoding = base64.NewEncoding("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").WithPadding(base64.NoPadding)
CiscoEncoding is the non-standard, not documented alphabet used by Cisco for their base64 encoding.
Taken from: https://github.com/BrettVerney/ciscoPWDhasher/blob/master/CiscoPWDhasher/__init__.py#L8-L11
var ErrInterfaceNotFound = errors.New("one or more interfaces do not exist")
Functions ¶
func NewProvider ¶
func ParsePasswordSalt ¶
func Range ¶
Range provides a string representation of identifiers (typically VLAN IDs) that formats the range in a human-readable way. Consecutive IDs are represented as a range (e.g., "10-12"), while single IDs are shown individually (e.g., "15"). All values are joined in a comma-separated list of ranges and individual IDs, e.g. "10-12,15,20-22".
func ResetToFactoryDefaults ¶
func ResetToFactoryDefaults(ctx context.Context, conn *grpc.ClientConn) error
func RouteDistinguisher ¶
func RouteTarget ¶
func ShortName ¶
ShortName converts a full interface name to its short form. If the name is already in short form, it is returned as is.
func ShortNameLoopback ¶
func ShortNamePortChannel ¶
func ShortNameVLAN ¶
Types ¶
type ACL ¶
type ACL struct {
// Name is the name of the ACL. This name must be unique across IPv4 and IPv6 access lists.
Name string `json:"name"`
// SeqItems contains the list of ACE entries in the ACL.
SeqItems struct {
ACEList gnmiext.List[int32, *ACLEntry] `json:"ACE-list,omitzero"`
} `json:"seq-items,omitzero"`
// Is6 indicates whether this is an IPv6 ACL. This field is not serialized to JSON
// and is only used internally to determine the correct XPath for the ACL.
Is6 bool `json:"-"`
}
ACL represents an IPv4 or IPv6 access control list, depending on the rules it contains. It can only contain either IPv4 or IPv6 rules, never both. It's name must be unique across IPv4 and IPv6 access lists.
func (*ACL) IsListItem ¶
func (*ACL) IsListItem()
type ACLEntry ¶
type ACLEntry struct {
SeqNum int32 `json:"seqNum"`
Action Action `json:"action"`
Protocol Protocol `json:"protocol"`
Remark string `json:"remark,omitempty"`
SrcPrefix string `json:"srcPrefix"`
SrcPrefixLength int `json:"srcPrefixLength,omitempty"`
DstPrefix string `json:"dstPrefix"`
DstPrefixLength int `json:"dstPrefixLength,omitempty"`
}
type ASCIIStr ¶
type ASCIIStr string
ASCIIStr represents a string, encoded as a sequence of comma-separated ASCII code points (0 - 127).
type AddrDom ¶
type AddrItem ¶
type AddrItem struct {
ID string `json:"id"`
Unnumbered string `json:"unnumbered,omitempty"`
AddrItems struct {
AddrList gnmiext.List[string, *IntfAddr] `json:"Addr-list,omitzero"`
} `json:"addr-items,omitzero"`
// Is6 indicates whether the addresses are IPv6 (true) or IPv4 (false).
// This field is not serialized to JSON and is only used internally to
// determine the correct XPath for the address.
Is6 bool `json:"-"`
// Vrf is the VRF Domain in which the address is configured.
// This field is not serialized to JSON and is only used internally to
// determine the correct XPath for the address.
Vrf string `json:"-"`
}
AddrItem represents the IP address configuration for an interface. It can hold either IPv4 or IPv6 addresses, determined by the Is6 field.
func (*AddrItem) IsListItem ¶
func (*AddrItem) IsListItem()
type AddrList ¶
type AddrList struct {
DomList gnmiext.List[string, *AddrDom] `json:"Dom-list,omitzero"`
// Is6 indicates whether the addresses are IPv6 (true) or IPv4 (false).
// This field is not serialized to JSON and is only used internally to
// determine the correct XPath for the address.
Is6 bool `json:"-"`
}
func (*AddrList) GetAddrItemsByInterface ¶
GetAddrItemsByInterface retrieves the address items for a given interface name.
type AddressFamily ¶
type AddressFamily string
AddressFamily represents the identifier of an address family.
const ( AddressFamilyL2EVPN AddressFamily = "l2vpn-evpn" AddressFamilyIPv4Unicast AddressFamily = "ipv4-ucast" AddressFamilyIPv6Unicast AddressFamily = "ipv6-ucast" )
func (AddressFamily) ToAddressFamilyType ¶
func (af AddressFamily) ToAddressFamilyType() v1alpha1.BGPAddressFamilyType
type AdjChangeLogLevel ¶
type AdjChangeLogLevel string
const ( AdjChangeLogLevelBrief AdjChangeLogLevel = "brief" AdjChangeLogLevelDetail AdjChangeLogLevel = "detail" AdjChangeLogLevelNone AdjChangeLogLevel = "none" )
type AdjOperSt ¶
type AdjOperSt string
const ( AdjOperStUnknown AdjOperSt = "unknown" AdjOperStDown AdjOperSt = "down" AdjOperStAttempt AdjOperSt = "attempt" AdjOperStInitializing AdjOperSt = "initializing" AdjOperStTwoWay AdjOperSt = "two-way" AdjOperStExstart AdjOperSt = "exstart" AdjOperStExchange AdjOperSt = "exchange" AdjOperStLoading AdjOperSt = "loading" AdjOperStFull AdjOperSt = "full" AdjOperStSelf AdjOperSt = "self" )
func (AdjOperSt) ToNeighborState ¶
func (s AdjOperSt) ToNeighborState() v1alpha1.OSPFNeighborState
type AdminSt ¶
type AdminSt string
AdminSt represents the administrative state of a component ("enabled" or "disabled").
type AdminSt2 ¶
type AdminSt2 string
AdminSt2 represents the administrative state of a component ("up" or "down").
type AdminSt3 ¶
type AdminSt3 string
AdminSt3 represents the administrative state of a component ("off" or "on").
type AdminSt4 ¶
type AdminSt4 string
AdminSt4 represents the administrative state of a component ("enable" or "disable").
type AnycastPeerAddr ¶
AnycastPeerAddr represents an anycast RP peer address configuration used for redundancy in PIM.
func (*AnycastPeerAddr) IsListItem ¶
func (*AnycastPeerAddr) IsListItem()
func (*AnycastPeerAddr) Key ¶
func (a *AnycastPeerAddr) Key() AnycastPeerAddr
func (*AnycastPeerAddr) XPath ¶
func (a *AnycastPeerAddr) XPath() string
type AnycastPeerItems ¶
type AnycastPeerItems struct {
AcastRPPeerList gnmiext.List[AnycastPeerAddr, *AnycastPeerAddr] `json:"AcastRPPeer-list,omitzero"`
}
func (*AnycastPeerItems) XPath ¶
func (*AnycastPeerItems) XPath() string
type BDEVI ¶
type BDEVI struct {
Encap string `json:"encap"`
Rd string `json:"rd"`
RttpItems struct {
RttPList gnmiext.List[RttEntryType, *RttEntry] `json:"RttP-list,omitzero"`
} `json:"rttp-items,omitzero"`
}
BDEVI represents a Bridge Domain Ethernet VPN Instance (MAC-VRF).
func (*BDEVI) IsListItem ¶
func (*BDEVI) IsListItem()
type BDItems ¶
type BDItems struct {
BdList []struct {
AccEncap string `json:"accEncap"`
FabEncap string `json:"fabEncap"`
} `json:"BD-list"`
}
func (*BDItems) GetByVXLAN ¶
type BFD ¶
type BFD struct {
ID string `json:"id"`
AdminSt AdminSt `json:"adminSt"`
IfkaItems struct {
DetectMult int32 `json:"detectMult"`
MinRxIntvlMs int64 `json:"minRxIntvl"`
MinTxIntvlMs int64 `json:"minTxIntvl"`
} `json:"ifka-items,omitzero"`
}
func (*BFD) IsListItem ¶
func (*BFD) IsListItem()
type BGPDom ¶
type BGPDom struct {
Name string `json:"name"`
RtrID string `json:"rtrId"`
RtrIDAuto AdminSt `json:"rtrIdAuto"`
AfItems struct {
DomAfList gnmiext.List[AddressFamily, *BGPDomAfItem] `json:"DomAf-list,omitzero"`
} `json:"af-items,omitzero"`
PeerContItems struct {
PeerContList gnmiext.List[string, *BGPPeerGroup] `json:"PeerCont-list,omitzero"`
} `json:"peercont-items,omitzero"`
}
func (*BGPDom) IsListItem ¶
func (*BGPDom) IsListItem()
type BGPDomAfItem ¶
type BGPDomAfItem struct {
MaxExtEcmp int8 `json:"maxExtEcmp,omitempty"`
MaxExtIntEcmp int8 `json:"maxExtIntEcmp,omitempty"`
ExportGwIP AdminSt `json:"exportGwIp"`
Type AddressFamily `json:"type"`
// The fields below are only valid for the l2vpn-evpn address family.
// For other address families, these fields will be omitted in the JSON
// representation.
AdvPip AdminSt `json:"advPip,omitempty"`
RetainRttAll AdminSt `json:"retainRttAll,omitempty"`
RetainRttRtMap Option[string] `json:"retainRttRtMap"`
InterLeakPItems struct {
InterLeakPList gnmiext.List[InterLeakPKey, *InterLeakP] `json:"InterLeakP-list,omitzero"`
} `json:"interleak-items,omitzero"`
}
func (*BGPDomAfItem) Key ¶
func (af *BGPDomAfItem) Key() AddressFamily
func (BGPDomAfItem) MarshalJSON ¶
func (af BGPDomAfItem) MarshalJSON() ([]byte, error)
func (*BGPDomAfItem) SetMultipath ¶
func (af *BGPDomAfItem) SetMultipath(m *v1alpha1.BGPMultipath) error
func (*BGPDomAfItem) UnmarshalJSON ¶
func (af *BGPDomAfItem) UnmarshalJSON(v []byte) error
type BGPDomItems ¶
BGPDomItems is the container for all BGP domains configured on the device.
func (*BGPDomItems) XPath ¶
func (*BGPDomItems) XPath() string
type BGPPeer ¶
type BGPPeer struct {
VRFName string `json:"-"`
Addr string `json:"addr"`
AdminSt AdminSt `json:"adminSt"`
Asn string `json:"asn"`
AsnType PeerAsnType `json:"asnType"`
Name string `json:"name,omitempty"`
SrcIf string `json:"srcIf,omitempty"`
InheritContPeerCtrl string `json:"inheritContPeerCtrl"`
AfItems struct {
PeerAfList gnmiext.List[AddressFamily, *BGPPeerAfItem] `json:"PeerAf-list,omitzero"`
} `json:"af-items,omitzero"`
}
func (*BGPPeer) IsListItem ¶
func (*BGPPeer) IsListItem()
type BGPPeerAfItem ¶
type BGPPeerAfItem struct {
Ctrl Option[string] `json:"ctrl"`
SendComExt AdminSt `json:"sendComExt"`
SendComStd AdminSt `json:"sendComStd"`
Type AddressFamily `json:"type"`
RtCtrlPItems struct {
RtCtrlPList gnmiext.List[RtCtrlDirection, *BGPPeerAfRtCtrlP] `json:"RtCtrlP-list,omitzero"`
} `json:"rtctrl-items,omitzero"`
}
func (*BGPPeerAfItem) Key ¶
func (af *BGPPeerAfItem) Key() AddressFamily
type BGPPeerAfOperItems ¶
type BGPPeerAfOperItems struct {
AcceptedPaths uint32 `json:"acceptedPaths"`
PfxSent string `json:"pfxSent"`
Type AddressFamily `json:"type"`
}
type BGPPeerAfRtCtrlP ¶
type BGPPeerAfRtCtrlP struct {
Direction RtCtrlDirection `json:"direction"`
RtMap string `json:"rtMap"`
}
func (*BGPPeerAfRtCtrlP) Key ¶
func (r *BGPPeerAfRtCtrlP) Key() RtCtrlDirection
type BGPPeerGroup ¶
BGPPeerGroup is a template peer group under a BGP domain.
func (*BGPPeerGroup) IsListItem ¶
func (*BGPPeerGroup) IsListItem()
func (*BGPPeerGroup) Key ¶
func (g *BGPPeerGroup) Key() string
func (*BGPPeerGroup) XPath ¶
func (g *BGPPeerGroup) XPath() string
type BGPPeerOperItems ¶
type BGPPeerOperItems struct {
VRFName string `json:"-"`
Addr string `json:"addr"`
OperSt BGPPeerOperSt `json:"operSt"`
LastFlapTime time.Time `json:"lastFlapTs"`
AfItems struct {
PeerAfList []*BGPPeerAfOperItems `json:"PeerAfEntry-list,omitempty"`
} `json:"af-items,omitzero"`
}
func (*BGPPeerOperItems) IsListItem ¶
func (*BGPPeerOperItems) IsListItem()
func (*BGPPeerOperItems) XPath ¶
func (p *BGPPeerOperItems) XPath() string
type BGPPeerOperSt ¶
type BGPPeerOperSt string
const ( BGPPeerOperStIdle BGPPeerOperSt = "idle" BGPPeerOperStConnect BGPPeerOperSt = "connect" BGPPeerOperStActive BGPPeerOperSt = "active" BGPPeerOperStOpenSent BGPPeerOperSt = "opensent" BGPPeerOperStOpenConfirm BGPPeerOperSt = "openconfirm" BGPPeerOperStEstablished BGPPeerOperSt = "established" )
func (BGPPeerOperSt) ToSessionState ¶
func (s BGPPeerOperSt) ToSessionState() v1alpha1.BGPPeerSessionState
type Banner ¶
type Banner struct {
// The value of the delimiter used to start and end the banner message
Delimiter string `json:"delimiter"`
// String to be displayed as the banner message
Message string `json:"message"`
// Type indicates whether this is a pre-login or post-login banner.
// This field is not serialized to JSON and is only used internally
// to determine the correct XPath for the banner configuration.
Type BannerType `json:"-"`
}
Banner represents the pre-login banner configuration of the device.
type BannerType ¶
type BannerType string
const ( PreLogin BannerType = "prelogin" PostLogin BannerType = "postlogin" )
func BannerTypeFrom ¶
func BannerTypeFrom(bt v1alpha1.BannerType) (BannerType, error)
type BorderGatewayInterconnect ¶
type BorderGatewayInterconnect struct {
Interface *v1alpha1.Interface
Tracking nxv1alpha1.InterconnectTrackingType
}
type BorderGatewayPeer ¶
type BorderGatewayPeer struct {
BGPPeer *v1alpha1.BGPPeer
PeerType nxv1alpha1.BGPPeerType
}
type BorderGatewayPeerType ¶
type BorderGatewayPeerType string
const ( BorderGatewayPeerTypeFabricExternal BorderGatewayPeerType = "fabric-external" BorderGatewayPeerTypeFabricBorderLeaf BorderGatewayPeerType = "fabric-border-leaf" )
func BorderGatewayPeerTypeFrom ¶
func BorderGatewayPeerTypeFrom(t nxv1alpha1.BGPPeerType) BorderGatewayPeerType
type BorderGatewaySettingsRequest ¶
type BorderGatewaySettingsRequest struct {
BorderGateway *nxv1alpha1.BorderGateway
SourceInterface *v1alpha1.Interface
Interconnects []BorderGatewayInterconnect
Peers []BorderGatewayPeer
}
type Certificate ¶
type Certificate struct {
Key *rsa.PrivateKey
Cert *x509.Certificate
}
Certificate represents a X.509 certificate and its associated private key. It can be used to load the certificate into a NX-OS device truspoint via gNOI.
func (*Certificate) Encode ¶
func (c *Certificate) Encode() ([]byte, error)
func (*Certificate) EncodeKeyPair ¶
func (c *Certificate) EncodeKeyPair() (private, public []byte, err error)
func (*Certificate) Load ¶
func (c *Certificate) Load(ctx context.Context, conn *grpc.ClientConn, trustpoint string) error
Load loads the certificate into the specified trustpoint via the gNOI cert service.
type Console ¶
type Console struct {
// Maximum time allowed for a command to execute in minutes.
// Leave unspecified (zero) to disable.
Timeout int `json:"timeout"`
}
Console represents the primary terminal line configuration.
type DHCPRelay ¶
type DHCPRelay struct {
ID string `json:"id"`
AddrItems struct {
AddrList gnmiext.List[netip.Addr, *DHCPRelayServer] `json:"RelayAddr-list,omitzero"`
} `json:"addr-items"`
}
DHCPRelay represents the DHCP Relay configuration for a single interface.
func (*DHCPRelay) IsListItem ¶
func (*DHCPRelay) IsListItem()
type DHCPRelayConfig ¶
type DHCPRelayConfig struct {
RelayIfList gnmiext.List[string, *DHCPRelay] `json:"RelayIf-list,omitzero"`
}
DHCPRelayConfig represents the complete DHCP relay configuration tree.
func (*DHCPRelayConfig) XPath ¶
func (*DHCPRelayConfig) XPath() string
type DHCPRelayServer ¶
type DHCPRelayServer struct {
Address netip.Addr `json:"address"`
Vrf string `json:"vrf,omitempty"`
}
func (*DHCPRelayServer) Key ¶
func (d *DHCPRelayServer) Key() netip.Addr
type DNS ¶
type DNS struct {
AdminSt AdminSt `json:"adminSt"`
ProfItems struct {
ProfList gnmiext.List[string, *DNSProf] `json:"Prof-list,omitzero"`
} `json:"prof-items,omitzero"`
}
DNS represents the DNS configuration on a NX-OS device.
type DNSProf ¶
type DNSProf struct {
Name string `json:"name"`
ProvItems struct {
ProviderList gnmiext.List[string, *DNSProv] `json:"Provider-list,omitzero"`
} `json:"prov-items,omitzero"`
VrfItems struct {
VrfList gnmiext.List[string, *DNSVrf] `json:"Vrf-list,omitzero"`
} `json:"vrf-items,omitzero"`
DomItems struct {
Name string `json:"name,omitempty"`
} `json:"dom-items,omitzero"`
}
type DNSVrf ¶
type EncapRoutedInterface ¶
type EncapRoutedInterface struct {
ID string `json:"id"`
Medium Medium `json:"mediumType"`
MTU int32 `json:"mtu"`
MTUInherit bool `json:"mtuInherit"`
Encap string `json:"encap"`
AdminSt AdminSt2 `json:"adminSt"`
Descr Option[string] `json:"descr"`
RtvrfMbrItems *VrfMember `json:"rtvrfMbr-items,omitempty"`
}
EncapRoutedInterface represents an Encapsulated Routed Subinterface.
func (*EncapRoutedInterface) IsListItem ¶
func (*EncapRoutedInterface) IsListItem()
func (*EncapRoutedInterface) XPath ¶
func (s *EncapRoutedInterface) XPath() string
type EncapRoutedInterfaceOperItems ¶
type EncapRoutedInterfaceOperItems struct {
ID string `json:"-"`
OperSt OperSt `json:"operSt"`
OperStQual string `json:"operStQual"`
}
func (*EncapRoutedInterfaceOperItems) XPath ¶
func (s *EncapRoutedInterfaceOperItems) XPath() string
type Encoder ¶
type Encoder interface {
Encode(password string) (string, PwdEncryptType, error)
}
Encoder is used to encode the user password before sending it to the device.
type ExtCommItem ¶
type ExtCommItem struct {
Community string `json:"community"`
Scope RtExtComScope `json:"scope"`
}
func (*ExtCommItem) Key ¶
func (c *ExtCommItem) Key() ExtCommItem
type FabricFwd ¶
type FabricFwd struct {
// AdminSt defines the administrative state of fabric forwarding
AdminSt AdminSt `json:"adminSt"`
// Address defines the anycast gateway MAC address
Address string `json:"amac"`
}
FabricFwd represents the fabric forwarding settings required for NVE operation. Should use only PATCH operations: `FabricFwdIf` also modifies this model.
func (*FabricFwd) IsListItem ¶
func (*FabricFwd) IsListItem()
type FabricFwdAnycastMAC ¶
type FabricFwdAnycastMAC string
func (*FabricFwdAnycastMAC) XPath ¶
func (*FabricFwdAnycastMAC) XPath() string
type FabricFwdIf ¶
type FabricFwdIf struct {
AdminSt AdminSt `json:"adminSt"`
ID string `json:"id"`
Mode FwdMode `json:"mode"`
}
FabricFwdIf that represents an Interface configured as part of the HMM Fabric Forwarding Instance.
func (*FabricFwdIf) IsListItem ¶
func (*FabricFwdIf) IsListItem()
func (*FabricFwdIf) XPath ¶
func (f *FabricFwdIf) XPath() string
type FirmwareVersion ¶
type FirmwareVersion string
FirmwareVersion is the firmware version of the device, e.g. "10.4(3)".
func (*FirmwareVersion) XPath ¶
func (*FirmwareVersion) XPath() string
type GNMI ¶
type GNMI struct {
// The keepalive timeout in seconds for inactive or unauthorized connections.
// The gRPC agent periodically sends an empty response to the client. If this response fails to deliver to the client, then the connection stops.
// The default interval value is 600 seconds. You can configure to change the keepalive interval with the interval range of 600-86400 seconds.
KeepAliveTimeout int `json:"keepAliveTimeout"`
// The maximum number of concurrent gNMI calls that can be made to the gRPC server on the switch for each VRF.
// Configure a limit from 1 through 16. The default limit is 8.
MaxCalls int8 `json:"maxCalls"`
}
GNMI represents the gNMI configuration on a NX-OS device.
type GRPC ¶
type GRPC struct {
Cert Option[string] `json:"cert,omitzero"`
CertClientRoot string `json:"certClientRoot,omitempty"`
Port int32 `json:"port"`
UseVrf string `json:"useVrf,omitempty"`
}
GRPC represents the gRPC configuration on a NX-OS device.
type HostReachType ¶
type HostReachType string
const ( HostReachFloodAndLearn HostReachType = "Flood_and_learn" HostReachBGP HostReachType = "bgp" HostReachController HostReachType = "controller" HostReachOpenFlow HostReachType = "openflow" HostReachOpenFlowIR HostReachType = "openflowIR" )
type ICMPIf ¶
func (*ICMPIf) IsListItem ¶
func (*ICMPIf) IsListItem()
type ISIS ¶
type ISIS struct {
AdminSt AdminSt `json:"adminSt"`
Name string `json:"name"`
DomItems struct {
DomList gnmiext.List[string, *ISISDom] `json:"Dom-list,omitzero"`
} `json:"dom-items,omitzero"`
}
ISIS represents the IS-IS routing protocol configuration on a NX-OS device.
func (*ISIS) IsListItem ¶
func (*ISIS) IsListItem()
type ISISAddressFamily ¶
type ISISAddressFamily string
const ( ISISAfIPv4Unicast ISISAddressFamily = "v4" ISISAfIPv6Unicast ISISAddressFamily = "v6" )
type ISISDom ¶
type ISISDom struct {
IsType ISISLevel `json:"isType"`
Name string `json:"name"`
Net string `json:"net"`
PassiveDflt ISISLevel `json:"passiveDflt"`
AfItems struct {
DomAfList gnmiext.List[ISISAddressFamily, *ISISDomAf] `json:"DomAf-list,omitzero"`
} `json:"af-items,omitzero"`
OverloadItems struct {
AdminSt string `json:"adminSt"`
BgpAsNumStr string `json:"bgpAsNumStr"`
StartupTime int `json:"startupTime"`
Suppress string `json:"suppress"`
} `json:"overload-items,omitzero"`
IfItems struct {
IfList gnmiext.List[string, *ISISInterface] `json:"If-list,omitzero"`
} `json:"if-items,omitzero"`
}
type ISISDomAf ¶
type ISISDomAf struct {
Type ISISAddressFamily `json:"type"`
}
func (*ISISDomAf) Key ¶
func (a *ISISDomAf) Key() ISISAddressFamily
type ISISInterface ¶
type ISISInterface struct {
ID string `json:"id"`
NetworkTypeP2P AdminSt3 `json:"networkTypeP2P"`
V4Bfd string `json:"v4Bfd"`
V4Enable bool `json:"v4enable"`
V6Bfd string `json:"v6Bfd"`
V6Enable bool `json:"v6enable"`
}
func (*ISISInterface) Key ¶
func (i *ISISInterface) Key() string
type InterLeakP ¶
type InterLeakP struct {
InterLeakPKey
RtMap string `json:"rtMap"`
}
func NewInterLeakPDirect ¶
func NewInterLeakPDirect(rtMap string) *InterLeakP
NewInterLeakPDirect creates an InterLeakP entry for redistributing directly connected routes into a BGP address family.
func (*InterLeakP) Key ¶
func (o *InterLeakP) Key() InterLeakPKey
type InterLeakPKey ¶
type InterLeakPKey struct {
Asn string `json:"asn"`
Inst string `json:"inst"`
Proto RtLeakProto `json:"proto"`
}
type IntfAddr ¶
type IntfAddr struct {
Addr string `json:"addr"`
Pref int `json:"pref"`
Tag int `json:"tag"`
Type IntfAddrType `json:"type"`
}
type IntfAddrType ¶
type IntfAddrType string
const ( IntfAddrTypePrimary IntfAddrType = "primary" IntfAddrTypeSecondary IntfAddrType = "secondary" )
type KeyPair ¶
type KeyPair struct {
Name string `json:"name"`
}
func (*KeyPair) IsListItem ¶
func (*KeyPair) IsListItem()
type LLDP ¶
type LLDP struct {
// HoldTime is the number of seconds that a receiving device should hold the information sent by another device before discarding it.
HoldTime Option[uint16] `json:"holdTime"`
// InitDelay is the number of seconds for LLDP to initialize on any interface.
InitDelay Option[uint16] `json:"initDelayTime"`
// IfItems contains the per-interface LLDP configuration.
IfItems struct {
IfList gnmiext.List[string, *LLDPIfItem] `json:"If-list,omitzero"`
} `json:"if-items,omitzero"`
}
func (*LLDP) IsListItem ¶
func (*LLDP) IsListItem()
type LLDPIfItem ¶
type LLDPIfItem struct {
InterfaceName string `json:"id"`
AdminRxSt Option[AdminSt] `json:"adminRxSt"`
AdminTxSt Option[AdminSt] `json:"adminTxSt"`
}
func (*LLDPIfItem) Key ¶
func (i *LLDPIfItem) Key() string
type LLDPOper ¶
type LLDPOper struct {
OperSt OperSt `json:"operSt"`
}
func (*LLDPOper) IsListItem ¶
func (*LLDPOper) IsListItem()
type Loopback ¶
type Loopback struct {
AdminSt AdminSt2 `json:"adminSt"`
Descr Option[string] `json:"descr"`
ID string `json:"id"`
RtvrfMbrItems *VrfMember `json:"rtvrfMbr-items,omitempty"`
}
Loopback represents a loopback interface.
func (*Loopback) IsListItem ¶
func (*Loopback) IsListItem()
type LoopbackOperItems ¶
type LoopbackOperItems struct {
ID string `json:"-"`
OperSt OperSt `json:"operSt"`
OperStQual string `json:"operStQual"`
}
func (*LoopbackOperItems) XPath ¶
func (l *LoopbackOperItems) XPath() string
type MaxLSAAction ¶
type MaxLSAAction string
const ( MaxLSAActionReject MaxLSAAction = "reject" MaxLSAActionRestart MaxLSAAction = "restart" MaxLSAActionLog MaxLSAAction = "log" )
type MessageType ¶
type MessageType string
const ( Informs MessageType = "Informs" Traps MessageType = "Traps" )
type MultisiteBorderGatewayInterface ¶
type MultisiteBorderGatewayInterface string
func (*MultisiteBorderGatewayInterface) XPath ¶
func (*MultisiteBorderGatewayInterface) XPath() string
type MultisiteIfTracking ¶
type MultisiteIfTracking struct {
IfName string `json:"-"`
Tracking MultisiteIfTrackingMode `json:"tracking"`
}
func (*MultisiteIfTracking) XPath ¶
func (m *MultisiteIfTracking) XPath() string
type MultisiteIfTrackingItems ¶
type MultisiteIfTrackingItems struct {
PhysIfList []struct {
ID string `json:"id"`
MultisiteIfTracking *MultisiteIfTracking `json:"multisiteiftracking-items"`
} `json:"PhysIf-list"`
}
func (*MultisiteIfTrackingItems) XPath ¶
func (*MultisiteIfTrackingItems) XPath() string
type MultisiteIfTrackingMode ¶
type MultisiteIfTrackingMode string
const ( MultisiteIfTrackingModeDCI MultisiteIfTrackingMode = "dci" MultisiteIfTrackingModeFabric MultisiteIfTrackingMode = "fabric" )
func MultisiteIfTrackingModeFrom ¶
func MultisiteIfTrackingModeFrom(t nxv1alpha1.InterconnectTrackingType) MultisiteIfTrackingMode
type MultisiteItems ¶
type MultisiteItems struct {
SiteID string `json:"siteId"`
AdminSt AdminSt `json:"state"`
DelayRestoreSeconds int64 `json:"delayRestoreTime"`
}
func (*MultisiteItems) XPath ¶
func (*MultisiteItems) XPath() string
type MultisitePeer ¶
type MultisitePeer struct {
Addr string `json:"-"`
PeerType BorderGatewayPeerType `json:"-"`
}
func (MultisitePeer) MarshalJSON ¶
func (p MultisitePeer) MarshalJSON() ([]byte, error)
func (*MultisitePeer) UnmarshalJSON ¶
func (p *MultisitePeer) UnmarshalJSON(b []byte) error
func (*MultisitePeer) XPath ¶
func (p *MultisitePeer) XPath() string
type MultisitePeerItems ¶
type MultisitePeerItems struct {
PeerList []struct {
Addr string `json:"addr"`
PeerType BorderGatewayPeerType `json:"peerType"`
} `json:"Peer-list"`
}
func (*MultisitePeerItems) XPath ¶
func (*MultisitePeerItems) XPath() string
type NTP ¶
type NTP struct {
AdminSt AdminSt `json:"adminSt"`
Logging AdminSt `json:"logging"`
ProvItems struct {
NtpProviderList gnmiext.List[string, *NTPProvider] `json:"NtpProvider-list,omitzero"`
} `json:"prov-items,omitzero"`
SrcIfItems struct {
SrcIf string `json:"srcIf,omitempty"`
} `json:"srcIf-items,omitzero"`
}
NTP represents the NTP configuration on a NX-OS device.
type NTPProvider ¶
type NTPProvider struct {
KeyID int `json:"keyId"`
MaxPoll int `json:"maxPoll"`
MinPoll int `json:"minPoll"`
Name string `json:"name"`
Preferred bool `json:"preferred"`
ProvT ProvType `json:"provT"`
Vrf string `json:"vrf,omitempty"`
}
func (*NTPProvider) Key ¶
func (p *NTPProvider) Key() string
type NVE ¶
type NVE struct {
AdminSt AdminSt `json:"adminSt"`
AdvertiseVmac bool `json:"advertiseVmac"`
SourceInterface string `json:"sourceInterface,omitempty"`
AnycastInterface Option[string] `json:"anycastIntf"`
HoldDownTime uint16 `json:"holdDownTime"`
HostReach HostReachType `json:"hostReach"`
McastGroupL2 Option[string] `json:"mcastGroupL2"`
McastGroupL3 Option[string] `json:"mcastGroupL3"`
SuppressARP bool `json:"suppressARP"`
}
NVE represents the Network Virtualization Edge interface (nve1). Note: NXOS only supports a single NVE interface with epId=1.
func (*NVE) IsListItem ¶
func (*NVE) IsListItem()
func (*NVE) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type NVEInfraVLAN ¶
type NVEInfraVLAN struct {
ID uint32 `json:"id"`
}
func (*NVEInfraVLAN) IsListItem ¶
func (*NVEInfraVLAN) IsListItem()
type NVEInfraVLANs ¶
type NVEInfraVLANs struct {
InfraVLANList []*NVEInfraVLAN `json:"InfraVlan-list,omitempty"`
}
func (*NVEInfraVLANs) XPath ¶
func (*NVEInfraVLANs) XPath() string
type NVEOper ¶
type NVEOper struct {
OperSt OperSt `json:"operState"`
}
NVEOper represents the operational state of the NVE interface. Note: NXOS also returns the Operational status of the associated interfaces, but those are not included here.
func (*NVEOper) IsListItem ¶
func (*NVEOper) IsListItem()
type OSPF ¶
type OSPF struct {
AdminSt AdminSt `json:"adminSt"`
Name string `json:"name"`
DomItems struct {
DomList gnmiext.List[string, *OSPFDom] `json:"Dom-list,omitzero"`
} `json:"dom-items,omitzero"`
}
func (*OSPF) IsListItem ¶
func (*OSPF) IsListItem()
type OSPFConfig ¶
type OSPFConfig struct {
// PropagateDefaultRoute is equivalent to the CLI command `default-information originate`
PropagateDefaultRoute *bool
// RedistributionConfigs is a list of redistribution configurations for the OSPF process.
RedistributionConfigs []RedistributionConfig
// Distance is the administrative distance value (1-255) for OSPF routes. Cisco's default is 110.
Distance int16
// ReferenceBandwidthMbps is the reference bandwidth in Mbps used for OSPF calculations. By default Cisco NX-OS
// assigns a cost that is the configured reference bandwidth divided by the interface bandwidth. The
// the reference bandwidth in these devices is 40 Gbps. Must be between 1 and 999999 Mbps.
ReferenceBandwidthMbps int32
// MaxLSA is the maximum number of non self-generated LSAs (min 1)
MaxLSA int32
}
type OSPFDom ¶
type OSPFDom struct {
AdjChangeLogLevel AdjChangeLogLevel `json:"adjChangeLogLevel"`
AdminSt AdminSt `json:"adminSt"`
BwRef int32 `json:"bwRef"`
BwRefUnit BwRefUnit `json:"bwRefUnit"`
Ctrl string `json:"ctrl,omitempty"`
Dist int16 `json:"dist"`
Name string `json:"name"`
RtrID string `json:"rtrId"`
IfItems struct {
IfList gnmiext.List[string, *OSPFInterface] `json:"If-list,omitzero"`
} `json:"if-items,omitzero"`
MaxlsapItems struct {
Action MaxLSAAction `json:"action"`
MaxLsa int32 `json:"maxLsa"`
} `json:"maxlsap-items,omitzero"`
InterleakItems struct {
InterLeakPList gnmiext.List[InterLeakPKey, *InterLeakP] `json:"InterLeakP-list,omitzero"`
} `json:"interleak-items,omitzero"`
DefrtleakItems struct {
Always string `json:"always"`
RtMap string `json:"rtMap"`
} `json:"defrtleak-items,omitzero"`
}
type OSPFIfAdjEpGroup ¶
type OSPFIfAdjEpGroup struct {
ID string `json:"id"` // Adjacency neighbor's router id
PeerIP string `json:"peerIp"` // Adjacency neighbor's ip address
OperSt AdjOperSt `json:"operSt"` // Adjacency neighbor state
Prio uint8 `json:"prio"` // Priority, used in determining the designated router on this network
AdjStatsItems struct {
LastStChgTS time.Time `json:"lastStChgTs"` // Timestamp of the last state change
} `json:"adjstats-items,omitzero"`
}
type OSPFIfOperItems ¶
type OSPFIfOperItems struct {
ID string `json:"id"`
AdjItems struct {
AdjList []*OSPFIfAdjEpGroup `json:"AdjEp-list,omitzero"`
} `json:"adj-items,omitzero"`
}
type OSPFInterface ¶
type OSPFInterface struct {
AdminSt AdminSt `json:"adminSt"`
AdvertiseSecondaries bool `json:"advertiseSecondaries"`
Area string `json:"area"`
ID string `json:"id"`
NwT NtwType `json:"nwT"`
PassiveCtrl PassiveControl `json:"passiveCtrl"`
BFDCtrl OspfBfdCtrl `json:"bfdCtrl"`
}
func (*OSPFInterface) Key ¶
func (i *OSPFInterface) Key() string
type OSPFOperItems ¶
type OSPFOperItems struct {
Name string `json:"name"`
OperSt OperSt `json:"operSt"`
IfItems struct {
IfList []*OSPFIfOperItems `json:"If-list"`
} `json:"if-items"`
}
func (*OSPFOperItems) IsListItem ¶
func (*OSPFOperItems) IsListItem()
func (*OSPFOperItems) XPath ¶
func (o *OSPFOperItems) XPath() string
type Option ¶
type Option[T comparable] struct { Value *T `json:"-"` }
Option is a generic optional value wrapper for NX-OS configurations. If unset, it will marshal to the string "DME_UNSET_PROPERTY_MARKER", effectively resetting the value in the configuration when sent to the device.
func NewOption ¶
func NewOption[T comparable](v T) Option[T]
func (Option[T]) MarshalJSON ¶
func (*Option[T]) UnmarshalJSON ¶
type OspfBfdCtrl ¶
type OspfBfdCtrl string
const ( OspfBfdCtrlUnspecified OspfBfdCtrl = "unspecified" OspfBfdCtrlEnabled OspfBfdCtrl = "enabled" OspfBfdCtrlDisabled OspfBfdCtrl = "disabled" )
type PIM ¶
type PIMDom ¶
func (*PIMDom) IsListItem ¶
func (*PIMDom) IsListItem()
type PIMIf ¶
func (*PIMIf) IsListItem ¶
func (*PIMIf) IsListItem()
type PIMIfItems ¶
PIMIfItems represents the PIM interface configuration. It is used to configure PIM on a specific interface.
func (*PIMIfItems) XPath ¶
func (*PIMIfItems) XPath() string
type PassiveControl ¶
type PassiveControl string
const ( PassiveControlUnspecified PassiveControl = "unspecified" PassiveControlEnabled PassiveControl = "enabled" PassiveControlDisabled PassiveControl = "disabled" )
type PeerAsnType ¶
type PeerAsnType string
const ( PeerAsnTypeNone PeerAsnType = "none" PeerAsnTypeExternal PeerAsnType = "external" PeerAsnTypeInternal PeerAsnType = "internal" )
type PhysIf ¶
type PhysIf struct {
AccessVlan string `json:"accessVlan"`
AdminSt AdminSt2 `json:"adminSt,omitempty"`
Descr Option[string] `json:"descr"`
FecMode FecMode `json:"FECMode"`
ID string `json:"id"`
Layer Layer `json:"layer"`
MTU int32 `json:"mtu"`
Medium Medium `json:"medium"`
Mode SwitchportMode `json:"mode"`
NativeVlan string `json:"nativeVlan"`
TrunkVlans string `json:"trunkVlans"`
UserCfgdFlags UserFlags `json:"userCfgdFlags"`
RtvrfMbrItems *VrfMember `json:"rtvrfMbr-items,omitempty"`
PhysExtdItems struct {
BufferBoost AdminSt4 `json:"bufferBoost,omitempty"`
} `json:"physExtd-items,omitzero"`
}
PhysIf represents a physical (ethernet) interface.
func (*PhysIf) IsListItem ¶
func (*PhysIf) IsListItem()
type PhysIfOperItems ¶
type PhysIfOperItems struct {
ID string `json:"-"`
OperSt OperSt `json:"operSt"`
OperStQual string `json:"operStQual"`
}
func (*PhysIfOperItems) XPath ¶
func (p *PhysIfOperItems) XPath() string
type PortChannel ¶
type PortChannel struct {
AccessVlan string `json:"accessVlan"`
AdminSt AdminSt2 `json:"adminSt"`
Descr Option[string] `json:"descr"`
ID string `json:"id"`
VPCConvergence AdminSt4 `json:"lacpVpcConvergence"`
Layer Layer `json:"layer"`
MTU int32 `json:"mtu"`
Medium Medium `json:"medium"`
Mode SwitchportMode `json:"mode"`
PcMode PortChannelMode `json:"pcMode"`
NativeVlan string `json:"nativeVlan"`
SuspIndividual AdminSt4 `json:"suspIndividual"`
TrunkVlans string `json:"trunkVlans"`
UserCfgdFlags UserFlags `json:"userCfgdFlags"`
RtvrfMbrItems *VrfMember `json:"rtvrfMbr-items,omitempty"`
RsmbrIfsItems struct {
RsMbrIfsList gnmiext.List[string, *PortChannelMember] `json:"RsMbrIfs-list,omitzero"`
} `json:"rsmbrIfs-items,omitzero"`
AggrExtdItems struct {
BufferBoost AdminSt4 `json:"bufferBoost,omitempty"`
} `json:"aggrExtd-items,omitzero"`
}
PortChannel represents a port-channel (LAG) interface.
func (*PortChannel) IsListItem ¶
func (*PortChannel) IsListItem()
func (*PortChannel) XPath ¶
func (p *PortChannel) XPath() string
type PortChannelMember ¶
func NewPortChannelMember ¶
func NewPortChannelMember(name string) *PortChannelMember
func (*PortChannelMember) Key ¶
func (m *PortChannelMember) Key() string
type PortChannelMode ¶
type PortChannelMode string
const ( PortChannelModeActive PortChannelMode = "active" PortChannelModePassive PortChannelMode = "passive" )
type PortChannelOperItems ¶
type PortChannelOperItems struct {
ID string `json:"-"`
OperSt OperSt `json:"operSt"`
OperStQual string `json:"operStQual"`
}
func (*PortChannelOperItems) XPath ¶
func (p *PortChannelOperItems) XPath() string
type PrefixEntry ¶
type PrefixEntry struct {
Action Action `json:"action"`
Criteria Criteria `json:"criteria"`
FromPfxLen int8 `json:"fromPfxLen"`
Order int32 `json:"order"`
Pfx string `json:"pfx"`
ToPfxLen int8 `json:"toPfxLen"`
}
func (*PrefixEntry) Key ¶
func (e *PrefixEntry) Key() int32
type PrefixList ¶
type PrefixList struct {
Name string `json:"name"`
EntItems struct {
EntryList gnmiext.List[int32, *PrefixEntry] `json:"Entry-list"`
} `json:"ent-items"`
// Is6 indicates whether this is an IPv6 prefix list. This field is not serialized to JSON
// and is only used internally to determine the correct XPath for the prefix list.
Is6 bool `json:"-"`
}
func (*PrefixList) IsListItem ¶
func (*PrefixList) IsListItem()
func (*PrefixList) XPath ¶
func (p *PrefixList) XPath() string
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) Connect ¶
func (p *Provider) Connect(ctx context.Context, conn *deviceutil.Connection) (err error)
func (*Provider) DeleteBGPPeer ¶
func (*Provider) DeleteBanner ¶
func (*Provider) DeleteCertificate ¶
func (*Provider) DeleteDHCPRelay ¶
DeleteDHCPRelay removes all DHCP relay configurations from the device.
func (*Provider) DeleteEVPNInstance ¶
func (*Provider) DeleteISIS ¶
func (*Provider) DeleteInterface ¶
func (*Provider) DeleteLLDP ¶
func (*Provider) DeleteManagementAccess ¶
func (*Provider) DeleteOSPF ¶
func (*Provider) DeletePrefixSet ¶
func (*Provider) DeleteRoutingPolicy ¶
func (*Provider) DeleteSNMP ¶
func (*Provider) DeleteUser ¶
func (*Provider) DeleteVLAN ¶
func (*Provider) Disconnect ¶
func (p *Provider) Disconnect(_ context.Context, _ *deviceutil.Connection) error
func (*Provider) EnsureBGPPeer ¶
func (*Provider) EnsureBanner ¶
func (*Provider) EnsureBorderGatewaySettings ¶
func (p *Provider) EnsureBorderGatewaySettings(ctx context.Context, req *BorderGatewaySettingsRequest) error
func (*Provider) EnsureCertificate ¶
func (*Provider) EnsureDHCPRelay ¶
EnsureDHCPRelay configures DHCP relay on the specified interfaces. Replaces the entire DHCP relay configuration on the device with the provided configuration in the request.
func (*Provider) EnsureEVPNInstance ¶
func (*Provider) EnsureISIS ¶
func (*Provider) EnsureInterface ¶
func (*Provider) EnsureInterfacesExist ¶
func (*Provider) EnsureLLDP ¶
func (*Provider) EnsureManagementAccess ¶
func (*Provider) EnsureNVE ¶
EnsureNVE ensures that the NVE configuration on the device matches the desired state specified in the NVE custom resource. If no provider config is provided then the provider will use default settings.
func (*Provider) EnsureOSPF ¶
func (*Provider) EnsurePrefixSet ¶
func (*Provider) EnsureRoutingPolicy ¶
func (*Provider) EnsureSNMP ¶
EnsureSNMP ensures that the SNMP configuration on the device matches the desired state specified in the SNMP custom resource.
It configures various SNMP components with the following default values:
Communities:
- Default group: "network-operator" (used when Community.Group is empty)
- Access level: unspecified (CommAcess = unspecified)
Hosts:
- Default port: 162 (standard SNMP trap port)
- Default security level: noauth (for v1/v2c), auth (for v3)
- Default notification type: traps (when Host.Type is not specified)
- Default version: v1 (when Host.Version is not specified)
Traps:
- Individual traps are enabled by setting Trapstatus = "enable"
System Information:
- Empty strings are converted to "DME_UNSET_PROPERTY_MARKER" for deletion
func (*Provider) EnsureSyslog ¶
func (*Provider) EnsureSystemSettings ¶
func (*Provider) EnsureUser ¶
func (*Provider) EnsureVLAN ¶
func (*Provider) EnsureVPCDomain ¶
func (p *Provider) EnsureVPCDomain(ctx context.Context, vpcdomain *nxv1alpha1.VPCDomain, vrf *v1alpha1.VRF, pc *v1alpha1.Interface) (reterr error)
EnsureVPCDomain applies the vPC configuration on the device. It also ensures that the vPC feature is enabled on the device. `vrf` is a resource referencing the VRF to use in the keep-alive link configuration, can be nil. `pc` is a resource referencing a port-channel interface to use as vPC peer-link, must not be nil.
func (*Provider) FactoryReset ¶
func (p *Provider) FactoryReset(ctx context.Context, conn *deviceutil.Connection) error
func (*Provider) GetDHCPRelayStatus ¶
func (p *Provider) GetDHCPRelayStatus(ctx context.Context, req *provider.DHCPRelayRequest) (provider.DHCPRelayStatus, error)
GetDHCPRelayStatus retrieves the current DHCP relay status.
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, req *provider.LLDPRequest) (provider.LLDPStatus, error)
func (*Provider) GetLastRebootTime ¶
func (*Provider) GetNVEStatus ¶
func (p *Provider) GetNVEStatus(ctx context.Context, req *provider.NVERequest) (provider.NVEStatus, error)
GetNVEStatus retrieves the operational status of the NVE configuration on the device.
func (*Provider) GetOSPFStatus ¶
func (p *Provider) GetOSPFStatus(ctx context.Context, req *provider.OSPFStatusRequest) (provider.OSPFStatus, error)
func (*Provider) GetPeerStatus ¶
func (p *Provider) GetPeerStatus(ctx context.Context, req *provider.BGPPeerStatusRequest) (provider.BGPPeerStatus, error)
func (*Provider) GetStatusVPCDomain ¶
func (p *Provider) GetStatusVPCDomain(ctx context.Context) (VPCDomainStatus, error)
GetStatusVPCDomain retrieves the current status of the vPC configuration on the device.
func (*Provider) GetVLANStatus ¶
func (p *Provider) GetVLANStatus(ctx context.Context, req *provider.VLANRequest) (provider.VLANStatus, error)
func (*Provider) HashProvisioningPassword ¶
func (*Provider) Reboot ¶
func (p *Provider) Reboot(ctx context.Context, conn *deviceutil.Connection) error
func (*Provider) Reprovision ¶
func (p *Provider) Reprovision(ctx context.Context, conn *deviceutil.Connection) (reterr error)
func (*Provider) ResetBorderGatewaySettings ¶
func (*Provider) ResetSystemSettings ¶
func (*Provider) VerifyProvisioned ¶
func (p *Provider) VerifyProvisioned(ctx context.Context, conn *deviceutil.Connection, device *v1alpha1.Device) bool
type PwdEncryptType ¶
type PwdEncryptType string
const ( PwdEncryptTypeClear PwdEncryptType = "clear" PwdEncryptTypeEncrypt PwdEncryptType = "Encrypt" // Type 5 PwdEncryptTypePbkdf2 PwdEncryptType = "Pbkdf2" // Type 8 PwdEncryptTypeScrypt PwdEncryptType = "scrypt" // Type 9 )
type PwdHashType ¶
type PwdHashType string
const ( PwdHashTypeUnspecified PwdHashType = "unspecified" PwdHashTypePbkdf2 PwdHashType = "pbkdf2" // Type 8 PwdHashTypeScrypt PwdHashType = "scrypt" // Type 9 )
type RedistributionConfig ¶
type RedistributionConfig struct {
// Protocol to redistribute, e.g., `direct`
Protocol RtLeakProto
// Route map to apply, e.g., `REDIST-ALL`
RouteMapName string
}
RedistributionConfig represents a redistribution configuration of a route map through a specific protocol.
type RouteMap ¶
type RouteMap struct {
Name string `json:"name"`
EntItems struct {
EntryList gnmiext.List[int32, *RouteMapEntry] `json:"Entry-list,omitzero"`
} `json:"ent-items,omitzero"`
}
func (*RouteMap) IsListItem ¶
func (*RouteMap) IsListItem()
type RouteMapEntry ¶
type RouteMapEntry struct {
Action Action `json:"action"`
Order int32 `json:"order"`
SrttItems struct {
ItemItems struct {
ItemList gnmiext.List[ExtCommItem, *ExtCommItem] `json:"Item-list,omitzero"`
} `json:"item-items,omitzero"`
} `json:"srtt-items,omitzero"`
SregcommItems struct {
NoCommAttr AdminSt `json:"noCommAttr"`
ItemItems struct {
ItemList gnmiext.List[string, *CommItem] `json:"Item-list,omitzero"`
} `json:"item-items,omitzero"`
} `json:"sregcomm-items,omitzero"`
MrtdstItems struct {
RsrtDstAttItems struct {
RsRtDstAttList gnmiext.List[string, *RsRtDstAtt] `json:"RsRtDstAtt-list,omitzero"`
} `json:"rsrtDstAtt-items,omitzero"`
} `json:"mrtdst-items,omitzero"`
SetASPathPrependItems struct {
AS string `json:"as"`
} `json:"setaspathprepend-items,omitzero"`
SetASPathLastASItems struct {
LastAS int32 `json:"lastas"`
} `json:"setaspathlastas-items,omitzero"`
SetASPathReplaceItems struct {
MatchAsnList string `json:"matchAsnList,omitempty"`
MatchPrivateAS bool `json:"matchPrivateAs"`
ReplaceAsn string `json:"replaceAsn"`
ReplaceType string `json:"replaceType"`
} `json:"setaspathreplace-items,omitzero"`
SetASPathItems struct {
AsnList string `json:"asnList"`
} `json:"setaspath-items,omitzero"`
}
func (*RouteMapEntry) Key ¶
func (e *RouteMapEntry) Key() int32
func (*RouteMapEntry) SetCommunities ¶
func (e *RouteMapEntry) SetCommunities(communities []string) error
func (*RouteMapEntry) SetExtCommunities ¶
func (e *RouteMapEntry) SetExtCommunities(communities []string) error
func (*RouteMapEntry) SetPrefixSet ¶
func (e *RouteMapEntry) SetPrefixSet(ps *v1alpha1.PrefixSet)
type RsRtDstAtt ¶
type RsRtDstAtt struct {
TDn string `json:"tDn"`
}
func (*RsRtDstAtt) Key ¶
func (r *RsRtDstAtt) Key() string
type RtCtrlDirection ¶
type RtCtrlDirection string
const ( RtCtrlDirectionIn RtCtrlDirection = "in" RtCtrlDirectionOut RtCtrlDirection = "out" )
type RtExtComScope ¶
type RtExtComScope string
const ( RtExtComScopeTransitive RtExtComScope = "transitive" RtExtComScopeNonTransitive RtExtComScope = "non-transitive" )
type RtLeakProto ¶
type RtLeakProto string
const ( RtLeakProtoStatic RtLeakProto = "static" RtLeakProtoDirect RtLeakProto = "direct" )
type RttEntItems ¶
type RttEntry ¶
type RttEntry struct {
Type RttEntryType `json:"type"`
EntItems RttEntItems `json:"ent-items,omitzero"`
}
func (*RttEntry) Key ¶
func (r *RttEntry) Key() RttEntryType
type RttEntryType ¶
type RttEntryType string
const ( RttEntryTypeImport RttEntryType = "import" RttEntryTypeExport RttEntryType = "export" )
type SNMPCommunity ¶
type SNMPCommunity struct {
CommAccess string `json:"commAcess"`
GrpName string `json:"grpName"`
Name string `json:"name"`
ACLItems struct {
UseACLName string `json:"useAclName,omitempty"`
} `json:"acl-items,omitzero"`
}
func (*SNMPCommunity) IsListItem ¶
func (*SNMPCommunity) IsListItem()
func (*SNMPCommunity) Key ¶
func (s *SNMPCommunity) Key() string
func (*SNMPCommunity) XPath ¶
func (s *SNMPCommunity) XPath() string
type SNMPCommunityItems ¶
type SNMPCommunityItems struct {
CommSecPList gnmiext.List[string, *SNMPCommunity] `json:"CommSecP-list,omitzero"`
}
SNMPCommunityItems represents the SNMP community configuration on a NX-OS device.
func (*SNMPCommunityItems) XPath ¶
func (*SNMPCommunityItems) XPath() string
type SNMPHost ¶
type SNMPHost struct {
CommName Option[string] `json:"commName"`
HostName string `json:"hostName"`
NotifType string `json:"notifType"`
SecLevel SecLevel `json:"secLevel"`
UDPPortID int `json:"udpPortID"`
Version string `json:"version"`
UsevrfItems struct {
UseVrfList gnmiext.List[string, *SNMPHostVrf] `json:"UseVrf-list,omitzero"`
} `json:"usevrf-items,omitzero"`
}
func (*SNMPHost) IsListItem ¶
func (*SNMPHost) IsListItem()
func (*SNMPHost) Key ¶
func (s *SNMPHost) Key() SNMPHostKey
type SNMPHostItems ¶
type SNMPHostItems struct {
HostList gnmiext.List[SNMPHostKey, *SNMPHost] `json:"Host-list,omitzero"`
}
SNMPHostItems represents the SNMP host configuration on a NX-OS device.
func (*SNMPHostItems) XPath ¶
func (*SNMPHostItems) XPath() string
type SNMPHostKey ¶
type SNMPHostVrf ¶
type SNMPHostVrf struct {
Vrfname string `json:"vrfname,omitempty"`
}
func (*SNMPHostVrf) Key ¶
func (s *SNMPHostVrf) Key() string
type SNMPSrcIf ¶
type SNMPSrcIf struct {
Type MessageType `json:"-"`
Ifname Option[string] `json:"ifname"`
}
SNMPSrcIf represents the SNMP source interface configuration on a NX-OS device.
type SNMPSysInfo ¶
type SNMPSysInfo struct {
SysContact Option[string] `json:"sysContact"`
SysLocation Option[string] `json:"sysLocation"`
}
SNMPSysInfo represents the SNMP system information configuration on a NX-OS device.
func (*SNMPSysInfo) XPath ¶
func (*SNMPSysInfo) XPath() string
type SNMPTrapsItems ¶
type SNMPTrapsItems struct {
AaaItems struct {
ServerstatechangeItems *SNMPTraps `json:"serverstatechange-items,omitzero"`
} `json:"aaa-items,omitzero"`
BfdItems struct {
SessiondownItems *SNMPTraps `json:"sessiondown-items,omitzero"`
SessionupItems *SNMPTraps `json:"sessionup-items,omitzero"`
} `json:"bfd-items,omitzero"`
BridgeItems struct {
NewrootItems *SNMPTraps `json:"newroot-items,omitzero"`
TopologychangeItems *SNMPTraps `json:"topologychange-items,omitzero"`
} `json:"bridge-items,omitzero"`
CallhomeItems struct {
EventnotifyItems *SNMPTraps `json:"eventnotify-items,omitzero"`
SmtpsendfailItems *SNMPTraps `json:"smtpsendfail-items,omitzero"`
} `json:"callhome-items,omitzero"`
CfsItems struct {
MergefailureItems *SNMPTraps `json:"mergefailure-items,omitzero"`
StatechangenotifItems *SNMPTraps `json:"statechangenotif-items,omitzero"`
} `json:"cfs-items,omitzero"`
ConfigItems struct {
CcmCLIRunningConfigChangedItems *SNMPTraps `json:"ccmCLIRunningConfigChanged-items,omitzero"`
} `json:"config-items,omitzero"`
EntityItems struct {
CefcMIBEnableStatusNotificationItems *SNMPTraps `json:"cefcMIBEnableStatusNotification-items,omitzero"`
EntityfanstatuschangeItems *SNMPTraps `json:"entityfanstatuschange-items,omitzero"`
EntitymibchangeItems *SNMPTraps `json:"entitymibchange-items,omitzero"`
EntitymoduleinsertedItems *SNMPTraps `json:"entitymoduleinserted-items,omitzero"`
EntitymoduleremovedItems *SNMPTraps `json:"entitymoduleremoved-items,omitzero"`
EntitymodulestatuschangeItems *SNMPTraps `json:"entitymodulestatuschange-items,omitzero"`
EntitypoweroutchangeItems *SNMPTraps `json:"entitypoweroutchange-items,omitzero"`
EntitypowerstatuschangeItems *SNMPTraps `json:"entitypowerstatuschange-items,omitzero"`
EntitysensorItems *SNMPTraps `json:"entitysensor-items,omitzero"`
EntityunrecognisedmoduleItems *SNMPTraps `json:"entityunrecognisedmodule-items,omitzero"`
} `json:"entity-items,omitzero"`
FeaturecontrolItems struct {
FeatureOpStatusChangeItems *SNMPTraps `json:"FeatureOpStatusChange-items,omitzero"`
CiscoFeatOpStatusChangeItems *SNMPTraps `json:"ciscoFeatOpStatusChange-items,omitzero"`
} `json:"featurecontrol-items,omitzero"`
GenericItems struct {
ColdStartItems *SNMPTraps `json:"coldStart-items,omitzero"`
WarmStartItems *SNMPTraps `json:"warmStart-items,omitzero"`
} `json:"generic-items,omitzero"`
HsrpItems struct {
StatechangeItems *SNMPTraps `json:"statechange-items,omitzero"`
} `json:"hsrp-items,omitzero"`
IPItems struct {
SLAItems *SNMPTraps `json:"sla-items,omitzero"`
} `json:"ip-items,omitzero"`
LicenseItems struct {
NotifylicenseexpiryItems *SNMPTraps `json:"notifylicenseexpiry-items,omitzero"`
NotifylicenseexpirywarningItems *SNMPTraps `json:"notifylicenseexpirywarning-items,omitzero"`
NotifylicensefilemissingItems *SNMPTraps `json:"notifylicensefilemissing-items,omitzero"`
NotifynolicenseforfeatureItems *SNMPTraps `json:"notifynolicenseforfeature-items,omitzero"`
} `json:"license-items,omitzero"`
LinkItems struct {
CieLinkDownItems *SNMPTraps `json:"cieLinkDown-items,omitzero"`
CieLinkUpItems *SNMPTraps `json:"cieLinkUp-items,omitzero"`
CiscoxcvrmonstatuschgItems *SNMPTraps `json:"ciscoxcvrmonstatuschg-items,omitzero"`
DelayedlinkstatechangeItems *SNMPTraps `json:"delayedlinkstatechange-items,omitzero"`
ExtendedlinkDownItems *SNMPTraps `json:"extendedlinkDown-items,omitzero"`
ExtendedlinkUpItems *SNMPTraps `json:"extendedlinkUp-items,omitzero"`
LinkDownItems *SNMPTraps `json:"linkDown-items,omitzero"`
LinkUpItems *SNMPTraps `json:"linkUp-items,omitzero"`
} `json:"link-items,omitzero"`
LldpItems struct {
LldpRemTablesChangeItems *SNMPTraps `json:"lldpRemTablesChange-items,omitzero"`
} `json:"lldp-items,omitzero"`
MmodeItems struct {
CseMaintModeChangeNotifyItems *SNMPTraps `json:"cseMaintModeChangeNotify-items,omitzero"`
CseNormalModeChangeNotifyItems *SNMPTraps `json:"cseNormalModeChangeNotify-items,omitzero"`
} `json:"mmode-items,omitzero"`
MsdpItems struct {
MsdpBackwardTransitionItems *SNMPTraps `json:"msdpBackwardTransition-items,omitzero"`
} `json:"msdp-items,omitzero"`
PimItems struct {
PimNeighborLossItems *SNMPTraps `json:"pimNeighborLoss-items,omitzero"`
} `json:"pim-items,omitzero"`
PoeItems struct {
ControlenableItems *SNMPTraps `json:"controlenable-items,omitzero"`
PolicenotifyItems *SNMPTraps `json:"policenotify-items,omitzero"`
} `json:"poe-items,omitzero"`
PortsecurityItems struct {
AccesssecuremacviolationItems *SNMPTraps `json:"accesssecuremacviolation-items,omitzero"`
TrunksecuremacviolationItems *SNMPTraps `json:"trunksecuremacviolation-items,omitzero"`
} `json:"portsecurity-items,omitzero"`
RfItems struct {
RedundancyframeworkItems *SNMPTraps `json:"redundancyframework-items,omitzero"`
} `json:"rf-items,omitzero"`
RmonItems struct {
FallingAlarmItems *SNMPTraps `json:"fallingAlarm-items,omitzero"`
HcFallingAlarmItems *SNMPTraps `json:"hcFallingAlarm-items,omitzero"`
HcRisingAlarmItems *SNMPTraps `json:"hcRisingAlarm-items,omitzero"`
RisingAlarmItems *SNMPTraps `json:"risingAlarm-items,omitzero"`
} `json:"rmon-items,omitzero"`
SnmpItems struct {
AuthenticationItems *SNMPTraps `json:"authentication-items,omitzero"`
} `json:"snmp-items,omitzero"`
StormcontrolItems struct {
CpscEventRev1Items *SNMPTraps `json:"cpscEventRev1-items,omitzero"`
} `json:"stormcontrol-items,omitzero"`
StpxItems struct {
InconsistencyItems *SNMPTraps `json:"inconsistency-items,omitzero"`
LoopinconsistencyItems *SNMPTraps `json:"loopinconsistency-items,omitzero"`
RootinconsistencyItems *SNMPTraps `json:"rootinconsistency-items,omitzero"`
} `json:"stpx-items,omitzero"`
SysmgrItems struct {
CseFailSwCoreNotifyExtendedItems *SNMPTraps `json:"cseFailSwCoreNotifyExtended-items,omitzero"`
} `json:"sysmgr-items,omitzero"`
SystemItems struct {
ClockchangenotificationItems *SNMPTraps `json:"Clockchangenotification-items,omitzero"`
} `json:"system-items,omitzero"`
UpgradeItems struct {
UpgradeJobStatusNotifyItems *SNMPTraps `json:"UpgradeJobStatusNotify-items,omitzero"`
} `json:"upgrade-items,omitzero"`
VsanItems struct {
VsanPortMembershipChangeItems *SNMPTraps `json:"vsanPortMembershipChange-items,omitzero"`
VsanStatusChangeItems *SNMPTraps `json:"vsanStatusChange-items,omitzero"`
} `json:"vsan-items,omitzero"`
VtpItems struct {
NotifsItems *SNMPTraps `json:"notifs-items,omitzero"`
VlancreateItems *SNMPTraps `json:"vlancreate-items,omitzero"`
VlandeleteItems *SNMPTraps `json:"vlandelete-items,omitzero"`
} `json:"vtp-items,omitzero"`
}
func (*SNMPTrapsItems) XPath ¶
func (*SNMPTrapsItems) XPath() string
type SNMPUser ¶
type SNMPUser struct {
Username string `json:"userName"`
Ipv4AclName Option[string] `json:"ipv4AclName"`
}
SNMPUser represents an SNMP local user configuration on a NX-OS device.
func (*SNMPUser) IsListItem ¶
func (*SNMPUser) IsListItem()
type SerialNumber ¶
type SerialNumber string
SerialNumber is the serial number of the device, e.g. "9VT9OHZBC3H". This value should typically match the serial number under "System/serial".
func (*SerialNumber) XPath ¶
func (*SerialNumber) XPath() string
type SeverityLevel ¶
type SeverityLevel string
const ( Emergency SeverityLevel = "emergencies" Alert SeverityLevel = "alerts" Critical SeverityLevel = "critical" Error SeverityLevel = "errors" Warning SeverityLevel = "warnings" Notice SeverityLevel = "notifications" Informational SeverityLevel = "information" Debug SeverityLevel = "debugging" )
func SeverityLevelFrom ¶
func SeverityLevelFrom(v v1alpha1.Severity) SeverityLevel
type SpanningTree ¶
type SpanningTree struct {
Mode SpanningTreeMode `json:"mode"`
IfName string `json:"-"`
BPDUfilter AdminSt4 `json:"bpdufilter"`
BPDUGuard AdminSt4 `json:"bpduguard"`
}
SpanningTree represents the spanning tree configuration for an interface.
func (*SpanningTree) Default ¶
func (s *SpanningTree) Default()
func (*SpanningTree) IsListItem ¶
func (*SpanningTree) IsListItem()
func (*SpanningTree) XPath ¶
func (s *SpanningTree) XPath() string
type SpanningTreeMode ¶
type SpanningTreeMode string
const ( SpanningTreeModeDefault SpanningTreeMode = "default" SpanningTreeModeEdge SpanningTreeMode = "edge" SpanningTreeModeNetwork SpanningTreeMode = "network" SpanningTreeModeTrunk SpanningTreeMode = "trunk" )
func (SpanningTreeMode) IsValid ¶
func (s SpanningTreeMode) IsValid() bool
type StaticRP ¶
type StaticRP struct {
Addr string `json:"addr"`
RpgrplistItems struct {
RPGrpListList gnmiext.List[string, *StaticRPGrp] `json:"RPGrpList-list,omitzero"`
} `json:"rpgrplist-items,omitzero"`
}
StaticRP represents a static Rendezvous Point (RP) configuration in PIM.
func (*StaticRP) IsListItem ¶
func (*StaticRP) IsListItem()
type StaticRPGrp ¶
type StaticRPGrp struct {
Bidir bool `json:"bidir"`
GrpListName string `json:"grpListName"`
Override bool `json:"override"`
// RpAddr is the parent StaticRP address, used to construct the XPath.
// It is not serialized to JSON.
RpAddr string `json:"-"`
}
func (*StaticRPGrp) Key ¶
func (g *StaticRPGrp) Key() string
func (*StaticRPGrp) XPath ¶
func (g *StaticRPGrp) XPath() string
type StaticRPItems ¶
type StaticRPItems struct {
StaticRPList gnmiext.List[string, *StaticRP] `json:"StaticRP-list,omitzero"`
}
func (*StaticRPItems) XPath ¶
func (*StaticRPItems) XPath() string
type StormControlItem ¶
type StormControlItem struct {
Floatlevel string `json:"floatlevel"`
Name StormControlType `json:"name"`
}
func (*StormControlItem) Key ¶
func (ctrl *StormControlItem) Key() StormControlType
type StormControlItems ¶
type StormControlItems struct {
EvpnStormControlList gnmiext.List[StormControlType, *StormControlItem] `json:"EvpnStormControl-list"`
}
func (*StormControlItems) XPath ¶
func (*StormControlItems) XPath() string
type StormControlType ¶
type StormControlType string
const ( StormControlTypeUnicast StormControlType = "ucast" StormControlTypeMulticast StormControlType = "mcast" StormControlTypeBroadcast StormControlType = "bcast" )
type SwitchVirtualInterface ¶
type SwitchVirtualInterface struct {
AdminSt AdminSt2 `json:"adminSt"`
Descr string `json:"descr"`
ID string `json:"id"`
Medium SVIMedium `json:"medium"`
MTU int32 `json:"mtu,omitempty"`
RtvrfMbrItems *VrfMember `json:"rtvrfMbr-items,omitempty"`
VlanID int16 `json:"vlanId"`
}
func (*SwitchVirtualInterface) IsListItem ¶
func (*SwitchVirtualInterface) IsListItem()
func (*SwitchVirtualInterface) XPath ¶
func (s *SwitchVirtualInterface) XPath() string
type SwitchVirtualInterfaceOperItems ¶
type SwitchVirtualInterfaceOperItems struct {
ID string `json:"-"`
OperSt OperSt `json:"operSt"`
OperStQual string `json:"operStQual"`
}
func (*SwitchVirtualInterfaceOperItems) IsListItem ¶
func (*SwitchVirtualInterfaceOperItems) IsListItem()
func (*SwitchVirtualInterfaceOperItems) XPath ¶
func (s *SwitchVirtualInterfaceOperItems) XPath() string
type SwitchportMode ¶
type SwitchportMode string
const ( SwitchportModeAccess SwitchportMode = "access" SwitchportModeTrunk SwitchportMode = "trunk" )
type SyslogConfig ¶
type SyslogFacility ¶
type SyslogFacility struct {
FacilityName string `json:"facilityName"`
SeverityLevel SeverityLevel `json:"severityLevel"`
}
func (*SyslogFacility) IsListItem ¶
func (*SyslogFacility) IsListItem()
func (*SyslogFacility) Key ¶
func (s *SyslogFacility) Key() string
func (*SyslogFacility) XPath ¶
func (s *SyslogFacility) XPath() string
type SyslogFacilityItems ¶
type SyslogFacilityItems struct {
FacilityList gnmiext.List[string, *SyslogFacility] `json:"Facility-list,omitzero"`
}
func (*SyslogFacilityItems) XPath ¶
func (*SyslogFacilityItems) XPath() string
type SyslogHistory ¶
type SyslogHistory struct {
Level SeverityLevel `json:"level"`
Size uint32 `json:"size"`
}
func (*SyslogHistory) XPath ¶
func (*SyslogHistory) XPath() string
type SyslogOrigin ¶
type SyslogOrigin struct {
Idtype string `json:"idtype"`
Idvalue string `json:"idvalue,omitempty"`
}
func (*SyslogOrigin) XPath ¶
func (*SyslogOrigin) XPath() string
type SyslogRemote ¶
type SyslogRemote struct {
ForwardingFacility string `json:"forwardingFacility"`
Host string `json:"host"`
Port int32 `json:"port"`
Severity SeverityLevel `json:"severity"`
Transport Transport `json:"transport"`
VrfName string `json:"vrfName"`
}
func (*SyslogRemote) Key ¶
func (r *SyslogRemote) Key() string
type SyslogRemoteItems ¶
type SyslogRemoteItems struct {
RemoteDestList gnmiext.List[string, *SyslogRemote] `json:"RemoteDest-list,omitzero"`
}
func (*SyslogRemoteItems) XPath ¶
func (*SyslogRemoteItems) XPath() string
type SyslogSrcIf ¶
func (*SyslogSrcIf) XPath ¶
func (*SyslogSrcIf) XPath() string
type SystemJumboMTU ¶
type SystemJumboMTU int16
SystemJumboMTU represents the jumbo MTU size configured on the system.
func (*SystemJumboMTU) Default ¶
func (s *SystemJumboMTU) Default()
func (*SystemJumboMTU) XPath ¶
func (s *SystemJumboMTU) XPath() string
type Trustpoint ¶
type Trustpoint struct {
Name string `json:"name"`
}
Trustpoint represents a PKI trustpoint configuration on a NX-OS device.
func (*Trustpoint) IsListItem ¶
func (*Trustpoint) IsListItem()
func (*Trustpoint) XPath ¶
func (t *Trustpoint) XPath() string
type UnixTime ¶
UnixTime is a wrapper around time.Time that marshals/unmarshals to/from a Unix timestamp in seconds.
func (*UnixTime) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type User ¶
type User struct {
AllowExpired string `json:"allowExpired"`
Expiration string `json:"expiration"`
Name string `json:"name"`
Pwd string `json:"pwd,omitempty"` // #nosec G117
PwdHash PwdHashType `json:"passwordHash,omitempty"`
PwdEncryptType PwdEncryptType `json:"pwdEncryptType,omitempty"`
SshauthItems struct {
Data string `json:"data,omitempty"`
} `json:"sshauth-items,omitzero"`
UserdomainItems struct {
UserDomainList gnmiext.List[string, *UserDomain] `json:"UserDomain-list,omitzero"`
} `json:"userdomain-items,omitzero"`
}
User represents a local user on a NX-OS device.
func (*User) IsListItem ¶
func (*User) IsListItem()
type UserDomain ¶
type UserDomain struct {
Name string `json:"name"`
RoleItems struct {
UserRoleList gnmiext.List[string, *UserRole] `json:"UserRole-list,omitzero"`
} `json:"role-items,omitzero"`
}
func (*UserDomain) Key ¶
func (d *UserDomain) Key() string
type UserFlags ¶
type UserFlags uint8
UserFlags represents the user configured flags for an interface. It supports a combination of the following flags: 1 - admin_state 2 - admin_layer 4 - admin_router_mac 8 - admin_dce_mode 16 - admin_mtu
func (UserFlags) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*UserFlags) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type VLAN ¶
type VLAN struct {
AdminSt BdState `json:"adminSt"`
BdState BdState `json:"BdState"` // Note the capitalization of this fields JSON tag
FabEncap string `json:"fabEncap"`
Name Option[string] `json:"name"`
}
VLAN represents a VLAN configuration on the device
func (*VLAN) IsListItem ¶
func (*VLAN) IsListItem()
type VLANOperItems ¶
func (*VLANOperItems) IsListItem ¶
func (*VLANOperItems) IsListItem()
func (*VLANOperItems) XPath ¶
func (v *VLANOperItems) XPath() string
type VLANReservation ¶
type VLANReservation int16
VLANReservation represents the settings for VLAN reservations
func (*VLANReservation) Default ¶
func (v *VLANReservation) Default()
func (*VLANReservation) XPath ¶
func (*VLANReservation) XPath() string
type VLANSystem ¶
type VLANSystem struct {
LongName bool `json:"longName"`
}
VLANSystem represents the settings shared among all VLANs
func (*VLANSystem) Default ¶
func (v *VLANSystem) Default()
func (*VLANSystem) XPath ¶
func (*VLANSystem) XPath() string
type VNI ¶
type VNI struct {
AssociateVrfFlag bool `json:"associateVrfFlag"`
McastGroup Option[string] `json:"mcastGroup"`
Vni int32 `json:"vni"`
}
func (*VNI) IsListItem ¶
func (*VNI) IsListItem()
type VNIOperItems ¶
func (*VNIOperItems) XPath ¶
func (v *VNIOperItems) XPath() string
type VPCDomain ¶
type VPCDomain struct {
AdminSt AdminSt `json:"adminSt"`
AutoRecovery AdminSt `json:"autoRecovery"`
AutoRecoveryReloadDelay int16 `json:"autoRecoveryIntvl"`
DelayRestoreSVI int16 `json:"delayRestoreSVI"`
DelayRestoreVPC int16 `json:"delayRestoreVPC"`
FastConvergence AdminSt `json:"fastConvergence"`
ID int16 `json:"id"`
L3PeerRouter AdminSt `json:"l3PeerRouter"`
PeerGateway AdminSt `json:"peerGw"`
PeerSwitch AdminSt `json:"peerSwitch"`
RolePrio int32 `json:"rolePrio"`
SysPrio int32 `json:"sysPrio"`
KeepAliveItems struct {
DestIP string `json:"destIp"`
SrcIP string `json:"srcIp"`
VRF string `json:"vrf"`
PeerLinkItems struct {
AdminSt AdminSt `json:"adminSt"`
ID string `json:"id"`
} `json:"peerlink-items,omitzero"`
} `json:"keepalive-items,omitzero"`
}
VPCDomain represents the domain of a virtual Port Channel (vPC)
type VPCDomainOper ¶
type VPCDomainOper struct {
KeepAliveItems struct {
OperSt string `json:"operSt,omitempty"`
PeerUpTime string `json:"peerUpTime,omitempty"`
} `json:"keepalive-items,omitzero"`
PeerStQual string `json:"peerStQual,omitempty"`
Role VPCDomainRole `json:"summOperRole,omitempty"`
}
VPCDomainOper represents the operational status of a vPC domain
func (*VPCDomainOper) XPath ¶
func (*VPCDomainOper) XPath() string
type VPCDomainStatus ¶
type VPCDomainStatus struct {
// KeepAliveStatus indicates whether the keepalive link is operationally up (true) or down (false).
KeepAliveStatus bool
// KeepAliveStatusMsg provides additional human-readable information returned by the device
KeepAliveStatusMsg []string
// PeerStatus indicates whether the vPC peer is operationally up (true) or down (false).
PeerStatus bool
// PeerStatusMsg provides additional human-readable information about the vPC peer status.
PeerStatusMsg []string
// PeerUptime indicates the uptime of the vPC peer link in human-readable format provided by Cisco.
PeerUptime time.Duration
// Role represents the role of the vPC peer.
Role nxv1alpha1.VPCDomainRole
}
VPCDomainStatus represents the operational status of a vPC configuration on the device.
type VPCIf ¶
type VPCIf struct {
ID int `json:"id"`
RsvpcConfItems struct {
TDn string `json:"tDn"`
} `json:"rsvpcConf-items"`
}
VPCIf represents a vPC member interface
func (*VPCIf) IsListItem ¶
func (*VPCIf) IsListItem()
func (*VPCIf) SetPortChannel ¶
type VPCIfItems ¶
type VPCIfItems struct {
IfList []*VPCIf `json:"If-list"`
}
func (*VPCIfItems) GetListItemByInterface ¶
func (v *VPCIfItems) GetListItemByInterface(name string) *VPCIf
func (*VPCIfItems) XPath ¶
func (*VPCIfItems) XPath() string
type VPNIPv4Address ¶
type VPNIPv4Address struct {
Type AFTYPE
// Administrator is the ASN or IP address
Administrator string
// AssignedNumber is stored as a 4-byte unsigned integer (uint32). While for Type 0 addresses, it is a 4-byte value;
// for Type 1 and Type 2 addresses, it is a only a 2-byte value.
AssignedNumber uint32
}
VPNIPv4Address represents a VPN-IPv4 Address Family as per RFC 4364.
func NewVPNIPv4Address ¶
func NewVPNIPv4Address(afType AFTYPE, value string) (*VPNIPv4Address, error)
NewVPNIPv4Address creates a new VPNIPv4Address based on the provided address family type and value. The value must be in the format defined by the type:
- Type 0: <2-byte ASN>:<4-byte AssignedNumber> (e.g., "65000:100")
- Type 1: <IPv4 address>:<2-byte AssignedNumber> (e.g, "1.2.3.4:100")
- Type 2: <4-byte ASN>:<2-byte AssignedNumber> (e.g., "65000:100")
This function returns an error if the value does not conform to the expected format or if the ASN or assigned number is out of range. Also:
- Type 0: the ASN numbers 0, 65535 are reserved and not allowed by this function.
- Type 1:
- Type 2: the ASN numbers 0, 4294967295 are reserved and not allowed by this function.
func (*VPNIPv4Address) String ¶
func (a *VPNIPv4Address) String() string
String returns the string representation of the VPNIPv4Address as per cisco conventions.
type VRF ¶
type VRF struct {
Encap Option[string] `json:"encap"`
L3Vni bool `json:"l3vni"`
Name string `json:"name"`
Descr Option[string] `json:"descr"`
DomItems VRFDomItems `json:"dom-items,omitzero"`
}
func (*VRF) IsListItem ¶
func (*VRF) IsListItem()
type VRFDom ¶
type VRFDom struct {
Name string `json:"name"`
Rd string `json:"rd,omitempty"`
AfItems VRFDomAfItems `json:"af-items,omitzero"`
}
type VRFDomAf ¶
type VRFDomAf struct {
Type AddressFamily `json:"type"`
CtrlItems VRFDomAfCtrlItems `json:"ctrl-items,omitzero"`
}
func (*VRFDomAf) Key ¶
func (af *VRFDomAf) Key() AddressFamily
type VRFDomAfCtrl ¶
type VRFDomAfCtrl struct {
Type AddressFamily `json:"type"`
RttpItems VRFRttpItems `json:"rttp-items,omitzero"`
}
func (*VRFDomAfCtrl) Key ¶
func (c *VRFDomAfCtrl) Key() AddressFamily
type VRFDomAfCtrlItems ¶
type VRFDomAfCtrlItems struct {
AfCtrlList gnmiext.List[AddressFamily, *VRFDomAfCtrl] `json:"AfCtrl-list,omitzero"`
}
type VRFDomAfItems ¶
type VRFDomAfItems struct {
DomAfList gnmiext.List[AddressFamily, *VRFDomAf] `json:"DomAf-list,omitzero"`
}
type VRFDomItems ¶
type VRFRttpItems ¶
type VRFRttpItems struct {
RttPList gnmiext.List[RttEntryType, *RttEntry] `json:"RttP-list,omitzero"`
}
type VTY ¶
type VTY struct {
ExecTmeoutItems struct {
// Maximum time allowed for a command to execute in minutes.
// Leave unspecified (zero) to disable.
Timeout int `json:"timeout"`
} `json:"execTmeout-items"`
SsLmtItems struct {
// Maximum number of concurrent vsh sessions.
SesLmt int8 `json:"sesLmt"`
} `json:"ssLmt-items"`
}
VTY represents the virtual terminal line configuration.
type VTYAccessClass ¶
type VTYAccessClass struct {
// IPv4 access control list to be applied for packets.
Name string `json:"name"`
}
VTYAccessClass represents the access control list applied to packets.
func (*VTYAccessClass) XPath ¶
func (v *VTYAccessClass) XPath() string
type VXLAN ¶
VXLAN represents VXLAN encapsulation settings for a VLAN. It is part of the Bridge Domain configuration of a VLAN.
func (VXLAN) MarshalJSON ¶
func (*VXLAN) UnmarshalJSON ¶
type Version ¶
type Version string
Version represents the operating system version of the target device.
const ( VersionUnknown Version = "Unknown" VersionNX10_4_3 Version = "10.4(3)" VersionNX10_4_4 Version = "10.4(4)" VersionNX10_4_5 Version = "10.4(5)" VersionNX10_4_6 Version = "10.4(6)" VersionNX10_5_1 Version = "10.5(1)" VersionNX10_5_2 Version = "10.5(2)" VersionNX10_5_3 Version = "10.5(3)" VersionNX10_6_1 Version = "10.6(1)" VersionNX10_6_2 Version = "10.6(2)" )
func NXVersion ¶
func NXVersion(c *gnmiext.Capabilities) Version
NXVersion returns the NX-OS operating system version of the target device based on the supported models. If the version cannot be determined, VersionUnknown is returned.