models

package
Version: v0.0.0-...-d6856c1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 18 Imported by: 18

Documentation

Index

Constants

View Source
const (
	// AnySecurityGroup matches any security group in AddressType.
	AnySecurityGroup = "any"
	// LocalSecurityGroup matches the local security group in AddressType.
	LocalSecurityGroup = "local"
	// UnspecifiedSecurityGroup doesn't match against the security group in AddressType.
	UnspecifiedSecurityGroup = ""

	// IPv4ZeroValue is the zero IPv4 address.
	IPv4ZeroValue = "0.0.0.0"
	// IPv6ZeroValue is the zero IPv6 address.
	IPv6ZeroValue = "::"
)
View Source
const (
	DefaultPortRangeStart = 50000
	DefaultPortRangeEnd   = 50512
)

BGP constants.

View Source
const (
	//L3VPNType is one of BGPVPN types
	L3VPNType = "l3"
	//L2VPNType is one of BGPVPN types
	L2VPNType = "l2"
)
View Source
const (
	DefaultMatchTagType               = "application"
	FirewallPolicyTagNameGlobalPrefix = "global:"
	Endpoint1Index                    = 1
	Endpoint2Index                    = 2
)

FirewallRule constants.

View Source
const (
	UserDefinedSubnet = "user-defined-subnet"
	AutoSubnet        = "auto-subnet"
	FlatSubnet        = "flat-subnet"
)

IPAM subnet methods.

View Source
const (
	// SRCToDSTDirection is the standard direction in PolicyRuleType.
	SRCToDSTDirection = ">"

	// IPv6Ethertype is the Ethertype for IPv6.
	IPv6Ethertype = "IPv6"
	// IPv4Ethertype is the Ethertype for IPv4.
	IPv4Ethertype = "IPv4"

	// AnyProtocol matches any protocol in PolicyRuleType.
	AnyProtocol = "any"
	// ICMPProtocol matches ICMP protocol in PolicyRuleType.
	ICMPProtocol = "icmp"
	// TCPProtocol matches TCP protocol in PolicyRuleType.
	TCPProtocol = "tcp"
	// UDPProtocol matches UDP protocol in PolicyRuleType.
	UDPProtocol = "udp"
	// ICMP6Protocol matches ICMPv6 protocol in PolicyRuleType.
	ICMP6Protocol = "icmp6"
)
View Source
const (
	PropCollectionUpdateOperationAdd    = "add"
	PropCollectionUpdateOperationModify = "modify"
	PropCollectionUpdateOperationSet    = "set"
	PropCollectionUpdateOperationDelete = "delete"
)

PropCollectionUpdate operations.

View Source
const (
	L3Mode   = "l3"
	L2L3Mode = "l2_l3"
)

Virtual network forwarding modes.

View Source
const (
	UserDefinedSubnetOnly      = "user-defined-subnet-only"
	UserDefinedSubnetPreferred = "user-defined-subnet-preferred"
	FlatSubnetOnly             = "flat-subnet-only"
)

TODO: Enums strings should be generated from schema

View Source
const (
	DefaultSecurityGroupName = "default"
)

DefaultSecurityGroupName is the Name of a project's default SecurityGroup.

View Source
const (
	ServiceHealthCheckLinkLocalType = "link-local"
)

Available ServiceHealthCheck types.

Variables

View Source
var TagTypeIDs = map[string]int64{
	"label":       0,
	"application": 1,
	"tier":        2,
	"deployment":  3,
	"site":        4,
}

TagTypeIDs contains tag-type names with corresponding ids

Functions

func CheckSubnetsOverlap

func CheckSubnetsOverlap(cidr1, cidr2 string) (bool, error)

CheckSubnetsOverlap checks if subnets overlaps.

func CreateTagName

func CreateTagName(tagType, tagValue string) string

CreateTagName constructs tag name from it's type and value.

func IsRouteTargetUserDefined

func IsRouteTargetUserDefined(routeTarget string, globalAsn int64) (bool, error)

IsRouteTargetUserDefined checks if route target was user defined.

func RouteTargetString

func RouteTargetString(asn int64, target int64) string

RouteTargetString constructs route target string for given asn and target number.

func TagTypeValueFromFQName

func TagTypeValueFromFQName(fqName []string) (tagType, tagValue string)

TagTypeValueFromFQName extracts type and value from tag's fqName.

func TagTypeValueFromName

func TagTypeValueFromName(name string) (tagType, tagValue string)

TagTypeValueFromName extracts type and value from tag's name.

Types

type APIAccessLists

type APIAccessLists []*APIAccessList

APIAccessLists is a type in models package corresponding to []*rbac.APIAccessList.

func (APIAccessLists) ToRBAC

func (a APIAccessLists) ToRBAC() []*rbac.APIAccessList

ToRBAC translates objects to []*rbac.APIAccessList.

type PolicyAddressPair

type PolicyAddressPair struct {
	PolicyRule                        *PolicyRuleType
	SourceAddress, DestinationAddress *AddressType
	SourcePort, DestinationPort       *PortType
}

PolicyAddressPair is a single combination of source and destination specifications from a PolicyRuleType.

func (*PolicyAddressPair) IsIngress

func (pair *PolicyAddressPair) IsIngress() (bool, error)

IsIngress checks whether the pair is ingress (remote to local addresses) or egress (local to remote addresses).

type PolicyRulesWithRefs

type PolicyRulesWithRefs struct {
	Rules      []*PolicyRuleType
	FQNameToSG map[string]*SecurityGroup
}

PolicyRulesWithRefs is a list of policy rules together with resolved references to security groups whose names are mentioned in the rules.

func (*PolicyRulesWithRefs) ToACLRules

func (rs *PolicyRulesWithRefs) ToACLRules() (ingressRules, egressRules []*AclRuleType)

ToACLRules translates policy rules to ACL rules.

type PropCollectionUpdate

type PropCollectionUpdate struct {
	Field     string
	Operation string
	Value     interface{}
	Position  interface{}
}

PropCollectionUpdate holds update data for collection property (with CollectionType "map" or "list").

func (*PropCollectionUpdate) KeyForMap

func (u *PropCollectionUpdate) KeyForMap() (key string, err error)

KeyForMap validates MapProperty collection update.

func (*PropCollectionUpdate) PositionForList

func (u *PropCollectionUpdate) PositionForList() (position int, err error)

PositionForList parses position and validates operation for ListProperty collection update.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL