k8sconfigdb

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sConfigDB

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

K8sConfigDB implements DB interface using k8s configmap. The k8s configmap is stored in Etcd. Etcd has 1MB limit for key. So it is not possible to put all configs in one configmap. We simply store one record as one configmap.

func NewK8sConfigDB

func NewK8sConfigDB(namespace string) (*K8sConfigDB, error)

NewK8sConfigDB creates a K8sConfigDB instance.

func NewK8sConfigDBWithConfig

func NewK8sConfigDBWithConfig(namespace string, config *rest.Config) (*K8sConfigDB, error)

NewK8sConfigDBWithConfig creates a K8sConfigDB instance.

func (*K8sConfigDB) CreateConfigFile

func (s *K8sConfigDB) CreateConfigFile(ctx context.Context, cfg *common.ConfigFile) error

CreateConfigFile creates one config file in DB

func (*K8sConfigDB) CreateDevice

func (s *K8sConfigDB) CreateDevice(ctx context.Context, dev *common.Device) error

CreateDevice creates a device.

func (*K8sConfigDB) CreateService

func (s *K8sConfigDB) CreateService(ctx context.Context, svc *common.Service) error

CreateService creates a service.

func (*K8sConfigDB) CreateServiceAttr

func (s *K8sConfigDB) CreateServiceAttr(ctx context.Context, attr *common.ServiceAttr) error

CreateServiceAttr creates a service attr.

func (*K8sConfigDB) CreateServiceMember

func (s *K8sConfigDB) CreateServiceMember(ctx context.Context, member *common.ServiceMember) error

CreateServiceMember creates one EBS serviceMember in DB

func (*K8sConfigDB) CreateServiceStaticIP

func (s *K8sConfigDB) CreateServiceStaticIP(ctx context.Context, serviceip *common.ServiceStaticIP) error

CreateServiceStaticIP creates one ServiceStaticIP in DB

func (*K8sConfigDB) CreateSystemTables

func (s *K8sConfigDB) CreateSystemTables(ctx context.Context) error

CreateSystemTables is a non-op.

func (*K8sConfigDB) DeleteConfigFile

func (s *K8sConfigDB) DeleteConfigFile(ctx context.Context, serviceUUID string, fileID string) error

DeleteConfigFile deletes the config file from DB

func (*K8sConfigDB) DeleteDevice

func (s *K8sConfigDB) DeleteDevice(ctx context.Context, clusterName string, deviceName string) error

DeleteDevice deletes one device.

func (*K8sConfigDB) DeleteService

func (s *K8sConfigDB) DeleteService(ctx context.Context, clusterName string, serviceName string) error

DeleteService deletes one service.

func (*K8sConfigDB) DeleteServiceAttr

func (s *K8sConfigDB) DeleteServiceAttr(ctx context.Context, serviceUUID string) error

DeleteServiceAttr deletes one service attr.

func (*K8sConfigDB) DeleteServiceMember

func (s *K8sConfigDB) DeleteServiceMember(ctx context.Context, serviceUUID string, memberName string) error

DeleteServiceMember deletes the serviceMember from DB

func (*K8sConfigDB) DeleteServiceStaticIP

func (s *K8sConfigDB) DeleteServiceStaticIP(ctx context.Context, staticIP string) error

DeleteServiceStaticIP deletes the service static ip from DB

func (*K8sConfigDB) DeleteSystemTables

func (s *K8sConfigDB) DeleteSystemTables(ctx context.Context) error

DeleteSystemTables is a non-op. Assume all records are already deleted.

func (*K8sConfigDB) GetConfigFile

func (s *K8sConfigDB) GetConfigFile(ctx context.Context, serviceUUID string, fileID string) (cfg *common.ConfigFile, err error)

GetConfigFile gets the config fileItem from DB

func (*K8sConfigDB) GetDevice

func (s *K8sConfigDB) GetDevice(ctx context.Context, clusterName string, deviceName string) (dev *common.Device, err error)

GetDevice gets the device.

func (*K8sConfigDB) GetService

func (s *K8sConfigDB) GetService(ctx context.Context, clusterName string, serviceName string) (svc *common.Service, err error)

GetService gets the service.

func (*K8sConfigDB) GetServiceAttr

func (s *K8sConfigDB) GetServiceAttr(ctx context.Context, serviceUUID string) (attr *common.ServiceAttr, err error)

GetServiceAttr gets the service attr.

func (*K8sConfigDB) GetServiceMember

func (s *K8sConfigDB) GetServiceMember(ctx context.Context, serviceUUID string, memberName string) (member *common.ServiceMember, err error)

GetServiceMember gets the serviceMemberItem from DB

func (*K8sConfigDB) GetServiceStaticIP

func (s *K8sConfigDB) GetServiceStaticIP(ctx context.Context, staticIP string) (serviceip *common.ServiceStaticIP, err error)

GetServiceStaticIP gets the ServiceStaticIP from DB

func (*K8sConfigDB) ListDevices

func (s *K8sConfigDB) ListDevices(ctx context.Context, clusterName string) (devs []*common.Device, err error)

ListDevices lists all devices.

func (*K8sConfigDB) ListDevicesWithLimit

func (s *K8sConfigDB) ListDevicesWithLimit(ctx context.Context, clusterName string, limit int64) (devs []*common.Device, err error)

ListDevicesWithLimit does pagination list.

func (*K8sConfigDB) ListServiceMembers

func (s *K8sConfigDB) ListServiceMembers(ctx context.Context, serviceUUID string) (serviceMembers []*common.ServiceMember, err error)

ListServiceMembers lists all serviceMembers of the service

func (*K8sConfigDB) ListServiceMembersWithLimit

func (s *K8sConfigDB) ListServiceMembersWithLimit(ctx context.Context, serviceUUID string, limit int64) (serviceMembers []*common.ServiceMember, err error)

ListServiceMembersWithLimit limits the returned db.ServiceMembers at one query. This is for testing the pagination list.

func (*K8sConfigDB) ListServices

func (s *K8sConfigDB) ListServices(ctx context.Context, clusterName string) (svcs []*common.Service, err error)

ListServices lists all services.

func (*K8sConfigDB) ListServicesWithLimit

func (s *K8sConfigDB) ListServicesWithLimit(ctx context.Context, clusterName string, limit int64) (svcs []*common.Service, err error)

ListServicesWithLimit does pagination list.

func (*K8sConfigDB) SystemTablesReady

func (s *K8sConfigDB) SystemTablesReady(ctx context.Context) (tableStatus string, ready bool, err error)

SystemTablesReady is a non-op.

func (*K8sConfigDB) UpdateServiceAttr

func (s *K8sConfigDB) UpdateServiceAttr(ctx context.Context, oldAttr *common.ServiceAttr, newAttr *common.ServiceAttr) error

UpdateServiceAttr updates the ServiceAttr in DB.

func (*K8sConfigDB) UpdateServiceMember

func (s *K8sConfigDB) UpdateServiceMember(ctx context.Context, oldMember *common.ServiceMember, newMember *common.ServiceMember) error

UpdateServiceMember updates the ServiceMember in DB

func (*K8sConfigDB) UpdateServiceStaticIP

func (s *K8sConfigDB) UpdateServiceStaticIP(ctx context.Context, oldIP *common.ServiceStaticIP, newIP *common.ServiceStaticIP) error

UpdateServiceStaticIP updates the ServiceStaticIP in DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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