services

package
v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 23 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultNetworkConfig

func GetDefaultNetworkConfig() ([]byte, error)

func InitConfigurations4Monitor

func InitConfigurations4Monitor(confObj *jason.Object, kubeconfig string) error

func IsCTNetPlane

func IsCTNetPlane(netPlane string) bool

func IsSameRoles

func IsSameRoles(portObj1, portObj2 *Port) bool

func IsSameRolesIllegal

func IsSameRolesIllegal(portObj1, portObj2 *Port) error

func NewCreatePortForPodController

func NewCreatePortForPodController() (*createPortForPodController, error)

Types

type BluePrintAttributes

type BluePrintAttributes struct {
	Accelerate string `json:"accelerate"`
	Function   string `json:"function"`
	NicName    string `json:"nic_name"`
	NicType    string `json:"nic_type"`
}

type BluePrintNetworkMessage

type BluePrintNetworkMessage struct {
	Ports []BluePrintPort `json:"ports"`
}

func (*BluePrintNetworkMessage) NewDelaultNetworkMessage

func (bpnm *BluePrintNetworkMessage) NewDelaultNetworkMessage() error

type BluePrintPort

type BluePrintPort struct {
	AttachToNetwork string              `json:"attach_to_network"`
	Attributes      BluePrintAttributes `json:"attributes"`
}

type EagerPort

type EagerPort struct {
	NetworkName  string
	NetworkPlane string
	PortName     string
	VnicType     string
	Accelerate   string
	FixIP        string
	IPGroupName  string
	PortFunc     string
	Combinable   string
}

func (*EagerPort) Transform

func (ep *EagerPort) Transform(portJSON *jason.Object) error

type Pod

type Pod struct {
	TenantId     string
	PodID        string
	PodName      string
	PodNs        string
	PodType      string //todo podtype
	IsSuccessful bool
	ErrorMsg     string
	Ports        []*Port
}

type PodForCreatPort

type PodForCreatPort struct {
	TenantID string
	PodID    string
	PodName  string
	PodNs    string
}

type PodServiceInterface

type PodServiceInterface interface {
	NewPodFromK8sPod(pod *v1.Pod) (*Pod, error)
	Save(pod *Pod) error
	Get(podNs, podName string) (*Pod, error)
	DeletePodAndPorts(podNs, podName string) error
}

func GetPodService

func GetPodService() PodServiceInterface

type Port

type Port struct {
	EagerAttr PortEagerAttr
	LazyAttr  PortLazyAttr
}

func (*Port) TransformToMangerCreatePortReq

func (p *Port) TransformToMangerCreatePortReq(pod *PodForCreatPort) *infra.ManagerCreatePortReq

type PortEagerAttr

type PortEagerAttr struct {
	NetworkName  string //"attach_to_network"
	NetworkPlane string
	PortName     string //nic_name
	VnicType     string
	Accelerate   string
	PodName      string
	PodNs        string
	FixIP        string
	IPGroupName  string
	Combinable   string
	Metadata     interface{}
	Roles        []string
}

type PortLazyAttr

type PortLazyAttr struct {
	//NetworkID      string
	ID         string
	Name       string
	TenantID   string
	MacAddress string
	FixedIps   []ports.IP
	GatewayIP  string
	Cidr       string
}

type PortServiceInterface

type PortServiceInterface interface {
	//todo
	NewPortsWithEagerAttrFromK8s(pod *PodForCreatPort, nwJSON *jason.Object) ([]*Port, error)
	NewPortsWithEagerAttrAndLazyAttr(pod *PodForCreatPort, nwJSON *jason.Object) ([]*Port, error)
	DeleteBulkPorts(tenantID string, portIDs []string) error
}

func GetPortService

func GetPortService() PortServiceInterface

Jump to

Keyboard shortcuts

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