Documentation ¶
Overview ¶
Package mcis is to handle REST API for mcis
Package mcis is to handle REST API for mcis ¶
Package mcis is to handle REST API for mcis ¶
Package mcis is to handle REST API for mcis ¶
Package mcis is to handle REST API for mcis
Index ¶
- func RestCheckMcis(c echo.Context) error
- func RestCheckVm(c echo.Context) error
- func RestDelAllMcis(c echo.Context) error
- func RestDelAllMcisPolicy(c echo.Context) error
- func RestDelMcis(c echo.Context) error
- func RestDelMcisPolicy(c echo.Context) error
- func RestDelMcisVm(c echo.Context) error
- func RestGetAllBenchmark(c echo.Context) error
- func RestGetAllMcis(c echo.Context) error
- func RestGetAllMcisPolicy(c echo.Context) error
- func RestGetBenchmark(c echo.Context) error
- func RestGetControlMcis(c echo.Context) error
- func RestGetControlMcisVm(c echo.Context) error
- func RestGetMcis(c echo.Context) error
- func RestGetMcisPolicy(c echo.Context) error
- func RestGetMcisVm(c echo.Context) error
- func RestGetMonitorData(c echo.Context) error
- func RestPostCmdMcis(c echo.Context) error
- func RestPostCmdMcisVm(c echo.Context) error
- func RestPostInstallBenchmarkAgentToMcis(c echo.Context) error
- func RestPostInstallMonitorAgentToMcis(c echo.Context) error
- func RestPostMcis(c echo.Context) error
- func RestPostMcisDynamic(c echo.Context) error
- func RestPostMcisPolicy(c echo.Context) error
- func RestPostMcisRecommend(c echo.Context) error
- func RestPostMcisVm(c echo.Context) error
- func RestPostMcisVmGroup(c echo.Context) error
- func RestPutMcis(c echo.Context) error
- func RestPutMcisPolicy(c echo.Context) error
- func RestPutMcisVm(c echo.Context) error
- func RestRecommendVm(c echo.Context) error
- type JSONResult
- type RestGetAllBenchmarkRequest
- type RestGetAllMcisPolicyResponse
- type RestGetAllMcisResponse
- type RestGetAllMcisStatusResponse
- type RestGetBenchmarkRequest
- type RestPostCmdMcisResponse
- type RestPostCmdMcisResponseWrapper
- type RestPostCmdMcisVmResponse
- type RestPostMcisRecommendResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RestCheckMcis ¶
func RestCheckMcis(c echo.Context) error
func RestCheckVm ¶
func RestCheckVm(c echo.Context) error
func RestDelAllMcis ¶
func RestDelAllMcis(c echo.Context) error
RestDelAllMcis godoc @Summary Delete all MCISs @Description Delete all MCISs @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param option query string false "Option for delete MCIS (support force delete)" Enums(force) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Router /ns/{nsId}/mcis [delete]
func RestDelAllMcisPolicy ¶ added in v0.2.8
func RestDelAllMcisPolicy(c echo.Context) error
RestDelAllMcisPolicy godoc @Summary Delete all MCIS policies @Description Delete all MCIS policies @Tags [Infra service] MCIS Auto control policy management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Router /ns/{nsId}/policy/mcis [delete]
func RestDelMcis ¶
func RestDelMcis(c echo.Context) error
RestDelMcis godoc @Summary Delete MCIS @Description Delete MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param option query string false "Option for delete MCIS (support force delete)" Enums(terminate,force) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId} [delete]
func RestDelMcisPolicy ¶ added in v0.2.8
func RestDelMcisPolicy(c echo.Context) error
DelMcisPolicy godoc @Summary Delete MCIS Policy @Description Delete MCIS Policy @Tags [Infra service] MCIS Auto control policy management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Router /ns/{nsId}/policy/mcis/{mcisId} [delete]
func RestDelMcisVm ¶
func RestDelMcisVm(c echo.Context) error
RestDelMcisVm godoc @Summary Delete VM in specified MCIS @Description Delete VM in specified MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmId path string true "VM ID" default(vm01) @Param option query string false "Option for delete VM (support force delete)" Enums(force) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId}/vm/{vmId} [delete]
func RestGetAllBenchmark ¶
func RestGetAllBenchmark(c echo.Context) error
RestGetAllBenchmark godoc @Summary Run MCIS benchmark for all performance metrics and return results @Description Run MCIS benchmark for all performance metrics and return results @Tags [Infra service] MCIS Performance benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param hostIP body RestGetAllBenchmarkRequest true "Host IP address to benchmark" @Success 200 {object} mcis.BenchmarkInfoArray @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/benchmarkAll/mcis/{mcisId} [post]
func RestGetAllMcis ¶
func RestGetAllMcis(c echo.Context) error
RestGetAllMcis godoc @Summary List all MCISs or MCISs' ID @Description List all MCISs or MCISs' ID @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param option query string false "Option" Enums(id, simple, status) @Success 200 {object} JSONResult{[DEFAULT]=RestGetAllMcisResponse,[SIMPLE]=RestGetAllMcisResponse,[ID]=common.IdList,[STATUS]=RestGetAllMcisStatusResponse} "Different return structures by the given option param" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis [get]
func RestGetAllMcisPolicy ¶ added in v0.2.8
func RestGetAllMcisPolicy(c echo.Context) error
RestGetAllMcisPolicy godoc @Summary List all MCIS policies @Description List all MCIS policies @Tags [Infra service] MCIS Auto control policy management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Success 200 {object} RestGetAllMcisPolicyResponse @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/policy/mcis [get]
func RestGetBenchmark ¶
func RestGetBenchmark(c echo.Context) error
RestGetBenchmark godoc @Summary Run MCIS benchmark for a single performance metric and return results @Description Run MCIS benchmark for a single performance metric and return results @Tags [Infra service] MCIS Performance benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param hostIP body RestGetBenchmarkRequest true "Host IP address to benchmark" @Param action query string true "Benchmark Action to MCIS" Enums(install, init, cpus, cpum, memR, memW, fioR, fioW, dbR, dbW, rtt, mrtt, clean) @Success 200 {object} mcis.BenchmarkInfoArray @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/benchmark/mcis/{mcisId} [post]
func RestGetControlMcis ¶ added in v0.4.4
func RestGetControlMcis(c echo.Context) error
RestGetControlMcis godoc @Summary Control the lifecycle of MCIS (refine, suspend, resume, reboot, terminate) @Description Control the lifecycle of MCIS (refine, suspend, resume, reboot, terminate) @Tags [Infra service] MCIS Control lifecycle @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param action query string true "Action to MCIS" Enums(suspend, resume, reboot, terminate, refine) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/control/mcis/{mcisId} [get]
func RestGetControlMcisVm ¶ added in v0.4.4
func RestGetControlMcisVm(c echo.Context) error
RestGetControlMcisVm godoc @Summary Control the lifecycle of VM (suspend, resume, reboot, terminate) @Description Control the lifecycle of VM (suspend, resume, reboot, terminate) @Tags [Infra service] MCIS Control lifecycle @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmId path string true "VM ID" default(vm01) @Param action query string true "Action to MCIS" Enums(suspend, resume, reboot, terminate) @Success 200 {object} common.SimpleMsg @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/control/mcis/{mcisId}/vm/{vmId} [get]
func RestGetMcis ¶
func RestGetMcis(c echo.Context) error
RestGetMcis godoc @Summary Get MCIS object (option: status, vmID) @Description Get MCIS object (option: status, vmID) @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param option query string false "Option" Enums(default, id, status) @success 200 {object} JSONResult{[DEFAULT]=mcis.TbMcisInfo,[ID]=common.IdList,[STATUS]=mcis.McisStatusInfo} "Different return structures by the given action param" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId} [get]
func RestGetMcisPolicy ¶ added in v0.2.8
func RestGetMcisPolicy(c echo.Context) error
RestGetMcisPolicy godoc @Summary Get MCIS Policy @Description Get MCIS Policy @Tags [Infra service] MCIS Auto control policy management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Success 200 {object} mcis.McisPolicyInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/policy/mcis/{mcisId} [get]
func RestGetMcisVm ¶
func RestGetMcisVm(c echo.Context) error
RestGetMcisVm godoc @Summary Get VM in specified MCIS @Description Get VM in specified MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmId path string true "VM ID" default(vm01) @Param option query string false "Option for MCIS" Enums(default, status) @success 200 {object} JSONResult{[DEFAULT]=mcis.TbVmInfo,[STATUS]=mcis.TbVmStatusInfo} "Different return structures by the given option param" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId}/vm/{vmId} [get]
func RestGetMonitorData ¶
func RestGetMonitorData(c echo.Context) error
RestGetMonitorData godoc @Summary Get monitoring data of specified MCIS for specified monitoring metric (cpu, memory, disk, network) @Description Get monitoring data of specified MCIS for specified monitoring metric (cpu, memory, disk, network) @Tags [Infra service] MCIS Resource monitor (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param metric path string true "Metric type: cpu, memory, disk, network" @Success 200 {object} mcis.MonResultSimpleResponse @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/monitoring/mcis/{mcisId}/metric/{metric} [get]
func RestPostCmdMcis ¶
func RestPostCmdMcis(c echo.Context) error
RestPostCmdMcis godoc @Summary Send a command to specified MCIS @Description Send a command to specified MCIS @Tags [Infra service] MCIS Remote command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param mcisCmdReq body mcis.McisCmdReq true "MCIS Command Request" @Success 200 {object} RestPostCmdMcisResponseWrapper @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/cmd/mcis/{mcisId} [post]
func RestPostCmdMcisVm ¶
func RestPostCmdMcisVm(c echo.Context) error
RestPostCmdMcisVm godoc @Summary Send a command to specified VM @Description Send a command to specified VM @Tags [Infra service] MCIS Remote command @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmId path string true "VM ID" default(vm01) @Param mcisCmdReq body mcis.McisCmdReq true "MCIS Command Request" @Success 200 {object} RestPostCmdMcisVmResponse @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/cmd/mcis/{mcisId}/vm/{vmId} [post]
func RestPostInstallBenchmarkAgentToMcis ¶ added in v0.4.9
func RestPostInstallBenchmarkAgentToMcis(c echo.Context) error
RestPostInstallBenchmarkAgentToMcis godoc @Summary Install the benchmark agent to specified MCIS @Description Install the benchmark agent to specified MCIS @Tags [Infra service] MCIS Performance benchmarking (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param mcisCmdReq body mcis.McisCmdReq true "MCIS Command Request" @Success 200 {object} mcis.RestPostCmdMcisResponseWrapper @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/installBenchmarkAgent/mcis/{mcisId} [post]
func RestPostInstallMonitorAgentToMcis ¶
func RestPostInstallMonitorAgentToMcis(c echo.Context) error
RestPostInstallMonitorAgentToMcis godoc @Summary Install monitoring agent (CB-Dragonfly agent) to MCIS @Description Install monitoring agent (CB-Dragonfly agent) to MCIS @Tags [Infra service] MCIS Resource monitor (for developer) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param mcisInfo body mcis.McisCmdReq true "Details for an MCIS object" @Success 200 {object} mcis.AgentInstallContentWrapper @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/monitoring/install/mcis/{mcisId} [post]
func RestPostMcis ¶
func RestPostMcis(c echo.Context) error
RestPostMcis godoc @Summary Create MCIS @Description Create MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisReq body TbMcisReq true "Details for an MCIS object" @Success 200 {object} TbMcisInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis [post]
func RestPostMcisDynamic ¶ added in v0.4.10
func RestPostMcisDynamic(c echo.Context) error
RestPostMcisDynamic godoc @Summary Create MCIS Dynamically @Description Create MCIS Dynamically from common spec and image @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisReq body TbMcisDynamicReq true "Details for MCIS object" @Success 200 {object} TbMcisInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcisDynamic [post]
func RestPostMcisPolicy ¶ added in v0.2.8
func RestPostMcisPolicy(c echo.Context) error
RestPostMcisPolicy godoc @Summary Create MCIS Automation policy @Description Create MCIS Automation policy @Tags [Infra service] MCIS Auto control policy management (WIP) @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param mcisInfo body mcis.McisPolicyInfo true "Details for an MCIS object" @Success 200 {object} mcis.McisPolicyInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/policy/mcis/{mcisId} [post]
func RestPostMcisRecommend ¶ added in v0.3.8
func RestPostMcisRecommend(c echo.Context) error
RestPostMcisRecommend godoc @Deprecated
func RestPostMcisVm ¶
func RestPostMcisVm(c echo.Context) error
RestPostMcisVm godoc @Summary Create VM in specified MCIS @Description Create VM in specified MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmReq body mcis.TbVmReq true "Details for an VM object" @Success 200 {object} mcis.TbVmInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId}/vm [post]
func RestPostMcisVmGroup ¶ added in v0.3.4
func RestPostMcisVmGroup(c echo.Context) error
RestPostMcisVmGroup godoc @Summary Create multiple VMs by VM group in specified MCIS @Description Create multiple VMs by VM group in specified MCIS @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(ns01) @Param mcisId path string true "MCIS ID" default(mcis01) @Param vmReq body mcis.TbVmReq true "Details for VM Group" @Success 200 {object} mcis.TbMcisInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcis/{mcisId}/vmgroup [post]
func RestPutMcis ¶
func RestPutMcis(c echo.Context) error
function RestPutMcis not yet implemented
// RestPutMcis godoc // @Summary Update MCIS // @Description Update MCIS // @Tags [Infra service] MCIS Provisioning management // @Accept json // @Produce json // @Param mcisInfo body TbMcisInfo true "Details for an MCIS object" // @Success 200 {object} TbMcisInfo // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg // @Router /ns/{nsId}/mcis/{mcisId} [put]
func RestPutMcisPolicy ¶ added in v0.2.8
func RestPutMcisPolicy(c echo.Context) error
function RestPutMcisPolicy not yet implemented
// RestPutMcisPolicy godoc // @Summary Update MCIS Policy // @Description Update MCIS Policy // @Tags [Infra service] MCIS Auto control policy management (WIP) // @Accept json // @Produce json // @Param mcisInfo body McisPolicyInfo true "Details for an MCIS Policy object" // @Success 200 {object} McisPolicyInfo // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg // @Router /ns/{nsId}/policy/mcis/{mcisId} [put]
func RestPutMcisVm ¶
func RestPutMcisVm(c echo.Context) error
RestPutMcisVm function not yet implemented
// RestPutSshKey godoc // @Summary Update MCIS // @Description Update MCIS // @Tags [Infra service] MCIS Provisioning management // @Accept json // @Produce json // @Param nsId path string true "Namespace ID" default(ns01) // @Param mcisId path string true "MCIS ID" default(mcis01) // @Param vmId path string true "VM ID" default(vm01) // @Param vmInfo body mcis.TbVmInfo true "Details for an VM object" // @Success 200 {object} mcis.TbVmInfo // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg // @Router /ns/{nsId}/mcis/{mcisId}/vm/{vmId} [put]
func RestRecommendVm ¶ added in v0.3.7
func RestRecommendVm(c echo.Context) error
RestRecommendVm godoc @Summary Recommend MCIS plan (filter and priority) @Description Recommend MCIS plan (filter and priority) @Tags [Infra service] MCIS Provisioning management @Accept json @Produce json @Param nsId path string true "Namespace ID" default(common) @Param deploymentPlan body mcis.DeploymentPlan false "Recommend MCIS plan (filter and priority)" @Success 200 {object} []mcir.TbSpecInfo @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /ns/{nsId}/mcisRecommendVm [post]
Types ¶
type JSONResult ¶ added in v0.3.4
type JSONResult struct { }
JSONResult is a dummy struct for Swagger annotations.
type RestGetAllBenchmarkRequest ¶
type RestGetAllBenchmarkRequest struct {
Host string `json:"host"`
}
Request struct for RestGetAllBenchmark
type RestGetAllMcisPolicyResponse ¶ added in v0.2.8
type RestGetAllMcisPolicyResponse struct {
McisPolicy []mcis.McisPolicyInfo `json:"mcisPolicy"`
}
Response structure for RestGetAllMcisPolicy
type RestGetAllMcisResponse ¶
type RestGetAllMcisResponse struct {
Mcis []mcis.TbMcisInfo `json:"mcis"`
}
RestGetAllMcisResponse is a response structure for RestGetAllMcis
type RestGetAllMcisStatusResponse ¶ added in v0.2.8
type RestGetAllMcisStatusResponse struct {
Mcis []mcis.McisStatusInfo `json:"mcis"`
}
RestGetAllMcisStatusResponse is a response structure for RestGetAllMcisStatus
type RestGetBenchmarkRequest ¶
type RestGetBenchmarkRequest struct {
Host string `json:"host"`
}
type RestPostCmdMcisResponse ¶
type RestPostCmdMcisResponseWrapper ¶
type RestPostCmdMcisResponseWrapper struct {
ResultArray []RestPostCmdMcisResponse `json:"resultArray"`
}
type RestPostCmdMcisVmResponse ¶
type RestPostCmdMcisVmResponse struct {
Result string `json:"result"`
}
type RestPostMcisRecommendResponse ¶ added in v0.3.8
type RestPostMcisRecommendResponse struct { //VmReq []TbVmRecommendReq `json:"vmReq"` VmRecommend []mcis.TbVmRecommendInfo `json:"vmRecommend"` PlacementAlgo string `json:"placementAlgo"` PlacementParam []common.KeyValue `json:"placementParam"` }