provider

package
v0.0.0-...-db2fe5d Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Providers

func Providers() []string

Providers returns a slice of all registered provider names.

func Register

func Register(name string, provider ProviderFunc)

Register registers a new provider with the given name. If a provider with the same name already exists, it panics.

Types

type ACLProvider

type ACLProvider interface {
	Provider

	// EnsureACL call is responsible for AccessControlList realization on the provider.
	EnsureACL(context.Context, *EnsureACLRequest) error
	// DeleteACL call is responsible for AccessControlList deletion on the provider.
	DeleteACL(context.Context, *DeleteACLRequest) error
}

ACLProvider is the interface for the realization of the AccessControlList objects over different providers.

type BGPPeerProvider

type BGPPeerProvider interface {
	Provider

	// EnsureBGPPeer call is responsible for BGPPeer realization on the provider.
	EnsureBGPPeer(context.Context, *EnsureBGPPeerRequest) error
	// DeleteBGPPeer call is responsible for BGPPeer deletion on the provider.
	DeleteBGPPeer(context.Context, *DeleteBGPPeerRequest) error
	// GetPeerStatus call is responsible for retrieving the current status of the BGPPeer from the provider.
	GetPeerStatus(context.Context, *BGPPeerStatusRequest) (BGPPeerStatus, error)
}

BGPPeerProvider is the interface for the realization of the BGPPeer objects over different providers.

type BGPPeerStatus

type BGPPeerStatus struct {
	SessionState        v1alpha1.BGPPeerSessionState
	LastEstablishedTime time.Time
	AddressFamilies     map[v1alpha1.BGPAddressFamilyType]*PrefixStats
}

type BGPPeerStatusRequest

type BGPPeerStatusRequest struct {
	BGPPeer        *v1alpha1.BGPPeer
	ProviderConfig *ProviderConfig
}

type BGPProvider

type BGPProvider interface {
	Provider

	// EnsureBGP call is responsible for BGP realization on the provider.
	EnsureBGP(context.Context, *EnsureBGPRequest) error
	// DeleteBGP call is responsible for BGP deletion on the provider.
	DeleteBGP(context.Context, *DeleteBGPRequest) error
}

BGPProvider is the interface for the realization of the BGP objects over different providers.

type BannerProvider

type BannerProvider interface {
	Provider

	// EnsureBanner call is responsible for Banner realization on the provider.
	EnsureBanner(context.Context, *BannerRequest) error
	// DeleteBanner call is responsible for Banner deletion on the provider.
	DeleteBanner(context.Context) error
}

BannerProvider is the interface for the realization of the Banner objects over different providers.

type BannerRequest

type BannerRequest struct {
	Message        string
	ProviderConfig *ProviderConfig
}

type CertificateProvider

type CertificateProvider interface {
	Provider

	// EnsureCertificate call is responsible for Certificate realization on the provider.
	EnsureCertificate(context.Context, *EnsureCertificateRequest) error
	// DeleteCertificate call is responsible for Certificate deletion on the provider.
	DeleteCertificate(context.Context, *DeleteCertificateRequest) error
}

CertificateProvider is the interface for the realization of the Certificate objects over different providers.

type DNSProvider

type DNSProvider interface {
	Provider

	// EnsureDNS call is responsible for DNS realization on the provider.
	EnsureDNS(context.Context, *EnsureDNSRequest) error
	// DeleteDNS call is responsible for DNS deletion on the provider.
	DeleteDNS(context.Context) error
}

DNSProvider is the interface for the realization of the DNS objects over different providers.

type DeleteACLRequest

type DeleteACLRequest struct {
	Name           string
	ProviderConfig *ProviderConfig
}

type DeleteBGPPeerRequest

type DeleteBGPPeerRequest struct {
	BGPPeer        *v1alpha1.BGPPeer
	ProviderConfig *ProviderConfig
}

type DeleteBGPRequest

type DeleteBGPRequest struct {
	BGP            *v1alpha1.BGP
	ProviderConfig *ProviderConfig
}

type DeleteCertificateRequest

type DeleteCertificateRequest struct {
	ID             string
	ProviderConfig *ProviderConfig
}

type DeleteISISRequest

type DeleteISISRequest struct {
	ISIS           *v1alpha1.ISIS
	ProviderConfig *ProviderConfig
}

type DeleteOSPFRequest

type DeleteOSPFRequest struct {
	OSPF           *v1alpha1.OSPF
	ProviderConfig *ProviderConfig
}

type DeletePIMRequest

type DeletePIMRequest struct {
	PIM            *v1alpha1.PIM
	ProviderConfig *ProviderConfig
}

type DeleteSNMPRequest

type DeleteSNMPRequest struct {
	ProviderConfig *ProviderConfig
}

type DeleteUserRequest

type DeleteUserRequest struct {
	Username       string
	ProviderConfig *ProviderConfig
}

type DeviceInfo

type DeviceInfo struct {
	// Manufacturer is the manufacturer of the device, e.g. "Cisco".
	Manufacturer string
	// Model is the model of the device, e.g. "N9K-C9332D-GX2B".
	Model string
	// SerialNumber is the serial number of the device.
	SerialNumber string
	// FirmwareVersion is the firmware version running on the device, e.g. "10.4(3)".
	FirmwareVersion string
}

type DevicePort

type DevicePort struct {
	// ID is the unique identifier of the port on the device.
	ID string
	// Type is the type of the port, e.g. "10g".
	Type string
	// SupportedSpeedsGbps is the list of supported speeds for the port in Gbps.
	SupportedSpeedsGbps []int32
	// Trasceiver is the type of transceiver present on the port, e.g. "SFP" or "QSFP", if any.
	Transceiver string
}

type DeviceProvider

type DeviceProvider interface {
	Provider

	// ListPorts retrieves the list of available ports on the device.
	// This can be used to validate port references in other resources.
	ListPorts(context.Context) ([]DevicePort, error)
	// GetDeviceInfo retrieves basic information about the device,
	// such as manufacturer, model, serial number, and firmware version.
	GetDeviceInfo(context.Context) (*DeviceInfo, error)
}

type EnsureACLRequest

type EnsureACLRequest struct {
	ACL            *v1alpha1.AccessControlList
	ProviderConfig *ProviderConfig
}

type EnsureBGPPeerRequest

type EnsureBGPPeerRequest struct {
	BGPPeer         *v1alpha1.BGPPeer
	ProviderConfig  *ProviderConfig
	SourceInterface string
}

type EnsureBGPRequest

type EnsureBGPRequest struct {
	BGP            *v1alpha1.BGP
	ProviderConfig *ProviderConfig
}

type EnsureCertificateRequest

type EnsureCertificateRequest struct {
	ID             string
	Certificate    *tls.Certificate
	ProviderConfig *ProviderConfig
}

type EnsureDNSRequest

type EnsureDNSRequest struct {
	DNS            *v1alpha1.DNS
	ProviderConfig *ProviderConfig
}

type EnsureISISRequest

type EnsureISISRequest struct {
	ISIS           *v1alpha1.ISIS
	Interfaces     []ISISInterface
	ProviderConfig *ProviderConfig
}

type EnsureManagementAccessRequest

type EnsureManagementAccessRequest struct {
	ManagementAccess *v1alpha1.ManagementAccess
	ProviderConfig   *ProviderConfig
}

type EnsureNTPRequest

type EnsureNTPRequest struct {
	NTP            *v1alpha1.NTP
	ProviderConfig *ProviderConfig
}

type EnsureOSPFRequest

type EnsureOSPFRequest struct {
	OSPF           *v1alpha1.OSPF
	ProviderConfig *ProviderConfig
	Interfaces     []OSPFInterface
}

type EnsurePIMRequest

type EnsurePIMRequest struct {
	PIM            *v1alpha1.PIM
	Interfaces     []PIMInterface
	ProviderConfig *ProviderConfig
}

type EnsureSNMPRequest

type EnsureSNMPRequest struct {
	SNMP           *v1alpha1.SNMP
	ProviderConfig *ProviderConfig
}

type EnsureSyslogRequest

type EnsureSyslogRequest struct {
	Syslog         *v1alpha1.Syslog
	ProviderConfig *ProviderConfig
}

type EnsureUserRequest

type EnsureUserRequest struct {
	Username       string
	Password       string
	SSHKey         string
	Roles          []string
	ProviderConfig *ProviderConfig
}

type IPv4

type IPv4 interface {
	// contains filtered or unexported methods
}

type IPv4AddressList

type IPv4AddressList []netip.Prefix

type IPv4Unnumbered

type IPv4Unnumbered struct {
	SourceInterface string
}

type ISISInterface

type ISISInterface struct {
	Interface *v1alpha1.Interface
	BFD       bool
}

type ISISProvider

type ISISProvider interface {
	Provider

	// EnsureISIS call is responsible for ISIS realization on the provider.
	EnsureISIS(context.Context, *EnsureISISRequest) error
	// DeleteISIS call is responsible for ISIS deletion on the provider.
	DeleteISIS(context.Context, *DeleteISISRequest) error
}

ISISProvider is the interface for the realization of the ISIS objects over different providers.

type InterfaceProvider

type InterfaceProvider interface {
	Provider

	// EnsureInterface call is responsible for Interface realization on the provider.
	EnsureInterface(context.Context, *InterfaceRequest) error
	// DeleteInterface call is responsible for Interface deletion on the provider.
	DeleteInterface(context.Context, *InterfaceRequest) error
	// GetInterfaceStatus call is responsible for retrieving the current status of the Interface from the provider.
	GetInterfaceStatus(context.Context, *InterfaceRequest) (InterfaceStatus, error)
}

InterfaceProvider is the interface for the realization of the Interface objects over different providers.

type InterfaceRequest

type InterfaceRequest struct {
	Interface      *v1alpha1.Interface
	ProviderConfig *ProviderConfig
	IPv4           IPv4

	// Members is the list of member interfaces for aggregated interfaces.
	// This field is only applicable if the interface type is Aggregate.
	Members []*v1alpha1.Interface
	// MultiChassisID is the multi-chassis identifier for multi-chassis link aggregation.
	MultiChassisID *int16
}

type InterfaceStatus

type InterfaceStatus struct {
	// OperStatus indicates whether the interface is operationally up (true) or down (false).
	OperStatus bool
}

type ManagementAccessProvider

type ManagementAccessProvider interface {
	Provider

	// EnsureManagementAccess call is responsible for ManagementAccess realization on the provider.
	EnsureManagementAccess(context.Context, *EnsureManagementAccessRequest) error
	// DeleteManagementAccess call is responsible for ManagementAccess deletion on the provider.
	DeleteManagementAccess(context.Context) error
}

ManagementAccessProvider is the interface for the realization of the ManagementAccess objects over different providers.

type NTPProvider

type NTPProvider interface {
	Provider

	// EnsureNTP call is responsible for NTP realization on the provider.
	EnsureNTP(context.Context, *EnsureNTPRequest) error
	// DeleteNTP call is responsible for NTP deletion on the provider.
	DeleteNTP(context.Context) error
}

NTPProvider is the interface for the realization of the NTP objects over different providers.

type OSPFInterface

type OSPFInterface struct {
	Interface *v1alpha1.Interface
	Area      string
	Passive   *bool
}

type OSPFNeighbor

type OSPFNeighbor struct {
	RouterID            string
	Address             string
	Interface           *v1alpha1.Interface
	Priority            uint8
	LastEstablishedTime time.Time
	AdjacencyState      v1alpha1.OSPFNeighborState
}

type OSPFProvider

type OSPFProvider interface {
	Provider

	// EnsureOSPF call is responsible for OSPF realization on the provider.
	EnsureOSPF(context.Context, *EnsureOSPFRequest) error
	// DeleteOSPF call is responsible for OSPF deletion on the provider.
	DeleteOSPF(context.Context, *DeleteOSPFRequest) error
	// GetOSPFStatus call is responsible for retrieving the current status of the OSPF from the provider.
	GetOSPFStatus(context.Context, *OSPFStatusRequest) (OSPFStatus, error)
}

OSPFProvider is the interface for the realization of the OSPF objects over different providers.

type OSPFStatus

type OSPFStatus struct {
	// OperStatus indicates whether the ospf instance is operationally up (true) or down (false).
	OperStatus bool
	// Neighbors is a list of OSPF neighbors and their adjacency states.
	Neighbors []OSPFNeighbor
}

type OSPFStatusRequest

type OSPFStatusRequest struct {
	OSPF           *v1alpha1.OSPF
	ProviderConfig *ProviderConfig
	Interfaces     []OSPFInterface
}

type PIMInterface

type PIMInterface struct {
	Interface *v1alpha1.Interface
	Mode      v1alpha1.PIMInterfaceMode
}

type PIMProvider

type PIMProvider interface {
	Provider

	// EnsurePIM call is responsible for PIM realization on the provider.
	EnsurePIM(context.Context, *EnsurePIMRequest) error
	// DeletePIM call is responsible for PIM deletion on the provider.
	DeletePIM(context.Context, *DeletePIMRequest) error
}

PIMProvider is the interface for the realization of the PIM objects over different providers.

type PrefixStats

type PrefixStats struct {
	Accepted   uint32
	Advertised uint32
}

type Provider

type Provider interface {
	Connect(context.Context, *deviceutil.Connection) error
	Disconnect(context.Context, *deviceutil.Connection) error
}

Provider is the common interface used to establish and tear down connections to the provider.

type ProviderConfig

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

ProviderConfig is a wrapper around an unstructured.Unstructured object that represents a provider-specific configuration.

func GetProviderConfig

func GetProviderConfig(ctx context.Context, r client.Reader, namespace string, ref *v1alpha1.TypedLocalObjectReference) (*ProviderConfig, error)

GetProviderConfig retrieves the provider-specific configuration resource for a given reference.

func (ProviderConfig) Into

func (p ProviderConfig) Into(v any) error

Into converts the underlying unstructured object into the specified type.

type ProviderFunc

type ProviderFunc func() Provider

ProviderFunc returns a new Provider instance.

func Get

func Get(name string) (ProviderFunc, error)

Get returns the provider with the given name. If the provider does not exist, it returns an error.

type SNMPProvider

type SNMPProvider interface {
	Provider

	// EnsureSNMP call is responsible for SNMP realization on the provider.
	EnsureSNMP(context.Context, *EnsureSNMPRequest) error
	// DeleteSNMP call is responsible for SNMP deletion on the provider.
	DeleteSNMP(context.Context, *DeleteSNMPRequest) error
}

SNMPProvider is the interface for the realization of the SNMP objects over different providers.

type SyslogProvider

type SyslogProvider interface {
	Provider

	// EnsureSyslog call is responsible for Syslog realization on the provider.
	EnsureSyslog(context.Context, *EnsureSyslogRequest) error
	// DeleteSyslog call is responsible for Syslog deletion on the provider.
	DeleteSyslog(context.Context) error
}

SyslogProvider is the interface for the realization of the Syslog objects over different providers.

type UserProvider

type UserProvider interface {
	Provider

	// EnsureUser call is responsible for User realization on the provider.
	EnsureUser(context.Context, *EnsureUserRequest) error
	// DeleteUser call is responsible for User deletion on the provider.
	DeleteUser(context.Context, *DeleteUserRequest) error
}

UserProvider is the interface for the realization of the User objects over different providers.

type VLANProvider

type VLANProvider interface {
	Provider

	// EnsureVLAN call is responsible for VLAN realization on the provider.
	EnsureVLAN(context.Context, *VLANRequest) error
	// DeleteVLAN call is responsible for VLAN deletion on the provider.
	DeleteVLAN(context.Context, *VLANRequest) error
	// GetVLANStatus call is responsible for retrieving the current status of the VLAN from the provider.
	GetVLANStatus(context.Context, *VLANRequest) (VLANStatus, error)
}

VLANProvider is the interface for the realization of the VLAN objects over different providers.

type VLANRequest

type VLANRequest struct {
	VLAN           *v1alpha1.VLAN
	ProviderConfig *ProviderConfig
}

type VLANStatus

type VLANStatus struct {
	// OperStatus indicates whether the interface is operationally up (true) or down (false).
	OperStatus bool
}

type VRFProvider

type VRFProvider interface {
	Provider

	// EnsureVRF call is responsible for VRF realization on the provider.
	EnsureVRF(context.Context, *VRFRequest) error
	// DeleteVRF call is responsible for VRF deletion on the provider.
	DeleteVRF(context.Context, *VRFRequest) error
}

VRFProvider is the interface for the realization of the VRF objects over different providers.

type VRFRequest

type VRFRequest struct {
	VRF            *v1alpha1.VRF
	ProviderConfig *ProviderConfig
}

VRFRequest is the request for handling a VRF on the provider.

Directories

Path Synopsis
cisco
gnmiext/v2
Package gnmiext provides a gNMI client with device capability awareness and configuration management utilities.
Package gnmiext provides a gNMI client with device capability awareness and configuration management utilities.
nxos
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
Package openconfig is a generated package which contains definitions of structs which represent a YANG schema.
Package openconfig is a generated package which contains definitions of structs which represent a YANG schema.

Jump to

Keyboard shortcuts

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