cluster.go 907 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3 4 5
package cluster

import (
	"net/http"

黄孟柱 已提交
6 7
	"github.com/eolinker/goku-api-gateway/console/controller"
	cluster2 "github.com/eolinker/goku-api-gateway/server/cluster"
E
eoLinker API Management 已提交
8 9
)

Y
Your Name 已提交
10
//GetClusterList 获取集群列表
E
eoLinker API Management 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24
func GetClusterList(httpResponse http.ResponseWriter, httpRequest *http.Request) {
	_, e := controller.CheckLogin(httpResponse, httpRequest, controller.OperationNone, controller.OperationREAD)
	if e != nil {
		return
	}
	list := cluster2.GetList()

	controller.WriteResultInfo(httpResponse,
		"cluster",
		"clusters",
		list)

}

Y
Your Name 已提交
25
//GetClusterInfoList 获取集群信息列表
E
eoLinker API Management 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38
func GetClusterInfoList(httpResponse http.ResponseWriter, httpRequest *http.Request) {

	_, e := controller.CheckLogin(httpResponse, httpRequest, controller.OperationNone, controller.OperationREAD)
	if e != nil {
		return
	}
	all := cluster2.GetAll()

	controller.WriteResultInfo(httpResponse,
		"cluster",
		"clusters",
		all)
}