api

package
v1.20.10 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//SUCCESS success string for response
	SUCCESS = "success"
)

Functions

func RegisterMetrics

func RegisterMetrics(addr string)

RegisterMetrics register http metrics for netservice

Types

type Allocator

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

Allocator ip resource lean & release

func RegisterAllocator

func RegisterAllocator(httpSvr *HTTPService, logic *netservice.NetService) *Allocator

RegisterAllocator ip resource allocation

func (*Allocator) Add

func (allo *Allocator) Add(request *restful.Request, response *restful.Response)

Add iplease

func (*Allocator) Delete

func (allo *Allocator) Delete(request *restful.Request, response *restful.Response)

Delete relesase ip address

func (*Allocator) HostVIPRelease

func (allo *Allocator) HostVIPRelease(request *restful.Request, response *restful.Response)

HostVIPRelease release all the vip in the host

func (*Allocator) List

func (allo *Allocator) List(request *restful.Request, response *restful.Response)

List list all ip address under active

func (*Allocator) Update

func (allo *Allocator) Update(request *restful.Request, response *restful.Response)

Update update pool by ip segment

type HTTPService

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

HTTPService http container for register api for net-service

func NewHTTPService

func NewHTTPService(addr string, port int) *HTTPService

NewHTTPService create http service for net-service

func (*HTTPService) ListenAndServe

func (svr *HTTPService) ListenAndServe() error

ListenAndServe http listen

func (*HTTPService) ListenAndServeTLS

func (svr *HTTPService) ListenAndServeTLS(certFile, keyFile, pubFile, passwd string) error

ListenAndServeTLS https listen param certFile: root ca cert param keyFile: http server private key file param pubFile: http server public key file param passwd: if private key encrypted, passwd required

func (*HTTPService) Register

func (svr *HTTPService) Register(wb *restful.WebService)

Register register restful web service

func (*HTTPService) Stop

func (svr *HTTPService) Stop(sec int)

Stop stop http service

type HostHandler

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

HostHandler for http host handler

func RegisterHostHandler

func RegisterHostHandler(httpSvr *HTTPService, logic *netservice.NetService) *HostHandler

RegisterHostHandler init host url info

func (*HostHandler) Add

func (host *HostHandler) Add(request *restful.Request, response *restful.Response)

Add add host to ip pool

func (*HostHandler) Delete

func (host *HostHandler) Delete(request *restful.Request, response *restful.Response)

Delete delete specified by host IPaddress, also clean IPAddress assign to this host

func (*HostHandler) List

func (host *HostHandler) List(request *restful.Request, response *restful.Response)

List list all pools

func (*HostHandler) ListByID

func (host *HostHandler) ListByID(request *restful.Request, response *restful.Response)

ListByID list host by ip

func (*HostHandler) Update

func (host *HostHandler) Update(request *restful.Request, response *restful.Response)

Update update pool by ip segment

type IPInstanceHandler

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

IPInstanceHandler http request handler

func RegisterIPInstanceHandler

func RegisterIPInstanceHandler(httpSvr *HTTPService, logic *netservice.NetService) *IPInstanceHandler

RegisterIPInstanceHandler create pool handler, url link : v1/ipinstanace

func (*IPInstanceHandler) TransferIPAttr

func (inst *IPInstanceHandler) TransferIPAttr(request *restful.Request, response *restful.Response)

TransferIPAttr transfer ip attr from available/reserved to reserved/available

func (*IPInstanceHandler) Update

func (inst *IPInstanceHandler) Update(request *restful.Request, response *restful.Response)

Update update pool by ip segment

type PoolHandler

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

PoolHandler http request handler

func RegisterPoolHandler

func RegisterPoolHandler(httpSvr *HTTPService, logic *netservice.NetService) *PoolHandler

RegisterPoolHandler create pool handler, url link : v1/pool

func (*PoolHandler) Add

func (pool *PoolHandler) Add(request *restful.Request, response *restful.Response)

Add add new pool

func (*PoolHandler) Delete

func (pool *PoolHandler) Delete(request *restful.Request, response *restful.Response)

Delete delete pool by ip segment

func (*PoolHandler) List

func (pool *PoolHandler) List(request *restful.Request, response *restful.Response)

List list all pools

func (*PoolHandler) ListByID

func (pool *PoolHandler) ListByID(request *restful.Request, response *restful.Response)

ListByID list all pools

func (*PoolHandler) Query

func (pool *PoolHandler) Query(request *restful.Request, response *restful.Response)

Query list all pools

func (*PoolHandler) Update

func (pool *PoolHandler) Update(request *restful.Request, response *restful.Response)

Update update pool by ip segment

type ResourceHandler

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

ResourceHandler for http host handler

func RegisterResourceHandler

func RegisterResourceHandler(httpSvr *HTTPService, logic *netservice.NetService) *ResourceHandler

RegisterResourceHandler init host url info

func (*ResourceHandler) List

func (resource *ResourceHandler) List(request *restful.Request, response *restful.Response)

List list all pools

Jump to

Keyboard shortcuts

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