cloud app重启接口实现

Signed-off-by: devad <cossjie@foxmail.com>
This commit is contained in:
devad 2024-01-03 12:51:18 +08:00
parent a899d04925
commit ab602b43a6
12 changed files with 235 additions and 92 deletions

View File

@ -661,4 +661,10 @@ type (
Msg string `json:"msg,omitempty"`
Data interface{} `json:"data,omitempty"`
}
AppResp {
Code int `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Data interface{} `json:"data,omitempty"`
}
)

View File

@ -557,7 +557,7 @@ service pcm {
@doc "重启应用"
@handler RestartAppByAppName
put /apps/restartApp (DeleteAppReq) returns (AppTaskResp)
put /apps/restartApp (DeleteAppReq) returns (AppResp)
@doc "暂停应用"
@handler PauseAppByAppName

View File

@ -34,7 +34,7 @@ func (l *DeleteAppByAppNameLogic) DeleteAppByAppName(req *types.DeleteAppReq) (r
return resp, err
}
//删除主任务信息
l.svcCtx.DbEngin.Model(&models.Task{}).Where("id", task.Id).Update("status", "Deleted")
l.svcCtx.DbEngin.Model(&models.Task{}).Where("id", task.Id).Update("status", constants.Deleted)
tx := l.svcCtx.DbEngin.Delete(&models.Task{}, task.Id)
if tx.Error != nil {
return nil, tx.Error

View File

@ -2,6 +2,8 @@ package apps
import (
"context"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/constants"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
@ -23,8 +25,17 @@ func NewRestartAppByAppNameLogic(ctx context.Context, svcCtx *svc.ServiceContext
}
}
func (l *RestartAppByAppNameLogic) RestartAppByAppName(req *types.DeleteAppReq) (resp *types.AppTaskResp, err error) {
// todo: add your logic here and delete this line
func (l *RestartAppByAppNameLogic) RestartAppByAppName(req *types.DeleteAppReq) (resp *types.AppResp, err error) {
resp = &types.AppResp{}
var task = &Task{}
//查询应用的yamlString
l.svcCtx.DbEngin.Raw(`select * from task where ns_id= ? and name= ? `, req.NsID, req.Name).Scan(&task)
if task.Id == 0 {
resp.Code = 500
resp.Msg = "App not fount"
return resp, err
}
// 将子任务状态修改为待重启
l.svcCtx.DbEngin.Model(&models.Cloud{}).Where("task_id", task.Id).Update("status", constants.WaitRestart)
return
}

View File

@ -623,6 +623,12 @@ type DeleteAppResp struct {
Data interface{} `json:"data,omitempty"`
}
type AppResp struct {
Code int `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Data interface{} `json:"data,omitempty"`
}
type Job struct {
SlurmVersion string `json:"slurmVersion"`
Name string `json:"name"`

View File

@ -16,11 +16,12 @@ package constants
// 任务状态类型
const (
Saved = "Saved"
Running = "Running"
WaitDelete = "WaitDelete"
Deleted = "Deleted"
Completed = "Completed"
Succeeded = "Succeeded"
Failed = "Failed"
Saved = "Saved"
Running = "Running"
WaitDelete = "WaitDelete"
Deleted = "Deleted"
Completed = "Completed"
Succeeded = "Succeeded"
Failed = "Failed"
WaitRestart = "WaitRestart"
)

View File

@ -64,6 +64,8 @@ type (
ApplyList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
// DeleteList 删除任务列表
DeleteList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
// RestartList 重启任务列表
RestartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
}
defaultParticipantService struct {
@ -136,3 +138,9 @@ func (m *defaultParticipantService) DeleteList(ctx context.Context, in *ApplyLis
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
return client.DeleteList(ctx, in, opts...)
}
// RestartList 重启任务列表
func (m *defaultParticipantService) RestartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
return client.RestartList(ctx, in, opts...)
}

View File

@ -0,0 +1,36 @@
package participantservicelogic
import (
"context"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
"github.com/zeromicro/go-zero/core/logx"
)
type RestartListLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewRestartListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RestartListLogic {
return &RestartListLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// RestartList 重启任务列表
func (l *RestartListLogic) RestartList(in *pcmCore.ApplyListReq) (*pcmCore.ApplyListResp, error) {
result := pcmCore.ApplyListResp{
InfoList: make([]*pcmCore.ApplyInfo, 0),
}
l.svcCtx.DbEngin.Raw("SELECT sppi.`name` as ParticipantName, c.ns_id as namespace,c.name as name FROM cloud c,sc_participant_phy_info sppi where c.`status` = 'WaitRestart' and sppi.id = c.participant_id").Scan(&result.InfoList)
if len(result.InfoList) != 0 {
l.svcCtx.DbEngin.Exec("update cloud set status = ? where status = ?", "Issued", "WaitRestart")
}
return &result, nil
}

View File

@ -81,3 +81,9 @@ func (s *ParticipantServiceServer) DeleteList(ctx context.Context, in *pcmCore.A
l := participantservicelogic.NewDeleteListLogic(ctx, s.svcCtx)
return l.DeleteList(in)
}
// RestartList 重启任务列表
func (s *ParticipantServiceServer) RestartList(ctx context.Context, in *pcmCore.ApplyListReq) (*pcmCore.ApplyListResp, error) {
l := participantservicelogic.NewRestartListLogic(ctx, s.svcCtx)
return l.RestartList(in)
}

View File

@ -295,6 +295,8 @@ message ApplyListResp{
message ApplyInfo{
string participantName = 1;
string yamlString = 2;
string namespace =3;
string name =4;
}
// participant
@ -329,4 +331,7 @@ service participantService {
// DeleteList
rpc deleteList(ApplyListReq) returns (ApplyListResp) {};
// RestartList
rpc restartList(ApplyListReq) returns (ApplyListResp) {};
}

View File

@ -2601,6 +2601,8 @@ type ApplyInfo struct {
ParticipantName string `protobuf:"bytes,1,opt,name=participantName,proto3" json:"participantName,omitempty"`
YamlString string `protobuf:"bytes,2,opt,name=yamlString,proto3" json:"yamlString,omitempty"`
Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *ApplyInfo) Reset() {
@ -2649,6 +2651,20 @@ func (x *ApplyInfo) GetYamlString() string {
return ""
}
func (x *ApplyInfo) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *ApplyInfo) GetName() string {
if x != nil {
return x.Name
}
return ""
}
var File_pb_pcmCore_proto protoreflect.FileDescriptor
var file_pb_pcmCore_proto_rawDesc = []byte{
@ -3028,73 +3044,80 @@ var file_pb_pcmCore_proto_rawDesc = []byte{
0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a,
0x08, 0x69, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x55, 0x0a,
0x09, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x53, 0x74, 0x72, 0x69,
0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x53, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x2a, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x00, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,
0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x7b, 0x0a, 0x07, 0x70, 0x63, 0x6d,
0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a,
0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43,
0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a,
0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0xf9, 0x05, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x74, 0x69,
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a,
0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x71,
0x1a, 0x1b, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12,
0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65,
0x61, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61,
0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x48,
0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00,
0x12, 0x4b, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61,
0x62, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x52, 0x65,
0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x50, 0x0a,
0x0f, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x1f, 0x2e, 0x70,
0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12,
0x53, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x79, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61,
0x62, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
0x6e, 0x66, 0x6f, 0x52, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x87, 0x01,
0x0a, 0x09, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x70,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x53, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x53,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c,
0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12,
0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x7b, 0x0a, 0x07,
0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79,
0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43,
0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x12, 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x70,
0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66,
0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0xb9, 0x06, 0x0a, 0x12, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x50, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72,
0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79,
0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70,
0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x72,
0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e,
0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74,
0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72,
0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x76, 0x61,
0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69,
0x6c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00,
0x12, 0x50, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a,
0x21, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x52, 0x65,
0x73, 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x12, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x79, 0x49,
0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d,
0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0e, 0x72, 0x65, 0x67,
0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x63,
0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f,
0x1a, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e,
0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x54,
0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e,
0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x17, 0x2e, 0x70, 0x63, 0x6d,
0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52,
0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69,
0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70,
0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x63, 0x6d, 0x43,
0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c,
0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f,
0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x1f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63,
0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70,
0x22, 0x00, 0x12, 0x53, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x79, 0x41, 0x76, 0x61,
0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61,
0x6e, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69,
0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x12, 0x6c, 0x69, 0x73, 0x74, 0x50,
0x68, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x2e,
0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x63, 0x6d, 0x43,
0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0e,
0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x13,
0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49,
0x6e, 0x66, 0x6f, 0x1a, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65,
0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, 0x6c, 0x69,
0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f,
0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x17, 0x2e,
0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61,
0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x6c,
0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e,
0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70,
0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41,
0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x63,
0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41,
0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x63,
0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72,
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -3173,20 +3196,22 @@ var file_pb_pcmCore_proto_depIdxs = []int32{
24, // 26: pcmCore.participantService.listTenant:input_type -> pcmCore.TenantInfo
27, // 27: pcmCore.participantService.applyList:input_type -> pcmCore.ApplyListReq
27, // 28: pcmCore.participantService.deleteList:input_type -> pcmCore.ApplyListReq
6, // 29: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp
8, // 30: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp
12, // 31: pcmCore.participantService.registerParticipant:output_type -> pcmCore.ParticipantPhyResp
11, // 32: pcmCore.participantService.reportHeartbeat:output_type -> pcmCore.HealthCheckResp
21, // 33: pcmCore.participantService.reportAvailable:output_type -> pcmCore.ParticipantResp
22, // 34: pcmCore.participantService.listParticipant:output_type -> pcmCore.ParticipantServiceResp
20, // 35: pcmCore.participantService.listPhyAvailable:output_type -> pcmCore.ListParticipantAvailResp
13, // 36: pcmCore.participantService.listPhyInformation:output_type -> pcmCore.ListParticipantPhyResp
25, // 37: pcmCore.participantService.registerTenant:output_type -> pcmCore.TenantResp
26, // 38: pcmCore.participantService.listTenant:output_type -> pcmCore.ListTenantResp
28, // 39: pcmCore.participantService.applyList:output_type -> pcmCore.ApplyListResp
28, // 40: pcmCore.participantService.deleteList:output_type -> pcmCore.ApplyListResp
29, // [29:41] is the sub-list for method output_type
17, // [17:29] is the sub-list for method input_type
27, // 29: pcmCore.participantService.restartList:input_type -> pcmCore.ApplyListReq
6, // 30: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp
8, // 31: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp
12, // 32: pcmCore.participantService.registerParticipant:output_type -> pcmCore.ParticipantPhyResp
11, // 33: pcmCore.participantService.reportHeartbeat:output_type -> pcmCore.HealthCheckResp
21, // 34: pcmCore.participantService.reportAvailable:output_type -> pcmCore.ParticipantResp
22, // 35: pcmCore.participantService.listParticipant:output_type -> pcmCore.ParticipantServiceResp
20, // 36: pcmCore.participantService.listPhyAvailable:output_type -> pcmCore.ListParticipantAvailResp
13, // 37: pcmCore.participantService.listPhyInformation:output_type -> pcmCore.ListParticipantPhyResp
25, // 38: pcmCore.participantService.registerTenant:output_type -> pcmCore.TenantResp
26, // 39: pcmCore.participantService.listTenant:output_type -> pcmCore.ListTenantResp
28, // 40: pcmCore.participantService.applyList:output_type -> pcmCore.ApplyListResp
28, // 41: pcmCore.participantService.deleteList:output_type -> pcmCore.ApplyListResp
28, // 42: pcmCore.participantService.restartList:output_type -> pcmCore.ApplyListResp
30, // [30:43] is the sub-list for method output_type
17, // [17:30] is the sub-list for method input_type
17, // [17:17] is the sub-list for extension type_name
17, // [17:17] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name

View File

@ -160,6 +160,7 @@ const (
ParticipantService_ListTenant_FullMethodName = "/pcmCore.participantService/listTenant"
ParticipantService_ApplyList_FullMethodName = "/pcmCore.participantService/applyList"
ParticipantService_DeleteList_FullMethodName = "/pcmCore.participantService/deleteList"
ParticipantService_RestartList_FullMethodName = "/pcmCore.participantService/restartList"
)
// ParticipantServiceClient is the client API for ParticipantService service.
@ -186,6 +187,8 @@ type ParticipantServiceClient interface {
ApplyList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
// DeleteList 删除任务列表
DeleteList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
// RestartList 重启任务列表
RestartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
}
type participantServiceClient struct {
@ -286,6 +289,15 @@ func (c *participantServiceClient) DeleteList(ctx context.Context, in *ApplyList
return out, nil
}
func (c *participantServiceClient) RestartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
out := new(ApplyListResp)
err := c.cc.Invoke(ctx, ParticipantService_RestartList_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ParticipantServiceServer is the server API for ParticipantService service.
// All implementations must embed UnimplementedParticipantServiceServer
// for forward compatibility
@ -310,6 +322,8 @@ type ParticipantServiceServer interface {
ApplyList(context.Context, *ApplyListReq) (*ApplyListResp, error)
// DeleteList 删除任务列表
DeleteList(context.Context, *ApplyListReq) (*ApplyListResp, error)
// RestartList 重启任务列表
RestartList(context.Context, *ApplyListReq) (*ApplyListResp, error)
mustEmbedUnimplementedParticipantServiceServer()
}
@ -347,6 +361,9 @@ func (UnimplementedParticipantServiceServer) ApplyList(context.Context, *ApplyLi
func (UnimplementedParticipantServiceServer) DeleteList(context.Context, *ApplyListReq) (*ApplyListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteList not implemented")
}
func (UnimplementedParticipantServiceServer) RestartList(context.Context, *ApplyListReq) (*ApplyListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method RestartList not implemented")
}
func (UnimplementedParticipantServiceServer) mustEmbedUnimplementedParticipantServiceServer() {}
// UnsafeParticipantServiceServer may be embedded to opt out of forward compatibility for this service.
@ -540,6 +557,24 @@ func _ParticipantService_DeleteList_Handler(srv interface{}, ctx context.Context
return interceptor(ctx, in, info, handler)
}
func _ParticipantService_RestartList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ApplyListReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantServiceServer).RestartList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_RestartList_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).RestartList(ctx, req.(*ApplyListReq))
}
return interceptor(ctx, in, info, handler)
}
// ParticipantService_ServiceDesc is the grpc.ServiceDesc for ParticipantService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -587,6 +622,10 @@ var ParticipantService_ServiceDesc = grpc.ServiceDesc{
MethodName: "deleteList",
Handler: _ParticipantService_DeleteList_Handler,
},
{
MethodName: "restartList",
Handler: _ParticipantService_RestartList_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pb/pcmCore.proto",