任务详情的指标单位转换
Former-commit-id: 69cd38ef57e07208fc09ee391e46cccee5123818
This commit is contained in:
parent
5dd96440f8
commit
ae43d349a3
|
@ -26,66 +26,63 @@ info(
|
|||
service pcm {
|
||||
@handler participantListHandler
|
||||
get /core/participantList returns (participantListResp)
|
||||
|
||||
|
||||
@handler scheduleTaskByYamlHandler
|
||||
post /core/scheduleTaskByYaml (scheduleTaskByYamlReq) returns (scheduleTaskByYamlResp)
|
||||
|
||||
|
||||
@handler deleteTaskHandler
|
||||
delete /core/deleteTask/:id (deleteTaskReq)
|
||||
|
||||
@handler scheduleTaskHandler
|
||||
post /core/scheduleTask (scheduleTaskReq)
|
||||
|
||||
|
||||
// 任务列表接口
|
||||
@handler TaskListHandler
|
||||
get /core/taskList (taskListReq)returns (taskListResp)
|
||||
|
||||
|
||||
// 任务详情接口
|
||||
@handler TaskDetailHandler
|
||||
get /core/taskDetail/:taskId (taskDetailReq) returns (taskDetailResp)
|
||||
|
||||
|
||||
@handler JobTotalHandler
|
||||
get /core/jobTotal returns (jobTotalResp)
|
||||
|
||||
|
||||
@handler listCenterHandler
|
||||
get /core/listCenter returns (listCenterResp)
|
||||
|
||||
|
||||
@handler listClusterHandler
|
||||
get /core/listCluster/:centerId (listClusterReq) returns (listClusterResp)
|
||||
|
||||
|
||||
@handler submitJobHandler
|
||||
post /core/submitJob (submitJobReq) returns (submitJobResp)
|
||||
|
||||
|
||||
@handler getRegionHandler
|
||||
get /core/getRegion returns (getRegionResp)
|
||||
|
||||
|
||||
@handler listRegionHandler
|
||||
get /core/listRegion returns (listRegionResp)
|
||||
|
||||
|
||||
@handler getComputingPowerHandler
|
||||
get /core/getComputingPower returns (cpResp)
|
||||
|
||||
|
||||
@handler getGeneralInfoHandler
|
||||
get /core/getGeneralInfo returns (GiResp)
|
||||
|
||||
|
||||
@handler listDomainResourceHandler
|
||||
get /core/listDomainResource returns (DomainResourceResp)
|
||||
|
||||
|
||||
@handler getResourcePanelConfigHandler
|
||||
get /core/getResourcePanelConfigHandler returns (ResourcePanelConfigResp)
|
||||
|
||||
|
||||
@handler putResourcePanelConfigHandler
|
||||
put /core/resourcePanelConfigHandler (ResourcePanelConfigReq)
|
||||
|
||||
|
||||
@handler getComputilityStatisticsHandler
|
||||
get /core/getComputilityStatistics returns (ComputilityStatisticsResp)
|
||||
|
||||
|
||||
@handler nodeAssetsHandler
|
||||
get /core/assets returns (NodeAssetsResp)
|
||||
|
||||
|
||||
@handler saveHashcatHandler
|
||||
post /core/saveHashcat (SaveHashcatReq)
|
||||
|
||||
|
||||
@handler getHashcatHandler
|
||||
get /core/getHashcat/:crackTaskId (getHashcatHandlerReq) returns (getHashcatHandlerResp)
|
||||
}
|
||||
|
@ -98,10 +95,10 @@ service pcm {
|
|||
service pcm {
|
||||
@handler listJobHandler
|
||||
get /hpc/listJob (listJobReq) returns (listJobResp)
|
||||
|
||||
|
||||
@handler listHistoryJobHandler
|
||||
get /hpc/listHistoryJob (listHistoryJobReq) returns (listHistoryJobResp)
|
||||
|
||||
|
||||
@handler queueAssetsHandler
|
||||
get /queue/assets returns (QueueAssetsResp)
|
||||
}
|
||||
|
@ -114,7 +111,7 @@ service pcm {
|
|||
service pcm {
|
||||
@handler cloudListHandler
|
||||
get /task/list returns (cloudListResp)
|
||||
|
||||
|
||||
@handler deleteYamlHandler
|
||||
get /cloud/DeleteYaml (ApplyReq) returns (DeleteResp)
|
||||
}
|
||||
|
@ -127,10 +124,10 @@ service pcm {
|
|||
service pcm {
|
||||
@handler listDataSetHandler
|
||||
get /ai/listDataSet/:projectId (DataSetReq) returns (DataSetResp)
|
||||
|
||||
|
||||
@handler CreateDataSetHandler
|
||||
post /ai/createDataSet/:projectId (CreateDataSetReq) returns (CreateDataSetResp)
|
||||
|
||||
|
||||
@handler DeleteDataSetHandler
|
||||
delete /ai/deleteDataSet/:projectId/:datasetId (DeleteDataSetReq) returns (DeleteDataSetResp)
|
||||
// creat task 创建导入任务
|
||||
|
@ -161,7 +158,7 @@ service pcm {
|
|||
// ShowAlgorithmByUuid 展示算法详情
|
||||
@handler ShowAlgorithmByUuid
|
||||
get /ai/ShowAlgorithmByUuid/:projectId/:algorithmId (ShowAlgorithmByUuidReq) returns (ShowAlgorithmByUuidResp)
|
||||
|
||||
|
||||
// creat export task 创建导出任务
|
||||
@handler CreateExportTaskHandler
|
||||
post /ai/CreateExportTask/:projectId/:datasetId (CreateExportTaskReq) returns (ExportTaskDataResp)
|
||||
|
@ -169,11 +166,11 @@ service pcm {
|
|||
get /ai/GetExportTasksOfDataset/:projectId/:datasetId (GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp)
|
||||
@handler GetExportTaskStatusOfDatasetHandler
|
||||
get /ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId (GetExportTaskStatusOfDatasetReq) returns (GetExportTaskStatusOfDatasetResp)
|
||||
|
||||
|
||||
// create processor task 创建处理任务
|
||||
@handler CreateProcessorTaskHandler
|
||||
post /ai/CreateProcessorTask (CreateProcessorTaskReq) returns (CreateProcessorTaskResp)
|
||||
|
||||
|
||||
// create service 创建服务
|
||||
@handler CreateServiceHandler
|
||||
post /ai/CreateService/:projectId (CreateServiceReq) returns (CreateServiceResp)
|
||||
|
@ -189,7 +186,7 @@ service pcm {
|
|||
// ListClusters查询专属资源池列表
|
||||
@handler ListClustersHandler
|
||||
get /ai/ListClusters (ListClustersReq) returns (ListClustersResp)
|
||||
|
||||
|
||||
/******************Notebook Method start*************************/
|
||||
@handler listNotebookHandler
|
||||
get /ai/listNotebook (ListNotebookReq) returns (ListNotebookResp)
|
||||
|
@ -204,7 +201,7 @@ service pcm {
|
|||
@handler mountNotebookStorageHandler
|
||||
post /ai/mountNotebookStorage (MountNotebookStorageReq) returns (MountNotebookStorageResp)
|
||||
/******************Notebook Method end*************************/
|
||||
|
||||
|
||||
/******************Visualization Job Method start*************************/
|
||||
@handler getVisualizationJobHandler
|
||||
get /ai/getVisualizationJob (GetVisualizationJobReq) returns (GetVisualizationJobResp)
|
||||
|
@ -235,16 +232,16 @@ service pcm {
|
|||
service pcm {
|
||||
@handler uploadHandler
|
||||
post /upload
|
||||
|
||||
|
||||
@handler chunkHandler
|
||||
post /chunk
|
||||
|
||||
|
||||
@handler imageListHandler
|
||||
get /image/list returns (imageListResp)
|
||||
|
||||
|
||||
@handler dataSetCheckHandler
|
||||
get /dataSet/check/:fileMd5 (checkReq) returns (checkResp)
|
||||
|
||||
|
||||
@handler uploadDataSetHandler
|
||||
post /dataSet/upload
|
||||
}
|
||||
|
@ -290,7 +287,7 @@ service pcm {
|
|||
post /vm/createImage (CreateImageReq) returns (CreateImageResp)
|
||||
@handler UploadImageHandler
|
||||
put /vm/uploadImage (UploadOsImageReq) returns (UploadOsImageResp)
|
||||
|
||||
|
||||
/*网络*/
|
||||
@handler ListNetworksHandler
|
||||
get /vm/listNetworks (ListNetworksReq) returns (ListNetworksResp)
|
||||
|
@ -306,7 +303,7 @@ service pcm {
|
|||
put /vm/updateNetwork (UpdateNetworkReq) returns (UpdateNetworkResp)
|
||||
@handler BulkCreateNetworksHandler
|
||||
post /vm/bulkCreateNetworks (BulkCreateNetworksReq) returns (BulkCreateNetworksResp)
|
||||
|
||||
|
||||
/*卷*/
|
||||
@handler ListVolumesDetailHandler
|
||||
get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp)
|
||||
|
@ -328,7 +325,7 @@ service pcm {
|
|||
get /vm/listVolumes (ListVolumesReq) returns (ListVolumesResp)
|
||||
@handler GetVolumeDetailedByIdHandler
|
||||
get /vm/getVolumeDetailedById (GetVolumeDetailedByIdReq) returns (GetVolumeDetailedByIdResp)
|
||||
|
||||
|
||||
// Bare Metal
|
||||
@handler ListNodesHandler
|
||||
get /vm/listNodes (ListNodesReq) returns (ListNodesResp)
|
||||
|
@ -349,25 +346,25 @@ service pcm {
|
|||
service pcm {
|
||||
@handler UploadLinkImageHandler
|
||||
post /storelink/uploadImage (UploadLinkImageReq) returns (UploadLinkImageResp)
|
||||
|
||||
|
||||
@handler GetLinkImageListHandler
|
||||
get /storelink/getImageList (GetLinkImageListReq) returns (GetLinkImageListResp)
|
||||
|
||||
|
||||
@handler DeleteLinkImageHandler
|
||||
delete /storelink/deleteImage (DeleteLinkImageReq) returns (DeleteLinkImageResp)
|
||||
|
||||
|
||||
@handler SubmitLinkTaskHandler
|
||||
post /storelink/submitTask (SubmitLinkTaskReq) returns (SubmitLinkTaskResp)
|
||||
|
||||
|
||||
@handler GetLinkTaskHandler
|
||||
get /storelink/getTask (GetLinkTaskReq) returns (GetLinkTaskResp)
|
||||
|
||||
|
||||
@handler DeleteLinkTaskHandler
|
||||
delete /storelink/deleteTask (DeleteLinkTaskReq) returns (DeleteLinkTaskResp)
|
||||
|
||||
|
||||
@handler GetParticipantsHandler
|
||||
get /storelink/getParticipants (GetParticipantsReq) returns (GetParticipantsResp)
|
||||
|
||||
|
||||
@handler GetAISpecsHandler
|
||||
get /storelink/getResourceSpecs (GetResourceSpecsReq) returns (GetResourceSpecsResp)
|
||||
}
|
|
@ -9,5 +9,9 @@ func AddCronGroup(svc *svc.ServiceContext) {
|
|||
svc.Cron.AddFunc("*/5 * * * * ?", func() {
|
||||
SyncParticipantRpc(svc)
|
||||
})
|
||||
// 删除三天前的监控信息
|
||||
svc.Cron.AddFunc("*/5 * * * * ?", func() {
|
||||
ClearMetricsData(svc)
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package cron
|
||||
|
||||
import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
|
||||
)
|
||||
|
||||
func ClearMetricsData(svc *svc.ServiceContext) {
|
||||
tx := svc.DbEngin.Where("DATE(created_time) <= DATE(DATE_SUB(NOW(),INTERVAL 3 DAY))").Delete(&models.ScNodeAvailInfo{})
|
||||
if tx.Error != nil {
|
||||
log.Err(tx.Error)
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||
"io/ioutil"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"net/http"
|
||||
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/core"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||
)
|
||||
|
||||
func ScheduleTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ScheduleTaskReq
|
||||
bytes, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
json.Unmarshal(bytes, &req)
|
||||
l := core.NewScheduleTaskLogic(r.Context(), svcCtx)
|
||||
err = l.ScheduleTask(&req)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
@ -12,13 +11,18 @@ import (
|
|||
|
||||
func SubmitJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ScheduleTaskReq
|
||||
var req types.SubmitJobReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
l := core.NewScheduleTaskLogic(r.Context(), svcCtx)
|
||||
err := l.ScheduleTask(&req)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
|
||||
l := core.NewSubmitJobLogic(r.Context(), svcCtx)
|
||||
resp, err := l.SubmitJob(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,11 +35,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||
Path: "/core/deleteTask/:id",
|
||||
Handler: core.DeleteTaskHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/core/scheduleTask",
|
||||
Handler: core.ScheduleTaskHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/core/taskList",
|
||||
|
|
|
@ -26,7 +26,7 @@ func (l *NodeAssetsLogic) NodeAssets() (resp *types.NodeAssetsResp, err error) {
|
|||
// 查询数据库系节点动态资源信息
|
||||
|
||||
nodeResp := types.NodeAssetsResp{}
|
||||
tx := l.svcCtx.DbEngin.Raw("SELECT nai.*,ti.tenant_name FROM sc_node_avail_info nai left join sc_participant_phy_info ppi on ppi.id = nai.participant_id left JOIN sc_tenant_info ti on ti.id = ppi.tenant_id WHERE nai.id IN ( SELECT MAX( id ) FROM sc_node_avail_info WHERE deleted_flag = 0 GROUP BY participant_id, node_name ) ").Scan(&nodeResp.NodeAssets)
|
||||
tx := l.svcCtx.DbEngin.Raw("SELECT ppi.`name`,nai.* FROM sc_node_avail_info nai left join sc_participant_phy_info ppi on ppi.id = nai.participant_id WHERE nai.id IN ( SELECT MAX( id ) FROM sc_node_avail_info WHERE deleted_flag = 0 GROUP BY participant_id, node_name)\n ").Scan(&nodeResp.NodeAssets)
|
||||
if tx.Error != nil {
|
||||
logx.Error(err)
|
||||
return nil, tx.Error
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
|
||||
appv1 "k8s.io/api/apps/v1"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ScheduleTaskLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
type DeploymentParam struct {
|
||||
ClusterName []string `json:"clusterName"`
|
||||
TemplateId string `json:"templateId"`
|
||||
Deployment appv1.Deployment `json:"deployment"`
|
||||
}
|
||||
|
||||
func NewScheduleTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ScheduleTaskLogic {
|
||||
return &ScheduleTaskLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ScheduleTaskLogic) ScheduleTask(req *types.ScheduleTaskReq) (err error) {
|
||||
|
||||
bytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// construct task info
|
||||
taskModel := models.Task{
|
||||
Status: "Saved",
|
||||
Description: req.Description,
|
||||
Name: req.Name,
|
||||
YamlString: string(bytes),
|
||||
CommitTime: time.Now(),
|
||||
}
|
||||
// save the task in mysql and return id
|
||||
tx := l.svcCtx.DbEngin.Create(&taskModel)
|
||||
if tx.Error != nil {
|
||||
return tx.Error
|
||||
}
|
||||
|
||||
// push message into topic
|
||||
for _, task := range req.Tasks {
|
||||
task.TaskId = taskModel.Id
|
||||
reqMessage, err := json.Marshal(task)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return err
|
||||
}
|
||||
switch task.TaskType {
|
||||
case "kubeNative":
|
||||
l.svcCtx.ScheduleCloudClient.Push(string(reqMessage))
|
||||
case "ac", "th":
|
||||
l.svcCtx.ScheduleHpcClient.Push(string(reqMessage))
|
||||
case "modelArts":
|
||||
l.svcCtx.ScheduleAiClient.Push(string(reqMessage))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -112,6 +112,7 @@ func podsMetrics(metricsUrl string, pods []*kubernetesclient.Pod, resp *types.Ta
|
|||
PodName: *pod.Metadata.Name,
|
||||
NamespaceName: *pod.Metadata.Namespace,
|
||||
})
|
||||
|
||||
resp.MemoryTotal = metricAdd(resp.MemoryTotal, podMemoryUsage)
|
||||
// 内存需求量
|
||||
podMemoryLimit := prometheusClient.GetNamedMetrics([]string{"pod_memory_resource_limits"}, time.Now(), tracker.PodOption{
|
||||
|
@ -120,6 +121,8 @@ func podsMetrics(metricsUrl string, pods []*kubernetesclient.Pod, resp *types.Ta
|
|||
})
|
||||
resp.MemoryLimit = metricAdd(resp.MemoryLimit, podMemoryLimit)
|
||||
}
|
||||
resp.MemoryTotal = resp.MemoryTotal / float64(1073741824)
|
||||
resp.MemoryLimit = resp.MemoryLimit / float64(1073741824)
|
||||
}
|
||||
|
||||
func metricAdd(z float64, metric []tracker.Metric) float64 {
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/docker/docker/client"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/robfig/cron/v3"
|
||||
"github.com/zeromicro/go-queue/kq"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-ac/hpcacclient"
|
||||
|
@ -27,24 +26,21 @@ import (
|
|||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
RedisClient *redis.Client
|
||||
ScheduleHpcClient *kq.Pusher
|
||||
ScheduleCloudClient *kq.Pusher
|
||||
ScheduleAiClient *kq.Pusher
|
||||
Cron *cron.Cron
|
||||
ModelArtsRpc modelartsservice.ModelArtsService
|
||||
ModelArtsImgRpc imagesservice.ImagesService
|
||||
DbEngin *gorm.DB
|
||||
ACRpc hpcacclient.HpcAC
|
||||
THRpc slurmclient.Slurm
|
||||
OctopusRpc octopusclient.Octopus
|
||||
CephRpc cephclient.Ceph
|
||||
OpenstackRpc openstackclient.Openstack
|
||||
DockerClient *client.Client
|
||||
Downloader *s3manager.Downloader
|
||||
Uploader *s3manager.Uploader
|
||||
K8sRpc map[int64]kubernetesclient.Kubernetes
|
||||
Config config.Config
|
||||
RedisClient *redis.Client
|
||||
Cron *cron.Cron
|
||||
ModelArtsRpc modelartsservice.ModelArtsService
|
||||
ModelArtsImgRpc imagesservice.ImagesService
|
||||
DbEngin *gorm.DB
|
||||
ACRpc hpcacclient.HpcAC
|
||||
THRpc slurmclient.Slurm
|
||||
OctopusRpc octopusclient.Octopus
|
||||
CephRpc cephclient.Ceph
|
||||
OpenstackRpc openstackclient.Openstack
|
||||
DockerClient *client.Client
|
||||
Downloader *s3manager.Downloader
|
||||
Uploader *s3manager.Uploader
|
||||
K8sRpc map[int64]kubernetesclient.Kubernetes
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
|
|
1
go.mod
1
go.mod
|
@ -20,6 +20,7 @@ require (
|
|||
github.com/prometheus/common v0.45.0
|
||||
github.com/redis/go-redis/v9 v9.3.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/rs/zerolog v1.28.0
|
||||
github.com/shopspring/decimal v1.3.1
|
||||
github.com/zeromicro/go-queue v1.1.8
|
||||
github.com/zeromicro/go-zero v1.6.0
|
||||
|
|
1
go.sum
1
go.sum
|
@ -967,6 +967,7 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
|
|||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY=
|
||||
github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.19.4
|
||||
// source: pcmCore.proto
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.19.4
|
||||
// source: pcmCore.proto
|
||||
|
||||
|
@ -18,6 +18,11 @@ import (
|
|||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
PcmCore_SyncInfo_FullMethodName = "/pcmCore.pcmCore/SyncInfo"
|
||||
PcmCore_InfoList_FullMethodName = "/pcmCore.pcmCore/InfoList"
|
||||
)
|
||||
|
||||
// PcmCoreClient is the client API for PcmCore service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
|
@ -38,7 +43,7 @@ func NewPcmCoreClient(cc grpc.ClientConnInterface) PcmCoreClient {
|
|||
|
||||
func (c *pcmCoreClient) SyncInfo(ctx context.Context, in *SyncInfoReq, opts ...grpc.CallOption) (*SyncInfoResp, error) {
|
||||
out := new(SyncInfoResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.pcmCore/SyncInfo", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, PcmCore_SyncInfo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -47,7 +52,7 @@ func (c *pcmCoreClient) SyncInfo(ctx context.Context, in *SyncInfoReq, opts ...g
|
|||
|
||||
func (c *pcmCoreClient) InfoList(ctx context.Context, in *InfoListReq, opts ...grpc.CallOption) (*InfoListResp, error) {
|
||||
out := new(InfoListResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.pcmCore/InfoList", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, PcmCore_InfoList_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -98,7 +103,7 @@ func _PcmCore_SyncInfo_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.pcmCore/SyncInfo",
|
||||
FullMethod: PcmCore_SyncInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PcmCoreServer).SyncInfo(ctx, req.(*SyncInfoReq))
|
||||
|
@ -116,7 +121,7 @@ func _PcmCore_InfoList_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.pcmCore/InfoList",
|
||||
FullMethod: PcmCore_InfoList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PcmCoreServer).InfoList(ctx, req.(*InfoListReq))
|
||||
|
@ -144,6 +149,17 @@ var PcmCore_ServiceDesc = grpc.ServiceDesc{
|
|||
Metadata: "pcmCore.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
ParticipantService_RegisterParticipant_FullMethodName = "/pcmCore.participantService/registerParticipant"
|
||||
ParticipantService_ReportHeartbeat_FullMethodName = "/pcmCore.participantService/reportHeartbeat"
|
||||
ParticipantService_ReportAvailable_FullMethodName = "/pcmCore.participantService/reportAvailable"
|
||||
ParticipantService_ListParticipant_FullMethodName = "/pcmCore.participantService/listParticipant"
|
||||
ParticipantService_ListPhyAvailable_FullMethodName = "/pcmCore.participantService/listPhyAvailable"
|
||||
ParticipantService_ListPhyInformation_FullMethodName = "/pcmCore.participantService/listPhyInformation"
|
||||
ParticipantService_RegisterTenant_FullMethodName = "/pcmCore.participantService/registerTenant"
|
||||
ParticipantService_ListTenant_FullMethodName = "/pcmCore.participantService/listTenant"
|
||||
)
|
||||
|
||||
// ParticipantServiceClient is the client API for ParticipantService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
|
@ -176,7 +192,7 @@ func NewParticipantServiceClient(cc grpc.ClientConnInterface) ParticipantService
|
|||
|
||||
func (c *participantServiceClient) RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) {
|
||||
out := new(ParticipantPhyResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/registerParticipant", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_RegisterParticipant_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -185,7 +201,7 @@ func (c *participantServiceClient) RegisterParticipant(ctx context.Context, in *
|
|||
|
||||
func (c *participantServiceClient) ReportHeartbeat(ctx context.Context, in *ParticipantHeartbeatReq, opts ...grpc.CallOption) (*HealthCheckResp, error) {
|
||||
out := new(HealthCheckResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/reportHeartbeat", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ReportHeartbeat_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -194,7 +210,7 @@ func (c *participantServiceClient) ReportHeartbeat(ctx context.Context, in *Part
|
|||
|
||||
func (c *participantServiceClient) ReportAvailable(ctx context.Context, in *ParticipantAvailReq, opts ...grpc.CallOption) (*ParticipantResp, error) {
|
||||
out := new(ParticipantResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/reportAvailable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ReportAvailable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -203,7 +219,7 @@ func (c *participantServiceClient) ReportAvailable(ctx context.Context, in *Part
|
|||
|
||||
func (c *participantServiceClient) ListParticipant(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ParticipantServiceResp, error) {
|
||||
out := new(ParticipantServiceResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listParticipant", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ListParticipant_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -212,7 +228,7 @@ func (c *participantServiceClient) ListParticipant(ctx context.Context, in *Part
|
|||
|
||||
func (c *participantServiceClient) ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error) {
|
||||
out := new(ListParticipantAvailResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listPhyAvailable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ListPhyAvailable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -221,7 +237,7 @@ func (c *participantServiceClient) ListPhyAvailable(ctx context.Context, in *Par
|
|||
|
||||
func (c *participantServiceClient) ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error) {
|
||||
out := new(ListParticipantPhyResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listPhyInformation", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ListPhyInformation_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -230,7 +246,7 @@ func (c *participantServiceClient) ListPhyInformation(ctx context.Context, in *P
|
|||
|
||||
func (c *participantServiceClient) RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) {
|
||||
out := new(TenantResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/registerTenant", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_RegisterTenant_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -239,7 +255,7 @@ func (c *participantServiceClient) RegisterTenant(ctx context.Context, in *Tenan
|
|||
|
||||
func (c *participantServiceClient) ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) {
|
||||
out := new(ListTenantResp)
|
||||
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listTenant", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ParticipantService_ListTenant_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -320,7 +336,7 @@ func _ParticipantService_RegisterParticipant_Handler(srv interface{}, ctx contex
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/registerParticipant",
|
||||
FullMethod: ParticipantService_RegisterParticipant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).RegisterParticipant(ctx, req.(*ParticipantPhyReq))
|
||||
|
@ -338,7 +354,7 @@ func _ParticipantService_ReportHeartbeat_Handler(srv interface{}, ctx context.Co
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/reportHeartbeat",
|
||||
FullMethod: ParticipantService_ReportHeartbeat_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ReportHeartbeat(ctx, req.(*ParticipantHeartbeatReq))
|
||||
|
@ -356,7 +372,7 @@ func _ParticipantService_ReportAvailable_Handler(srv interface{}, ctx context.Co
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/reportAvailable",
|
||||
FullMethod: ParticipantService_ReportAvailable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ReportAvailable(ctx, req.(*ParticipantAvailReq))
|
||||
|
@ -374,7 +390,7 @@ func _ParticipantService_ListParticipant_Handler(srv interface{}, ctx context.Co
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/listParticipant",
|
||||
FullMethod: ParticipantService_ListParticipant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ListParticipant(ctx, req.(*ParticipantTenant))
|
||||
|
@ -392,7 +408,7 @@ func _ParticipantService_ListPhyAvailable_Handler(srv interface{}, ctx context.C
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/listPhyAvailable",
|
||||
FullMethod: ParticipantService_ListPhyAvailable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ListPhyAvailable(ctx, req.(*ParticipantTenant))
|
||||
|
@ -410,7 +426,7 @@ func _ParticipantService_ListPhyInformation_Handler(srv interface{}, ctx context
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/listPhyInformation",
|
||||
FullMethod: ParticipantService_ListPhyInformation_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ListPhyInformation(ctx, req.(*ParticipantTenant))
|
||||
|
@ -428,7 +444,7 @@ func _ParticipantService_RegisterTenant_Handler(srv interface{}, ctx context.Con
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/registerTenant",
|
||||
FullMethod: ParticipantService_RegisterTenant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).RegisterTenant(ctx, req.(*TenantInfo))
|
||||
|
@ -446,7 +462,7 @@ func _ParticipantService_ListTenant_Handler(srv interface{}, ctx context.Context
|
|||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pcmCore.participantService/listTenant",
|
||||
FullMethod: ParticipantService_ListTenant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ParticipantServiceServer).ListTenant(ctx, req.(*TenantInfo))
|
||||
|
|
Loading…
Reference in New Issue