Documentation
¶
Index ¶
- func ACLNetworkUsage(s *state.State, aclProjectName string, aclNames []string, ...) error
- func ACLUsedBy(s *state.State, aclProjectName string, ...) error
- func ACLisInUseByDevice(d deviceConfig.Device, matchACLNames ...string) []string
- func AddressSetNetworkUsage(s *state.State, projectName string, addressSetName string, addresses []string, ...) error
- func AddressSetUsedBy(s *state.State, projectName string, usageFunc func(aclName string) error, ...) error
- func Create(s *state.State, projectName string, asInfo *api.NetworkAddressSetsPost) error
- func Exists(s *state.State, projectName string, name ...string) error
- func FirewallAddressSets(s *state.State, addrSetProjectName string) ([]firewallDrivers.AddressSet, error)
- func FirewallApplyAddressSets(s *state.State, projectName string, addressSet AddressSetUsage) error
- func FirewallApplyAddressSetsForACLRules(s *state.State, nftTable string, projectName string, ACLNames []string) error
- func GetAddressSetsForACLs(s *state.State, projectName string, ACLNames []string) ([]string, error)
- func OVNAddressSetDeleteIfUnused(s *state.State, l logger.Logger, client *ovn.NB, projectName string, ...) error
- func OVNAddressSetsDeleteIfUnused(s *state.State, l logger.Logger, client *ovn.NB, projectName string) error
- func OVNDeleteAddressSetsViaACLs(s *state.State, l logger.Logger, client *ovn.NB, projectName string, ...) error
- func OVNEnsureAddressSets(s *state.State, l logger.Logger, client *ovn.NB, projectName string, ...) (revert.Hook, error)
- func OVNEnsureAddressSetsViaACLs(s *state.State, l logger.Logger, client *ovn.NB, projectName string, ...) (revert.Hook, error)
- func ValidName(name string) error
- type AddressSetUsage
- type NetworkACLUsage
- type NetworkAddressSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ACLNetworkUsage ¶
func ACLNetworkUsage(s *state.State, aclProjectName string, aclNames []string, aclNets map[string]NetworkACLUsage) error
ACLNetworkUsage populates the provided aclNets map with networks that are using any of the specified ACLs.
func ACLUsedBy ¶
func ACLUsedBy(s *state.State, aclProjectName string, usageFunc func(ctx context.Context, tx *db.ClusterTx, matchedACLNames []string, usageType any, nicName string, nicConfig map[string]string) error, matchACLNames ...string) error
ACLUsedBy finds all networks, profiles and instance NICs that use any of the specified ACLs and executes usageFunc once for each resource using one or more of the ACLs with info about the resource and matched ACLs being used.
func ACLisInUseByDevice ¶
func ACLisInUseByDevice(d deviceConfig.Device, matchACLNames ...string) []string
ACLisInUseByDevice returns any of the supplied matching ACL names found referenced by the NIC device.
func AddressSetNetworkUsage ¶
func AddressSetNetworkUsage(s *state.State, projectName string, addressSetName string, addresses []string, asNets map[string]AddressSetUsage) error
AddressSetNetworkUsage retrieve the networks that use an address set by checking ACLs.
func AddressSetUsedBy ¶
func AddressSetUsedBy(s *state.State, projectName string, usageFunc func(aclName string) error, addressSetName string) error
AddressSetUsedBy calls usageFunc for each ACL that references the specified address set name.
func Create ¶
Create validates supplied record and creates a new network address set record in the database.
func Exists ¶
Exists checks the address set name(s) provided exist in the project. If multiple names are provided, also checks that duplicate names aren't specified in the list.
func FirewallAddressSets ¶
func FirewallAddressSets(s *state.State, addrSetProjectName string) ([]firewallDrivers.AddressSet, error)
FirewallAddressSets returns address sets for a network firewall.
func FirewallApplyAddressSets ¶
func FirewallApplyAddressSets(s *state.State, projectName string, addressSet AddressSetUsage) error
FirewallApplyAddressSets applies address set rules to the network firewall.
func FirewallApplyAddressSetsForACLRules ¶
func FirewallApplyAddressSetsForACLRules(s *state.State, nftTable string, projectName string, ACLNames []string) error
FirewallApplyAddressSetsForACLRules apply address-sets from ACLNames to the correct nft Table.
func GetAddressSetsForACLs ¶
GetAddressSetsForACLs return the set of address sets used by given ACLs.
func OVNAddressSetDeleteIfUnused ¶
func OVNAddressSetDeleteIfUnused(s *state.State, l logger.Logger, client *ovn.NB, projectName string, setName string) error
OVNAddressSetDeleteIfUnused checks if the specified address set is unused and if so, removes it from OVN.
func OVNAddressSetsDeleteIfUnused ¶
func OVNAddressSetsDeleteIfUnused(s *state.State, l logger.Logger, client *ovn.NB, projectName string) error
OVNAddressSetsDeleteIfUnused remove all address sets in OVN that are not used.
func OVNDeleteAddressSetsViaACLs ¶
func OVNDeleteAddressSetsViaACLs(s *state.State, l logger.Logger, client *ovn.NB, projectName string, ACLNames []string) error
OVNDeleteAddressSetsViaACLs remove address sets used by network ACLS.
func OVNEnsureAddressSets ¶
func OVNEnsureAddressSets(s *state.State, l logger.Logger, client *ovn.NB, projectName string, addressSetNames []string) (revert.Hook, error)
OVNEnsureAddressSets ensures that the address sets and their addresses are created in OVN NB DB. Returns a revert function to undo changes if needed.
Types ¶
type AddressSetUsage ¶
type AddressSetUsage struct {
ID int
Name string
Type string
DeviceName string
Addresses []string
Config map[string]string
ACLNames []string
}
AddressSetUsage holds info about a network using the address set.
type NetworkACLUsage ¶
type NetworkACLUsage struct {
ID int64
Name string
Type string
Config map[string]string
InstanceName string
DeviceName string
}
NetworkACLUsage info about a network and what ACL it uses.
type NetworkAddressSet ¶
type NetworkAddressSet interface {
// Info
ID() int
Project() string
Info() *api.NetworkAddressSet
Etag() []any
UsedBy() ([]string, error)
// Modifications.
Update(config *api.NetworkAddressSetPut, clientType request.ClientType) error
Rename(newName string) error
Delete() error
// contains filtered or unexported methods
}
NetworkAddressSet represents a network address set.
func LoadByName ¶
LoadByName loads and initializes a network address set from the database by project and name.