Merge remote-tracking branch 'origin/2.0' into 2.0

This commit is contained in:
tzwang 2023-04-21 09:12:00 +08:00
commit e7df99ca03
4 changed files with 304 additions and 197 deletions

View File

@ -59,77 +59,39 @@ func (*StorageScreenReq) Descriptor() ([]byte, []int) {
return file_pcm_ceph_proto_rawDescGZIP(), []int{0}
}
type StorageArg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TotalSize int32 `protobuf:"varint,1,opt,name=totalSize,proto3" json:"totalSize,omitempty"` // @gotags: copier:"totalSize"
AiCenterInfos []*AiCenterInfos `protobuf:"bytes,2,rep,name=aiCenterInfos,proto3" json:"aiCenterInfos,omitempty"` // @gotags: copier:"aiCenterInfos"
}
func (x *StorageArg) Reset() {
*x = StorageArg{}
if protoimpl.UnsafeEnabled {
mi := &file_pcm_ceph_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StorageArg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StorageArg) ProtoMessage() {}
func (x *StorageArg) ProtoReflect() protoreflect.Message {
mi := &file_pcm_ceph_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StorageArg.ProtoReflect.Descriptor instead.
func (*StorageArg) Descriptor() ([]byte, []int) {
return file_pcm_ceph_proto_rawDescGZIP(), []int{1}
}
func (x *StorageArg) GetTotalSize() int32 {
if x != nil {
return x.TotalSize
}
return 0
}
func (x *StorageArg) GetAiCenterInfos() []*AiCenterInfos {
if x != nil {
return x.AiCenterInfos
}
return nil
}
type AiCenterInfos struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StorageScale int32 `protobuf:"varint,1,opt,name=storageScale,proto3" json:"storageScale,omitempty"` // @gotags: copier:"storageScale"
ConnectionState int32 `protobuf:"varint,2,opt,name=connectionState,proto3" json:"connectionState,omitempty"` // @gotags: copier:"connectionState"
Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` // @gotags: copier:"id"
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // @gotags: copier:"name"
City string `protobuf:"bytes,5,opt,name=city,proto3" json:"city,omitempty"` // @gotags: copier:"city"
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // @gotags: copier:"id"
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // @gotags: copier:"name"
Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` // @gotags: copier:"name"
Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"`
TrainJob string `protobuf:"bytes,5,opt,name=trainJob,proto3" json:"trainJob,omitempty"`
ComputeScale int32 `protobuf:"varint,6,opt,name=computeScale,proto3" json:"computeScale,omitempty"`
StorageScale int32 `protobuf:"varint,7,opt,name=storageScale,proto3" json:"storageScale,omitempty"` // @gotags: copier:"storageScale"
Province string `protobuf:"bytes,8,opt,name=province,proto3" json:"province,omitempty"`
City string `protobuf:"bytes,9,opt,name=city,proto3" json:"city,omitempty"` // @gotags: copier:"city"
CoordinateX int32 `protobuf:"varint,10,opt,name=coordinateX,proto3" json:"coordinateX,omitempty"`
CoordinateY int32 `protobuf:"varint,11,opt,name=coordinateY,proto3" json:"coordinateY,omitempty"`
Type int32 `protobuf:"varint,12,opt,name=type,proto3" json:"type,omitempty"`
Weight int32 `protobuf:"varint,13,opt,name=weight,proto3" json:"weight,omitempty"`
ConnectionState int32 `protobuf:"varint,14,opt,name=connectionState,proto3" json:"connectionState,omitempty"` // @gotags: copier:"connectionState"
BusyState int32 `protobuf:"varint,15,opt,name=busyState,proto3" json:"busyState,omitempty"`
ImageUrl string `protobuf:"bytes,16,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"`
AccDevices string `protobuf:"bytes,17,opt,name=accDevices,proto3" json:"accDevices,omitempty"`
MarketTime int64 `protobuf:"varint,18,opt,name=marketTime,proto3" json:"marketTime,omitempty"`
CreatedAt int64 `protobuf:"varint,19,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
AccessTime int32 `protobuf:"varint,20,opt,name=accessTime,proto3" json:"accessTime,omitempty"`
CardRunTime int32 `protobuf:"varint,21,opt,name=cardRunTime,proto3" json:"cardRunTime,omitempty"`
JobCount int32 `protobuf:"varint,22,opt,name=jobCount,proto3" json:"jobCount,omitempty"`
}
func (x *AiCenterInfos) Reset() {
*x = AiCenterInfos{}
if protoimpl.UnsafeEnabled {
mi := &file_pcm_ceph_proto_msgTypes[2]
mi := &file_pcm_ceph_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -142,7 +104,7 @@ func (x *AiCenterInfos) String() string {
func (*AiCenterInfos) ProtoMessage() {}
func (x *AiCenterInfos) ProtoReflect() protoreflect.Message {
mi := &file_pcm_ceph_proto_msgTypes[2]
mi := &file_pcm_ceph_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -155,21 +117,7 @@ func (x *AiCenterInfos) ProtoReflect() protoreflect.Message {
// Deprecated: Use AiCenterInfos.ProtoReflect.Descriptor instead.
func (*AiCenterInfos) Descriptor() ([]byte, []int) {
return file_pcm_ceph_proto_rawDescGZIP(), []int{2}
}
func (x *AiCenterInfos) GetStorageScale() int32 {
if x != nil {
return x.StorageScale
}
return 0
}
func (x *AiCenterInfos) GetConnectionState() int32 {
if x != nil {
return x.ConnectionState
}
return 0
return file_pcm_ceph_proto_rawDescGZIP(), []int{1}
}
func (x *AiCenterInfos) GetId() string {
@ -186,6 +134,48 @@ func (x *AiCenterInfos) GetName() string {
return ""
}
func (x *AiCenterInfos) GetDesc() string {
if x != nil {
return x.Desc
}
return ""
}
func (x *AiCenterInfos) GetResource() string {
if x != nil {
return x.Resource
}
return ""
}
func (x *AiCenterInfos) GetTrainJob() string {
if x != nil {
return x.TrainJob
}
return ""
}
func (x *AiCenterInfos) GetComputeScale() int32 {
if x != nil {
return x.ComputeScale
}
return 0
}
func (x *AiCenterInfos) GetStorageScale() int32 {
if x != nil {
return x.StorageScale
}
return 0
}
func (x *AiCenterInfos) GetProvince() string {
if x != nil {
return x.Province
}
return ""
}
func (x *AiCenterInfos) GetCity() string {
if x != nil {
return x.City
@ -193,21 +183,113 @@ func (x *AiCenterInfos) GetCity() string {
return ""
}
func (x *AiCenterInfos) GetCoordinateX() int32 {
if x != nil {
return x.CoordinateX
}
return 0
}
func (x *AiCenterInfos) GetCoordinateY() int32 {
if x != nil {
return x.CoordinateY
}
return 0
}
func (x *AiCenterInfos) GetType() int32 {
if x != nil {
return x.Type
}
return 0
}
func (x *AiCenterInfos) GetWeight() int32 {
if x != nil {
return x.Weight
}
return 0
}
func (x *AiCenterInfos) GetConnectionState() int32 {
if x != nil {
return x.ConnectionState
}
return 0
}
func (x *AiCenterInfos) GetBusyState() int32 {
if x != nil {
return x.BusyState
}
return 0
}
func (x *AiCenterInfos) GetImageUrl() string {
if x != nil {
return x.ImageUrl
}
return ""
}
func (x *AiCenterInfos) GetAccDevices() string {
if x != nil {
return x.AccDevices
}
return ""
}
func (x *AiCenterInfos) GetMarketTime() int64 {
if x != nil {
return x.MarketTime
}
return 0
}
func (x *AiCenterInfos) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *AiCenterInfos) GetAccessTime() int32 {
if x != nil {
return x.AccessTime
}
return 0
}
func (x *AiCenterInfos) GetCardRunTime() int32 {
if x != nil {
return x.CardRunTime
}
return 0
}
func (x *AiCenterInfos) GetJobCount() int32 {
if x != nil {
return x.JobCount
}
return 0
}
type StorageScreenResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StorageArg *StorageArg `protobuf:"bytes,1,opt,name=storageArg,proto3" json:"storageArg,omitempty"` // @gotags: copier:"StorageArg"
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` // @gotags: copier:"Code"
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` // @gotags: copier:"Msg"
ErrorMsg string `protobuf:"bytes,4,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` // @gotags: copier:"ErrorMsg"
TotalSize int32 `protobuf:"varint,1,opt,name=totalSize,proto3" json:"totalSize,omitempty"` // @gotags: copier:"totalSize"
AiCenterInfos []*AiCenterInfos `protobuf:"bytes,2,rep,name=aiCenterInfos,proto3" json:"aiCenterInfos,omitempty"` // @gotags: copier:"aiCenterInfos"
Code int32 `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"` // @gotags: copier:"Code"
Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` // @gotags: copier:"Msg"
ErrorMsg string `protobuf:"bytes,5,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` // @gotags: copier:"ErrorMsg"
}
func (x *StorageScreenResp) Reset() {
*x = StorageScreenResp{}
if protoimpl.UnsafeEnabled {
mi := &file_pcm_ceph_proto_msgTypes[3]
mi := &file_pcm_ceph_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -220,7 +302,7 @@ func (x *StorageScreenResp) String() string {
func (*StorageScreenResp) ProtoMessage() {}
func (x *StorageScreenResp) ProtoReflect() protoreflect.Message {
mi := &file_pcm_ceph_proto_msgTypes[3]
mi := &file_pcm_ceph_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -233,12 +315,19 @@ func (x *StorageScreenResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use StorageScreenResp.ProtoReflect.Descriptor instead.
func (*StorageScreenResp) Descriptor() ([]byte, []int) {
return file_pcm_ceph_proto_rawDescGZIP(), []int{3}
return file_pcm_ceph_proto_rawDescGZIP(), []int{2}
}
func (x *StorageScreenResp) GetStorageArg() *StorageArg {
func (x *StorageScreenResp) GetTotalSize() int32 {
if x != nil {
return x.StorageArg
return x.TotalSize
}
return 0
}
func (x *StorageScreenResp) GetAiCenterInfos() []*AiCenterInfos {
if x != nil {
return x.AiCenterInfos
}
return nil
}
@ -269,39 +358,66 @@ var File_pcm_ceph_proto protoreflect.FileDescriptor
var file_pcm_ceph_proto_rawDesc = []byte{
0x0a, 0x0e, 0x70, 0x63, 0x6d, 0x2d, 0x63, 0x65, 0x70, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x74,
0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x69,
0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x72, 0x67, 0x12, 0x1c, 0x0a, 0x09,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x61, 0x69,
0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x69, 0x43,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x0d, 0x61, 0x69, 0x43, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0d, 0x41, 0x69,
0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73,
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12,
0x28, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61,
0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74,
0x79, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72,
0x65, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61,
0x67, 0x65, 0x41, 0x72, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x72,
0x67, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x72, 0x67, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6d, 0x73, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67,
0x32, 0x50, 0x0a, 0x04, 0x43, 0x65, 0x70, 0x68, 0x12, 0x48, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72,
0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65,
0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x63, 0x65, 0x70, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x87,
0x05, 0x0a, 0x0d, 0x41, 0x69, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x4a, 0x6f, 0x62,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x4a, 0x6f, 0x62,
0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x53,
0x63, 0x61, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53,
0x63, 0x61, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72,
0x61, 0x67, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76,
0x69, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76,
0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6f, 0x72,
0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x58, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63,
0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x58, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f,
0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x59, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0b, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x59, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x75, 0x73, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18,
0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x75, 0x73, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1e, 0x0a, 0x0a,
0x61, 0x63, 0x63, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0a, 0x61, 0x63, 0x63, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a,
0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52,
0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61,
0x72, 0x64, 0x52, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0b, 0x63, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x6a, 0x6f, 0x62, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x6a, 0x6f, 0x62, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb3, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x6f,
0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c,
0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3d, 0x0a, 0x0d,
0x61, 0x69, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41,
0x69, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x0d, 0x61, 0x69,
0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
0x67, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x32, 0x50,
0x0a, 0x04, 0x43, 0x65, 0x70, 0x68, 0x12, 0x48, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e,
0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x53,
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70,
0x42, 0x07, 0x5a, 0x05, 0x2f, 0x63, 0x65, 0x70, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -316,23 +432,21 @@ func file_pcm_ceph_proto_rawDescGZIP() []byte {
return file_pcm_ceph_proto_rawDescData
}
var file_pcm_ceph_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_pcm_ceph_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_pcm_ceph_proto_goTypes = []interface{}{
(*StorageScreenReq)(nil), // 0: template.StorageScreenReq
(*StorageArg)(nil), // 1: template.StorageArg
(*AiCenterInfos)(nil), // 2: template.AiCenterInfos
(*StorageScreenResp)(nil), // 3: template.StorageScreenResp
(*AiCenterInfos)(nil), // 1: template.AiCenterInfos
(*StorageScreenResp)(nil), // 2: template.StorageScreenResp
}
var file_pcm_ceph_proto_depIdxs = []int32{
2, // 0: template.StorageArg.aiCenterInfos:type_name -> template.AiCenterInfos
1, // 1: template.StorageScreenResp.storageArg:type_name -> template.StorageArg
0, // 2: template.Ceph.storageScreen:input_type -> template.StorageScreenReq
3, // 3: template.Ceph.storageScreen:output_type -> template.StorageScreenResp
3, // [3:4] is the sub-list for method output_type
2, // [2:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
1, // 0: template.StorageScreenResp.aiCenterInfos:type_name -> template.AiCenterInfos
0, // 1: template.Ceph.storageScreen:input_type -> template.StorageScreenReq
2, // 2: template.Ceph.storageScreen:output_type -> template.StorageScreenResp
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_pcm_ceph_proto_init() }
@ -354,18 +468,6 @@ func file_pcm_ceph_proto_init() {
}
}
file_pcm_ceph_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StorageArg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pcm_ceph_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AiCenterInfos); i {
case 0:
return &v.state
@ -377,7 +479,7 @@ func file_pcm_ceph_proto_init() {
return nil
}
}
file_pcm_ceph_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_pcm_ceph_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StorageScreenResp); i {
case 0:
return &v.state
@ -396,7 +498,7 @@ func file_pcm_ceph_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pcm_ceph_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -14,7 +14,6 @@ import (
type (
AiCenterInfos = ceph.AiCenterInfos
StorageArg = ceph.StorageArg
StorageScreenReq = ceph.StorageScreenReq
StorageScreenResp = ceph.StorageScreenResp

View File

@ -4,7 +4,6 @@ import (
"PCM/adaptor/PCM-STORAGE/PCM-CEPH/rpc/internal/config"
"PCM/common/tool"
"context"
"fmt"
"k8s.io/apimachinery/pkg/util/json"
"strings"
@ -20,34 +19,34 @@ type StorageScreenLogic struct {
logx.Logger
}
type StorageArg struct {
totalSize int32
aiCenterInfos []AiCenterInfos
/*type StorageArg struct {
totalSize int32 `json:"totalSize"`
aiCenterInfos []AiCenterInfos `json:"aiCenterInfos"`
}
type AiCenterInfos struct {
id string
name string
desc string
resource string
trainJob string
computeScale int32
storageScale int32
province string
city string
coordinateX int32
coordinateY int32
weight int32
connectionState int32
busyState int32
imageUrl string
accDevices string
marketTime int64
createdAt int64
accessTime int32
cardRunTime int32
jobCount int32
}
id string `json:"id"`
name string `json:"name"`
/* desc string
resource string
trainJob string
computeScale int32
storageScale int32 `json:"storageScale"`
/* province string
city string
coordinateX int32
coordinateY int32
weight int32
connectionState int32
busyState int32
imageUrl string
accDevices string
marketTime int64
createdAt int64
accessTime int32
cardRunTime int32
jobCount int32
}*/
func NewStorageScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StorageScreenLogic {
return &StorageScreenLogic{
@ -61,7 +60,7 @@ func NewStorageScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sto
func (l *StorageScreenLogic) StorageScreen(in *ceph.StorageScreenReq) (*ceph.StorageScreenResp, error) {
// todo: add your logic here and delete this line
var resp ceph.StorageScreenResp
var storageArg StorageArg
//var storageArg StorageArg
screenConfig := config.Cfg
screenUrl := screenConfig.ScreenConfig.ScreenUrl
statusCode, body, err := tool.HttpClientWithScreen(tool.GET, screenUrl+"aicenter?sortBy=weight&orderBy=asc", strings.NewReader(``))
@ -69,15 +68,7 @@ func (l *StorageScreenLogic) StorageScreen(in *ceph.StorageScreenReq) (*ceph.Sto
return nil, err
}
if statusCode == 200 {
err := json.Unmarshal([]byte(body), &storageArg)
if err == nil {
fmt.Println(storageArg.totalSize)
fmt.Println(storageArg.aiCenterInfos)
} else {
fmt.Println(storageArg.aiCenterInfos)
}
//json.Unmarshal(body, &resp)
json.Unmarshal(body, &resp)
resp.Code = 200
resp.Msg = "Success"
} else if statusCode != 200 {
@ -85,5 +76,5 @@ func (l *StorageScreenLogic) StorageScreen(in *ceph.StorageScreenReq) (*ceph.Sto
resp.Code = 400
resp.Msg = "Failure"
}
return &ceph.StorageScreenResp{}, nil
return &resp, nil
}

View File

@ -8,24 +8,39 @@ message StorageScreenReq{
}
message StorageArg{
int32 totalSize = 1; // @gotags: copier:"totalSize"
repeated AiCenterInfos aiCenterInfos = 2; // @gotags: copier:"aiCenterInfos"
}
message AiCenterInfos{
int32 storageScale = 1; // @gotags: copier:"storageScale"
int32 connectionState = 2; // @gotags: copier:"connectionState"
string id = 3; // @gotags: copier:"id"
string name = 4; // @gotags: copier:"name"
string city = 5 ; // @gotags: copier:"city"
string id = 1; // @gotags: copier:"id"
string name = 2; // @gotags: copier:"name"
string desc = 3; // @gotags: copier:"name"
string resource = 4;
string trainJob = 5;
int32 computeScale = 6;
int32 storageScale = 7; // @gotags: copier:"storageScale"
string province =8;
string city = 9 ; // @gotags: copier:"city"
int32 coordinateX =10;
int32 coordinateY =11;
int32 type =12;
int32 weight =13;
int32 connectionState = 14; // @gotags: copier:"connectionState"
int32 busyState =15;
string imageUrl =16;
string accDevices =17;
int64 marketTime =18;
int64 createdAt =19;
int32 accessTime =20;
int32 cardRunTime =21;
int32 jobCount=22;
}
message StorageScreenResp{
StorageArg storageArg =1; // @gotags: copier:"StorageArg"
int32 code = 2; // @gotags: copier:"Code"
string msg = 3; // @gotags: copier:"Msg"
string error_msg =4;// @gotags: copier:"ErrorMsg"
int32 totalSize = 1; // @gotags: copier:"totalSize"
repeated AiCenterInfos aiCenterInfos = 2; // @gotags: copier:"aiCenterInfos"
int32 code = 3; // @gotags: copier:"Code"
string msg = 4; // @gotags: copier:"Msg"
string error_msg =5;// @gotags: copier:"ErrorMsg"
}
service Ceph {