1392 lines
36 KiB
Go
1392 lines
36 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
adapters "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/adapters"
|
|
ai "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/ai"
|
|
cloud "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/cloud"
|
|
core "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/core"
|
|
dictionary "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/dictionary"
|
|
hpc "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/hpc"
|
|
inference "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/inference"
|
|
monitoring "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/monitoring"
|
|
schedule "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/schedule"
|
|
storage "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/storage"
|
|
storelink "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/storelink"
|
|
vm "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/vm"
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
)
|
|
|
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/participantList",
|
|
Handler: core.ParticipantListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/scheduleTaskByYaml",
|
|
Handler: core.ScheduleTaskByYamlHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/commitTask",
|
|
Handler: core.CommitTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/commitVmTask",
|
|
Handler: core.CommitVmTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/asynCommitAiTask",
|
|
Handler: core.AsynCommitAiTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/core/deleteTask/:id",
|
|
Handler: core.DeleteTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/taskList",
|
|
Handler: core.TaskListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/jobTotal",
|
|
Handler: core.JobTotalHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/listCenter",
|
|
Handler: core.ListCenterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/listCluster/:centerId",
|
|
Handler: core.ListClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getRegion",
|
|
Handler: core.GetRegionHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/listRegion",
|
|
Handler: core.ListRegionHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getComputingPower",
|
|
Handler: core.GetComputingPowerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getGeneralInfo",
|
|
Handler: core.GetGeneralInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getResourcePanelConfigHandler",
|
|
Handler: core.GetResourcePanelConfigHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/core/resourcePanelConfigHandler",
|
|
Handler: core.PutResourcePanelConfigHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getComputilityStatistics",
|
|
Handler: core.GetComputilityStatisticsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/assets",
|
|
Handler: core.NodeAssetsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/centerResources",
|
|
Handler: core.CenterResourcesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/syncClusterLoad",
|
|
Handler: core.SyncClusterLoadHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/metrics",
|
|
Handler: core.MetricsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/pullTaskInfo",
|
|
Handler: core.PullTaskInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/pushTaskInfo",
|
|
Handler: core.PushTaskInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/pushResourceInfo",
|
|
Handler: core.PushResourceInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/pushNotice",
|
|
Handler: core.PushNoticeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/listNotice",
|
|
Handler: core.ListNoticeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/task/list",
|
|
Handler: core.PageListTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/task/countTaskStatus",
|
|
Handler: core.CountTaskStatusHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/homeOverview",
|
|
Handler: core.HomeOverviewHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/task/details",
|
|
Handler: core.TaskDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getPublicImage",
|
|
Handler: core.GetPublicImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getPublicFlavor",
|
|
Handler: core.GetPublicFlavorHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getPublicNetwork",
|
|
Handler: core.GetPublicNetworkHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getDomainResource",
|
|
Handler: core.GetDomainResourceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getScreenInfo",
|
|
Handler: core.GetScreenInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getScreenChart",
|
|
Handler: core.GetScreenChartHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/getClusterById",
|
|
Handler: core.GetClusterByIdHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/hpc/commitHpcTask",
|
|
Handler: hpc.CommitHpcTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/overview",
|
|
Handler: hpc.OverViewHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/adapterSummary",
|
|
Handler: hpc.AdapterSummaryHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/job",
|
|
Handler: hpc.JobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/resource",
|
|
Handler: hpc.ResourceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/queueAssets",
|
|
Handler: hpc.QueueAssetsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/hpc/cancelJob",
|
|
Handler: hpc.CancelJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/jobInfo",
|
|
Handler: hpc.JobInfoHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/task/list",
|
|
Handler: cloud.CloudListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/cloud/DeleteYaml",
|
|
Handler: cloud.DeleteYamlHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/cloud/controller/Metrics",
|
|
Handler: cloud.ControllerMetricsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/cloud/registerCluster",
|
|
Handler: cloud.RegisterClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/cloud/deleteCluster",
|
|
Handler: cloud.DeleteClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/core/clusterList",
|
|
Handler: cloud.GetClusterListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/cloud/task/create",
|
|
Handler: cloud.CommitGeneralTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/cloud/pod/logs",
|
|
Handler: cloud.PodLogsHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/trainingTaskStat",
|
|
Handler: ai.TrainingTaskStatHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getCenterOverview",
|
|
Handler: ai.GetCenterOverviewHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getCenterQueueing",
|
|
Handler: ai.GetCenterQueueingHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getCenterList",
|
|
Handler: ai.GetCenterListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getCenterTaskList",
|
|
Handler: ai.GetCenterTaskListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/listDataSet/:projectId",
|
|
Handler: ai.ListDataSetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/createDataSet/:projectId",
|
|
Handler: ai.CreateDataSetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/ai/deleteDataSet/:projectId/:datasetId",
|
|
Handler: ai.DeleteDataSetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateTask/:projectId/:datasetId",
|
|
Handler: ai.CreateTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ListImport/:projectId/:datasetId",
|
|
Handler: ai.ListImportHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/GetListTrainingJobs/:projectId",
|
|
Handler: ai.GetListTrainingJobsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
|
|
Handler: ai.DeleteTrainingJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateAlgorithm/:projectId",
|
|
Handler: ai.CreateAlgorithmHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ListAlgorithms/:projectId",
|
|
Handler: ai.ListAlgorithmsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
|
|
Handler: ai.DeleteAlgorithmHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateTrainingJob/:projectId",
|
|
Handler: ai.CreateTrainingJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
|
|
Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateExportTask/:projectId/:datasetId",
|
|
Handler: ai.CreateExportTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
|
|
Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
|
|
Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateProcessorTask",
|
|
Handler: ai.CreateProcessorTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateService/:projectId",
|
|
Handler: ai.CreateServiceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ListServices/:projectId",
|
|
Handler: ai.ListServicesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ShowService/:projectId/:serviceId",
|
|
Handler: ai.ShowServiceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/ai/DeleteService/:projectId/:serviceId",
|
|
Handler: ai.DeleteServiceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/ListClusters",
|
|
Handler: ai.ListClustersHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/listNotebook",
|
|
Handler: ai.ListNotebookHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/createNotebook",
|
|
Handler: ai.CreateNotebookHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/startNotebook",
|
|
Handler: ai.StartNotebookHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/stopNotebook",
|
|
Handler: ai.StopNotebookHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getNotebookStorage",
|
|
Handler: ai.GetNotebookStorageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/mountNotebookStorage",
|
|
Handler: ai.MountNotebookStorageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ai/getVisualizationJob",
|
|
Handler: ai.GetVisualizationJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/CreateVisualizationJob",
|
|
Handler: ai.CreateVisualizationJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ai/chat",
|
|
Handler: ai.ChatHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storage/dailyPowerScreen",
|
|
Handler: storage.DailyPowerScreenHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storage/perCenterComputerPowers",
|
|
Handler: storage.PerCenterComputerPowersHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getComputeLimits",
|
|
Handler: vm.GetComputeLimitsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getVolumeLimits",
|
|
Handler: vm.GetVolumeLimitsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getNetworkNum",
|
|
Handler: vm.GetNetworkNumHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getImageNum",
|
|
Handler: vm.GetImageNumHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getOpenstackOverview",
|
|
Handler: vm.GetOpenstackOverviewHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listServer",
|
|
Handler: vm.ListServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listServersDetailed",
|
|
Handler: vm.ListServersDetailedHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteServer",
|
|
Handler: vm.DeleteServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createServer",
|
|
Handler: vm.CreateServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createMulServer",
|
|
Handler: vm.CreateMulServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getServersDetailedById",
|
|
Handler: vm.GetServersDetailedByIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateServer",
|
|
Handler: vm.UpdateServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/startServer",
|
|
Handler: vm.StartServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/stopServer",
|
|
Handler: vm.StopServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/rebootServer",
|
|
Handler: vm.RebootServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/pauseServer",
|
|
Handler: vm.PauseServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/unpauseServer",
|
|
Handler: vm.UnpauseServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/resizeServer",
|
|
Handler: vm.ResizeServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/migrateServer",
|
|
Handler: vm.MigrateServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/shelveServer",
|
|
Handler: vm.ShelveServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/changeAdministrativePassword",
|
|
Handler: vm.ChangeAdministrativePasswordHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/rescueServer",
|
|
Handler: vm.RescueServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/unRescueServer",
|
|
Handler: vm.UnRescueHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/suspendServer",
|
|
Handler: vm.SuspendServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/addSecurityGroupToServer",
|
|
Handler: vm.AddSecurityGroupToServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/removeSecurityGroup",
|
|
Handler: vm.RemoveSecurityGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createFlavor",
|
|
Handler: vm.CreateFlavorHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/deleteFlavor",
|
|
Handler: vm.DeleteFlavorHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listImages",
|
|
Handler: vm.ListImagesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteImage",
|
|
Handler: vm.DeleteImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createImage",
|
|
Handler: vm.CreateImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/uploadImage",
|
|
Handler: vm.UploadImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listNetworks",
|
|
Handler: vm.ListNetworksHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteNetwork",
|
|
Handler: vm.DeleteNetworkHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createNetwork",
|
|
Handler: vm.CreateNetworkHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createSubnet",
|
|
Handler: vm.CreateSubnetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showNetworkDetails",
|
|
Handler: vm.ShowNetworkDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateNetwork",
|
|
Handler: vm.UpdateNetworkHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/bulkCreateNetworks",
|
|
Handler: vm.BulkCreateNetworksHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listSubnets",
|
|
Handler: vm.ListSubnetsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteSubnet",
|
|
Handler: vm.DeleteSubnetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateSubnet",
|
|
Handler: vm.UpdateSubnetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listNetworkSegmentRanges",
|
|
Handler: vm.ListNetworkSegmentRangesRangeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createNetworkSegmentRange",
|
|
Handler: vm.CreateNetworkSegmentRangeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteNetworkSegmentRanges",
|
|
Handler: vm.DeleteNetworkSegmentRangesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateNetworkSegmentRanges",
|
|
Handler: vm.UpdateNetworkSegmentRangesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showNetworkSegmentRangeDetails",
|
|
Handler: vm.ShowNetworkSegmentRangeDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createPort",
|
|
Handler: vm.CreatePortHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listPortsReq",
|
|
Handler: vm.ListPortsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deletePort",
|
|
Handler: vm.DeletePortHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updatePort",
|
|
Handler: vm.UpdatePortHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showPortDetails",
|
|
Handler: vm.ShowPortDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createRouter",
|
|
Handler: vm.CreateRouterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listRouters",
|
|
Handler: vm.ListRoutersHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteRouter",
|
|
Handler: vm.DeleteRouterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateRouter",
|
|
Handler: vm.UpdateRouterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showRouterDetails",
|
|
Handler: vm.ShowRouterDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createFloatingIP",
|
|
Handler: vm.CreateFloatingIPHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listFloatingIPs",
|
|
Handler: vm.ListFloatingIPsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteFloatingIP",
|
|
Handler: vm.DeleteFloatingIPHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateFloatingIP",
|
|
Handler: vm.UpdateFloatingIPHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showFloatingIPDetails",
|
|
Handler: vm.ShowFloatingIPDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createFirewallGroup",
|
|
Handler: vm.CreateFirewallGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listFirewallGroups",
|
|
Handler: vm.ListFirewallGroupsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteFirewallGroup",
|
|
Handler: vm.DeleteFirewallGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateFirewallGroup",
|
|
Handler: vm.UpdateFirewallGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showFirewallGroupDetails",
|
|
Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createFirewallPolicy",
|
|
Handler: vm.CreateFirewallPolicyHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listFirewallPolicies",
|
|
Handler: vm.ListFirewallPoliciesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteFirewallPolicy",
|
|
Handler: vm.DeleteFirewallPolicyHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showFirewallRuleDetails",
|
|
Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showFirewallPolicyDetails",
|
|
Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createFirewallRule",
|
|
Handler: vm.CreateFirewallRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listFirewallRules",
|
|
Handler: vm.ListFirewallRulesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteFirewallRule",
|
|
Handler: vm.DeleteFirewallRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createSecurityGroup",
|
|
Handler: vm.CreateSecurityGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listSecurityGroups",
|
|
Handler: vm.ListSecurityGroupsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteSecurityGroup",
|
|
Handler: vm.DeleteSecurityGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateSecurityGroup",
|
|
Handler: vm.UpdateSecurityGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showSecurityGroup",
|
|
Handler: vm.ShowSecurityGroupHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createSecurityGroupRule",
|
|
Handler: vm.CreateSecurityGroupRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listSecurityGroupRules",
|
|
Handler: vm.ListSecurityGroupRulesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteSecurityGroupRule",
|
|
Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showSecurityGroupRule",
|
|
Handler: vm.ShowSecurityGroupRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listVolumesDetail",
|
|
Handler: vm.ListVolumesDetailHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteVolume",
|
|
Handler: vm.DeleteVolumeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createVolume",
|
|
Handler: vm.CreateVolumeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listFlavorsDetail",
|
|
Handler: vm.ListFlavorsDetailHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listVolumeTypes",
|
|
Handler: vm.ListVolumeTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/vm/updateVolume",
|
|
Handler: vm.UpdateVolumeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createVolumeTypes",
|
|
Handler: vm.CreateVolumeTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteVolumeType",
|
|
Handler: vm.DeleteVolumeTypeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listVolumes",
|
|
Handler: vm.ListVolumesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/getVolumeDetailedById",
|
|
Handler: vm.GetVolumeDetailedByIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listNodes",
|
|
Handler: vm.ListNodesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createNode",
|
|
Handler: vm.CreateNodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteNode",
|
|
Handler: vm.DeleteNodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/showNodeDetails",
|
|
Handler: vm.ShowNodeDetailsHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/storelink/uploadImage",
|
|
Handler: storelink.UploadLinkImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storelink/getImageList",
|
|
Handler: storelink.GetLinkImageListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/storelink/deleteImage",
|
|
Handler: storelink.DeleteLinkImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/storelink/submitTask",
|
|
Handler: storelink.SubmitLinkTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storelink/getTask",
|
|
Handler: storelink.GetLinkTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/storelink/deleteTask",
|
|
Handler: storelink.DeleteLinkTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storelink/getParticipants",
|
|
Handler: storelink.GetParticipantsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storelink/getResourceSpecs",
|
|
Handler: storelink.GetAISpecsHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/list",
|
|
Handler: adapters.AdaptersListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/adapter/create",
|
|
Handler: adapters.CreateAdapterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/adapter/update",
|
|
Handler: adapters.UpdateAdapterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/adapter/delete",
|
|
Handler: adapters.DeleteAdapterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/get",
|
|
Handler: adapters.GetAdapterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/cluster/list",
|
|
Handler: adapters.ClusterListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/adapter/cluster/create",
|
|
Handler: adapters.CreateClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/adapter/cluster/update",
|
|
Handler: adapters.UpdateClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/adapter/cluster/delete",
|
|
Handler: adapters.DeleteClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/cluster/get",
|
|
Handler: adapters.GetClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/relation",
|
|
Handler: adapters.GetAdapterRelationHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/clusterSum",
|
|
Handler: adapters.GetClusterSumHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/adapter/getAdapterInfo",
|
|
Handler: adapters.GetAdapterInfoHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getResourceTypes",
|
|
Handler: schedule.ScheduleGetAiResourceTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getTaskTypes",
|
|
Handler: schedule.ScheduleGetAiTaskTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getDatasets/:adapterId",
|
|
Handler: schedule.ScheduleGetDatasetsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getStrategies",
|
|
Handler: schedule.ScheduleGetStrategyHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getAlgorithms/:adapterId/:resourceType/:taskType/:dataset",
|
|
Handler: schedule.ScheduleGetAlgorithmsHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/ai/getJobLog/:adapterId/:clusterId/:taskId/:instanceNum",
|
|
Handler: schedule.ScheduleGetAiJobLogLogHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/schedule/submit",
|
|
Handler: schedule.ScheduleSubmitHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/schedule/getOverview",
|
|
Handler: schedule.ScheduleGetOverviewHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/downloadAlgorithmCode",
|
|
Handler: schedule.DownloadAlgothmCodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/schedule/uploadAlgorithmCode",
|
|
Handler: schedule.UploadAlgothmCodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/getComputeCardsByCluster/:adapterId/:clusterId",
|
|
Handler: schedule.GetComputeCardsByClusterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/schedule/getClusterBalanceById/:adapterId/:clusterId",
|
|
Handler: schedule.GetClusterBalanceByIdHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/text",
|
|
Handler: inference.TextToTextInferenceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/images",
|
|
Handler: inference.ImageInferenceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/modelTypes",
|
|
Handler: inference.ModelTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/instanceCenter",
|
|
Handler: inference.InstanceCenterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/modelNames",
|
|
Handler: inference.ModelNamesByTypeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/taskDetail",
|
|
Handler: inference.InferenceTaskDetailHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/deployInstanceList",
|
|
Handler: inference.DeployInstanceListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/startDeployInstance",
|
|
Handler: inference.StartDeployInstanceListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/stopDeployInstance",
|
|
Handler: inference.StopDeployInstanceHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/deployInstanceStat",
|
|
Handler: inference.DeployInstanceStatHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/taskStat",
|
|
Handler: inference.InferenceTaskStatHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/startAll",
|
|
Handler: inference.StartAllByDeployTaskIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/stopAll",
|
|
Handler: inference.StopAllByDeployTaskIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/getRunningInstanceById",
|
|
Handler: inference.GetRunningInstanceByIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/getDeployTasksByType",
|
|
Handler: inference.GetDeployTasksByTypeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/inference/createDeployTask",
|
|
Handler: inference.CreateDeployTaskHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/inference/getAdaptersByModel",
|
|
Handler: inference.GetAdaptersByModelHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dict/:id",
|
|
Handler: dictionary.GetDictHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dicts",
|
|
Handler: dictionary.ListDictHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/dict",
|
|
Handler: dictionary.AddDictHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/dict",
|
|
Handler: dictionary.EditDictHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/dict/:id",
|
|
Handler: dictionary.DeleteDictHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dictItem/:id",
|
|
Handler: dictionary.GetDictItemHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dictItems",
|
|
Handler: dictionary.ListDictItemHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/dictItem",
|
|
Handler: dictionary.AddDictItemHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/dictItem",
|
|
Handler: dictionary.EditDictItemHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/dictItem/:id",
|
|
Handler: dictionary.DeleteDictItemHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dictItem/code/:dictCode",
|
|
Handler: dictionary.ListDictItemByCodeHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/monitoring/alert/rule",
|
|
Handler: monitoring.CreateAlertRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/alert/rule",
|
|
Handler: monitoring.AlertRulesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/monitoring/alert/rule",
|
|
Handler: monitoring.DeleteAlertRuleHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/cluster/load",
|
|
Handler: monitoring.ClustersLoadHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/node/top",
|
|
Handler: monitoring.NodesLoadTopHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/alert/list",
|
|
Handler: monitoring.AlertListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/monitoring/syncClusterAlert",
|
|
Handler: monitoring.SyncClusterAlertHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/task/num",
|
|
Handler: monitoring.TaskNumHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/adapter/info",
|
|
Handler: monitoring.AdapterInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/monitoring/schedule/situation",
|
|
Handler: monitoring.ScheduleSituationHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
}
|