Documentation
¶
Index ¶
- func CreateMACAddressForObjectType(ctx context.Context, nbi *inventory.NetboxInventory, mac string, ...) (*objects.MACAddress, error)
- func MatchClusterToSite(ctx context.Context, nbi *inventory.NetboxInventory, clusterName string, ...) (*objects.Site, error)
- func MatchClusterToTenant(ctx context.Context, nbi *inventory.NetboxInventory, clusterName string, ...) (*objects.Tenant, error)
- func MatchHostToRole(ctx context.Context, nbi *inventory.NetboxInventory, hostName string, ...) (*objects.DeviceRole, error)
- func MatchHostToSite(ctx context.Context, nbi *inventory.NetboxInventory, hostName string, ...) (*objects.Site, error)
- func MatchHostToTenant(ctx context.Context, nbi *inventory.NetboxInventory, hostName string, ...) (*objects.Tenant, error)
- func MatchVMToRole(ctx context.Context, nbi *inventory.NetboxInventory, vmName string, ...) (*objects.DeviceRole, error)
- func MatchVMToTenant(ctx context.Context, nbi *inventory.NetboxInventory, vmName string, ...) (*objects.Tenant, error)
- func MatchVlanToGroup(ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, ...) (*objects.VlanGroup, error)
- func MatchVlanToSite(ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, ...) (*objects.Site, error)
- func MatchVlanToTenant(ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, ...) (*objects.Tenant, error)
- func SetPrimaryIPAddressForObject(ctx context.Context, nbi *inventory.NetboxInventory, ...) error
- func SetPrimaryMACForInterface(ctx context.Context, nbi *inventory.NetboxInventory, ...) error
- type Config
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMACAddressForObjectType ¶ added in v1.9.0
func CreateMACAddressForObjectType( ctx context.Context, nbi *inventory.NetboxInventory, mac string, targetInterface objects.MACAddressOwner, ) (*objects.MACAddress, error)
CreateMACAddressForObjectType creates MAC address for object type.
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 MatchHostToRole ¶ added in v1.7.0
func MatchHostToRole( ctx context.Context, nbi *inventory.NetboxInventory, hostName string, hostRoleRelations map[string]string, ) (*objects.DeviceRole, error)
MatchHostToRole matches Host from hostName to DeviceRole using hostRoleRelations.
In case that there is not match or hostRoleRelations 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 MatchVMToRole ¶ added in v1.7.0
func MatchVMToRole( ctx context.Context, nbi *inventory.NetboxInventory, vmName string, vmRoleRelations map[string]string, ) (*objects.DeviceRole, error)
MatchVMToRole matches VM from vmName to DeviceRole using vmRoleRelations.
In case that there is not match or hostRoleRelations 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, vlanSite *objects.Site, vlanGroupRelations map[string]string, vlanGroupSiteRelations 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 MatchVlanToSite ¶ added in v1.8.0
func MatchVlanToSite( ctx context.Context, nbi *inventory.NetboxInventory, vlanName string, vlanSiteRelations map[string]string, ) (*objects.Site, error)
MathcVlanToSite matches vlanName to Site using vlanSiteRelations.
In case there is no match or vlanSiteRelations is nil, it returns nil.
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.
func SetPrimaryIPAddressForObject ¶ added in v1.9.0
func SetPrimaryMACForInterface ¶ added in v1.9.0
func SetPrimaryMACForInterface( ctx context.Context, nbi *inventory.NetboxInventory, targetInterface objects.MACAddressOwner, mac *objects.MACAddress, ) error
Types ¶
type Config ¶
type Config struct { Logger *logger.Logger SourceConfig *parser.SourceConfig CustomCertPool *x509.CertPool SourceNameTag *objects.Tag SourceTypeTag *objects.Tag Ctx context.Context //nolint:containedctx CAFile string // path to the ca file }
Config is a common configuration that all sources share.