Documentation ¶
Index ¶
- type NetNode
- type NetService
- func (srv *NetService) AddHost(info *types.HostInfo) error
- func (srv *NetService) AddPool(pool *types.NetPool) error
- func (srv *NetService) DeleteHost(hostIP string, ipsDel []string) error
- func (srv *NetService) DeletePool(netKey string) error
- func (srv *NetService) GetHostInfo(ip string) (*types.HostInfo, error)
- func (srv *NetService) GetPoolAvailable(net string) (*types.NetPool, error)
- func (srv *NetService) HostVIPRelease(hostIP string) error
- func (srv *NetService) IPLean(lease *types.IPLease) (*types.IPInfo, error)
- func (srv *NetService) IPRelease(release *types.IPRelease) error
- func (srv *NetService) ListHost() ([]*types.HostInfo, error)
- func (srv *NetService) ListHostByKey(ip string) (*types.HostInfo, error)
- func (srv *NetService) ListPool() ([]*types.NetPool, error)
- func (srv *NetService) ListPoolByCluster(cluster string) ([]*types.NetPool, error)
- func (srv *NetService) ListPoolByKey(net string) (*types.NetPool, error)
- func (srv *NetService) TransferIPAttribute(tranInput *types.TranIPAttrInput) (int, error)
- func (srv *NetService) UpdateAvailableIPInstance(ipinst *types.IPInst) error
- func (srv *NetService) UpdateHost() error
- func (srv *NetService) UpdatePool(pool *types.NetPool, netKey string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetService ¶
type NetService struct {
// contains filtered or unexported fields
}
NetService service for all logic, this NetService add/delete/update/list all data base on key/value todo(DeveloperJim): if we need to store data in SQL system, NetService needs refactor.
func NewNetService ¶
func NewNetService(addr string, port, metricPort int, st storage.Storage) *NetService
NewNetService create netservice logic
func (*NetService) AddHost ¶
func (srv *NetService) AddHost(info *types.HostInfo) error
AddHost update host info
func (*NetService) AddPool ¶
func (srv *NetService) AddPool(pool *types.NetPool) error
AddPool construct pool info
func (*NetService) DeleteHost ¶
func (srv *NetService) DeleteHost(hostIP string, ipsDel []string) error
DeleteHost update host info
func (*NetService) DeletePool ¶
func (srv *NetService) DeletePool(netKey string) error
DeletePool update Pool info
func (*NetService) GetHostInfo ¶
func (srv *NetService) GetHostInfo(ip string) (*types.HostInfo, error)
GetHostInfo get host node content info, container info are exclude note: if err is nil & HostInfo is nil, no hostInfo in storage
func (*NetService) GetPoolAvailable ¶
func (srv *NetService) GetPoolAvailable(net string) (*types.NetPool, error)
GetPoolAvailable get pool available ip list only
func (*NetService) HostVIPRelease ¶
func (srv *NetService) HostVIPRelease(hostIP string) error
HostVIPRelease to release host's vip
func (*NetService) IPRelease ¶
func (srv *NetService) IPRelease(release *types.IPRelease) error
IPRelease release ip resource to net pool
func (*NetService) ListHost ¶
func (srv *NetService) ListHost() ([]*types.HostInfo, error)
ListHost list all host info
func (*NetService) ListHostByKey ¶
func (srv *NetService) ListHostByKey(ip string) (*types.HostInfo, error)
ListHostByKey list host by ip
func (*NetService) ListPool ¶
func (srv *NetService) ListPool() ([]*types.NetPool, error)
ListPool update Pool info
func (*NetService) ListPoolByCluster ¶
func (srv *NetService) ListPoolByCluster(cluster string) ([]*types.NetPool, error)
ListPoolByCluster list all pool under cluster
func (*NetService) ListPoolByKey ¶
func (srv *NetService) ListPoolByKey(net string) (*types.NetPool, error)
ListPoolByKey Get pool info by net
func (*NetService) TransferIPAttribute ¶
func (srv *NetService) TransferIPAttribute(tranInput *types.TranIPAttrInput) (int, error)
TransferIPAttribute change IP status
func (*NetService) UpdateAvailableIPInstance ¶
func (srv *NetService) UpdateAvailableIPInstance(ipinst *types.IPInst) error
UpdateAvailableIPInstance update ip instance info. only support: MacAddress, App
func (*NetService) UpdateHost ¶
func (srv *NetService) UpdateHost() error
UpdateHost update host info
func (*NetService) UpdatePool ¶
func (srv *NetService) UpdatePool(pool *types.NetPool, netKey string) error
UpdatePool update Pool info