broker

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotation

func AddAnnotation(baremetalId string, namespace string, poolId string, serverId string, schema string, logger logr.Logger) error

func BaremetalFound

func BaremetalFound(name string) bool

func CreateNewBaremetal

func CreateNewBaremetal(bm Baremetal)

func CreateNewPool

func CreateNewPool(pool Pool)

func CreateNewServer

func CreateNewServer(poolId string, serverId string, baremetalName string, schema string)

func DeleteBaremetal

func DeleteBaremetal(name string)

func DeletePool

func DeletePool(poolId string, logger logr.Logger)

func DeleteServer

func DeleteServer(serverId string, poolId string)

func GetBrokerClient

func GetBrokerClient(
	kubeconfig *rest.Config,
) (*rest.RESTClient, error)

func GetK8SClient

func GetK8SClient(kubeconfig *rest.Config) (*kubernetes.Clientset, error)

func HandleBrokerApiRequests

func HandleBrokerApiRequests(setupLog logr.Logger)

func InitBrokerData

func InitBrokerData(setupLog logr.Logger) error

func IsBrokerDataEmpty

func IsBrokerDataEmpty() bool

func PoolFound

func PoolFound(name string) bool

func ServerFound

func ServerFound(name string, poolid string) bool

func UpdateBaremetal

func UpdateBaremetal(bm Baremetal)

func UpdatePoolValues

func UpdatePoolValues(name string, poolValues Pool)

func ValidateBaremetalDataRequest

func ValidateBaremetalDataRequest(baremetalValues Baremetal) error

func ValidatePoolDataRequest

func ValidatePoolDataRequest(poolValues Pool) error

func ValidateServerDataRequest

func ValidateServerDataRequest(serverValues ServerRequest) error

func VerifyPoolAuthent

func VerifyPoolAuthent(username string, password string) bool

//////////////////////////////////////////////////////////////

Types

type AuthRequest

type AuthRequest struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

type Baremetal

type Baremetal struct {
	Id                             string            `json:"id"`
	Url                            string            `json:"url"`
	Username                       string            `json:"username"`
	Password                       string            `json:"password"`
	MacAddress                     string            `json:"macAddress"`
	K8sLabels                      map[string]string `json:"k8slabels"`
	K8sAnnotations                 map[string]string `json:"k8sannotations"`
	DeviceName                     string            `json:"devicename"`
	DisableCertificateVerification bool              `json:"disablecertificateverification"`
}

func GetBaremetal

func GetBaremetal(name string) *Baremetal

func RetrieveAllBaremetals

func RetrieveAllBaremetals() []Baremetal

type BrokerData

type BrokerData struct {
	Baremetals map[string]Baremetal
	Pools      map[string]Pool
}
var (
	BROKERDATA BrokerData = BrokerData{
		Baremetals: make(map[string]Baremetal),
		Pools:      make(map[string]Pool),
	}

	Mutex sync.Mutex
)

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

type PatchSpec

type PatchSpec struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

type Pool

type Pool struct {
	Id            string
	Username      string
	Password      string
	LabelSelector map[string]string
	MaxServers    int
	Servers       map[string]ServerData
}

type PoolResponse

type PoolResponse struct {
	Id            string            `json:"id"`
	Username      string            `json:"username"`
	Password      string            `json:"password"`
	LabelSelector map[string]string `json:"labelSelector"`
	MaxServers    int               `json:"maxServers"`
}

func GetPool

func GetPool(poolId string) *PoolResponse

func RetrieveAllPools

func RetrieveAllPools() []PoolResponse

type ServerData

type ServerData struct {
	Id        string `json:"id"`
	Baremetal string `json:"baremetal"`
	Schema    string `json:"schema"`
}

type ServerRequest

type ServerRequest struct {
	Id     string `json:"id"`
	Schema string `json:"schema"`
}

type ServerResponse

type ServerResponse struct {
	Id                             string            `json:"id"`
	K8sLabels                      map[string]string `json:"k8slabels"`
	K8sAnnotations                 map[string]string `json:"k8sannotations"`
	Baremetal                      string            `json:"baremetal"`
	Url                            string            `json:"url"`
	MacAddress                     string            `json:"macAddress"`
	DeviceName                     string            `json:"devicename"`
	DisableCertificateVerification bool              `json:"disablecertificateverification"`
}

func RetrieveAllServers

func RetrieveAllServers(poolId string) []ServerResponse

Jump to

Keyboard shortcuts

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