410 lines
10 KiB
Go
410 lines
10 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
ai "PCM/adaptor/PCM-CORE/api/internal/handler/ai"
|
|
core "PCM/adaptor/PCM-CORE/api/internal/handler/core"
|
|
hpc "PCM/adaptor/PCM-CORE/api/internal/handler/hpc"
|
|
image "PCM/adaptor/PCM-CORE/api/internal/handler/image"
|
|
storage "PCM/adaptor/PCM-CORE/api/internal/handler/storage"
|
|
vm "PCM/adaptor/PCM-CORE/api/internal/handler/vm"
|
|
"PCM/adaptor/PCM-CORE/api/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
)
|
|
|
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/scheduleTaskByYaml",
|
|
Handler: core.ScheduleTaskByYamlHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/core/scheduleTask",
|
|
Handler: core.ScheduleTaskHandler(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.MethodPost,
|
|
Path: "/core/submitJob",
|
|
Handler: core.SubmitJobHandler(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/listDomainResource",
|
|
Handler: core.ListDomainResourceHandler(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),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/listJob",
|
|
Handler: hpc.ListJobHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/hpc/listHistoryJob",
|
|
Handler: hpc.ListHistoryJobHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
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),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/storage/screenStorage",
|
|
Handler: storage.ScreenStorageHandler(serverCtx),
|
|
},
|
|
{
|
|
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.MethodPost,
|
|
Path: "/upload",
|
|
Handler: image.UploadHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/chunk",
|
|
Handler: image.ChunkHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/image/list",
|
|
Handler: image.ImageListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/dataSet/check/:fileMd5",
|
|
Handler: image.DataSetCheckHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/dataSet/upload",
|
|
Handler: image.UploadDataSetHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
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.MethodGet,
|
|
Path: "/vm/listImages",
|
|
Handler: vm.ListImagesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodDelete,
|
|
Path: "/vm/deleteImage",
|
|
Handler: vm.DeleteImageHandler(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/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.MethodPost,
|
|
Path: "/vm/createServer",
|
|
Handler: vm.CreateServerHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/vm/listVolumeTypes",
|
|
Handler: vm.ListVolumeTypesHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/createImage",
|
|
Handler: vm.CreateImageHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/vm/uploadImage",
|
|
Handler: vm.UploadImageHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/pcm/v1"),
|
|
)
|
|
}
|