product_pool

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/instance-pools",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(CreateAction),
	Authorizer: iauth.FAP(iauth.FeatureProductPool, iauth.ActionCreate),
}

CreateRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var DeleteEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/instance-pools/{instance_pool_name}",
	Method:     http.MethodDelete,
	Handler:    xreq.Convert(DeleteAction),
	Authorizer: iauth.FAP(iauth.FeatureProductPool, iauth.ActionDelete),
}

DeleteRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var ListEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/instance-pools",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(ListAction),
	Authorizer: iauth.FAP(iauth.FeatureProductPool, iauth.ActionRead),
}

ListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var OneEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/instance-pools/{instance_pool_name}",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(OneAction),
	Authorizer: iauth.FAP(iauth.FeatureProductPool, iauth.ActionRead),
}

OneRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UpdateEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/instance-pools/{instance_pool_name}",
	Method:     http.MethodPatch,
	Handler:    xreq.Convert(UpdateAction),
	Authorizer: iauth.FAP(iauth.FeatureProductPool, iauth.ActionUpdate),
}

UpdateRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

Functions

func CreateAction

func CreateAction(req *http.Request) (interface{}, error)

CreateAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func CreateProcess

func CreateProcess(req *http.Request, product *ibasic.Product, param *UpsertParam) (*icluster_conf.Pool, error)

func DeleteAction

func DeleteAction(req *http.Request) (interface{}, error)

DeleteAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func Instancesc2i

func Instancesc2i(is []*Instance) []icluster_conf.Instance

func ListAction

func ListAction(req *http.Request) (interface{}, error)

ListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func OneAction

func OneAction(req *http.Request) (interface{}, error)

OneAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UpdateAction

func UpdateAction(req *http.Request) (interface{}, error)

UpdateAction action AUTO GEN BY ctrl, MODIFY AS U NEED

Types

type Instance

type Instance struct {
	Hostname string            `json:"hostname" uri:"hostname" validate:"required,min=2"`
	IP       string            `json:"ip" uri:"ip" validate:"required,ip"`
	Weight   int64             `json:"weight" uri:"weight" validate:"min=0,max=100"`
	Ports    map[string]int    `json:"ports" uri:"ports" validate:"required,min=1"`
	Tags     map[string]string `json:"tags" uri:"tags" validate:"required,min=1"`
}

Instance Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type OneData

type OneData struct {
	Name      string      `json:"name" uri:"name"`
	Instances []*Instance `json:"instances" uri:"instances"`
}

OneData Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

func NewOneData

func NewOneData(pool *icluster_conf.Pool) *OneData

type OneParam

type OneParam struct {
	InstancePoolName string `json:"instance_pool_name" uri:"instance_pool_name" validate:"required,min=2"`
}

OneParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

func NewOneParam

func NewOneParam(req *http.Request) (*OneParam, error)

AUTO GEN BY ctrl, MODIFY AS U NEED

type UpsertParam

type UpsertParam struct {
	Name      *string     `json:"name" uri:"instance_pool_name" validate:"required,min=2"`
	Instances []*Instance `json:"instances" uri:"instances" validate:"min=1,dive"`
}

UpsertParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

func NewUpsertParam

func NewUpsertParam(req *http.Request) (*UpsertParam, error)

AUTO GEN BY ctrl, MODIFY AS U NEED

Jump to

Keyboard shortcuts

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