nxos

package
v0.0.0-...-9162fe5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

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

View Source
const (
	DefaultVLAN      = "vlan-1"
	DefaultVLANRange = "1-4094"
	DefaultMTU       = 1500
)
View Source
const (
	DefaultBwRef = 40_000 // 40 Gbps
	DefaultDist  = 110
)
View Source
const (
	DefaultVRFName    = "default"
	ManagementVRFName = "management"
)
View Source
const Manufacturer = "Cisco"
View Source
const RouteReflectorClient = "rr-client"

Variables

View Source
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

View Source
var ErrInterfaceNotFound = errors.New("one or more interfaces do not exist")

Functions

func Community

func Community(c string) (string, error)

func Exists

func Exists(ctx context.Context, client gnmiext.Client, names ...string) (bool, error)

Exists checks if all provided interface names exist on the device.

func NewProvider

func NewProvider() provider.Provider

func ParsePasswordSalt

func ParsePasswordSalt(hash string) (salt [10]byte, err error)

func Range

func Range(r []int32) string

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 Reboot

func Reboot(ctx context.Context, conn *grpc.ClientConn) error

func ResetToFactoryDefaults

func ResetToFactoryDefaults(ctx context.Context, conn *grpc.ClientConn) error

func RouteDistinguisher

func RouteDistinguisher(rd string) (string, error)

func RouteTarget

func RouteTarget(rt string) (string, error)

func ShortName

func ShortName(name string) (string, error)

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 ShortNameLoopback(name string) (string, error)

func ShortNamePhysicalInterface

func ShortNamePhysicalInterface(name string) (string, error)

func ShortNamePortChannel

func ShortNamePortChannel(name string) (string, error)

func ShortNameVLAN

func ShortNameVLAN(name string) (string, error)

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()

func (*ACL) XPath

func (a *ACL) XPath() string

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"`
}

func (*ACLEntry) Key

func (e *ACLEntry) Key() int32

type AFTYPE

type AFTYPE string
const (
	AFType0 AFTYPE = "type-0"
	AFType1 AFTYPE = "type-1"
	AFType2 AFTYPE = "type-2"
)

type ASCIIStr

type ASCIIStr string

ASCIIStr represents a string, encoded as a sequence of comma-separated ASCII code points (0 - 127).

func (ASCIIStr) String

func (s ASCIIStr) String() string

String decodes the ASCIIStr into a regular string, stopping at the first null character (ASCII code 0).

type Action

type Action string
const (
	ActionPermit Action = "permit"
	ActionDeny   Action = "deny"
)

func ActionFrom

func ActionFrom(act v1alpha1.ACLAction) (Action, error)

type AddrDom

type AddrDom struct {
	Name    string `json:"name"`
	IfItems struct {
		IfList gnmiext.List[string, *AddrItem] `json:"If-list,omitzero"`
	} `json:"if-items,omitzero"`
}

func (*AddrDom) Key

func (d *AddrDom) Key() string

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()

func (*AddrItem) Key

func (a *AddrItem) Key() string

func (*AddrItem) XPath

func (a *AddrItem) XPath() string

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

func (a *AddrList) GetAddrItemsByInterface(name string) []*AddrItem

GetAddrItemsByInterface retrieves the address items for a given interface name.

func (*AddrList) XPath

func (a *AddrList) XPath() string

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").

const (
	AdminStEnabled  AdminSt = "enabled"
	AdminStDisabled AdminSt = "disabled"
)

type AdminSt2

type AdminSt2 string

AdminSt2 represents the administrative state of a component ("up" or "down").

const (
	AdminStUp   AdminSt2 = "up"
	AdminStDown AdminSt2 = "down"
)

type AdminSt3

type AdminSt3 string

AdminSt3 represents the administrative state of a component ("off" or "on").

const (
	AdminStOff AdminSt3 = "off"
	AdminStOn  AdminSt3 = "on"
)

type AdminSt4

type AdminSt4 string

AdminSt4 represents the administrative state of a component ("enable" or "disable").

const (
	AdminStEnable  AdminSt4 = "enable"
	AdminStDisable AdminSt4 = "disable"
)

type AnycastPeerAddr

type AnycastPeerAddr struct {
	Addr      string `json:"addr"`
	RpSetAddr string `json:"rpSetAddr"`
}

AnycastPeerAddr represents an anycast RP peer address configuration used for redundancy in PIM.

func (*AnycastPeerAddr) IsListItem

func (*AnycastPeerAddr) IsListItem()

func (*AnycastPeerAddr) Key

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 AsFormat

type AsFormat string
const (
	AsFormatAsDot AsFormat = "as-dot"
)

func (AsFormat) XPath

func (AsFormat) 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()

func (*BDEVI) XPath

func (b *BDEVI) XPath() string

type BDItems

type BDItems struct {
	BdList []struct {
		AccEncap string `json:"accEncap"`
		FabEncap string `json:"fabEncap"`
	} `json:"BD-list"`
}

func (*BDItems) GetByVXLAN

func (b *BDItems) GetByVXLAN(v string) *VXLAN

func (*BDItems) XPath

func (*BDItems) XPath() string

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()

func (*BFD) Validate

func (b *BFD) Validate() error

func (*BFD) XPath

func (b *BFD) XPath() string

type BGP

type BGP struct {
	AdminSt AdminSt `json:"adminSt"`
	Asn     string  `json:"asn"`
}

func (*BGP) XPath

func (*BGP) XPath() string

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()

func (*BGPDom) Key

func (d *BGPDom) Key() string

func (*BGPDom) XPath

func (d *BGPDom) XPath() string

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

type BGPDomItems struct {
	DomList gnmiext.List[string, *BGPDom] `json:"Dom-list,omitzero"`
}

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()

func (*BGPPeer) XPath

func (p *BGPPeer) XPath() string

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

type BGPPeerGroup

type BGPPeerGroup struct {
	VRFName string `json:"-"`
	Name    string `json:"name"`
}

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 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.

func (*Banner) Default

func (b *Banner) Default()

func (*Banner) XPath

func (b *Banner) XPath() string

type BannerType

type BannerType string
const (
	PreLogin  BannerType = "prelogin"
	PostLogin BannerType = "postlogin"
)

func BannerTypeFrom

func BannerTypeFrom(bt v1alpha1.BannerType) (BannerType, error)

type BdState

type BdState string
const (
	// BdStateActive indicates that the bridge domain is active
	BdStateActive BdState = "active"
	// BdStateInactive indicates that the bridge domain is inactive/suspended
	BdStateInactive BdState = "suspend"
)

type BootPOAP

type BootPOAP string

func (*BootPOAP) XPath

func (*BootPOAP) XPath() string

type BootTime

type BootTime UnixTime

func (*BootTime) UnmarshalJSON

func (t *BootTime) UnmarshalJSON(b []byte) error

func (*BootTime) XPath

func (*BootTime) XPath() string

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"
)

type BorderGatewaySettingsRequest

type BorderGatewaySettingsRequest struct {
	BorderGateway   *nxv1alpha1.BorderGateway
	SourceInterface *v1alpha1.Interface
	Interconnects   []BorderGatewayInterconnect
	Peers           []BorderGatewayPeer
}

type BwRefUnit

type BwRefUnit string
const (
	BwRefUnitMbps BwRefUnit = "mbps"
	BwRefUnitGbps BwRefUnit = "gbps"
)

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 CommItem

type CommItem struct {
	Community string `json:"community"`
}

func (*CommItem) Key

func (c *CommItem) Key() string

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.

func (*Console) Default

func (c *Console) Default()

func (*Console) Validate

func (c *Console) Validate() error

func (*Console) XPath

func (*Console) XPath() string

type Criteria

type Criteria string
const (
	CriteriaExact   Criteria = "exact"
	CriteriaInexact Criteria = "inexact"
)

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()

func (*DHCPRelay) Key

func (d *DHCPRelay) Key() string

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.

func (*DNS) XPath

func (*DNS) XPath() string

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"`
}

func (*DNSProf) Key

func (p *DNSProf) Key() string

type DNSProv

type DNSProv struct {
	Addr  string `json:"addr"`
	SrcIf string `json:"srcIf,omitempty"`
}

func (*DNSProv) Key

func (p *DNSProv) Key() string

type DNSVrf

type DNSVrf struct {
	Name      string `json:"name"`
	ProvItems struct {
		ProviderList gnmiext.List[string, *DNSProv] `json:"Provider-list,omitzero"`
	} `json:"prov-items,omitzero"`
}

func (*DNSVrf) Key

func (v *DNSVrf) Key() string

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

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 Encrypt

type Encrypt struct{ Salt []byte }

func (Encrypt) Encode

func (e Encrypt) Encode(password string) (string, PwdEncryptType, error)

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()

func (*FabricFwd) XPath

func (*FabricFwd) XPath() string

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 Feature

type Feature struct {
	Name    string  `json:"-"`
	AdminSt AdminSt `json:"adminSt"`
}

Feature represents a dynamic feature configuration on a NX-OS device.

func (*Feature) Default

func (f *Feature) Default()

func (*Feature) XPath

func (f *Feature) XPath() string

type FecMode

type FecMode string
const (
	FecModeAuto FecMode = "auto"
	FecModeCL74 FecMode = "fc-fec"
	FecModeCL91 FecMode = "rs-fec"
	FecModeOff  FecMode = "fec-off"
)

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 FwdMode

type FwdMode string
const (
	FwdModeStandard       FwdMode = "standard"
	FwdModeAnycastGateway FwdMode = "anycastGW"
	FwdModeProxyGateway   FwdMode = "proxyGW"
)

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.

func (*GNMI) Default

func (g *GNMI) Default()

func (*GNMI) Validate

func (g *GNMI) Validate() error

func (*GNMI) XPath

func (*GNMI) XPath() string

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.

func (*GRPC) Default

func (g *GRPC) Default()

func (*GRPC) Validate

func (g *GRPC) Validate() error

func (*GRPC) XPath

func (*GRPC) XPath() string

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

type ICMPIf struct {
	ID   string `json:"id"`
	Ctrl string `json:"ctrl"`
}

func (*ICMPIf) IsListItem

func (*ICMPIf) IsListItem()

func (*ICMPIf) XPath

func (i *ICMPIf) XPath() string

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()

func (*ISIS) XPath

func (i *ISIS) XPath() string

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"`
}

func (*ISISDom) Key

func (d *ISISDom) Key() string

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 ISISLevel

type ISISLevel string
const (
	ISISLevel1  ISISLevel = "l1"
	ISISLevel2  ISISLevel = "l2"
	ISISLevel12 ISISLevel = "l12"
)

func ISISLevelFrom

func ISISLevelFrom(level v1alpha1.ISISLevel) ISISLevel

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"`
}

func (*IntfAddr) Key

func (a *IntfAddr) Key() string

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()

func (*KeyPair) XPath

func (k *KeyPair) XPath() string

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()

func (*LLDP) XPath

func (*LLDP) XPath() string

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()

func (*LLDPOper) XPath

func (*LLDPOper) XPath() string

type Layer

type Layer string
const (
	Layer2 Layer = "Layer2"
	Layer3 Layer = "Layer3"
)

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()

func (*Loopback) XPath

func (l *Loopback) XPath() string

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 Medium

type Medium string
const (
	MediumBroadcast    Medium = "broadcast"
	MediumPointToPoint Medium = "p2p"
)

type MessageType

type MessageType string
const (
	Informs MessageType = "Informs"
	Traps   MessageType = "Traps"
)

type Model

type Model string

Model is the chassis model of the device, e.g. "N9K-C9336C-FX2".

func (*Model) XPath

func (*Model) XPath() string

type MultisiteBorderGatewayInterface

type MultisiteBorderGatewayInterface string

func (*MultisiteBorderGatewayInterface) XPath

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

type MultisiteIfTrackingMode

type MultisiteIfTrackingMode string
const (
	MultisiteIfTrackingModeDCI    MultisiteIfTrackingMode = "dci"
	MultisiteIfTrackingModeFabric MultisiteIfTrackingMode = "fabric"
)

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.

func (*NTP) Default

func (n *NTP) Default()

func (*NTP) XPath

func (*NTP) XPath() string

type NTPConfig

type NTPConfig struct {
	Log struct {
		Enable bool `json:"enable"`
	} `json:"log"`
}

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

func (n *NVE) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*NVE) XPath

func (n *NVE) XPath() string

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()

func (*NVEOper) XPath

func (n *NVEOper) XPath() string

type NtwType

type NtwType string
const (
	NtwTypeUnspecified  NtwType = "unspecified"
	NtwTypeBroadcast    NtwType = "bcast"
	NtwTypePointToPoint NtwType = "p2p"
)

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()

func (*OSPF) XPath

func (o *OSPF) XPath() string

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"`
}

func (*OSPFDom) Key

func (o *OSPFDom) Key() string

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 OperSt

type OperSt string

OperSt represents the operational state of a component.

const (
	OperStUp      OperSt = "up"
	OperStDown    OperSt = "down"
	OperStUnknown OperSt = "unknown"
	OperStLinkUp  OperSt = "link-up"
)

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 (o Option[T]) MarshalJSON() ([]byte, error)

func (*Option[T]) UnmarshalJSON

func (o *Option[T]) UnmarshalJSON(b []byte) error

type OspfBfdCtrl

type OspfBfdCtrl string
const (
	OspfBfdCtrlUnspecified OspfBfdCtrl = "unspecified"
	OspfBfdCtrlEnabled     OspfBfdCtrl = "enabled"
	OspfBfdCtrlDisabled    OspfBfdCtrl = "disabled"
)

type PBKDF2

type PBKDF2 struct{ Salt [10]byte }

func (PBKDF2) Encode

func (p PBKDF2) Encode(password string) (string, PwdEncryptType, error)

type PIM

type PIM struct {
	AdminSt   AdminSt `json:"adminSt"`
	InstItems struct {
		AdminSt AdminSt `json:"adminSt"`
	} `json:"inst-items"`
}

func (*PIM) XPath

func (*PIM) XPath() string

type PIMDom

type PIMDom struct {
	Name    string  `json:"name"`
	AdminSt AdminSt `json:"adminSt"`
}

func (*PIMDom) IsListItem

func (*PIMDom) IsListItem()

func (*PIMDom) XPath

func (p *PIMDom) XPath() string

type PIMIf

type PIMIf struct {
	ID            string `json:"id"`
	PimSparseMode bool   `json:"pimSparseMode"`
}

func (*PIMIf) IsListItem

func (*PIMIf) IsListItem()

func (*PIMIf) Key

func (i *PIMIf) Key() string

func (*PIMIf) XPath

func (i *PIMIf) XPath() string

type PIMIfItems

type PIMIfItems struct {
	IfList gnmiext.List[string, *PIMIf] `json:"If-list,omitzero"`
}

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) Default

func (p *PhysIf) Default()

func (*PhysIf) IsListItem

func (*PhysIf) IsListItem()

func (*PhysIf) Validate

func (p *PhysIf) Validate() error

func (*PhysIf) XPath

func (p *PhysIf) XPath() string

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 Plain

type Plain struct{}

func (Plain) Encode

func (Plain) Encode(password string) (string, PwdEncryptType, error)

type Port

type Port struct {
	ID        string `json:"id"`
	PhysItems struct {
		FcotItems struct {
			Description string `json:"description"`
		} `json:"fcot-items"`
		PortcapItems struct {
			Speed string   `json:"speed"`
			Type  ASCIIStr `json:"type"`
		} `json:"portcap-items"`
	} `json:"phys-items"`
}

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

type PortChannelMember struct {
	TDn   string `json:"tDn"`
	Force bool   `json:"isMbrForce,omitempty"`
}

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 Ports

type Ports struct {
	PhysIfList []*Port `json:"PhysIf-list"`
}

func (Ports) XPath

func (p Ports) 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 Protocol

type Protocol uint8
const (
	ProtocolIP   Protocol = 0
	ProtocolICMP Protocol = 1
	ProtocolTCP  Protocol = 6
	ProtocolUDP  Protocol = 17
	ProtocolOSPF Protocol = 89
	ProtocolPIM  Protocol = 103
)

func ProtocolFrom

func ProtocolFrom(proto v1alpha1.Protocol) Protocol

type ProvType

type ProvType string
const (
	ProvTypePeer   ProvType = "peer"
	ProvTypeServer ProvType = "server"
)

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) DeleteACL

func (p *Provider) DeleteACL(ctx context.Context, req *provider.DeleteACLRequest) error

func (*Provider) DeleteBGP

func (p *Provider) DeleteBGP(ctx context.Context, req *provider.DeleteBGPRequest) error

func (*Provider) DeleteBGPPeer

func (p *Provider) DeleteBGPPeer(ctx context.Context, req *provider.DeleteBGPPeerRequest) error

func (*Provider) DeleteBanner

func (p *Provider) DeleteBanner(ctx context.Context, req *provider.DeleteBannerRequest) error

func (*Provider) DeleteCertificate

func (p *Provider) DeleteCertificate(ctx context.Context, req *provider.DeleteCertificateRequest) error

func (*Provider) DeleteDHCPRelay

func (p *Provider) DeleteDHCPRelay(ctx context.Context, req *provider.DHCPRelayRequest) error

DeleteDHCPRelay removes all DHCP relay configurations from the device.

func (*Provider) DeleteDNS

func (p *Provider) DeleteDNS(ctx context.Context) error

func (*Provider) DeleteEVPNInstance

func (p *Provider) DeleteEVPNInstance(ctx context.Context, req *provider.EVPNInstanceRequest) error

func (*Provider) DeleteISIS

func (p *Provider) DeleteISIS(ctx context.Context, req *provider.DeleteISISRequest) error

func (*Provider) DeleteInterface

func (p *Provider) DeleteInterface(ctx context.Context, req *provider.InterfaceRequest) error

func (*Provider) DeleteLLDP

func (p *Provider) DeleteLLDP(ctx context.Context, req *provider.LLDPRequest) error

func (*Provider) DeleteManagementAccess

func (p *Provider) DeleteManagementAccess(ctx context.Context) error

func (*Provider) DeleteNTP

func (p *Provider) DeleteNTP(ctx context.Context) error

func (*Provider) DeleteNVE

func (p *Provider) DeleteNVE(ctx context.Context, req *provider.NVERequest) error

func (*Provider) DeleteOSPF

func (p *Provider) DeleteOSPF(ctx context.Context, req *provider.DeleteOSPFRequest) error

func (*Provider) DeletePIM

func (p *Provider) DeletePIM(ctx context.Context, _ *provider.DeletePIMRequest) error

func (*Provider) DeletePrefixSet

func (p *Provider) DeletePrefixSet(ctx context.Context, req *provider.PrefixSetRequest) error

func (*Provider) DeleteRoutingPolicy

func (p *Provider) DeleteRoutingPolicy(ctx context.Context, req *provider.DeleteRoutingPolicyRequest) error

func (*Provider) DeleteSNMP

func (p *Provider) DeleteSNMP(ctx context.Context, req *provider.DeleteSNMPRequest) error

func (*Provider) DeleteSyslog

func (p *Provider) DeleteSyslog(ctx context.Context) error

func (*Provider) DeleteUser

func (p *Provider) DeleteUser(ctx context.Context, req *provider.DeleteUserRequest) error

func (*Provider) DeleteVLAN

func (p *Provider) DeleteVLAN(ctx context.Context, req *provider.VLANRequest) error

func (*Provider) DeleteVPCDomain

func (p *Provider) DeleteVPCDomain(ctx context.Context) error

func (*Provider) DeleteVRF

func (p *Provider) DeleteVRF(ctx context.Context, req *provider.VRFRequest) error

func (*Provider) Disconnect

func (p *Provider) Disconnect(_ context.Context, _ *deviceutil.Connection) error

func (*Provider) EnsureACL

func (p *Provider) EnsureACL(ctx context.Context, req *provider.EnsureACLRequest) error

func (*Provider) EnsureBGP

func (p *Provider) EnsureBGP(ctx context.Context, req *provider.EnsureBGPRequest) (reterr error)

func (*Provider) EnsureBGPPeer

func (p *Provider) EnsureBGPPeer(ctx context.Context, req *provider.EnsureBGPPeerRequest) error

func (*Provider) EnsureBanner

func (p *Provider) EnsureBanner(ctx context.Context, req *provider.EnsureBannerRequest) (reterr error)

func (*Provider) EnsureBorderGatewaySettings

func (p *Provider) EnsureBorderGatewaySettings(ctx context.Context, req *BorderGatewaySettingsRequest) error

func (*Provider) EnsureCertificate

func (p *Provider) EnsureCertificate(ctx context.Context, req *provider.EnsureCertificateRequest) error

func (*Provider) EnsureDHCPRelay

func (p *Provider) EnsureDHCPRelay(ctx context.Context, req *provider.DHCPRelayRequest) error

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) EnsureDNS

func (p *Provider) EnsureDNS(ctx context.Context, req *provider.EnsureDNSRequest) error

func (*Provider) EnsureEVPNInstance

func (p *Provider) EnsureEVPNInstance(ctx context.Context, req *provider.EVPNInstanceRequest) (err error)

func (*Provider) EnsureISIS

func (p *Provider) EnsureISIS(ctx context.Context, req *provider.EnsureISISRequest) error

func (*Provider) EnsureInterface

func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInterfaceRequest) error

func (*Provider) EnsureInterfacesExist

func (p *Provider) EnsureInterfacesExist(ctx context.Context, interfaces []*v1alpha1.Interface) (names []string, err error)

func (*Provider) EnsureLLDP

func (p *Provider) EnsureLLDP(ctx context.Context, req *provider.LLDPRequest) error

func (*Provider) EnsureManagementAccess

func (p *Provider) EnsureManagementAccess(ctx context.Context, req *provider.EnsureManagementAccessRequest) error

func (*Provider) EnsureNTP

func (p *Provider) EnsureNTP(ctx context.Context, req *provider.EnsureNTPRequest) error

func (*Provider) EnsureNVE

func (p *Provider) EnsureNVE(ctx context.Context, req *provider.NVERequest) error

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 (p *Provider) EnsureOSPF(ctx context.Context, req *provider.EnsureOSPFRequest) error

func (*Provider) EnsurePIM

func (p *Provider) EnsurePIM(ctx context.Context, req *provider.EnsurePIMRequest) error

func (*Provider) EnsurePrefixSet

func (p *Provider) EnsurePrefixSet(ctx context.Context, req *provider.PrefixSetRequest) error

func (*Provider) EnsureRoutingPolicy

func (p *Provider) EnsureRoutingPolicy(ctx context.Context, req *provider.EnsureRoutingPolicyRequest) error

func (*Provider) EnsureSNMP

func (p *Provider) EnsureSNMP(ctx context.Context, req *provider.EnsureSNMPRequest) error

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 (p *Provider) EnsureSyslog(ctx context.Context, req *provider.EnsureSyslogRequest) error

func (*Provider) EnsureSystemSettings

func (p *Provider) EnsureSystemSettings(ctx context.Context, s *nxv1alpha1.System) error

func (*Provider) EnsureUser

func (p *Provider) EnsureUser(ctx context.Context, req *provider.EnsureUserRequest) error

func (*Provider) EnsureVLAN

func (p *Provider) EnsureVLAN(ctx context.Context, req *provider.VLANRequest) error

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) EnsureVRF

func (p *Provider) EnsureVRF(ctx context.Context, req *provider.VRFRequest) error

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 (p *Provider) GetDeviceInfo(ctx context.Context) (*provider.DeviceInfo, error)

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 (p *Provider) GetLastRebootTime(ctx context.Context) (time.Time, error)

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 (*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 (p *Provider) HashProvisioningPassword(password string) (hashed, encryptType string, err error)

func (*Provider) ListPorts

func (p *Provider) ListPorts(ctx context.Context) ([]provider.DevicePort, error)

func (*Provider) Patch

func (p *Provider) Patch(ctx context.Context, patches ...gnmiext.DataElement) error

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 (p *Provider) ResetBorderGatewaySettings(ctx context.Context) error

func (*Provider) ResetSystemSettings

func (p *Provider) ResetSystemSettings(ctx context.Context) error

func (*Provider) Update

func (p *Provider) Update(ctx context.Context, updates ...gnmiext.DataElement) error

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()

func (*RouteMap) XPath

func (rm *RouteMap) XPath() string

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 Rtt

type Rtt struct {
	Rtt string `json:"rtt"`
}

func (*Rtt) Key

func (r *Rtt) Key() string

type RttEntItems

type RttEntItems struct {
	RttEntryList gnmiext.List[string, *Rtt] `json:"RttEntry-list,omitzero"`
}

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

func (*SNMPHost) XPath

func (s *SNMPHost) XPath() string

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 SNMPHostKey struct {
	HostName  string
	UDPPortID int
}

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.

func (*SNMPSrcIf) XPath

func (s *SNMPSrcIf) XPath() string

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 SNMPTraps

type SNMPTraps struct {
	Trapstatus AdminSt4 `json:"trapstatus"`
}

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()

func (*SNMPUser) XPath

func (s *SNMPUser) XPath() string

type SVIMedium

type SVIMedium string
const (
	SVIMediumBroadcast    SVIMedium = "bcast"
	SVIMediumPointToPoint SVIMedium = "p2p"
)

type Scrypt

type Scrypt struct{ Salt [10]byte }

func (Scrypt) Encode

func (s Scrypt) Encode(password string) (string, PwdEncryptType, error)

type SecLevel

type SecLevel string
const (
	SecLevelNoAuth SecLevel = "noauth"
	SecLevelAuth   SecLevel = "auth"
)

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()

func (*StaticRP) Key

func (rp *StaticRP) Key() string

func (*StaticRP) XPath

func (rp *StaticRP) XPath() string

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

type SwitchportMode

type SwitchportMode string
const (
	SwitchportModeAccess SwitchportMode = "access"
	SwitchportModeTrunk  SwitchportMode = "trunk"
)

type SyslogConfig

type SyslogConfig struct {
	OriginID            string
	SourceInterfaceName string
	HistorySize         uint32
	HistoryLevel        v1alpha1.Severity
}

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

type SyslogSrcIf struct {
	AdminSt AdminSt `json:"adminState"`
	IfName  string  `json:"ifName"`
}

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 Transport

type Transport string
const (
	TransportUDP Transport = "udp"
	TransportTCP Transport = "tcp"
)

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

type UnixTime struct {
	time.Time `json:"-"`
}

UnixTime is a wrapper around time.Time that marshals/unmarshals to/from a Unix timestamp in seconds.

func (*UnixTime) UnmarshalJSON

func (t *UnixTime) UnmarshalJSON(b []byte) error

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()

func (*User) SetPassword

func (u *User) SetPassword(password string, encoder Encoder) error

func (*User) XPath

func (u *User) XPath() string

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

const (
	UserFlagAdminState UserFlags = 1 << iota
	UserFlagAdminLayer
	UserFlagAdminRouterMac
	UserFlagAdminDceMode
	UserFlagAdminMTU
)

func (UserFlags) MarshalJSON

func (f UserFlags) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (UserFlags) String

func (f UserFlags) String() string

String implements fmt.Stringer.

func (*UserFlags) UnmarshalJSON

func (f *UserFlags) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UserRole

type UserRole struct {
	Name string `json:"name"`
}

func (*UserRole) Key

func (r *UserRole) Key() string

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()

func (*VLAN) XPath

func (v *VLAN) XPath() string

type VLANOperItems

type VLANOperItems struct {
	FabEncap string `json:"-"`
	OperSt   OperSt `json:"operSt"`
}

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()

func (*VNI) XPath

func (v *VNI) XPath() string

type VNIOperItems

type VNIOperItems struct {
	Vni   int32  `json:"vni"`
	State OperSt `json:"state"`
}

func (*VNIOperItems) XPath

func (v *VNIOperItems) XPath() string

type VNIState

type VNIState string
const (
	VNIStateUp   VNIState = "Up"
	VNIStateDown VNIState = "Down"
)

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)

func (*VPCDomain) XPath

func (*VPCDomain) XPath() string

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 VPCDomainRole

type VPCDomainRole string

VPCDomainRole represents the role of a vPC peer.

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

func (v *VPCIf) SetPortChannel(name string)

func (*VPCIf) XPath

func (v *VPCIf) XPath() string

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()

func (*VRF) XPath

func (v *VRF) XPath() string

type VRFDom

type VRFDom struct {
	Name    string        `json:"name"`
	Rd      string        `json:"rd,omitempty"`
	AfItems VRFDomAfItems `json:"af-items,omitzero"`
}

func (*VRFDom) Key

func (d *VRFDom) Key() string

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 VRFDomItems struct {
	DomList gnmiext.List[string, *VRFDom] `json:"Dom-list,omitzero"`
}

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.

func (*VTY) Default

func (v *VTY) Default()

func (*VTY) Validate

func (v *VTY) Validate() error

func (*VTY) XPath

func (*VTY) XPath() string

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

type VXLAN struct {
	AccEncap string `json:"-"`
	FabEncap string `json:"-"`
}

VXLAN represents VXLAN encapsulation settings for a VLAN. It is part of the Bridge Domain configuration of a VLAN.

func (VXLAN) MarshalJSON

func (v VXLAN) MarshalJSON() ([]byte, error)

func (*VXLAN) UnmarshalJSON

func (v *VXLAN) UnmarshalJSON(b []byte) error

func (*VXLAN) XPath

func (v *VXLAN) XPath() string

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.

type VrfMember

type VrfMember struct {
	TDn    string `json:"tDn"`
	IfName string `json:"-"`
}

VrfMember represents a VRF associtation for an interface.

func NewVrfMember

func NewVrfMember(ifName, vrfName string) *VrfMember

func (*VrfMember) XPath

func (v *VrfMember) XPath() string

Jump to

Keyboard shortcuts

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