cce

package module
v0.0.0-...-6e34d32 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

README

SPDX-License-Identifier: Apache-2.0
Copyright (c) 2019 Intel Corporation

For documentation please refer to https://github.com/open-ness/specs/blob/master/doc/getting-started/openness-experience-kits.md

Documentation

Index

Constants

View Source
const MaxBodySize = 64 * 1024

MaxBodySize is the maximum size (in bytes) of an acceptable request body

View Source
const MaxCores = 8

MaxCores is the maximum number of cores that an application can use.

View Source
const MaxDBRequestTime = 10 * time.Second

MaxDBRequestTime is the maximum time to request database data before timing out

View Source
const MaxHTTPRequestTime = 2 * time.Minute

MaxHTTPRequestTime is the maximum time to request HTTP data before timing out

View Source
const MaxMemory = 16 * 1024

MaxMemory is the maximum memory (in MB) that an application can use.

View Source
const MaxPort = 65535

MaxPort is the maximum port allowed in the TCP/IP stack

Variables

PrefaceLis Our network callback helper

Functions

func RegisterToProxy

func RegisterToProxy(ctx context.Context, ps PersistenceService, nodeID string)

Inform the proxy we're serving this host

Types

type App

type App struct {
	ID          string       `json:"id"`
	Type        string       `json:"type"`
	Name        string       `json:"name"`
	Version     string       `json:"version"`
	Vendor      string       `json:"vendor"`
	Description string       `json:"description"`
	Cores       int          `json:"cores"`
	Memory      int          `json:"memory"` // in MB
	Ports       []PortProto  `json:"ports,omitempty"`
	Source      string       `json:"source"`
	EPAFeatures []EPAFeature `json:"epafeatures,omitempty"`
}

App is an application.

func (*App) EPAValidate

func (app *App) EPAValidate(nodeFeatures map[string]string) error

EPAValidate returns error if provided nodeFeatures do not fulfill app.EPAFeatures

func (*App) FilterFields

func (*App) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*App) GetID

func (app *App) GetID() string

GetID gets the ID.

func (*App) GetTableName

func (*App) GetTableName() string

GetTableName returns the name of the persistence table.

func (*App) SetID

func (app *App) SetID(id string)

SetID sets the ID.

func (*App) String

func (app *App) String() string

func (*App) Validate

func (app *App) Validate() error

Validate validates the model.

type AuthCreds

type AuthCreds struct {
	Username string
	Password string
}

AuthCreds contains the username and password for a user.

type AuthorityService

type AuthorityService interface {
	// CAChain returns the certificate authority chain, starting with the
	// issuing CA and ending with the root CA (inclusive).
	CAChain() ([]*x509.Certificate, error)
	// SignCSR signs a ASN.1 DER encoded certificate signing request.
	SignCSR(der []byte, template *x509.Certificate) (*x509.Certificate, error)
}

AuthorityService manages digital certificates.

type Controller

type Controller struct {
	OrchestrationMode OrchestrationMode
	// must not be nil if
	// OrchestrationModeKubernetes or OrchestrationModeKubernetesOVN
	KubernetesClient   *k8s.Client
	PersistenceService PersistenceService
	AuthorityService   AuthorityService
	TokenService       *jose.JWSTokenIssuer
	AdminCreds         *AuthCreds

	// The edge node's port that it listens on for gRPC connections from the
	// Controller and serves Mm5-related endpoints for application and network
	// policy configuration.
	//
	// If ELAPort is empty the default of 42101 is used.
	ELAPort string

	// The edge node's port that it listens on for gRPC connections from the
	// Controller and serves Mm6-related endpoints for app deployment and
	// lifecycle commands.
	//
	// If EVAPort is empty the default of 42102 is used.
	EVAPort string

	// EdgeNodeCreds are the transport credentials for connecting to an edge
	// node. The server name will be overridden.
	EdgeNodeCreds *tls.Config
}

Controller aggregates controller services.

type Credentials

type Credentials struct {
	// ID is the base64-encoded MD5 hash of the certificate's public key.
	ID string `json:"id"`
	// Certificate is a PEM-encoded X.509 certificate.
	Certificate string `json:"certificate"`
}

Credentials defines a response for a request to obtain authentication credentials. These credentials may be used to further communicate with endpoint(s) that are protected by a form of authentication.

func (*Credentials) GetID

func (c *Credentials) GetID() string

GetID gets the ID.

func (*Credentials) GetTableName

func (c *Credentials) GetTableName() string

GetTableName returns the name of the table this entity is saved in.

func (*Credentials) SetID

func (c *Credentials) SetID(id string)

SetID sets the ID.

func (*Credentials) String

func (c *Credentials) String() string

func (*Credentials) Validate

func (c *Credentials) Validate() error

Validate validates the model.

type DNSARecord

type DNSARecord struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	IPs         []string `json:"ips"`
}

DNSARecord is a DNS A record.

func (*DNSARecord) String

func (r *DNSARecord) String() string

func (*DNSARecord) Validate

func (r *DNSARecord) Validate() error

Validate validates the model.

type DNSConfig

type DNSConfig struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	ARecords   []*DNSARecord   `json:"a_records"`
	Forwarders []*DNSForwarder `json:"forwarders"`
}

DNSConfig is a DNS configuration.

func (*DNSConfig) FilterFields

func (*DNSConfig) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*DNSConfig) GetID

func (cfg *DNSConfig) GetID() string

GetID gets the ID.

func (*DNSConfig) GetTableName

func (cfg *DNSConfig) GetTableName() string

GetTableName returns the name of the persistence table.

func (*DNSConfig) SetID

func (cfg *DNSConfig) SetID(id string)

SetID sets the ID.

func (*DNSConfig) String

func (cfg *DNSConfig) String() string

func (*DNSConfig) Validate

func (cfg *DNSConfig) Validate() error

Validate validates the model.

type DNSConfigAppAlias

type DNSConfigAppAlias struct {
	ID          string `json:"id"`
	DNSConfigID string `json:"dns_config_id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	AppID       string `json:"app_id"`
}

DNSConfigAppAlias represents an association between a DNSConfig and an AppID.

func (*DNSConfigAppAlias) FilterFields

func (*DNSConfigAppAlias) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*DNSConfigAppAlias) GetID

func (cfg_alias *DNSConfigAppAlias) GetID() string

GetID gets the ID.

func (*DNSConfigAppAlias) GetTableName

func (*DNSConfigAppAlias) GetTableName() string

GetTableName returns the name of the persistence table.

func (*DNSConfigAppAlias) SetID

func (cfg_alias *DNSConfigAppAlias) SetID(id string)

SetID sets the ID.

func (*DNSConfigAppAlias) String

func (cfg_alias *DNSConfigAppAlias) String() string

func (*DNSConfigAppAlias) Validate

func (cfg_alias *DNSConfigAppAlias) Validate() error

Validate validates the model.

type DNSForwarder

type DNSForwarder struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	IP          string `json:"ip"`
}

DNSForwarder is a DNS forwarder.

func (*DNSForwarder) String

func (f *DNSForwarder) String() string

func (*DNSForwarder) Validate

func (f *DNSForwarder) Validate() error

Validate validates the model.

type EPAFeature

type EPAFeature struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

EPAFeature is a key-value pair used to represent Enhanced Platform Awareness feature settings

type EgressRule

type EgressRule struct {
	Description string     `json:"description"`
	To          []*IPBlock `json:"to"`
	Ports       []*Port    `json:"ports"`
}

EgressRule is the model for a egress rule.

func (*EgressRule) String

func (er *EgressRule) String() string

func (*EgressRule) ToK8s

ToK8s converts egress rule into Kubernetes' egress rule

func (*EgressRule) Validate

func (er *EgressRule) Validate() error

Validate validates the model.

type Filter

type Filter struct {
	Field string
	Value string
}

Filter filters queries in PersistenceService.Filter.

type Filterable

type Filterable interface {
	Persistable
	FilterFields() []string
}

Filterable is a Persistable that can be filtered.

type GTPFilter

type GTPFilter struct {
	Address string   `json:"address"`
	Mask    int      `json:"mask"`
	IMSIs   []string `json:"imsis"`
}

GTPFilter is the model for a GTP filter.

func (*GTPFilter) String

func (f *GTPFilter) String() string

func (*GTPFilter) Validate

func (f *GTPFilter) Validate() error

Validate validates the model.

type IPBlock

type IPBlock struct {
	CIDR   string   `json:"cidr"`
	Except []string `json:"except"`
}

IPBlock is the model for a ip block.

func (*IPBlock) String

func (ipb *IPBlock) String() string

func (*IPBlock) ToK8s

func (ipb *IPBlock) ToK8s() networkingV1.NetworkPolicyPeer

ToK8s converts IPBlock into Kubernetes' Peer

func (*IPBlock) Validate

func (ipb *IPBlock) Validate() error

Validate validates the model.

type IPFilter

type IPFilter struct {
	Address   string `json:"address"`
	Mask      int    `json:"mask"`
	BeginPort int    `json:"begin_port"`
	EndPort   int    `json:"end_port"`
	Protocol  string `json:"protocol"`
}

IPFilter is the model for an IP filter.

func (*IPFilter) String

func (f *IPFilter) String() string

func (*IPFilter) Validate

func (f *IPFilter) Validate() error

Validate validates the model.

type IPModifier

type IPModifier struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
}

IPModifier is the model for an IP modifier.

func (*IPModifier) String

func (m *IPModifier) String() string

func (*IPModifier) Validate

func (m *IPModifier) Validate() error

Validate validates the model.

type IngressRule

type IngressRule struct {
	Description string     `json:"description"`
	From        []*IPBlock `json:"from"`
	Ports       []*Port    `json:"ports"`
}

IngressRule is the model for a ingress rule.

func (*IngressRule) String

func (ir *IngressRule) String() string

func (*IngressRule) ToK8s

ToK8s converts ingress rule into Kubernetes' ingress rule

func (*IngressRule) Validate

func (ir *IngressRule) Validate() error

Validate validates the model.

type LifecycleStatus

type LifecycleStatus int

LifecycleStatus is an application's status.

const (
	// Unknown is an unknown lifecycle status
	Unknown LifecycleStatus = iota
	// Deploying is deploying to a node
	Deploying
	// Deployed is deployed to a node
	Deployed
	// Starting is starting
	Starting
	// Running is running
	Running
	// Stopping is stopping
	Stopping
	// Stopped is stopped
	Stopped
	// Error is an error status
	Error
)

func (LifecycleStatus) String

func (s LifecycleStatus) String() string

type MACFilter

type MACFilter struct {
	MACAddresses []string `json:"mac_addresses"`
}

MACFilter is the model for a MAC filter.

func (*MACFilter) String

func (f *MACFilter) String() string

func (*MACFilter) Validate

func (f *MACFilter) Validate() error

Validate validates the model.

type MACModifier

type MACModifier struct {
	MACAddress string `json:"mac_address"`
}

MACModifier is the model for a MAC modifier.

func (*MACModifier) String

func (m *MACModifier) String() string

func (*MACModifier) Validate

func (m *MACModifier) Validate() error

Validate validates the model.

type NetworkInterface

type NetworkInterface struct {
	ID                string   `json:"id"`
	Description       string   `json:"description"`
	Driver            string   `json:"driver"`
	Type              string   `json:"type"`
	MACAddress        string   `json:"mac_address"`
	VLAN              int      `json:"vlan"`
	Zones             []string `json:"zones"`
	FallbackInterface string   `json:"fallback_interface"`
}

NetworkInterface is a NetworkInterface. TODO add a String() method for this struct.

type NetworkInterfaceTrafficPolicy

type NetworkInterfaceTrafficPolicy struct {
	NetworkInterfaceID string `json:"network_interface_id"`
	TrafficPolicyID    string `json:"traffic_policy_id"`
}

NetworkInterfaceTrafficPolicy specifies the traffic policy for a network interface.

type Node

type Node struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Location string `json:"location"`
	Serial   string `json:"serial"`
}

Node is a node (aka appliance or device).

func (*Node) FilterFields

func (*Node) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*Node) GetID

func (n *Node) GetID() string

GetID gets the ID.

func (*Node) GetNodeID

func (n *Node) GetNodeID() string

GetNodeID gets the node ID.

func (*Node) GetTableName

func (*Node) GetTableName() string

GetTableName returns the name of the persistence table.

func (*Node) SetID

func (n *Node) SetID(id string)

SetID sets the ID.

func (*Node) String

func (n *Node) String() string

func (*Node) Validate

func (n *Node) Validate() error

Validate validates the model.

type NodeApp

type NodeApp struct {
	ID     string `json:"id"`
	NodeID string `json:"node_id"`
	AppID  string `json:"app_id"`
}

NodeApp represents an association between a Node and an App.

func (*NodeApp) FilterFields

func (*NodeApp) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeApp) GetID

func (n_a *NodeApp) GetID() string

GetID gets the ID.

func (*NodeApp) GetNodeID

func (n_a *NodeApp) GetNodeID() string

GetNodeID gets the node ID.

func (*NodeApp) GetTableName

func (*NodeApp) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeApp) SetID

func (n_a *NodeApp) SetID(id string)

SetID sets the ID.

func (*NodeApp) String

func (n_a *NodeApp) String() string

func (*NodeApp) Validate

func (n_a *NodeApp) Validate() error

Validate validates the model.

type NodeAppReq

type NodeAppReq struct {
	NodeApp
	Cmd string `json:"cmd,omitempty"`
}

NodeAppReq is a NodeApp request. TODO add a String() method and test for this struct.

func (*NodeAppReq) GetTableName

func (n_ar *NodeAppReq) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeAppReq) Validate

func (n_ar *NodeAppReq) Validate() error

Validate validates the request model. TODO add a test for this method.

type NodeAppResp

type NodeAppResp struct {
	NodeApp
	Status string `json:"status"`
}

NodeAppResp is a NodeApp response. TODO add a String() method and test for this struct.

type NodeAppTrafficPolicy

type NodeAppTrafficPolicy struct {
	ID              string `json:"id"`
	NodeAppID       string `json:"nodes_apps_id"`
	TrafficPolicyID string `json:"traffic_policy_id"`
}

NodeAppTrafficPolicy represents an association between a NodeApp and a TrafficPolicy.

func (*NodeAppTrafficPolicy) FilterFields

func (*NodeAppTrafficPolicy) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeAppTrafficPolicy) GetID

func (n_a_tp *NodeAppTrafficPolicy) GetID() string

GetID gets the ID.

func (*NodeAppTrafficPolicy) GetTableName

func (*NodeAppTrafficPolicy) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeAppTrafficPolicy) SetID

func (n_a_tp *NodeAppTrafficPolicy) SetID(id string)

SetID sets the ID.

func (*NodeAppTrafficPolicy) String

func (n_a_tp *NodeAppTrafficPolicy) String() string

func (*NodeAppTrafficPolicy) Validate

func (n_a_tp *NodeAppTrafficPolicy) Validate() error

Validate validates the model.

type NodeDNSConfig

type NodeDNSConfig struct {
	ID          string `json:"id"`
	NodeID      string `json:"node_id"`
	DNSConfigID string `json:"dns_config_id"`
}

NodeDNSConfig represents an association between a Node and a DNSConfig.

func (*NodeDNSConfig) FilterFields

func (*NodeDNSConfig) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeDNSConfig) GetID

func (n_cfg *NodeDNSConfig) GetID() string

GetID gets the ID.

func (*NodeDNSConfig) GetNodeID

func (n_cfg *NodeDNSConfig) GetNodeID() string

GetNodeID gets the node ID.

func (*NodeDNSConfig) GetTableName

func (*NodeDNSConfig) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeDNSConfig) SetID

func (n_cfg *NodeDNSConfig) SetID(id string)

SetID sets the ID.

func (*NodeDNSConfig) String

func (n_cfg *NodeDNSConfig) String() string

func (*NodeDNSConfig) Validate

func (n_cfg *NodeDNSConfig) Validate() error

Validate validates the model.

type NodeEntity

type NodeEntity interface {
	GetNodeID() string
}

NodeEntity has a node ID.

type NodeGRPCTarget

type NodeGRPCTarget struct {
	ID         string `json:"id"`
	NodeID     string `json:"node_id"`
	GRPCTarget string `json:"grpc_target"`
}

NodeGRPCTarget is a node's GRPC target.

func (*NodeGRPCTarget) FilterFields

func (t *NodeGRPCTarget) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeGRPCTarget) GetID

func (t *NodeGRPCTarget) GetID() string

GetID gets the ID.

func (*NodeGRPCTarget) GetNodeID

func (t *NodeGRPCTarget) GetNodeID() string

GetNodeID gets the node ID.

func (*NodeGRPCTarget) GetTableName

func (*NodeGRPCTarget) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeGRPCTarget) SetID

func (t *NodeGRPCTarget) SetID(id string)

SetID sets the ID.

func (*NodeGRPCTarget) String

func (t *NodeGRPCTarget) String() string

type NodeInterface

type NodeInterface struct {
	ID          string `json:"id"`
	NodeID      string `json:"node_id"`
	InterfaceID string `json:"interface_id"`
}

NodeInterface represents an association between a Node and an Interface.

func (*NodeInterface) FilterFields

func (*NodeInterface) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeInterface) GetID

func (n_i *NodeInterface) GetID() string

GetID gets the ID.

func (*NodeInterface) GetNodeID

func (n_i *NodeInterface) GetNodeID() string

GetNodeID gets the node ID.

func (*NodeInterface) GetTableName

func (*NodeInterface) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeInterface) SetID

func (n_i *NodeInterface) SetID(id string)

SetID sets the ID.

func (*NodeInterface) String

func (n_i *NodeInterface) String() string

func (*NodeInterface) Validate

func (n_i *NodeInterface) Validate() error

Validate validates the model.

type NodeInterfaceReq

type NodeInterfaceReq struct {
	NodeInterface
	Cmd string `json:"cmd,omitempty"`
}

NodeInterfaceReq is a NodeInterface request. TODO add a String() method and test for this struct.

func (*NodeInterfaceReq) GetTableName

func (n_ir *NodeInterfaceReq) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeInterfaceReq) Validate

func (n_ir *NodeInterfaceReq) Validate() error

Validate validates the request model. TODO add a test for this method.

type NodeInterfaceResp

type NodeInterfaceResp struct {
	NodeInterface
	Status string `json:"status"`
}

NodeInterfaceResp is a NodeInterface response. TODO add a String() method and test for this struct.

type NodeInterfaceTrafficPolicy

type NodeInterfaceTrafficPolicy struct {
	ID                 string `json:"id"`
	NodeID             string `json:"node_id"`
	NetworkInterfaceID string `json:"network_interface_id"`
	TrafficPolicyID    string `json:"traffic_policy_id"`
}

NodeInterfaceTrafficPolicy represents an association between a NodeInterface and a TrafficPolicy.

func (*NodeInterfaceTrafficPolicy) FilterFields

func (*NodeInterfaceTrafficPolicy) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*NodeInterfaceTrafficPolicy) GetID

func (n_i_tp *NodeInterfaceTrafficPolicy) GetID() string

GetID gets the ID.

func (*NodeInterfaceTrafficPolicy) GetTableName

func (*NodeInterfaceTrafficPolicy) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeInterfaceTrafficPolicy) SetID

func (n_i_tp *NodeInterfaceTrafficPolicy) SetID(id string)

SetID sets the ID.

func (*NodeInterfaceTrafficPolicy) String

func (n_i_tp *NodeInterfaceTrafficPolicy) String() string

func (*NodeInterfaceTrafficPolicy) Validate

func (n_i_tp *NodeInterfaceTrafficPolicy) Validate() error

Validate validates the model.

type NodeReq

type NodeReq struct {
	Node
	NetworkInterfaces []*NetworkInterface             `json:"network_interfaces"`
	TrafficPolicies   []NetworkInterfaceTrafficPolicy `json:"traffic_policies"`
}

NodeReq is a Node request.

func (*NodeReq) GetTableName

func (nr *NodeReq) GetTableName() string

GetTableName returns the name of the persistence table.

func (*NodeReq) Validate

func (nr *NodeReq) Validate() error

Validate validates the request model. TODO add a test for this method.

type NodeResp

type NodeResp struct {
	Node
	NetworkInterfaces []*NetworkInterface `json:"network_interfaces"`
}

NodeResp is a Node response. TODO add a String() method and test for this struct.

type OrchestrationMode

type OrchestrationMode int

OrchestrationMode global level orchestration mode for application deployment

const (
	// OrchestrationModeNative uses Docker on the node to control application
	// container instances
	OrchestrationModeNative OrchestrationMode = iota
	// OrchestrationModeKubernetes uses an external Kubernetes master to
	// control application container instances on nodes
	OrchestrationModeKubernetes
	// OrchestrationModeKubernetesOVN uses an external Kubernetes master to
	// control application container instances on nodes. NTS functionality is
	// replaced with OVN/OVS. Traffic Policies are replaced with Kubernetes
	// Network Policies.
	OrchestrationModeKubernetesOVN
)

type Persistable

type Persistable interface {
	GetTableName() string
	GetID() string
	SetID(id string)
}

Persistable can be persisted.

type PersistenceService

type PersistenceService interface {
	Create(ctx context.Context, e Persistable) error
	Read(ctx context.Context, id string, zv Persistable) (e Persistable, err error)
	ReadAll(ctx context.Context, zv Persistable) (ps []Persistable, err error)
	Filter(ctx context.Context, zv Filterable, fs []Filter) (ps []Persistable, err error)
	BulkUpdate(ctx context.Context, ps []Persistable) error
	Delete(ctx context.Context, id string, zv Persistable) (ok bool, err error)
}

PersistenceService manages entity persistence. The methods with zv parameters take a zero-value Persistable for reflectively creating new instances of the concrete type. In the case of Delete it is used to get the table name.

type Port

type Port struct {
	Port     uint16 `json:"port"`
	Protocol string `json:"protocol"`
}

Port is the model for a port.

func (*Port) String

func (p *Port) String() string

func (*Port) ToK8s

func (p *Port) ToK8s() networkingV1.NetworkPolicyPort

ToK8s converts port into Kubernetes' port

func (*Port) Validate

func (p *Port) Validate() error

Validate validates the model.

type PortProto

type PortProto struct {
	Port     uint32 `json:"port,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

PortProto is a port and protocol combination. It is typically used to represent the ports and protocols that an application is listening on and needs exposed.

func (PortProto) String

func (pp PortProto) String() string

type ReqEntity

type ReqEntity interface {
	Validate() error
	GetTableName() string
}

ReqEntity is a request entity.

type RespEntity

type RespEntity interface {
}

RespEntity is a response entity.

type TrafficPolicy

type TrafficPolicy struct {
	ID    string         `json:"id"`
	Name  string         `json:"name"`
	Rules []*TrafficRule `json:"traffic_rules"`
}

TrafficPolicy is an application or interface traffic policy.

func (*TrafficPolicy) FilterFields

func (*TrafficPolicy) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*TrafficPolicy) GetID

func (tp *TrafficPolicy) GetID() string

GetID gets the ID.

func (*TrafficPolicy) GetTableName

func (*TrafficPolicy) GetTableName() string

GetTableName returns the name of the persistence table.

func (*TrafficPolicy) SetID

func (tp *TrafficPolicy) SetID(id string)

SetID sets the ID.

func (*TrafficPolicy) String

func (tp *TrafficPolicy) String() string

func (*TrafficPolicy) Validate

func (tp *TrafficPolicy) Validate() error

Validate validates the model.

type TrafficPolicyKubeOVN

type TrafficPolicyKubeOVN struct {
	ID      string         `json:"id"`
	Name    string         `json:"name"`
	Ingress []*IngressRule `json:"ingress_rules"`
	Egress  []*EgressRule  `json:"egress_rules"`
}

TrafficPolicyKubeOVN is an application or interface traffic policy.

func (*TrafficPolicyKubeOVN) FilterFields

func (*TrafficPolicyKubeOVN) FilterFields() []string

FilterFields returns the filterable fields for this model.

func (*TrafficPolicyKubeOVN) GetID

func (tp *TrafficPolicyKubeOVN) GetID() string

GetID gets the ID.

func (*TrafficPolicyKubeOVN) GetTableName

func (*TrafficPolicyKubeOVN) GetTableName() string

GetTableName returns the name of the persistence table.

func (*TrafficPolicyKubeOVN) SetID

func (tp *TrafficPolicyKubeOVN) SetID(id string)

SetID sets the ID.

func (*TrafficPolicyKubeOVN) String

func (tp *TrafficPolicyKubeOVN) String() string

func (*TrafficPolicyKubeOVN) ToK8s

ToK8s converts traffic policy into Kubernetes' NetworkPolicy

func (*TrafficPolicyKubeOVN) Validate

func (tp *TrafficPolicyKubeOVN) Validate() error

Validate validates the model.

type TrafficRule

type TrafficRule struct {
	Description string           `json:"description"`
	Priority    int              `json:"priority"`
	Source      *TrafficSelector `json:"source"`
	Destination *TrafficSelector `json:"destination"`
	Target      *TrafficTarget   `json:"target"`
}

TrafficRule is the model for a traffic rule.

func (*TrafficRule) String

func (tr *TrafficRule) String() string

func (*TrafficRule) Validate

func (tr *TrafficRule) Validate() error

Validate validates the model.

type TrafficSelector

type TrafficSelector struct {
	Description string     `json:"description"`
	MACs        *MACFilter `json:"mac_filter"`
	IP          *IPFilter  `json:"ip_filter"`
	GTP         *GTPFilter `json:"gtp_filter"`
}

TrafficSelector is the model for a traffic selector.

func (*TrafficSelector) String

func (ts *TrafficSelector) String() string

func (*TrafficSelector) Validate

func (ts *TrafficSelector) Validate() error

Validate validates the model.

type TrafficTarget

type TrafficTarget struct {
	Description string       `json:"description"`
	Action      string       `json:"action"`
	MAC         *MACModifier `json:"mac_modifier"`
	IP          *IPModifier  `json:"ip_modifier"`
}

TrafficTarget is the model for a traffic target.

func (*TrafficTarget) String

func (tt *TrafficTarget) String() string

func (*TrafficTarget) Validate

func (tt *TrafficTarget) Validate() error

Validate validates the model.

type Validatable

type Validatable interface {
	Validate() error
}

Validatable can be validated.

Jump to

Keyboard shortcuts

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