forked from JointCloud/pcm-coordinator
163 lines
7.5 KiB
Go
163 lines
7.5 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// Source: pcmCore.proto
|
|
|
|
package participantservice
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type (
|
|
AiInfo = pcmCore.AiInfo
|
|
ApplyInfo = pcmCore.ApplyInfo
|
|
ApplyListReq = pcmCore.ApplyListReq
|
|
ApplyListResp = pcmCore.ApplyListResp
|
|
ClientInfo = pcmCore.ClientInfo
|
|
CloudInfo = pcmCore.CloudInfo
|
|
HealthCheckResp = pcmCore.HealthCheckResp
|
|
HpcInfo = pcmCore.HpcInfo
|
|
InfoListReq = pcmCore.InfoListReq
|
|
InfoListResp = pcmCore.InfoListResp
|
|
ListParticipantAvailResp = pcmCore.ListParticipantAvailResp
|
|
ListParticipantPhyResp = pcmCore.ListParticipantPhyResp
|
|
ListTenantResp = pcmCore.ListTenantResp
|
|
NodeAvailInfo = pcmCore.NodeAvailInfo
|
|
NodePhyInfo = pcmCore.NodePhyInfo
|
|
ParticipantAvailReq = pcmCore.ParticipantAvailReq
|
|
ParticipantHeartbeatReq = pcmCore.ParticipantHeartbeatReq
|
|
ParticipantLabel = pcmCore.ParticipantLabel
|
|
ParticipantPhyReq = pcmCore.ParticipantPhyReq
|
|
ParticipantPhyResp = pcmCore.ParticipantPhyResp
|
|
ParticipantResp = pcmCore.ParticipantResp
|
|
ParticipantServiceResp = pcmCore.ParticipantServiceResp
|
|
ParticipantTenant = pcmCore.ParticipantTenant
|
|
QueuePhyInfo = pcmCore.QueuePhyInfo
|
|
SyncInfoReq = pcmCore.SyncInfoReq
|
|
SyncInfoResp = pcmCore.SyncInfoResp
|
|
TenantInfo = pcmCore.TenantInfo
|
|
TenantResp = pcmCore.TenantResp
|
|
VmInfo = pcmCore.VmInfo
|
|
|
|
ParticipantService interface {
|
|
// registerParticipant Participant注册接口
|
|
RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error)
|
|
// reportHeartbeat 心跳请求
|
|
ReportHeartbeat(ctx context.Context, in *ParticipantHeartbeatReq, opts ...grpc.CallOption) (*HealthCheckResp, error)
|
|
// reportAvailable 监控数据上报
|
|
ReportAvailable(ctx context.Context, in *ParticipantAvailReq, opts ...grpc.CallOption) (*ParticipantResp, error)
|
|
// listParticipant 服务列表
|
|
ListParticipant(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ParticipantServiceResp, error)
|
|
// listAvailable 集群动态信息列表
|
|
ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error)
|
|
// listPhyInformation 集群静态信息列表
|
|
ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error)
|
|
// registerTenant 注册租户信息
|
|
RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error)
|
|
// listTenant 租户列表信息
|
|
ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error)
|
|
// applyList 执行任务列表
|
|
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)
|
|
// PauseList 暂停任务列表
|
|
PauseList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
|
|
// StartList 暂停任务列表
|
|
StartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error)
|
|
}
|
|
|
|
defaultParticipantService struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewParticipantService(cli zrpc.Client) ParticipantService {
|
|
return &defaultParticipantService{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
// registerParticipant Participant注册接口
|
|
func (m *defaultParticipantService) RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.RegisterParticipant(ctx, in, opts...)
|
|
}
|
|
|
|
// reportHeartbeat 心跳请求
|
|
func (m *defaultParticipantService) ReportHeartbeat(ctx context.Context, in *ParticipantHeartbeatReq, opts ...grpc.CallOption) (*HealthCheckResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ReportHeartbeat(ctx, in, opts...)
|
|
}
|
|
|
|
// reportAvailable 监控数据上报
|
|
func (m *defaultParticipantService) ReportAvailable(ctx context.Context, in *ParticipantAvailReq, opts ...grpc.CallOption) (*ParticipantResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ReportAvailable(ctx, in, opts...)
|
|
}
|
|
|
|
// listParticipant 服务列表
|
|
func (m *defaultParticipantService) ListParticipant(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ParticipantServiceResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ListParticipant(ctx, in, opts...)
|
|
}
|
|
|
|
// listAvailable 集群动态信息列表
|
|
func (m *defaultParticipantService) ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ListPhyAvailable(ctx, in, opts...)
|
|
}
|
|
|
|
// listPhyInformation 集群静态信息列表
|
|
func (m *defaultParticipantService) ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ListPhyInformation(ctx, in, opts...)
|
|
}
|
|
|
|
// registerTenant 注册租户信息
|
|
func (m *defaultParticipantService) RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.RegisterTenant(ctx, in, opts...)
|
|
}
|
|
|
|
// listTenant 租户列表信息
|
|
func (m *defaultParticipantService) ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ListTenant(ctx, in, opts...)
|
|
}
|
|
|
|
// applyList 执行任务列表
|
|
func (m *defaultParticipantService) ApplyList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.ApplyList(ctx, in, opts...)
|
|
}
|
|
|
|
// DeleteList 删除任务列表
|
|
func (m *defaultParticipantService) DeleteList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
|
|
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...)
|
|
}
|
|
|
|
// PauseList 暂停任务列表
|
|
func (m *defaultParticipantService) PauseList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.PauseList(ctx, in, opts...)
|
|
}
|
|
|
|
// StartList 暂停任务列表
|
|
func (m *defaultParticipantService) StartList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListResp, error) {
|
|
client := pcmCore.NewParticipantServiceClient(m.cli.Conn())
|
|
return client.StartList(ctx, in, opts...)
|
|
}
|