common

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchClusterToSite added in v0.2.2

func MatchClusterToSite(ctx context.Context, nbi *inventory.NetboxInventory, clusterName string, clusterSiteRelations map[string]string) (*objects.Site, error)

Function that matches cluster to tenant using regexRelationsMap.

In case there is no match or regexRelations is nil, it will return nil.

func MatchClusterToTenant added in v0.2.2

func MatchClusterToTenant(ctx context.Context, nbi *inventory.NetboxInventory, clusterName string, clusterTenantRelations map[string]string) (*objects.Tenant, error)

Function that matches cluster to tenant using regexRelationsMap.

In case there is no match or regexRelations is nil, it will return nil.

func MatchHostToSite

func MatchHostToSite(ctx context.Context, nbi *inventory.NetboxInventory, hostName string, hostSiteRelations map[string]string) (*objects.Site, error)

Function that matches Host from hostName to Site using hostSiteRelations.

In case that there is not match or hostSiteRelations is nil, it will return default site.

func MatchHostToTenant

func MatchHostToTenant(ctx context.Context, nbi *inventory.NetboxInventory, hostName string, hostTenantRelations map[string]string) (*objects.Tenant, error)

Function that matches Host from hostName to Tenant using hostTenantRelations.

In case that there is not match or hostTenantRelations is nil, it will return nil.

func MatchVMToTenant

func MatchVMToTenant(ctx context.Context, nbi *inventory.NetboxInventory, vmName string, vmTenantRelations map[string]string) (*objects.Tenant, error)

Function that matches Vm from vmName to Tenant using vmTenantRelations.

In case that there is not match or hostTenantRelations is nil, it will return nil.

func MatchVlanToGroup

func MatchVlanToGroup(ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, regexRelations map[string]string) (*objects.VlanGroup, error)

Function that matches vlanName to vlanGroupName using regexRelationsMap.

In case there is no match or regexRelations is nil, it will return default VlanGroup.

func MatchVlanToTenant

func MatchVlanToTenant(ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, vlanTenantRelations map[string]string) (*objects.Tenant, error)

Function that matches vlanName to tenant using vlanTenantRelations regex relations map.

In case there is no match or vlanTenantRelations is nil, it will return nil.

Types

type Config

type Config struct {
	Logger         *logger.Logger
	SourceConfig   *parser.SourceConfig
	SourceTags     []*objects.Tag
	CustomCertPool *x509.CertPool
	Ctx            context.Context //nolint:containedctx
	CAFile         string          // path to the ca file
}

Config is a common configuration that all sources share.

type Source

type Source interface {
	// Init initializes the source
	Init() error
	// Sync syncs the source to Netbox inventory
	Sync(*inventory.NetboxInventory) error
}

Source is an interface for all sources (e.g. oVirt, VMware, etc.).

Jump to

Keyboard shortcuts

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