controller

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClickHouseClusterPath  string = "clusterName"
	ClickHouseSessionLimit int    = 10
)
View Source
const (
	TITLE_CLICKHOUSE_TABLE  string = "ClickHouse Table KPIs"
	TITLE_CLICKHOUSE_NODE   string = "ClickHouse Node KPIs"
	TITLE_ZOOKEEPER_METRICS string = "ZooKeeper KPIs"
)
View Source
const (
	DefaultPackageDirectory string = "package"
	FormPackageFieldName    string = "package"
	InitialByClusterPeer    string = "is_initial_by_cluster_peer"
)

Variables

View Source
var TokenCache *cache.Cache

Functions

func DeleteFileByURL

func DeleteFileByURL(url string) error

func DeployPackage

func DeployPackage(d deploy.Deploy, base *deploy.DeployBase, conf interface{}) (int, error)

func GetAllFiles

func GetAllFiles(dirPth string) ([]string, error)

func GetAllVersions

func GetAllVersions(files []string) []string

func ParserFormData

func ParserFormData(request *http.Request) (string, error)

func UploadFileByURL

func UploadFileByURL(url string, localFile string) error

Types

type ClickHouseController

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

func NewClickHouseController

func NewClickHouseController(nacosClient *nacos.NacosClient) *ClickHouseController

func (*ClickHouseController) AddNode

func (ck *ClickHouseController) AddNode(c *gin.Context)

@Summary Add ClickHouse node @Description Add ClickHouse node @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param req body model.AddNodeReq true "request body" @Failure 200 {string} json "{"retCode":5066,"retMsg":"add ClickHouse node failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/node/{clusterName} [post]

func (*ClickHouseController) AlterTable

func (ck *ClickHouseController) AlterTable(c *gin.Context)

@Summary Alter Table @Description Alter Table @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param req body model.AlterCkTableReq true "request body" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":nil}" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5003,"retMsg":"alter ClickHouse table failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":null}" @Router /api/v1/ck/table/{clusterName} [put]

func (*ClickHouseController) ArchiveToHDFS added in v1.2.8

func (ck *ClickHouseController) ArchiveToHDFS(c *gin.Context)

@Summary Archive Tables to HDFS @Description archive tables to hdfs @version 1.0 @Security ApiKeyAuth @Param req body model.ArchiveTableReq true "request body" @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5204, "retMsg":"archive to hdfs failed", "entity":"error"}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":""}" @Router /api/v1/ck/archive/{clusterName} [post]

func (*ClickHouseController) CreateTable

func (ck *ClickHouseController) CreateTable(c *gin.Context)

@Summary Create Table @Description Create Table @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param req body model.CreateCkTableReq true "request body" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5001,"retMsg":"create ClickHouse table failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":null}" @Router /api/v1/ck/table/{clusterName} [post]

func (*ClickHouseController) DeleteCluster added in v1.2.8

func (ck *ClickHouseController) DeleteCluster(c *gin.Context)

@Summary Delete a ClickHouse cluster @Description Delete a ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":null}" @Router /api/v1/ck/cluster/{clusterName} [delete]

func (*ClickHouseController) DeleteNode

func (ck *ClickHouseController) DeleteNode(c *gin.Context)

@Summary Delete ClickHouse node @Description Delete ClickHouse node @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param ip query string true "node ip address" default(192.168.101.105) @Failure 200 {string} json "{"retCode":5067,"retMsg":"delete ClickHouse node failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/node/{clusterName} [delete]

func (*ClickHouseController) DeleteTable

func (ck *ClickHouseController) DeleteTable(c *gin.Context)

@Summary Delete Table @Description Delete Table @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param database query string true "database name" default(default) @Param tableName query string true "table name" default(test_table) @Failure 200 {string} json "{"retCode":5002,"retMsg":"delete ClickHouse table failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":null}" @Router /api/v1/ck/table/{clusterName} [delete]

func (*ClickHouseController) DescTable

func (ck *ClickHouseController) DescTable(c *gin.Context)

@Summary Describe Table @Description Describe Table @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param database query string true "database name" default(default) @Param tableName query string true "table name" default(test_table) @Failure 200 {string} json "{"retCode":5040,"retMsg":"describe ClickHouse table failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"name":"_timestamp","type":"DateTime","defaultType":"","defaultExpression":"","comment":"","codecExpression":"","ttlExpression":""}]}" @Router /api/v1/ck/table/{clusterName} [get]

func (*ClickHouseController) DestroyCluster added in v1.2.8

func (ck *ClickHouseController) DestroyCluster(c *gin.Context)

@Summary Destroy ClickHouse cluster @Description Destroy ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5063,"retMsg":"destroy ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/destroy/{clusterName} [put]

func (*ClickHouseController) GetCluster added in v1.2.8

func (ck *ClickHouseController) GetCluster(c *gin.Context)

@Summary Get config of a ClickHouse cluster @Description Get config of a ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5065,"retMsg":"get ClickHouse cluster information failed","entity":null}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok", "entity":{"mode":"import","hosts":["192.168.0.1","192.168.0.2","192.168.0.3","192.168.0.4"],"names":["node1","node2","node3","node4"],"port":9000,"httpPort":8123,"user":"ck","password":"123456","database":"default","cluster":"test","zkNodes":["192.168.0.1","192.168.0.2","192.168.0.3"],"zkPort":2181,"zkStatusPort":8080,"isReplica":true,"version":"20.8.5.45","sshUser":"","sshPassword":"","shards":[{"replicas":[{"ip":"192.168.0.1","hostname":"node1"},{"ip":"192.168.0.2","hostname":"node2"}]},{"replicas":[{"ip":"192.168.0.3","hostname":"node3"},{"ip":"192.168.0.4","hostname":"node4"}]}],"path":""}}" @Router /api/v1/ck/cluster/{clusterName} [get]

func (*ClickHouseController) GetClusterStatus added in v1.2.8

func (ck *ClickHouseController) GetClusterStatus(c *gin.Context)

@Summary Get ClickHouse cluster status @Description Get ClickHouse cluster status @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5065,"retMsg":"get ClickHouse cluster information failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":{"test":{"mode":"import","hosts":["192.168.0.1","192.168.0.2","192.168.0.3","192.168.0.4"],"names":["node1","node2","node3","node4"],"port":9000,"httpPort":8123,"user":"ck","password":"123456","database":"default","cluster":"test","zkNodes":["192.168.0.1","192.168.0.2","192.168.0.3"],"zkPort":2181,"zkStatusPort":8080,"isReplica":true,"version":"20.8.5.45","sshUser":"","sshPassword":"","shards":[{"replicas":[{"ip":"192.168.0.1","hostname":"node1"},{"ip":"192.168.0.2","hostname":"node2"}]},{"replicas":[{"ip":"192.168.0.3","hostname":"node3"},{"ip":"192.168.0.4","hostname":"node4"}]}],"path":""}}}}" @Router /api/v1/ck/get/{clusterName} [get]

func (*ClickHouseController) GetClusters added in v1.2.8

func (ck *ClickHouseController) GetClusters(c *gin.Context)

@Summary Get config of all ClickHouse cluster @Description Get ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Success 200 {string} json "{"retCode":0,"retMsg":"ok", "entity":{"test":{"mode":"import","hosts":["192.168.0.1","192.168.0.2","192.168.0.3","192.168.0.4"],"names":["node1","node2","node3","node4"],"port":9000,"httpPort":8123,"user":"ck","password":"123456","database":"default","cluster":"test","zkNodes":["192.168.0.1","192.168.0.2","192.168.0.3"],"zkPort":2181,"zkStatusPort":8080,"isReplica":true,"version":"20.8.5.45","sshUser":"","sshPassword":"","shards":[{"replicas":[{"ip":"192.168.0.1","hostname":"node1"},{"ip":"192.168.0.2","hostname":"node2"}]},{"replicas":[{"ip":"192.168.0.3","hostname":"node3"},{"ip":"192.168.0.4","hostname":"node4"}]}],"path":""}}}" @Router /api/v1/ck/cluster [get]

func (*ClickHouseController) GetOpenSessions

func (ck *ClickHouseController) GetOpenSessions(c *gin.Context)

@Summary Get open sessions @Description Get open sessions @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param limit query string false "sessions limit" default(10) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"startTime":1609997894,"queryDuration":1,"query":"SELECT DISTINCT name FROM system.tables","user":"eoi","queryId":"62dce71d-9294-4e47-9d9b-cf298f73233d","address":"192.168.21.73","threads":2}]}" @Router /api/v1/ck/open_sessions/{clusterName} [get]

func (*ClickHouseController) GetSlowSessions

func (ck *ClickHouseController) GetSlowSessions(c *gin.Context)

@Summary Get slow sessions @Description Get slow sessions @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param limit query string false "sessions limit" default(10) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"startTime":1609986493,"queryDuration":145,"query":"select * from dist_sensor_dt_result_online limit 10000","user":"default","queryId":"8aa3de08-92c4-4102-a83d-2f5d88569dab","address":"::1","threads":2}]}" @Router /api/v1/ck/slow_sessions/{clusterName} [get]

func (*ClickHouseController) GetTableMetric

func (ck *ClickHouseController) GetTableMetric(c *gin.Context)

@Summary Get metrics of MergeTree in ClickHouse @Description Get metrics of MergeTree in ClickHouse @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":{"sensor_dt_result_online":{"columns":22,"rows":1381742496,"parts":192,"space":54967700946,"completedQueries":5,"failedQueries":0,"queryCost":{"middle":130,"secondaryMax":160.76,"max":162}}}}" @Router /api/v1/ck/table_metric/{clusterName} [get]

func (*ClickHouseController) ImportCluster added in v1.2.8

func (ck *ClickHouseController) ImportCluster(c *gin.Context)

@Summary Import a ClickHouse cluster @Description Import a ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param req body model.CkImportConfig true "request body" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5042,"retMsg":"import ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":null}" @Router /api/v1/ck/cluster [post]

func (*ClickHouseController) PingCluster added in v1.2.8

func (ck *ClickHouseController) PingCluster(c *gin.Context)

@Summary Ping cluster @Description check clickhousr server in cluster wether useful @version 1.0 @Security ApiKeyAuth @Param req body model.PingClusterReq true "request body" @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5201, "retMsg":"ClickHouse cluster can't ping all nodes successfully", "entity":[]}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":""}" @Router /api/v1/ck/ping/{clusterName} [post]

func (*ClickHouseController) PurgeTables added in v1.2.8

func (ck *ClickHouseController) PurgeTables(c *gin.Context)

@Summary Purger Tables Range @Description purger table @version 1.0 @Security ApiKeyAuth @Param req body model.PurgerTableReq true "request body" @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5203, "retMsg":"purger tables range failed", "entity":"error"}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":""}" @Router /api/v1/ck/purge_tables/{clusterName} [post]

func (*ClickHouseController) QueryInfo

func (ck *ClickHouseController) QueryInfo(c *gin.Context)

@Summary Query Info @Description Query Info @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param query query string true "sql" default(show databases) @Failure 200 {string} json "{"retCode":5042,"retMsg":"query ClickHouse failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[["name"],["default"],["system"]]}" @Router /api/v1/ck/query/{clusterName} [get]

func (*ClickHouseController) RebalanceCluster added in v1.2.8

func (ck *ClickHouseController) RebalanceCluster(c *gin.Context)

@Summary Rebanlance a ClickHouse cluster @Description Rebanlance a ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5064,"retMsg":"rebanlance ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/rebalance/{clusterName} [put]

func (*ClickHouseController) StartCluster added in v1.2.8

func (ck *ClickHouseController) StartCluster(c *gin.Context)

@Summary Start ClickHouse cluster @Description Start ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5061,"retMsg":"start ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/start/{clusterName} [put]

func (*ClickHouseController) StopCluster added in v1.2.8

func (ck *ClickHouseController) StopCluster(c *gin.Context)

@Summary Stop ClickHouse cluster @Description Stop ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Failure 200 {string} json "{"retCode":5062,"retMsg":"stop ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/stop/{clusterName} [put]

func (*ClickHouseController) UpgradeCluster added in v1.2.8

func (ck *ClickHouseController) UpgradeCluster(c *gin.Context)

@Summary Upgrade ClickHouse cluster @Description Upgrade ClickHouse cluster @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Param packageVersion query string true "package version" default(20.8.5.45) @Failure 200 {string} json "{"retCode":5060,"retMsg":"upgrade ClickHouse cluster failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/ck/upgrade/{clusterName} [put]

type ConfigController

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

func NewConfigController

func NewConfigController(ch chan os.Signal) *ConfigController

func (*ConfigController) GetConfig

func (cf *ConfigController) GetConfig(c *gin.Context)

@Summary Get Config @Description Get Config @version 1.0 @Security ApiKeyAuth @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":{"peers":null,"prometheus":["192.168.101.105:19090"],"alertManagers":null}}" @Router /api/v1/config [get]

func (ConfigController) GetVersion added in v1.3.2

func (cf ConfigController) GetVersion(c *gin.Context)

@Summary Get Version @Description Get Version @version 1.0 @Security ApiKeyAuth @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":"v1.3.1"}" @Router /api/v1/version [get]

func (*ConfigController) UpdateConfig

func (cf *ConfigController) UpdateConfig(c *gin.Context)

@Summary Update Config @Description Update Config @version 1.0 @Security ApiKeyAuth @Param req body model.UpdateConfigReq true "request body" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5070,"retMsg":"update config failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":nil}" @Router /api/v1/config [put]

type DeployController

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

func NewDeployController

func NewDeployController(config *config.CKManConfig, nacosClient *nacos.NacosClient) *DeployController

func (*DeployController) DeployCk

func (d *DeployController) DeployCk(c *gin.Context)

@Summary Deploy clickhouse @Description Deploy clickhouse @version 1.0 @Security ApiKeyAuth @Param req body model.DeployCkReq true "request body" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5011,"retMsg":"init package failed","entity":""}" @Failure 200 {string} json "{"retCode":5012,"retMsg":"prepare package failed","entity":""}" @Failure 200 {string} json "{"retCode":5013,"retMsg":"install package failed","entity":""}" @Failure 200 {string} json "{"retCode":5014,"retMsg":"config package failed","entity":""}" @Failure 200 {string} json "{"retCode":5015,"retMsg":"start package failed","entity":""}" @Failure 200 {string} json "{"retCode":5016,"retMsg":"check package failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":nil}" @Router /api/v1/deploy/ck [post]

type MetricController

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

func NewMetricController

func NewMetricController(config *config.CKManConfig, promService *prometheus.PrometheusService) *MetricController

func (*MetricController) Query

func (m *MetricController) Query(c *gin.Context)

@Summary Query @Description Query @version 1.0 @Security ApiKeyAuth @Param metric query string true "metric name" default(ClickHouseMetrics_Read) @Param time query string true "metric time" default(1606290000) @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5050,"retMsg":"get query metric failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"metric":{"__name__":"ClickHouseMetrics_Read","instance":"192.168.101.105:9363","job":"clickhouse_exporter"},"value":[1606290000,"2"]}]}" @Router /api/v1/metric/query [get]

func (*MetricController) QueryRange

func (m *MetricController) QueryRange(c *gin.Context)

@Summary Query Range @Description Query Range @version 1.0 @Security ApiKeyAuth @Param metric query string true "metric name" default(ClickHouseMetrics_Read) @Param start query string true "start time" default(1606290000) @Param end query string true "end time" default(1606290120) @Param step query string true "step window" default(60) @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5051,"retMsg":"get range-metric failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"metric":{"__name__":"ClickHouseMetrics_Read","instance":"192.168.101.105:9363","job":"clickhouse_exporter"},"values":[[1606290000,"2"],[1606290060,"2"],[1606290120,"2"]]}]}" @Router /api/v1/metric/query_range [get]

type PackageController

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

func NewPackageController

func NewPackageController(config *config.CKManConfig) *PackageController

func (*PackageController) Delete

func (p *PackageController) Delete(c *gin.Context)

@Summary Delete package @Description Delete package @version 1.0 @Security ApiKeyAuth @Param packageVersion query string true "package version" default(20.8.5.45) @Failure 200 {string} json "{"retCode":5002,"retMsg":"delete local package failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/package [delete]

func (*PackageController) List

func (p *PackageController) List(c *gin.Context)

@Summary Get package list @Description Get package list @version 1.0 @Security ApiKeyAuth @Failure 200 {string} json "{"retCode":5005,"retMsg":"get package list failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":["20.8.5.45"]}" @Router /api/v1/package [get]

func (*PackageController) Upload

func (p *PackageController) Upload(c *gin.Context)

@Summary Upload package @Description Upload package @version 1.0 @Security ApiKeyAuth @accept multipart/form-data @Param package formData file true "package" @Failure 200 {string} json "{"retCode":5004,"retMsg":"upload local package failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":null}" @Router /api/v1/package [post]

type UserController

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

func NewUserController

func NewUserController(config *config.CKManConfig) *UserController

func (*UserController) Login

func (d *UserController) Login(c *gin.Context)

@Summary Login @Description Login @version 1.0 @Param req body model.LoginReq true "request body" @Failure 200 {string} json "{"retCode":5000,"retMsg":"invalid params","entity":""}" @Failure 200 {string} json "{"retCode":5030,"retMsg":"user verify failed","entity":""}" @Failure 200 {string} json "{"retCode":5031,"retMsg":"get user and password failed","entity":""}" @Failure 200 {string} json "{"retCode":5032,"retMsg":"password verify failed","entity":""}" @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":{"username":"ckman","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"}}" @Router /api/login [post]

func (*UserController) Logout

func (d *UserController) Logout(c *gin.Context)

@Summary Logout @Description Logout @version 1.0 @Security ApiKeyAuth @Success 200 {string} json "{"retCode":0,"retMsg":"success","entity":nil}" @Router /api/logout [put]

type ZookeeperController

type ZookeeperController struct {
}

func NewZookeeperController

func NewZookeeperController() *ZookeeperController

func (*ZookeeperController) GetReplicatedTableStatus

func (zk *ZookeeperController) GetReplicatedTableStatus(c *gin.Context)

@Summary Get replicated table in Zookeeper status @Description Get replicated table in Zookeeper status @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":{"header":[["vm101106","vm101108"],["vm102114","vm101110"],["vm102116","vm102115"]],"tables":[{"name":"sensor_dt_result_online","values":[["l1846","f1846"],["l1845","f1845"],["l1846","f1846"]]}]}}" @Router /api/v1/zk/replicated_table/{clusterName} [get]

func (*ZookeeperController) GetStatus

func (zk *ZookeeperController) GetStatus(c *gin.Context)

@Summary Get Zookeeper cluster status @Description Get Zookeeper cluster status @version 1.0 @Security ApiKeyAuth @Param clusterName path string true "cluster name" default(test) @Success 200 {string} json "{"retCode":0,"retMsg":"ok","entity":[{"host":"192.168.102.116","version":"3.6.2","server_state":"follower","peer_state":"following - broadcast","avg_latency":0.4929,"approximate_data_size":141979,"znode_count":926}]}" @Router /api/v1/zk/status/{clusterName} [get]

Jump to

Keyboard shortcuts

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