manager

package
v0.0.0-...-48d3ca6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverlayKey = "Overlay"
	DeviceKey  = "Device"
	HubKey     = "Hub"

	InternalKey = "internal"
)
View Source
const (
	NameSpaceName               = "sdewan-system"
	RootIssuerName              = "sdewan-controller"
	RootCAIssuerName            = "sdewan-controller-ca"
	RootCertName                = "sdewan-controller"
	SCCCertName                 = "sdewan-controller-base"
	StoreName                   = "centralcontroller"
	OverlayCollection           = "overlays"
	OverlayResource             = "overlay-name"
	ProposalCollection          = "proposals"
	ProposalResource            = "proposal-name"
	HubCollection               = "hubs"
	HubResource                 = "hub-name"
	ConnectionCollection        = "connections"
	ConnectionResource          = "connection-name"
	CNFCollection               = "cnfs"
	CNFResource                 = "cnf-name"
	DeviceCollection            = "devices"
	DeviceResource              = "device-name"
	IPRangeCollection           = "ipranges"
	IPRangeResource             = "iprange-name"
	CertCollection              = "certificates"
	CertResource                = "certificate-name"
	ClusterSyncCollection       = "cluster-sync-objects"
	ClusterSyncResource         = "cluster-sync-object-name"
	SiteCollection              = "sites"
	SiteResource                = "site-name"
	Resource                    = "resource"
	Resource_Status_NotDeployed = "NotDeployed"
	Resource_Status_Deployed    = "Deployed"
)
View Source
const (
	DEFAULT_MARK                = "30"
	VTI_MODE                    = "VTI-based"
	POLICY_MODE                 = "policy-based"
	PUBKEY_AUTH                 = "pubkey"
	FORCECRYPTOPROPOSAL         = "0"
	DEFAULT_CONN                = "Conn"
	DEFAULT_UPDOWN              = "/etc/updown"
	IPTABLES_UPDOWN             = "/usr/lib/ipsec/_updown iptables"
	OIP_UPDOWN                  = "/etc/updown_oip"
	CONN_TYPE                   = "tunnel"
	START_MODE                  = "start"
	ADD_MODE                    = "add"
	OVERLAYIP                   = "overlayip"
	HUBTOHUB                    = "hub-to-hub"
	HUBTODEVICE                 = "hub-to-device"
	DEVICETODEVICE              = "device-to-device"
	BYCONFIG                    = "%config"
	ANY                         = "%any"
	BASE_PROTOCOL               = "TCP"
	DEFAULT_K8S_API_SERVER_PORT = "6443"
	ACCEPT                      = "ACCEPT"
	WILDCARD_SUBNET             = "0.0.0.0"
)
View Source
const DEFAULTPORT = "6443"
View Source
const PROVIDERNAME = "akraino_scc"
View Source
const RegStatus = "RegStatus"
View Source
const SCC_RESOURCE = "scc_ipsec_resource"
View Source
const SELFSIGNEDCA = "sdewan-controller"

Variables

View Source
var Resource_mux = sync.Mutex{}

Functions

func DecodeYAMLFromData

func DecodeYAMLFromData(data []byte, into runtime.Object) (runtime.Object, error)

func DecodeYAMLFromFile

func DecodeYAMLFromFile(path string, into runtime.Object) (runtime.Object, error)

func GetCertChain

func GetCertChain(m map[string]string) (string, error)

func GetRootCA

func GetRootCA() (string, error)

func InitRsyncClient

func InitRsyncClient() bool

func ValidateIPRangeObject

func ValidateIPRangeObject(sl validator.StructLevel)

Types

type BaseObjectManager

type BaseObjectManager struct {
	// contains filtered or unexported fields
}

func (*BaseObjectManager) AddDepResManager

func (c *BaseObjectManager) AddDepResManager(mgr ControllerObjectManager)

func (*BaseObjectManager) AddOwnResManager

func (c *BaseObjectManager) AddOwnResManager(mgr ControllerObjectManager)

func (*BaseObjectManager) GetDepResManagers

func (c *BaseObjectManager) GetDepResManagers() []ControllerObjectManager

func (*BaseObjectManager) GetOwnResManagers

func (c *BaseObjectManager) GetOwnResManagers() []ControllerObjectManager

func (*BaseObjectManager) GetResourceStoredName

func (c *BaseObjectManager) GetResourceStoredName(obj module.ControllerObject) string

func (*BaseObjectManager) GetStoreMeta

func (c *BaseObjectManager) GetStoreMeta() string

func (*BaseObjectManager) GetStoreName

func (c *BaseObjectManager) GetStoreName() string

type CNFObjectKey

type CNFObjectKey struct {
	OverlayName string `json:"overlay-name"`
	ClusterName string `json:"cluster-name"`
	CNFName     string `json:"cnf-name"`
}

type CNFObjectManager

type CNFObjectManager struct {
	BaseObjectManager
	// contains filtered or unexported fields
}

CNFObjectManager implements the ControllerObjectManager

func NewCNFObjectManager

func NewCNFObjectManager(isHub bool) *CNFObjectManager

func (*CNFObjectManager) CreateEmptyObject

func (c *CNFObjectManager) CreateEmptyObject() module.ControllerObject

func (*CNFObjectManager) CreateObject

func (*CNFObjectManager) DeleteObject

func (c *CNFObjectManager) DeleteObject(m map[string]string) error

func (*CNFObjectManager) GetObject

func (c *CNFObjectManager) GetObject(m map[string]string) (module.ControllerObject, error)

func (*CNFObjectManager) GetObjects

func (c *CNFObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*CNFObjectManager) GetResourceName

func (c *CNFObjectManager) GetResourceName() string

func (*CNFObjectManager) GetStoreKey

func (c *CNFObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*CNFObjectManager) IsOperationSupported

func (c *CNFObjectManager) IsOperationSupported(oper string) bool

func (*CNFObjectManager) ParseObject

func (c *CNFObjectManager) ParseObject(r io.Reader) (module.ControllerObject, error)

func (*CNFObjectManager) ParseStatus

func (c *CNFObjectManager) ParseStatus(val string) (string, error)

func (*CNFObjectManager) UpdateObject

type CertUtil

type CertUtil struct {
	// contains filtered or unexported fields
}

func GetCertUtil

func GetCertUtil() (*CertUtil, error)

func (*CertUtil) CreateCAIssuer

func (c *CertUtil) CreateCAIssuer(name string, namespace string, caname string) (*certv1.Issuer, error)

func (*CertUtil) CreateCertificate

func (c *CertUtil) CreateCertificate(name string, namespace string, issuer string, isCA bool) (*certv1.Certificate, error)

func (*CertUtil) CreateNamespace

func (c *CertUtil) CreateNamespace(name string) (*v1.Namespace, error)

func (*CertUtil) CreateSelfSignedIssuer

func (c *CertUtil) CreateSelfSignedIssuer(name string, namespace string) (*certv1.Issuer, error)

func (*CertUtil) DeleteCertificate

func (c *CertUtil) DeleteCertificate(name string, namespace string) error

func (*CertUtil) DeleteIssuer

func (c *CertUtil) DeleteIssuer(name string, namespace string) error

func (*CertUtil) DeleteNamespace

func (c *CertUtil) DeleteNamespace(name string) error

func (*CertUtil) GetCertSecretName

func (c *CertUtil) GetCertSecretName(name string) string

func (*CertUtil) GetCertificate

func (c *CertUtil) GetCertificate(name string, namespace string) (*certv1.Certificate, error)

func (*CertUtil) GetIssuer

func (c *CertUtil) GetIssuer(name string, namespace string) (*certv1.Issuer, error)

func (*CertUtil) GetKeypair

func (c *CertUtil) GetKeypair(certname string, namespace string) (string, string, error)

func (*CertUtil) GetSelfSignedCA

func (c *CertUtil) GetSelfSignedCA() string

func (*CertUtil) IsCertReady

func (c *CertUtil) IsCertReady(name string, namespace string) bool

type CertificateObjectKey

type CertificateObjectKey struct {
	OverlayName     string `json:"overlay-name"`
	CertificateName string `json:"certificate-name"`
}

type CertificateObjectManager

type CertificateObjectManager struct {
	BaseObjectManager
}

IPRangeObjectManager implements the ControllerObjectManager

func NewCertificateObjectManager

func NewCertificateObjectManager() *CertificateObjectManager

func (*CertificateObjectManager) CreateEmptyObject

func (c *CertificateObjectManager) CreateEmptyObject() module.ControllerObject

func (*CertificateObjectManager) CreateObject

func (*CertificateObjectManager) DeleteCertificateByType

func (c *CertificateObjectManager) DeleteCertificateByType(overlay_name string, dev_name string, dev_type string) error

func (*CertificateObjectManager) DeleteObject

func (c *CertificateObjectManager) DeleteObject(m map[string]string) error

func (*CertificateObjectManager) GetCertName

func (c *CertificateObjectManager) GetCertName(name string, obj_type string) string

func (*CertificateObjectManager) GetObject

func (*CertificateObjectManager) GetObjects

func (*CertificateObjectManager) GetOrCreateCertificateByType

func (c *CertificateObjectManager) GetOrCreateCertificateByType(overlay_name string, dev_name string, dev_type string, isCA bool) (string, string, string, error)

func (*CertificateObjectManager) GetOrCreateDC

func (c *CertificateObjectManager) GetOrCreateDC(overlay_name string, dev_name string, isCA bool) (string, string, string, error)

func (*CertificateObjectManager) GetResourceName

func (c *CertificateObjectManager) GetResourceName() string

func (*CertificateObjectManager) GetResourceStoredName

func (c *CertificateObjectManager) GetResourceStoredName(obj module.ControllerObject) string

func (*CertificateObjectManager) GetStoreKey

func (c *CertificateObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*CertificateObjectManager) IsOperationSupported

func (c *CertificateObjectManager) IsOperationSupported(oper string) bool

func (*CertificateObjectManager) ParseObject

func (*CertificateObjectManager) UpdateObject

type Cluster

type Cluster struct {
	Metadata mtypes.Metadata `json:"metadata"`
}

type ClusterContent

type ClusterContent struct {
	Kubeconfig string `json:"kubeconfig"`
}

type ClusterKey

type ClusterKey struct {
	ClusterProviderName string `json:"provider"`
	ClusterName         string `json:"cluster"`
}

type ClusterSyncObjectKey

type ClusterSyncObjectKey struct {
	OverlayName     string `json:"overlay-name"`
	ClusterSyncName string `json:"clustersync-name"`
}

type ClusterSyncObjectManager

type ClusterSyncObjectManager struct {
	BaseObjectManager
}

ClusterSyncObjectManager implements the ControllerObjectManager

func NewClusterSyncObjectManager

func NewClusterSyncObjectManager() *ClusterSyncObjectManager

func (*ClusterSyncObjectManager) CreateEmptyObject

func (c *ClusterSyncObjectManager) CreateEmptyObject() module.ControllerObject

func (*ClusterSyncObjectManager) CreateObject

func (*ClusterSyncObjectManager) DeleteObject

func (c *ClusterSyncObjectManager) DeleteObject(m map[string]string) error

func (*ClusterSyncObjectManager) GetObject

func (*ClusterSyncObjectManager) GetObjects

func (*ClusterSyncObjectManager) GetResourceName

func (c *ClusterSyncObjectManager) GetResourceName() string

func (*ClusterSyncObjectManager) GetStoreKey

func (c *ClusterSyncObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*ClusterSyncObjectManager) IsOperationSupported

func (c *ClusterSyncObjectManager) IsOperationSupported(oper string) bool

func (*ClusterSyncObjectManager) ParseObject

func (*ClusterSyncObjectManager) UpdateObject

type ConnectionKey

type ConnectionKey struct {
	OverlayName string `json:"overlay-name"`
	End1        string `json:"end1-name"`
	End2        string `json:"end2-name"`
}

type ConnectionManager

type ConnectionManager struct {
	// contains filtered or unexported fields
}

func GetConnectionManager

func GetConnectionManager() *ConnectionManager

func (*ConnectionManager) CreateEmptyObject

func (c *ConnectionManager) CreateEmptyObject() module.ControllerObject

func (*ConnectionManager) DeleteObject

func (c *ConnectionManager) DeleteObject(overlay string, key1 string, key2 string) error

func (*ConnectionManager) Deploy

func (c *ConnectionManager) Deploy(overlay string, cm module.ConnectionObject, resutil *ResUtil) error

func (*ConnectionManager) GetObject

func (c *ConnectionManager) GetObject(overlay string, key1 string, key2 string) (module.ControllerObject, error)

func (*ConnectionManager) GetObjects

func (c *ConnectionManager) GetObjects(overlay string, key string) ([]module.ControllerObject, error)

func (*ConnectionManager) GetStoreMeta

func (c *ConnectionManager) GetStoreMeta() string

func (*ConnectionManager) GetStoreName

func (c *ConnectionManager) GetStoreName() string

func (*ConnectionManager) Undeploy

func (c *ConnectionManager) Undeploy(overlay string, cm module.ConnectionObject) error

func (*ConnectionManager) UpdateObject

type ControllerObjectManager

type ControllerObjectManager interface {
	GetStoreName() string
	GetStoreMeta() string
	GetDepResManagers() []ControllerObjectManager
	AddDepResManager(mgr ControllerObjectManager)
	GetOwnResManagers() []ControllerObjectManager
	AddOwnResManager(mgr ControllerObjectManager)

	GetResourceName() string
	GetResourceStoredName(obj module.ControllerObject) string
	IsOperationSupported(oper string) bool
	GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)
	CreateEmptyObject() module.ControllerObject
	ParseObject(r io.Reader) (module.ControllerObject, error)
	CreateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error)
	GetObject(m map[string]string) (module.ControllerObject, error)
	GetObjects(m map[string]string) ([]module.ControllerObject, error)
	UpdateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error)
	DeleteObject(m map[string]string) error
}

ControllerManager is an interface exposes the ControllerObject functionality

type DBUtils

type DBUtils struct {
}

func GetDBUtils

func GetDBUtils() *DBUtils

func (*DBUtils) CheckDep

func (d *DBUtils) CheckDep(c ControllerObjectManager, m map[string]string) error

func (*DBUtils) CheckOwn

func (d *DBUtils) CheckOwn(c ControllerObjectManager, m map[string]string) error

func (*DBUtils) DeleteObject

func (d *DBUtils) DeleteObject(c ControllerObjectManager, m map[string]string) error

func (*DBUtils) GetObject

func (*DBUtils) GetObjects

func (*DBUtils) RegisterDevice

func (d *DBUtils) RegisterDevice(overlay, cluster_name string, kubeconfig string) error

func (*DBUtils) RegisterGitOpsDevice

func (d *DBUtils) RegisterGitOpsDevice(overlay, cluster_name string, gs mtypes.GitOpsSpec) error

func (*DBUtils) UnregisterDevice

func (d *DBUtils) UnregisterDevice(overlay, cluster_name string) error

func (*DBUtils) UnregisterGitOpsDevice

func (d *DBUtils) UnregisterGitOpsDevice(overlay, cluster_name string) error

type DeployResource

type DeployResource struct {
	Action   string
	Resource resource.ISdewanResource
	Status   int // 0: to be (un)deployed; 1: success; 2: failed
}

sdewan definition

type DeployResources

type DeployResources struct {
	Resources []DeployResource
}

type DeviceConnObjectKey

type DeviceConnObjectKey struct {
	OverlayName string `json:"overlay-name"`
	DeviceName  string `json:"device-name"`
	ConnName    string `json:"connection-name"`
}

type DeviceConnObjectManager

type DeviceConnObjectManager struct {
	BaseObjectManager
}

DeviceConnObjectManager implements the ControllerObjectManager

func NewDeviceConnObjectManager

func NewDeviceConnObjectManager() *DeviceConnObjectManager

func (*DeviceConnObjectManager) CreateEmptyObject

func (c *DeviceConnObjectManager) CreateEmptyObject() module.ControllerObject

func (*DeviceConnObjectManager) CreateObject

func (*DeviceConnObjectManager) DeleteObject

func (c *DeviceConnObjectManager) DeleteObject(m map[string]string) error

func (*DeviceConnObjectManager) GetConnectedHubs

func (c *DeviceConnObjectManager) GetConnectedHubs(overlay_name string, device_name string) ([]string, error)

func (*DeviceConnObjectManager) GetObject

func (*DeviceConnObjectManager) GetObjects

func (*DeviceConnObjectManager) GetResourceName

func (c *DeviceConnObjectManager) GetResourceName() string

func (*DeviceConnObjectManager) GetStoreKey

func (c *DeviceConnObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*DeviceConnObjectManager) IsConnectedHub

func (c *DeviceConnObjectManager) IsConnectedHub(overlay_name string, device_name string, hub string) bool

func (*DeviceConnObjectManager) IsOperationSupported

func (c *DeviceConnObjectManager) IsOperationSupported(oper string) bool

func (*DeviceConnObjectManager) ParseObject

func (*DeviceConnObjectManager) UpdateObject

type DeviceObjectKey

type DeviceObjectKey struct {
	OverlayName string `json:"overlay-name"`
	DeviceName  string `json:"device-name"`
}

type DeviceObjectManager

type DeviceObjectManager struct {
	BaseObjectManager
}

DeviceObjectManager implements the ControllerObjectManager

func NewDeviceObjectManager

func NewDeviceObjectManager() *DeviceObjectManager

func (*DeviceObjectManager) AllocateIP

func (c *DeviceObjectManager) AllocateIP(m map[string]string, t module.ControllerObject, name string) (string, error)

Function allocate ip and update

func (*DeviceObjectManager) CreateEmptyObject

func (c *DeviceObjectManager) CreateEmptyObject() module.ControllerObject

func (*DeviceObjectManager) CreateObject

func (*DeviceObjectManager) DeleteObject

func (c *DeviceObjectManager) DeleteObject(m map[string]string) error

func (*DeviceObjectManager) FreeIP

Function free ip and update

func (*DeviceObjectManager) GetObject

func (*DeviceObjectManager) GetObjects

func (c *DeviceObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*DeviceObjectManager) GetResourceName

func (c *DeviceObjectManager) GetResourceName() string

func (*DeviceObjectManager) GetStoreKey

func (c *DeviceObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*DeviceObjectManager) IsOperationSupported

func (c *DeviceObjectManager) IsOperationSupported(oper string) bool

func (*DeviceObjectManager) ParseObject

func (*DeviceObjectManager) PostRegister

func (c *DeviceObjectManager) PostRegister(m map[string]string, t module.ControllerObject) error

func (*DeviceObjectManager) PreProcessing

func (c *DeviceObjectManager) PreProcessing(m map[string]string, t module.ControllerObject) error

func (*DeviceObjectManager) UpdateObject

type DeviceSiteObjectKey

type DeviceSiteObjectKey struct {
	OverlayName string `json:"overlay-name"`
	DeviceName  string `json:"device-name"`
	SiteName    string `json:"site-name"`
}

type DeviceSiteObjectManager

type DeviceSiteObjectManager struct {
	BaseObjectManager
}

DeviceSiteObjectManager implements the ControllerObjectManager

func NewDeviceSiteObjectManager

func NewDeviceSiteObjectManager() *DeviceSiteObjectManager

func (*DeviceSiteObjectManager) CreateEmptyObject

func (c *DeviceSiteObjectManager) CreateEmptyObject() module.ControllerObject

func (*DeviceSiteObjectManager) CreateObject

func (*DeviceSiteObjectManager) DeleteObject

func (c *DeviceSiteObjectManager) DeleteObject(m map[string]string) error

func (*DeviceSiteObjectManager) GetObject

func (*DeviceSiteObjectManager) GetObjects

func (*DeviceSiteObjectManager) GetResourceName

func (c *DeviceSiteObjectManager) GetResourceName() string

func (*DeviceSiteObjectManager) GetStoreKey

func (c *DeviceSiteObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*DeviceSiteObjectManager) IsOperationSupported

func (c *DeviceSiteObjectManager) IsOperationSupported(oper string) bool

func (*DeviceSiteObjectManager) ParseObject

func (*DeviceSiteObjectManager) TryDeleteSite

func (c *DeviceSiteObjectManager) TryDeleteSite(overlay string, hub string, device string) error

func (*DeviceSiteObjectManager) UpdateObject

type HubConnObjectKey

type HubConnObjectKey struct {
	OverlayName string `json:"overlay-name"`
	HubName     string `json:"hub-name"`
	ConnName    string `json:"connection-name"`
}

type HubConnObjectManager

type HubConnObjectManager struct {
	BaseObjectManager
}

HubConnObjectManager implements the ControllerObjectManager

func NewHubConnObjectManager

func NewHubConnObjectManager() *HubConnObjectManager

func (*HubConnObjectManager) CreateEmptyObject

func (c *HubConnObjectManager) CreateEmptyObject() module.ControllerObject

func (*HubConnObjectManager) CreateObject

func (*HubConnObjectManager) DeleteObject

func (c *HubConnObjectManager) DeleteObject(m map[string]string) error

func (*HubConnObjectManager) GetConnectedDevices

func (c *HubConnObjectManager) GetConnectedDevices(overlay_name string, hub_name string) ([]string, error)

func (*HubConnObjectManager) GetObject

func (*HubConnObjectManager) GetObjects

func (c *HubConnObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*HubConnObjectManager) GetResourceName

func (c *HubConnObjectManager) GetResourceName() string

func (*HubConnObjectManager) GetStoreKey

func (c *HubConnObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*HubConnObjectManager) IsOperationSupported

func (c *HubConnObjectManager) IsOperationSupported(oper string) bool

func (*HubConnObjectManager) ParseObject

func (*HubConnObjectManager) UpdateObject

type HubDeviceObjectKey

type HubDeviceObjectKey struct {
	OverlayName string `json:"overlay-name"`
	HubName     string `json:"hub-name"`
	DeviceName  string `json:"device-name"`
}

type HubDeviceObjectManager

type HubDeviceObjectManager struct {
	BaseObjectManager
}

HubDeviceObjectManager implements the ControllerObjectManager

func NewHubDeviceObjectManager

func NewHubDeviceObjectManager() *HubDeviceObjectManager

func (*HubDeviceObjectManager) CreateEmptyObject

func (c *HubDeviceObjectManager) CreateEmptyObject() module.ControllerObject

func (*HubDeviceObjectManager) CreateObject

func (*HubDeviceObjectManager) DeleteObject

func (c *HubDeviceObjectManager) DeleteObject(m map[string]string) error

func (*HubDeviceObjectManager) GetObject

func (*HubDeviceObjectManager) GetObjects

func (*HubDeviceObjectManager) GetResourceName

func (c *HubDeviceObjectManager) GetResourceName() string

func (*HubDeviceObjectManager) GetStoreKey

func (c *HubDeviceObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*HubDeviceObjectManager) IsOperationSupported

func (c *HubDeviceObjectManager) IsOperationSupported(oper string) bool

func (*HubDeviceObjectManager) ParseObject

func (*HubDeviceObjectManager) UpdateObject

type HubObjectKey

type HubObjectKey struct {
	OverlayName string `json:"overlay-name"`
	HubName     string `json:"hub-name"`
}

type HubObjectManager

type HubObjectManager struct {
	BaseObjectManager
}

HubObjectManager implements the ControllerObjectManager

func NewHubObjectManager

func NewHubObjectManager() *HubObjectManager

func (*HubObjectManager) CreateEmptyObject

func (c *HubObjectManager) CreateEmptyObject() module.ControllerObject

func (*HubObjectManager) CreateObject

func (*HubObjectManager) DeleteObject

func (c *HubObjectManager) DeleteObject(m map[string]string) error

func (*HubObjectManager) GetObject

func (c *HubObjectManager) GetObject(m map[string]string) (module.ControllerObject, error)

func (*HubObjectManager) GetObjects

func (c *HubObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*HubObjectManager) GetResourceName

func (c *HubObjectManager) GetResourceName() string

func (*HubObjectManager) GetStoreKey

func (c *HubObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*HubObjectManager) IsOperationSupported

func (c *HubObjectManager) IsOperationSupported(oper string) bool

func (*HubObjectManager) ParseObject

func (c *HubObjectManager) ParseObject(r io.Reader) (module.ControllerObject, error)

func (*HubObjectManager) UpdateObject

type IPRangeObjectKey

type IPRangeObjectKey struct {
	OverlayName string `json:"overlay-name"`
	IPRangeName string `json:"iprange-name"`
}

type IPRangeObjectManager

type IPRangeObjectManager struct {
	BaseObjectManager
	// contains filtered or unexported fields
}

IPRangeObjectManager implements the ControllerObjectManager

func NewIPRangeObjectManager

func NewIPRangeObjectManager(provider bool) *IPRangeObjectManager

func (*IPRangeObjectManager) Allocate

func (c *IPRangeObjectManager) Allocate(oname string, name string) (string, error)

func (*IPRangeObjectManager) CreateEmptyObject

func (c *IPRangeObjectManager) CreateEmptyObject() module.ControllerObject

func (*IPRangeObjectManager) CreateObject

func (*IPRangeObjectManager) DeleteObject

func (c *IPRangeObjectManager) DeleteObject(m map[string]string) error

func (*IPRangeObjectManager) Free

func (c *IPRangeObjectManager) Free(oname string, ip string) error

func (*IPRangeObjectManager) FreeAll

func (c *IPRangeObjectManager) FreeAll(oname string) error

func (*IPRangeObjectManager) GetDefinedObjects

func (c *IPRangeObjectManager) GetDefinedObjects(m map[string]string) ([]module.ControllerObject, error)

func (*IPRangeObjectManager) GetObject

func (*IPRangeObjectManager) GetObjects

func (c *IPRangeObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*IPRangeObjectManager) GetResourceName

func (c *IPRangeObjectManager) GetResourceName() string

func (*IPRangeObjectManager) GetStoreKey

func (c *IPRangeObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*IPRangeObjectManager) IsOperationSupported

func (c *IPRangeObjectManager) IsOperationSupported(oper string) bool

func (*IPRangeObjectManager) ParseObject

func (*IPRangeObjectManager) SetIPRangeName

func (c *IPRangeObjectManager) SetIPRangeName(k db.Key, name string)

func (*IPRangeObjectManager) UpdateObject

type KubeConfigUtil

type KubeConfigUtil struct {
}

func GetKubeConfigUtil

func GetKubeConfigUtil() *KubeConfigUtil

func (*KubeConfigUtil) UpdateK8sConfig

func (c *KubeConfigUtil) UpdateK8sConfig(conf []byte, server string, insecure bool) ([]byte, error)

type Managerset

func GetManagerset

func GetManagerset() *Managerset

type OverlayObjectKey

type OverlayObjectKey struct {
	OverlayName string `json:"overlay-name"`
}

type OverlayObjectManager

type OverlayObjectManager struct {
	BaseObjectManager
}

OverlayObjectManager implements the ControllerObjectManager

func NewOverlayObjectManager

func NewOverlayObjectManager() *OverlayObjectManager

func (*OverlayObjectManager) CertName

func (c *OverlayObjectManager) CertName(name string) string

func (*OverlayObjectManager) CreateEmptyObject

func (c *OverlayObjectManager) CreateEmptyObject() module.ControllerObject

func (*OverlayObjectManager) CreateObject

func (*OverlayObjectManager) DeleteConnection

func (c *OverlayObjectManager) DeleteConnection(m map[string]string, conn module.ConnectionObject) error

func (*OverlayObjectManager) DeleteConnections

func (c *OverlayObjectManager) DeleteConnections(m map[string]string, m1 module.ControllerObject) error

func (*OverlayObjectManager) DeleteObject

func (c *OverlayObjectManager) DeleteObject(m map[string]string) error

func (*OverlayObjectManager) GetObject

func (*OverlayObjectManager) GetObjects

func (c *OverlayObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*OverlayObjectManager) GetResourceName

func (c *OverlayObjectManager) GetResourceName() string

func (*OverlayObjectManager) GetStoreKey

func (c *OverlayObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*OverlayObjectManager) IsOperationSupported

func (c *OverlayObjectManager) IsOperationSupported(oper string) bool

func (*OverlayObjectManager) IssuerName

func (c *OverlayObjectManager) IssuerName(name string) string

func (*OverlayObjectManager) ParseObject

func (*OverlayObjectManager) SetupConnection

func (c *OverlayObjectManager) SetupConnection(m map[string]string, m1 module.ControllerObject, m2 module.ControllerObject, conntype string, namespace string, is_delegated bool) error

Set up Connection between objects Passing the original map resource, the two objects, connection type("hub-to-hub", "hub-to-device", "device-to-device") and namespace name.

func (*OverlayObjectManager) UpdateObject

type ProposalObjectKey

type ProposalObjectKey struct {
	OverlayName  string `json:"overlay-name"`
	ProposalName string `json:"proposal-name"`
}

type ProposalObjectManager

type ProposalObjectManager struct {
	BaseObjectManager
}

ProposalObjectManager implements the ControllerObjectManager

func NewProposalObjectManager

func NewProposalObjectManager() *ProposalObjectManager

func (*ProposalObjectManager) CreateEmptyObject

func (c *ProposalObjectManager) CreateEmptyObject() module.ControllerObject

func (*ProposalObjectManager) CreateObject

func (*ProposalObjectManager) DeleteObject

func (c *ProposalObjectManager) DeleteObject(m map[string]string) error

func (*ProposalObjectManager) GetObject

func (*ProposalObjectManager) GetObjects

func (c *ProposalObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*ProposalObjectManager) GetResourceName

func (c *ProposalObjectManager) GetResourceName() string

func (*ProposalObjectManager) GetStoreKey

func (c *ProposalObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*ProposalObjectManager) IsOperationSupported

func (c *ProposalObjectManager) IsOperationSupported(oper string) bool

func (*ProposalObjectManager) ParseObject

func (*ProposalObjectManager) UpdateObject

type ProviderIPRangeObjectKey

type ProviderIPRangeObjectKey struct {
	IPRangeName string `json:"iprange-name"`
}

type QueryResource

type QueryResource struct {
	Handle   interface{}
	Resource ReadResource
}

type QueryResources

type QueryResources struct {
	Resources []*QueryResource
}

type ReadResource

type ReadResource struct {
	Gvk       schema.GroupVersionKind `json:"GVK,omitempty"`
	Name      string                  `json:"name,omitempty"`
	Namespace string                  `json:"namespace,omitempty"`
}

type ResUtil

type ResUtil struct {
	// contains filtered or unexported fields
}

func NewResUtil

func NewResUtil() *ResUtil

func (*ResUtil) AddQueryResource

func (d *ResUtil) AddQueryResource(device module.ControllerObject, resource QueryResource) error

func (*ResUtil) AddResource

func (d *ResUtil) AddResource(device module.ControllerObject, action string, resource resource.ISdewanResource) error

func (*ResUtil) Deploy

func (d *ResUtil) Deploy(overlay string, app_name string, format string) error

func (*ResUtil) DeployOneResource

func (d *ResUtil) DeployOneResource(overlay, app_name string, format string, device module.ControllerObject, resource DeployResource) (string, error)

func (*ResUtil) DeployUpdate

func (d *ResUtil) DeployUpdate(overlay string, app_name string, format string, update bool) error

func (*ResUtil) GetResourceData

func (d *ResUtil) GetResourceData(device module.ControllerObject, ns string, name string) (string, error)

func (*ResUtil) GetResources

func (d *ResUtil) GetResources() map[module.ControllerObject]*DeployResources

func (*ResUtil) Query

func (d *ResUtil) Query(app_name string) (string, error)

func (*ResUtil) TargetName

func (d *ResUtil) TargetName(o module.ControllerObject) string

func (*ResUtil) Undeploy

func (d *ResUtil) Undeploy(overlay string) error

func (*ResUtil) UpdateOneResource

func (d *ResUtil) UpdateOneResource(overlay, cid string, device module.ControllerObject, resourceName string, resourceValue string) error

type ResourceObjectKey

type ResourceObjectKey struct {
	Cluster string `json:"cluster-info"`
	Type    string `json:"type"`
	Name    string `json:"name"`
}

type ResourceObjectManager

type ResourceObjectManager struct {
	BaseObjectManager
}

ResourceObjectManager implements the ControllerObjectManager

func NewResourceObjectManager

func NewResourceObjectManager() *ResourceObjectManager

func (*ResourceObjectManager) CreateEmptyObject

func (c *ResourceObjectManager) CreateEmptyObject() module.ControllerObject

func (*ResourceObjectManager) CreateObject

func (*ResourceObjectManager) DeleteObject

func (c *ResourceObjectManager) DeleteObject(m map[string]string) error

func (*ResourceObjectManager) GetObject

func (*ResourceObjectManager) GetObjects

func (c *ResourceObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error)

func (*ResourceObjectManager) GetResourceName

func (c *ResourceObjectManager) GetResourceName() string

func (*ResourceObjectManager) GetStoreKey

func (c *ResourceObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error)

func (*ResourceObjectManager) IsOperationSupported

func (c *ResourceObjectManager) IsOperationSupported(oper string) bool

func (*ResourceObjectManager) ParseObject

func (*ResourceObjectManager) UpdateObject

Jump to

Keyboard shortcuts

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