netmaker/cli/functions/server.go

29 lines
711 B
Go
Raw Normal View History

package functions
import (
"net/http"
cfg "github.com/gravitl/netmaker/config"
"github.com/gravitl/netmaker/models"
)
2022-11-28 20:36:46 +08:00
// GetLogs - fetch Netmaker server logs
func GetLogs() string {
2022-12-08 21:34:23 +08:00
return get("/api/logs")
}
2022-11-28 20:36:46 +08:00
// GetServerInfo - fetch minimal server info
func GetServerInfo() *models.ServerConfig {
return request[models.ServerConfig](http.MethodGet, "/api/server/getserverinfo", nil)
}
2022-11-28 20:36:46 +08:00
// GetServerConfig - fetch entire server config including secrets
func GetServerConfig() *cfg.ServerConfig {
return request[cfg.ServerConfig](http.MethodGet, "/api/server/getconfig", nil)
}
2022-11-28 20:36:46 +08:00
// GetServerHealth - fetch server current health status
func GetServerHealth() string {
2022-12-08 21:34:23 +08:00
return get("/api/server/health")
}