Documentation ¶
Index ¶
- type API
- func (e *API) AgentRestart()
- func (e *API) CheckAuth(r *http.Request, w http.ResponseWriter) bool
- func (e *API) ClusterRestart(ds bool)
- func (e *API) Commands() *mux.Router
- func (e *API) ErrorMessage(number int, function string, msg string) []byte
- func (e *API) NotFound(w http.ResponseWriter, r *http.Request)
- func (e *API) ServerRestart()
- func (e *API) V0AdjustClusterResources(w http.ResponseWriter, r *http.Request)
- func (e *API) V0CapabilitiesDisclosure(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ClusterShutdown(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ClusterStart(w http.ResponseWriter, r *http.Request)
- func (e *API) V0CordonK3SAgent(w http.ResponseWriter, r *http.Request)
- func (e *API) V0GetCountK3SAgent(w http.ResponseWriter, r *http.Request)
- func (e *API) V0GetCountK3SServer(w http.ResponseWriter, r *http.Request)
- func (e *API) V0GetKubeVersion(w http.ResponseWriter, r *http.Request)
- func (e *API) V0GetKubeconfig(w http.ResponseWriter, r *http.Request)
- func (e *API) V0Restart(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ScaleDatastore(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ScaleK3SAgent(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ScaleK3SServer(w http.ResponseWriter, r *http.Request)
- func (e *API) V0StatusK8s(w http.ResponseWriter, r *http.Request)
- func (e *API) V0StatusM3s(w http.ResponseWriter, r *http.Request)
- func (e *API) V0UnCordonK3SAgent(w http.ResponseWriter, r *http.Request)
- func (e *API) Versions(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.4.0
type API struct { Config *cfg.Config Framework *cfg.FrameworkConfig Mesos mesos.Mesos Redis *redis.Redis Kubernetes *controller.Controller BootstrapProtocol string K3SAgentStatus bool }
API Service include all the current vars and global config
func New ¶ added in v0.4.0
func New(cfg *cfg.Config, frm *cfg.FrameworkConfig) *API
New will create a new API object
func (*API) AgentRestart ¶ added in v0.4.1
func (e *API) AgentRestart()
AgentRestart will scale down all K8 agents and scale up again.
func (*API) ClusterRestart ¶ added in v0.4.1
ClusterRestart will scale down all K8 instances and scale up again.
func (*API) ErrorMessage ¶ added in v0.4.0
ErrorMessage will create a message json
func (*API) NotFound ¶ added in v0.4.1
func (e *API) NotFound(w http.ResponseWriter, r *http.Request)
NotFound logs filenotfound messages
func (*API) ServerRestart ¶ added in v0.4.1
func (e *API) ServerRestart()
Server will scale down all K8 servers & agents instances and scale up again.
func (*API) V0AdjustClusterResources ¶ added in v0.4.1
func (e *API) V0AdjustClusterResources(w http.ResponseWriter, r *http.Request)
V0AdjustClusterResources will adjust the resource allocated to the k3s clusters example: curl -X GET http://user:password@127.0.0.1:10000/v0/agent/memory/{value} -d 'JSON'
func (*API) V0CapabilitiesDisclosure ¶ added in v0.4.1
func (e *API) V0CapabilitiesDisclosure(w http.ResponseWriter, r *http.Request)
V0CapabilitiesDisclosure gives out the current capabilities supported in this m3s framework version. Helpful when you may have multiple versions running in your environment and need feature flagging on downstream applications. example: curl -X GET 127.0.0.1:10000/v0/capabilities
func (*API) V0ClusterShutdown ¶ added in v0.4.1
func (e *API) V0ClusterShutdown(w http.ResponseWriter, r *http.Request)
V0ClusterShutdown - Shutdown the whole K8 cluster example: curl -X PUT 127.0.0.1:10000/v0/cluster/shutdown'
func (*API) V0ClusterStart ¶ added in v0.4.1
func (e *API) V0ClusterStart(w http.ResponseWriter, r *http.Request)
V0ClusterStart - Start the cluster after shutdown example: curl -X PUT 127.0.0.1:10000/v0/cluster/start
func (*API) V0CordonK3SAgent ¶ added in v0.5.0
func (e *API) V0CordonK3SAgent(w http.ResponseWriter, r *http.Request)
V0CordonK3SAgent will cordon the K3S nodes manually. example: curl -X GET http://user:password@127.0.0.1:10000/v0/agent/cordon'
func (*API) V0GetCountK3SAgent ¶ added in v0.4.0
func (e *API) V0GetCountK3SAgent(w http.ResponseWriter, r *http.Request)
V0GetCountK3SAgent will write out the current count of Kubernetes Agents and the expected one. example: curl -X GET http://user:password@127.0.0.1:10000/v0/agent/scale'
func (*API) V0GetCountK3SServer ¶ added in v0.4.0
func (e *API) V0GetCountK3SServer(w http.ResponseWriter, r *http.Request)
V0GetCountK3SServer will write out the current count of Kubernetes server and the expected one. example: curl -X GET http://user:password@127.0.0.1:10000/v0/server/scale'
func (*API) V0GetKubeVersion ¶ added in v0.4.0
func (e *API) V0GetKubeVersion(w http.ResponseWriter, r *http.Request)
V0GetKubeVersion will return the kubernetes Version example: curl -X GET 127.0.0.1:10000/v0/server/version'
func (*API) V0GetKubeconfig ¶ added in v0.4.0
func (e *API) V0GetKubeconfig(w http.ResponseWriter, r *http.Request)
V0GetKubeconfig will return the kubernetes config file example: curl -X GET 127.0.0.1:10000/api/m3s/v0/server/config"
func (*API) V0Restart ¶ added in v0.4.1
func (e *API) V0Restart(w http.ResponseWriter, r *http.Request)
V0Restart - Restart cluster or datastore, server or agent. example: curl -X PUT 127.0.0.1:10000/v0/cluster/restart
func (*API) V0ScaleDatastore ¶ added in v0.4.0
func (e *API) V0ScaleDatastore(w http.ResponseWriter, r *http.Request)
V0ScaleDatastore will scale the k3s agent service example: curl -X GET http://user:password@127.0.0.1:10000/v0/etcd/scale/{count of instances} -d 'JSON'
func (*API) V0ScaleK3SAgent ¶ added in v0.4.0
func (e *API) V0ScaleK3SAgent(w http.ResponseWriter, r *http.Request)
V0ScaleK3SAgent will scale the k3s agent service example: curl -X GET http://user:password@127.0.0.1:10000/v0/agent/scale/{count of instances} -d 'JSON'
func (*API) V0ScaleK3SServer ¶ added in v0.4.0
func (e *API) V0ScaleK3SServer(w http.ResponseWriter, r *http.Request)
V0ScaleK3SServer will scale the k3s server service example: curl -X GET http://user:password@127.0.0.1:10000/v0/server/scale/{count of instances} -d 'JSON'
func (*API) V0StatusK8s ¶ added in v0.4.0
func (e *API) V0StatusK8s(w http.ResponseWriter, r *http.Request)
V0StatusK8s gives out the current status of the K8s services example: curl -X GET 127.0.0.1:10000/v0/status/k8s
func (*API) V0StatusM3s ¶ added in v0.4.0
func (e *API) V0StatusM3s(w http.ResponseWriter, r *http.Request)
V0StatusM3s gives out the current status of the M3s services example: curl -X GET 127.0.0.1:10000/api/m3s/v0/status/m3s
func (*API) V0UnCordonK3SAgent ¶ added in v0.5.0
func (e *API) V0UnCordonK3SAgent(w http.ResponseWriter, r *http.Request)
V0UnCordonK3SAgent will uncordon the K3S nodes if they are manually cordoned. example: curl -X GET http://user:password@127.0.0.1:10000/v0/agent/uncordon'
Source Files ¶
- V0AdjustClusterResources.go
- V0CapabilitiesDisclosure.go
- V0ClusterShutdown.go
- V0ClusterStart.go
- V0CordonUncordonAgent.go
- V0GetCountK3SAgent.go
- V0GetCountK3SServer.go
- V0GetKubeVersion.go
- V0GetKubeconfig.go
- V0Restart.go
- V0ScaleAgent.go
- V0ScaleDatastore.go
- V0ScaleServer.go
- V0StatusK8s.go
- V0StatusM3s.go
- api.go