From 48f51465f77ea3ec97f7994c33e54f11e3e4ca1c Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 16 Oct 2023 09:48:53 -0400 Subject: [PATCH] Either go through gRPC gateway or use prisma --- docker-compose.yml | 1 - flow/cmd/handler.go | 90 --- flow/generated/protos/route.pb.go | 609 +++++++----------- flow/generated/protos/route.pb.gw.go | 255 ++++++++ flow/generated/protos/route_grpc.pb.go | 37 -- nexus/pt/src/peerdb_route.rs | 10 - nexus/pt/src/peerdb_route.serde.rs | 167 ----- nexus/pt/src/peerdb_route.tonic.rs | 78 --- protos/route.proto | 29 +- ui/app/api/mirrors/cdc/route.ts | 26 +- ui/app/api/peers/route.ts | 56 +- ui/app/dto/MirrorsDTO.ts | 3 + ui/app/dto/PeersDTO.ts | 9 + ui/app/mirrors/create/handlers.ts | 15 +- ui/app/mirrors/create/page.tsx | 9 +- ui/app/mirrors/edit/[mirrorId]/page.tsx | 2 +- ui/app/mirrors/page.tsx | 4 +- ui/app/peers/create/configuration/handlers.ts | 22 +- ui/app/peers/handler.ts | 8 - ui/app/peers/page.tsx | 13 +- ui/app/utils/prisma.ts | 5 + ui/grpc_generated/route.ts | 132 ---- ui/rpc/http.ts | 2 + ui/rpc/promisify.ts | 53 -- ui/rpc/rpc.ts | 13 - 25 files changed, 624 insertions(+), 1024 deletions(-) create mode 100644 ui/app/dto/MirrorsDTO.ts create mode 100644 ui/app/dto/PeersDTO.ts delete mode 100644 ui/app/peers/handler.ts create mode 100644 ui/app/utils/prisma.ts delete mode 100644 ui/rpc/promisify.ts delete mode 100644 ui/rpc/rpc.ts diff --git a/docker-compose.yml b/docker-compose.yml index e3a5cefaab..8a6f59ca3e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -232,7 +232,6 @@ services: - 3001:3000 environment: <<: *catalog-config - PEERDB_FLOW_SERVER_ADDRESS: flow_api:8112 DATABASE_URL: postgres://postgres:postgres@catalog:5432/postgres PEERDB_FLOW_SERVER_HTTP: http://flow_api:8113 diff --git a/flow/cmd/handler.go b/flow/cmd/handler.go index 1252fb844a..708f739867 100644 --- a/flow/cmd/handler.go +++ b/flow/cmd/handler.go @@ -346,96 +346,6 @@ func (h *FlowRequestHandler) handleWorkflowNotClosed(ctx context.Context, workfl return nil } -func (h *FlowRequestHandler) ListPeers( - ctx context.Context, - req *protos.ListPeersRequest, -) (*protos.ListPeersResponse, error) { - rows, err := h.pool.Query(ctx, "SELECT * FROM peers") - if err != nil { - return nil, fmt.Errorf("unable to query peers: %w", err) - } - defer rows.Close() - - peers := []*protos.Peer{} - for rows.Next() { - var id int - var name string - var peerType int - var options []byte - if err := rows.Scan(&id, &name, &peerType, &options); err != nil { - return nil, fmt.Errorf("unable to scan peer row: %w", err) - } - - dbtype := protos.DBType(peerType) - var peer *protos.Peer - switch dbtype { - case protos.DBType_POSTGRES: - var pgOptions protos.PostgresConfig - err := proto.Unmarshal(options, &pgOptions) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal postgres options: %w", err) - } - peer = &protos.Peer{ - Name: name, - Type: dbtype, - Config: &protos.Peer_PostgresConfig{PostgresConfig: &pgOptions}, - } - case protos.DBType_BIGQUERY: - var bqOptions protos.BigqueryConfig - err := proto.Unmarshal(options, &bqOptions) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal bigquery options: %w", err) - } - peer = &protos.Peer{ - Name: name, - Type: dbtype, - Config: &protos.Peer_BigqueryConfig{BigqueryConfig: &bqOptions}, - } - case protos.DBType_SNOWFLAKE: - var sfOptions protos.SnowflakeConfig - err := proto.Unmarshal(options, &sfOptions) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal snowflake options: %w", err) - } - peer = &protos.Peer{ - Name: name, - Type: dbtype, - Config: &protos.Peer_SnowflakeConfig{SnowflakeConfig: &sfOptions}, - } - case protos.DBType_EVENTHUB: - var ehOptions protos.EventHubConfig - err := proto.Unmarshal(options, &ehOptions) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal eventhub options: %w", err) - } - peer = &protos.Peer{ - Name: name, - Type: dbtype, - Config: &protos.Peer_EventhubConfig{EventhubConfig: &ehOptions}, - } - case protos.DBType_SQLSERVER: - var ssOptions protos.SqlServerConfig - err := proto.Unmarshal(options, &ssOptions) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal sqlserver options: %w", err) - } - peer = &protos.Peer{ - Name: name, - Type: dbtype, - Config: &protos.Peer_SqlserverConfig{SqlserverConfig: &ssOptions}, - } - default: - log.Errorf("unsupported peer type for peer '%s': %v", name, dbtype) - } - - peers = append(peers, peer) - } - - return &protos.ListPeersResponse{ - Peers: peers, - }, nil -} - func (h *FlowRequestHandler) ValidatePeer( ctx context.Context, req *protos.ValidatePeerRequest, diff --git a/flow/generated/protos/route.pb.go b/flow/generated/protos/route.pb.go index f3c6b2dbfd..460f8d18a4 100644 --- a/flow/generated/protos/route.pb.go +++ b/flow/generated/protos/route.pb.go @@ -442,91 +442,6 @@ func (x *ShutdownResponse) GetErrorMessage() string { return "" } -type ListPeersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListPeersRequest) Reset() { - *x = ListPeersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPeersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPeersRequest) ProtoMessage() {} - -func (x *ListPeersRequest) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[6] - 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 ListPeersRequest.ProtoReflect.Descriptor instead. -func (*ListPeersRequest) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{6} -} - -type ListPeersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` -} - -func (x *ListPeersResponse) Reset() { - *x = ListPeersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPeersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPeersResponse) ProtoMessage() {} - -func (x *ListPeersResponse) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[7] - 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 ListPeersResponse.ProtoReflect.Descriptor instead. -func (*ListPeersResponse) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{7} -} - -func (x *ListPeersResponse) GetPeers() []*Peer { - if x != nil { - return x.Peers - } - return nil -} - type ValidatePeerRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -538,7 +453,7 @@ type ValidatePeerRequest struct { func (x *ValidatePeerRequest) Reset() { *x = ValidatePeerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[8] + mi := &file_route_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +466,7 @@ func (x *ValidatePeerRequest) String() string { func (*ValidatePeerRequest) ProtoMessage() {} func (x *ValidatePeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[8] + mi := &file_route_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,7 +479,7 @@ func (x *ValidatePeerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatePeerRequest.ProtoReflect.Descriptor instead. func (*ValidatePeerRequest) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{8} + return file_route_proto_rawDescGZIP(), []int{6} } func (x *ValidatePeerRequest) GetPeer() *Peer { @@ -585,7 +500,7 @@ type CreatePeerRequest struct { func (x *CreatePeerRequest) Reset() { *x = CreatePeerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[9] + mi := &file_route_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -598,7 +513,7 @@ func (x *CreatePeerRequest) String() string { func (*CreatePeerRequest) ProtoMessage() {} func (x *CreatePeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[9] + mi := &file_route_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -611,7 +526,7 @@ func (x *CreatePeerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePeerRequest.ProtoReflect.Descriptor instead. func (*CreatePeerRequest) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{9} + return file_route_proto_rawDescGZIP(), []int{7} } func (x *CreatePeerRequest) GetPeer() *Peer { @@ -633,7 +548,7 @@ type ValidatePeerResponse struct { func (x *ValidatePeerResponse) Reset() { *x = ValidatePeerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[10] + mi := &file_route_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +561,7 @@ func (x *ValidatePeerResponse) String() string { func (*ValidatePeerResponse) ProtoMessage() {} func (x *ValidatePeerResponse) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[10] + mi := &file_route_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +574,7 @@ func (x *ValidatePeerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatePeerResponse.ProtoReflect.Descriptor instead. func (*ValidatePeerResponse) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{10} + return file_route_proto_rawDescGZIP(), []int{8} } func (x *ValidatePeerResponse) GetStatus() ValidatePeerStatus { @@ -688,7 +603,7 @@ type CreatePeerResponse struct { func (x *CreatePeerResponse) Reset() { *x = CreatePeerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[11] + mi := &file_route_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -701,7 +616,7 @@ func (x *CreatePeerResponse) String() string { func (*CreatePeerResponse) ProtoMessage() {} func (x *CreatePeerResponse) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[11] + mi := &file_route_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -714,7 +629,7 @@ func (x *CreatePeerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePeerResponse.ProtoReflect.Descriptor instead. func (*CreatePeerResponse) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{11} + return file_route_proto_rawDescGZIP(), []int{9} } func (x *CreatePeerResponse) GetStatus() CreatePeerStatus { @@ -742,7 +657,7 @@ type MirrorStatusRequest struct { func (x *MirrorStatusRequest) Reset() { *x = MirrorStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[12] + mi := &file_route_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -755,7 +670,7 @@ func (x *MirrorStatusRequest) String() string { func (*MirrorStatusRequest) ProtoMessage() {} func (x *MirrorStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[12] + mi := &file_route_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -768,7 +683,7 @@ func (x *MirrorStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MirrorStatusRequest.ProtoReflect.Descriptor instead. func (*MirrorStatusRequest) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{12} + return file_route_proto_rawDescGZIP(), []int{10} } func (x *MirrorStatusRequest) GetFlowJobName() string { @@ -792,7 +707,7 @@ type PartitionStatus struct { func (x *PartitionStatus) Reset() { *x = PartitionStatus{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[13] + mi := &file_route_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -805,7 +720,7 @@ func (x *PartitionStatus) String() string { func (*PartitionStatus) ProtoMessage() {} func (x *PartitionStatus) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[13] + mi := &file_route_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -818,7 +733,7 @@ func (x *PartitionStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PartitionStatus.ProtoReflect.Descriptor instead. func (*PartitionStatus) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{13} + return file_route_proto_rawDescGZIP(), []int{11} } func (x *PartitionStatus) GetPartitionId() string { @@ -861,7 +776,7 @@ type QRepMirrorStatus struct { func (x *QRepMirrorStatus) Reset() { *x = QRepMirrorStatus{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[14] + mi := &file_route_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -874,7 +789,7 @@ func (x *QRepMirrorStatus) String() string { func (*QRepMirrorStatus) ProtoMessage() {} func (x *QRepMirrorStatus) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[14] + mi := &file_route_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -887,7 +802,7 @@ func (x *QRepMirrorStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use QRepMirrorStatus.ProtoReflect.Descriptor instead. func (*QRepMirrorStatus) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{14} + return file_route_proto_rawDescGZIP(), []int{12} } func (x *QRepMirrorStatus) GetConfig() *QRepConfig { @@ -919,7 +834,7 @@ type CDCSyncStatus struct { func (x *CDCSyncStatus) Reset() { *x = CDCSyncStatus{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[15] + mi := &file_route_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -932,7 +847,7 @@ func (x *CDCSyncStatus) String() string { func (*CDCSyncStatus) ProtoMessage() {} func (x *CDCSyncStatus) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[15] + mi := &file_route_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -945,7 +860,7 @@ func (x *CDCSyncStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use CDCSyncStatus.ProtoReflect.Descriptor instead. func (*CDCSyncStatus) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{15} + return file_route_proto_rawDescGZIP(), []int{13} } func (x *CDCSyncStatus) GetStartLsn() int64 { @@ -994,7 +909,7 @@ type SnapshotStatus struct { func (x *SnapshotStatus) Reset() { *x = SnapshotStatus{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[16] + mi := &file_route_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1007,7 +922,7 @@ func (x *SnapshotStatus) String() string { func (*SnapshotStatus) ProtoMessage() {} func (x *SnapshotStatus) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[16] + mi := &file_route_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1020,7 +935,7 @@ func (x *SnapshotStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use SnapshotStatus.ProtoReflect.Descriptor instead. func (*SnapshotStatus) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{16} + return file_route_proto_rawDescGZIP(), []int{14} } func (x *SnapshotStatus) GetClones() []*QRepMirrorStatus { @@ -1043,7 +958,7 @@ type CDCMirrorStatus struct { func (x *CDCMirrorStatus) Reset() { *x = CDCMirrorStatus{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[17] + mi := &file_route_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1056,7 +971,7 @@ func (x *CDCMirrorStatus) String() string { func (*CDCMirrorStatus) ProtoMessage() {} func (x *CDCMirrorStatus) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[17] + mi := &file_route_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1069,7 +984,7 @@ func (x *CDCMirrorStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use CDCMirrorStatus.ProtoReflect.Descriptor instead. func (*CDCMirrorStatus) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{17} + return file_route_proto_rawDescGZIP(), []int{15} } func (x *CDCMirrorStatus) GetConfig() *FlowConnectionConfigs { @@ -1110,7 +1025,7 @@ type MirrorStatusResponse struct { func (x *MirrorStatusResponse) Reset() { *x = MirrorStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_route_proto_msgTypes[18] + mi := &file_route_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1123,7 +1038,7 @@ func (x *MirrorStatusResponse) String() string { func (*MirrorStatusResponse) ProtoMessage() {} func (x *MirrorStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_route_proto_msgTypes[18] + mi := &file_route_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1136,7 +1051,7 @@ func (x *MirrorStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MirrorStatusResponse.ProtoReflect.Descriptor instead. func (*MirrorStatusResponse) Descriptor() ([]byte, []int) { - return file_route_proto_rawDescGZIP(), []int{18} + return file_route_proto_rawDescGZIP(), []int{16} } func (x *MirrorStatusResponse) GetFlowJobName() string { @@ -1239,162 +1154,157 @@ var file_route_proto_rawDesc = []byte{ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x70, 0x65, 0x65, - 0x72, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x3d, - 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x70, 0x65, 0x65, - 0x72, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0x3b, 0x0a, - 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3d, 0x0a, 0x13, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x2e, - 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x14, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x66, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, - 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x39, - 0x0a, 0x13, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6a, 0x6f, - 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6c, - 0x6f, 0x77, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x0f, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, - 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, - 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x82, 0x01, - 0x0a, 0x10, 0x51, 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x66, 0x6c, 0x6f, 0x77, - 0x2e, 0x51, 0x52, 0x65, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, - 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x43, 0x44, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x73, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x73, - 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x65, 0x6e, 0x64, 0x4c, 0x73, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, - 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, - 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, - 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x48, 0x0a, 0x0e, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x6c, 0x6f, - 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, - 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x51, 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, - 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x6e, 0x65, - 0x73, 0x22, 0xce, 0x01, 0x0a, 0x0f, 0x43, 0x44, 0x43, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x66, - 0x6c, 0x6f, 0x77, 0x2e, 0x46, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x45, 0x0a, 0x0f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x65, 0x65, - 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x64, 0x63, 0x5f, - 0x73, 0x79, 0x6e, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x65, - 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x44, 0x43, 0x53, 0x79, - 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x63, 0x64, 0x63, 0x53, 0x79, 0x6e, - 0x63, 0x73, 0x22, 0xec, 0x01, 0x0a, 0x14, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x66, - 0x6c, 0x6f, 0x77, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x41, 0x0a, 0x0b, 0x71, 0x72, 0x65, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, - 0x75, 0x74, 0x65, 0x2e, 0x51, 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x71, 0x72, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x64, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x44, 0x43, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x09, 0x63, 0x64, 0x63, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2a, 0x42, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, - 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x10, 0x02, 0x2a, 0x43, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0x91, 0x05, 0x0a, 0x0b, 0x46, - 0x6c, 0x6f, 0x77, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, - 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, - 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0c, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x65, 0x65, + 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x26, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x2e, 0x50, 0x65, 0x65, + 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x20, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x66, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, + 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x39, 0x0a, 0x13, 0x4d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x39, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x51, + 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x51, 0x52, + 0x65, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0xd2, 0x01, 0x0a, 0x0d, 0x43, 0x44, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x73, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x73, 0x6e, 0x12, 0x17, + 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x65, 0x6e, 0x64, 0x4c, 0x73, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, + 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x6f, + 0x77, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x48, 0x0a, 0x0e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, + 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x51, 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x73, 0x22, 0xce, + 0x01, 0x0a, 0x0f, 0x43, 0x44, 0x43, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x66, 0x6c, 0x6f, 0x77, + 0x2e, 0x46, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x45, + 0x0a, 0x0f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, + 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x64, 0x63, 0x5f, 0x73, 0x79, 0x6e, + 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, + 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x44, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x63, 0x64, 0x63, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x22, + 0xec, 0x01, 0x0a, 0x14, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x6c, 0x6f, 0x77, + 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0b, + 0x71, 0x72, 0x65, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x2e, 0x51, 0x52, 0x65, 0x70, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x48, 0x00, 0x52, 0x0a, 0x71, 0x72, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x3e, 0x0a, 0x0a, 0x63, 0x64, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x2e, 0x43, 0x44, 0x43, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x48, 0x00, 0x52, 0x09, 0x63, 0x64, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x42, + 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x10, 0x02, 0x2a, 0x43, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0x98, 0x05, 0x0a, 0x0b, 0x46, 0x6c, 0x6f, 0x77, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, + 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, - 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x44, 0x43, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, - 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x44, 0x43, - 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x65, + 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x44, 0x43, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x52, 0x65, 0x70, - 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x23, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, - 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x52, 0x65, 0x70, 0x46, 0x6c, - 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x65, 0x65, 0x72, - 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, - 0x52, 0x65, 0x70, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x4f, 0x0a, 0x0c, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x46, 0x6c, 0x6f, - 0x77, 0x12, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, - 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x0c, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, - 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x7b, - 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x7c, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, - 0x74, 0x65, 0x42, 0x0a, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x64, - 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x64, 0x62, 0x52, - 0x6f, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x17, 0x50, 0x65, 0x65, 0x72, 0x64, 0x62, 0x52, 0x6f, 0x75, - 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0b, 0x50, 0x65, 0x65, 0x72, 0x64, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, + 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x79, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x44, 0x43, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x22, 0x2e, 0x70, + 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x44, 0x43, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x44, 0x43, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, + 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x2f, 0x63, 0x64, 0x63, 0x2f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x51, 0x52, 0x65, 0x70, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x23, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, + 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x52, + 0x65, 0x70, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x51, 0x52, 0x65, 0x70, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0c, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, + 0x6e, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x1d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x0c, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, 0x5f, + 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x65, 0x65, 0x72, + 0x64, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x42, 0x7c, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x64, 0x62, + 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x0a, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x50, + 0x65, 0x65, 0x72, 0x64, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0xca, 0x02, 0x0b, 0x50, 0x65, 0x65, + 0x72, 0x64, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0xe2, 0x02, 0x17, 0x50, 0x65, 0x65, 0x72, 0x64, + 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x64, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1410,7 +1320,7 @@ func file_route_proto_rawDescGZIP() []byte { } var file_route_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_route_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_route_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_route_proto_goTypes = []interface{}{ (ValidatePeerStatus)(0), // 0: peerdb_route.ValidatePeerStatus (CreatePeerStatus)(0), // 1: peerdb_route.CreatePeerStatus @@ -1420,65 +1330,60 @@ var file_route_proto_goTypes = []interface{}{ (*CreateQRepFlowResponse)(nil), // 5: peerdb_route.CreateQRepFlowResponse (*ShutdownRequest)(nil), // 6: peerdb_route.ShutdownRequest (*ShutdownResponse)(nil), // 7: peerdb_route.ShutdownResponse - (*ListPeersRequest)(nil), // 8: peerdb_route.ListPeersRequest - (*ListPeersResponse)(nil), // 9: peerdb_route.ListPeersResponse - (*ValidatePeerRequest)(nil), // 10: peerdb_route.ValidatePeerRequest - (*CreatePeerRequest)(nil), // 11: peerdb_route.CreatePeerRequest - (*ValidatePeerResponse)(nil), // 12: peerdb_route.ValidatePeerResponse - (*CreatePeerResponse)(nil), // 13: peerdb_route.CreatePeerResponse - (*MirrorStatusRequest)(nil), // 14: peerdb_route.MirrorStatusRequest - (*PartitionStatus)(nil), // 15: peerdb_route.PartitionStatus - (*QRepMirrorStatus)(nil), // 16: peerdb_route.QRepMirrorStatus - (*CDCSyncStatus)(nil), // 17: peerdb_route.CDCSyncStatus - (*SnapshotStatus)(nil), // 18: peerdb_route.SnapshotStatus - (*CDCMirrorStatus)(nil), // 19: peerdb_route.CDCMirrorStatus - (*MirrorStatusResponse)(nil), // 20: peerdb_route.MirrorStatusResponse - (*FlowConnectionConfigs)(nil), // 21: peerdb_flow.FlowConnectionConfigs - (*QRepConfig)(nil), // 22: peerdb_flow.QRepConfig - (*Peer)(nil), // 23: peerdb_peers.Peer - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp + (*ValidatePeerRequest)(nil), // 8: peerdb_route.ValidatePeerRequest + (*CreatePeerRequest)(nil), // 9: peerdb_route.CreatePeerRequest + (*ValidatePeerResponse)(nil), // 10: peerdb_route.ValidatePeerResponse + (*CreatePeerResponse)(nil), // 11: peerdb_route.CreatePeerResponse + (*MirrorStatusRequest)(nil), // 12: peerdb_route.MirrorStatusRequest + (*PartitionStatus)(nil), // 13: peerdb_route.PartitionStatus + (*QRepMirrorStatus)(nil), // 14: peerdb_route.QRepMirrorStatus + (*CDCSyncStatus)(nil), // 15: peerdb_route.CDCSyncStatus + (*SnapshotStatus)(nil), // 16: peerdb_route.SnapshotStatus + (*CDCMirrorStatus)(nil), // 17: peerdb_route.CDCMirrorStatus + (*MirrorStatusResponse)(nil), // 18: peerdb_route.MirrorStatusResponse + (*FlowConnectionConfigs)(nil), // 19: peerdb_flow.FlowConnectionConfigs + (*QRepConfig)(nil), // 20: peerdb_flow.QRepConfig + (*Peer)(nil), // 21: peerdb_peers.Peer + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp } var file_route_proto_depIdxs = []int32{ - 21, // 0: peerdb_route.CreateCDCFlowRequest.connection_configs:type_name -> peerdb_flow.FlowConnectionConfigs - 22, // 1: peerdb_route.CreateQRepFlowRequest.qrep_config:type_name -> peerdb_flow.QRepConfig - 23, // 2: peerdb_route.ShutdownRequest.source_peer:type_name -> peerdb_peers.Peer - 23, // 3: peerdb_route.ShutdownRequest.destination_peer:type_name -> peerdb_peers.Peer - 23, // 4: peerdb_route.ListPeersResponse.peers:type_name -> peerdb_peers.Peer - 23, // 5: peerdb_route.ValidatePeerRequest.peer:type_name -> peerdb_peers.Peer - 23, // 6: peerdb_route.CreatePeerRequest.peer:type_name -> peerdb_peers.Peer - 0, // 7: peerdb_route.ValidatePeerResponse.status:type_name -> peerdb_route.ValidatePeerStatus - 1, // 8: peerdb_route.CreatePeerResponse.status:type_name -> peerdb_route.CreatePeerStatus - 24, // 9: peerdb_route.PartitionStatus.start_time:type_name -> google.protobuf.Timestamp - 24, // 10: peerdb_route.PartitionStatus.end_time:type_name -> google.protobuf.Timestamp - 22, // 11: peerdb_route.QRepMirrorStatus.config:type_name -> peerdb_flow.QRepConfig - 15, // 12: peerdb_route.QRepMirrorStatus.partitions:type_name -> peerdb_route.PartitionStatus - 24, // 13: peerdb_route.CDCSyncStatus.start_time:type_name -> google.protobuf.Timestamp - 24, // 14: peerdb_route.CDCSyncStatus.end_time:type_name -> google.protobuf.Timestamp - 16, // 15: peerdb_route.SnapshotStatus.clones:type_name -> peerdb_route.QRepMirrorStatus - 21, // 16: peerdb_route.CDCMirrorStatus.config:type_name -> peerdb_flow.FlowConnectionConfigs - 18, // 17: peerdb_route.CDCMirrorStatus.snapshot_status:type_name -> peerdb_route.SnapshotStatus - 17, // 18: peerdb_route.CDCMirrorStatus.cdc_syncs:type_name -> peerdb_route.CDCSyncStatus - 16, // 19: peerdb_route.MirrorStatusResponse.qrep_status:type_name -> peerdb_route.QRepMirrorStatus - 19, // 20: peerdb_route.MirrorStatusResponse.cdc_status:type_name -> peerdb_route.CDCMirrorStatus - 8, // 21: peerdb_route.FlowService.ListPeers:input_type -> peerdb_route.ListPeersRequest - 10, // 22: peerdb_route.FlowService.ValidatePeer:input_type -> peerdb_route.ValidatePeerRequest - 11, // 23: peerdb_route.FlowService.CreatePeer:input_type -> peerdb_route.CreatePeerRequest - 2, // 24: peerdb_route.FlowService.CreateCDCFlow:input_type -> peerdb_route.CreateCDCFlowRequest - 4, // 25: peerdb_route.FlowService.CreateQRepFlow:input_type -> peerdb_route.CreateQRepFlowRequest - 6, // 26: peerdb_route.FlowService.ShutdownFlow:input_type -> peerdb_route.ShutdownRequest - 14, // 27: peerdb_route.FlowService.MirrorStatus:input_type -> peerdb_route.MirrorStatusRequest - 9, // 28: peerdb_route.FlowService.ListPeers:output_type -> peerdb_route.ListPeersResponse - 12, // 29: peerdb_route.FlowService.ValidatePeer:output_type -> peerdb_route.ValidatePeerResponse - 13, // 30: peerdb_route.FlowService.CreatePeer:output_type -> peerdb_route.CreatePeerResponse - 3, // 31: peerdb_route.FlowService.CreateCDCFlow:output_type -> peerdb_route.CreateCDCFlowResponse - 5, // 32: peerdb_route.FlowService.CreateQRepFlow:output_type -> peerdb_route.CreateQRepFlowResponse - 7, // 33: peerdb_route.FlowService.ShutdownFlow:output_type -> peerdb_route.ShutdownResponse - 20, // 34: peerdb_route.FlowService.MirrorStatus:output_type -> peerdb_route.MirrorStatusResponse - 28, // [28:35] is the sub-list for method output_type - 21, // [21:28] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 19, // 0: peerdb_route.CreateCDCFlowRequest.connection_configs:type_name -> peerdb_flow.FlowConnectionConfigs + 20, // 1: peerdb_route.CreateQRepFlowRequest.qrep_config:type_name -> peerdb_flow.QRepConfig + 21, // 2: peerdb_route.ShutdownRequest.source_peer:type_name -> peerdb_peers.Peer + 21, // 3: peerdb_route.ShutdownRequest.destination_peer:type_name -> peerdb_peers.Peer + 21, // 4: peerdb_route.ValidatePeerRequest.peer:type_name -> peerdb_peers.Peer + 21, // 5: peerdb_route.CreatePeerRequest.peer:type_name -> peerdb_peers.Peer + 0, // 6: peerdb_route.ValidatePeerResponse.status:type_name -> peerdb_route.ValidatePeerStatus + 1, // 7: peerdb_route.CreatePeerResponse.status:type_name -> peerdb_route.CreatePeerStatus + 22, // 8: peerdb_route.PartitionStatus.start_time:type_name -> google.protobuf.Timestamp + 22, // 9: peerdb_route.PartitionStatus.end_time:type_name -> google.protobuf.Timestamp + 20, // 10: peerdb_route.QRepMirrorStatus.config:type_name -> peerdb_flow.QRepConfig + 13, // 11: peerdb_route.QRepMirrorStatus.partitions:type_name -> peerdb_route.PartitionStatus + 22, // 12: peerdb_route.CDCSyncStatus.start_time:type_name -> google.protobuf.Timestamp + 22, // 13: peerdb_route.CDCSyncStatus.end_time:type_name -> google.protobuf.Timestamp + 14, // 14: peerdb_route.SnapshotStatus.clones:type_name -> peerdb_route.QRepMirrorStatus + 19, // 15: peerdb_route.CDCMirrorStatus.config:type_name -> peerdb_flow.FlowConnectionConfigs + 16, // 16: peerdb_route.CDCMirrorStatus.snapshot_status:type_name -> peerdb_route.SnapshotStatus + 15, // 17: peerdb_route.CDCMirrorStatus.cdc_syncs:type_name -> peerdb_route.CDCSyncStatus + 14, // 18: peerdb_route.MirrorStatusResponse.qrep_status:type_name -> peerdb_route.QRepMirrorStatus + 17, // 19: peerdb_route.MirrorStatusResponse.cdc_status:type_name -> peerdb_route.CDCMirrorStatus + 8, // 20: peerdb_route.FlowService.ValidatePeer:input_type -> peerdb_route.ValidatePeerRequest + 9, // 21: peerdb_route.FlowService.CreatePeer:input_type -> peerdb_route.CreatePeerRequest + 2, // 22: peerdb_route.FlowService.CreateCDCFlow:input_type -> peerdb_route.CreateCDCFlowRequest + 4, // 23: peerdb_route.FlowService.CreateQRepFlow:input_type -> peerdb_route.CreateQRepFlowRequest + 6, // 24: peerdb_route.FlowService.ShutdownFlow:input_type -> peerdb_route.ShutdownRequest + 12, // 25: peerdb_route.FlowService.MirrorStatus:input_type -> peerdb_route.MirrorStatusRequest + 10, // 26: peerdb_route.FlowService.ValidatePeer:output_type -> peerdb_route.ValidatePeerResponse + 11, // 27: peerdb_route.FlowService.CreatePeer:output_type -> peerdb_route.CreatePeerResponse + 3, // 28: peerdb_route.FlowService.CreateCDCFlow:output_type -> peerdb_route.CreateCDCFlowResponse + 5, // 29: peerdb_route.FlowService.CreateQRepFlow:output_type -> peerdb_route.CreateQRepFlowResponse + 7, // 30: peerdb_route.FlowService.ShutdownFlow:output_type -> peerdb_route.ShutdownResponse + 18, // 31: peerdb_route.FlowService.MirrorStatus:output_type -> peerdb_route.MirrorStatusResponse + 26, // [26:32] is the sub-list for method output_type + 20, // [20:26] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_route_proto_init() } @@ -1562,30 +1467,6 @@ func file_route_proto_init() { } } file_route_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPeersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_route_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPeersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_route_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatePeerRequest); i { case 0: return &v.state @@ -1597,7 +1478,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePeerRequest); i { case 0: return &v.state @@ -1609,7 +1490,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatePeerResponse); i { case 0: return &v.state @@ -1621,7 +1502,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePeerResponse); i { case 0: return &v.state @@ -1633,7 +1514,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MirrorStatusRequest); i { case 0: return &v.state @@ -1645,7 +1526,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PartitionStatus); i { case 0: return &v.state @@ -1657,7 +1538,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QRepMirrorStatus); i { case 0: return &v.state @@ -1669,7 +1550,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CDCSyncStatus); i { case 0: return &v.state @@ -1681,7 +1562,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SnapshotStatus); i { case 0: return &v.state @@ -1693,7 +1574,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CDCMirrorStatus); i { case 0: return &v.state @@ -1705,7 +1586,7 @@ func file_route_proto_init() { return nil } } - file_route_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_route_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MirrorStatusResponse); i { case 0: return &v.state @@ -1718,7 +1599,7 @@ func file_route_proto_init() { } } } - file_route_proto_msgTypes[18].OneofWrappers = []interface{}{ + file_route_proto_msgTypes[16].OneofWrappers = []interface{}{ (*MirrorStatusResponse_QrepStatus)(nil), (*MirrorStatusResponse_CdcStatus)(nil), } @@ -1728,7 +1609,7 @@ func file_route_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_route_proto_rawDesc, NumEnums: 2, - NumMessages: 19, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, diff --git a/flow/generated/protos/route.pb.gw.go b/flow/generated/protos/route.pb.gw.go index 333005640b..3449eb70ea 100644 --- a/flow/generated/protos/route.pb.gw.go +++ b/flow/generated/protos/route.pb.gw.go @@ -31,6 +31,108 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join +func request_FlowService_ValidatePeer_0(ctx context.Context, marshaler runtime.Marshaler, client FlowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ValidatePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ValidatePeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FlowService_ValidatePeer_0(ctx context.Context, marshaler runtime.Marshaler, server FlowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ValidatePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ValidatePeer(ctx, &protoReq) + return msg, metadata, err + +} + +func request_FlowService_CreatePeer_0(ctx context.Context, marshaler runtime.Marshaler, client FlowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreatePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreatePeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FlowService_CreatePeer_0(ctx context.Context, marshaler runtime.Marshaler, server FlowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreatePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreatePeer(ctx, &protoReq) + return msg, metadata, err + +} + +func request_FlowService_CreateCDCFlow_0(ctx context.Context, marshaler runtime.Marshaler, client FlowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateCDCFlowRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateCDCFlow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FlowService_CreateCDCFlow_0(ctx context.Context, marshaler runtime.Marshaler, server FlowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateCDCFlowRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateCDCFlow(ctx, &protoReq) + return msg, metadata, err + +} + func request_FlowService_MirrorStatus_0(ctx context.Context, marshaler runtime.Marshaler, client FlowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq MirrorStatusRequest var metadata runtime.ServerMetadata @@ -89,6 +191,81 @@ func local_request_FlowService_MirrorStatus_0(ctx context.Context, marshaler run // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFlowServiceHandlerFromEndpoint instead. func RegisterFlowServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FlowServiceServer) error { + mux.Handle("POST", pattern_FlowService_ValidatePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerdb_route.FlowService/ValidatePeer", runtime.WithHTTPPathPattern("/v1/peers/validate")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FlowService_ValidatePeer_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_ValidatePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_FlowService_CreatePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerdb_route.FlowService/CreatePeer", runtime.WithHTTPPathPattern("/v1/peers/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FlowService_CreatePeer_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_CreatePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_FlowService_CreateCDCFlow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerdb_route.FlowService/CreateCDCFlow", runtime.WithHTTPPathPattern("/v1/flows/cdc/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FlowService_CreateCDCFlow_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_CreateCDCFlow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_FlowService_MirrorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -155,6 +332,72 @@ func RegisterFlowServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // "FlowServiceClient" to call the correct interceptors. func RegisterFlowServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FlowServiceClient) error { + mux.Handle("POST", pattern_FlowService_ValidatePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerdb_route.FlowService/ValidatePeer", runtime.WithHTTPPathPattern("/v1/peers/validate")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FlowService_ValidatePeer_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_ValidatePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_FlowService_CreatePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerdb_route.FlowService/CreatePeer", runtime.WithHTTPPathPattern("/v1/peers/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FlowService_CreatePeer_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_CreatePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_FlowService_CreateCDCFlow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerdb_route.FlowService/CreateCDCFlow", runtime.WithHTTPPathPattern("/v1/flows/cdc/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FlowService_CreateCDCFlow_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_FlowService_CreateCDCFlow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_FlowService_MirrorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -181,9 +424,21 @@ func RegisterFlowServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( + pattern_FlowService_ValidatePeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "peers", "validate"}, "")) + + pattern_FlowService_CreatePeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "peers", "create"}, "")) + + pattern_FlowService_CreateCDCFlow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "flows", "cdc", "create"}, "")) + pattern_FlowService_MirrorStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "mirrors", "flow_job_name"}, "")) ) var ( + forward_FlowService_ValidatePeer_0 = runtime.ForwardResponseMessage + + forward_FlowService_CreatePeer_0 = runtime.ForwardResponseMessage + + forward_FlowService_CreateCDCFlow_0 = runtime.ForwardResponseMessage + forward_FlowService_MirrorStatus_0 = runtime.ForwardResponseMessage ) diff --git a/flow/generated/protos/route_grpc.pb.go b/flow/generated/protos/route_grpc.pb.go index 74ce7a6b0d..bee5b224b4 100644 --- a/flow/generated/protos/route_grpc.pb.go +++ b/flow/generated/protos/route_grpc.pb.go @@ -19,7 +19,6 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - FlowService_ListPeers_FullMethodName = "/peerdb_route.FlowService/ListPeers" FlowService_ValidatePeer_FullMethodName = "/peerdb_route.FlowService/ValidatePeer" FlowService_CreatePeer_FullMethodName = "/peerdb_route.FlowService/CreatePeer" FlowService_CreateCDCFlow_FullMethodName = "/peerdb_route.FlowService/CreateCDCFlow" @@ -32,7 +31,6 @@ const ( // // 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. type FlowServiceClient interface { - ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) ValidatePeer(ctx context.Context, in *ValidatePeerRequest, opts ...grpc.CallOption) (*ValidatePeerResponse, error) CreatePeer(ctx context.Context, in *CreatePeerRequest, opts ...grpc.CallOption) (*CreatePeerResponse, error) CreateCDCFlow(ctx context.Context, in *CreateCDCFlowRequest, opts ...grpc.CallOption) (*CreateCDCFlowResponse, error) @@ -49,15 +47,6 @@ func NewFlowServiceClient(cc grpc.ClientConnInterface) FlowServiceClient { return &flowServiceClient{cc} } -func (c *flowServiceClient) ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) { - out := new(ListPeersResponse) - err := c.cc.Invoke(ctx, FlowService_ListPeers_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *flowServiceClient) ValidatePeer(ctx context.Context, in *ValidatePeerRequest, opts ...grpc.CallOption) (*ValidatePeerResponse, error) { out := new(ValidatePeerResponse) err := c.cc.Invoke(ctx, FlowService_ValidatePeer_FullMethodName, in, out, opts...) @@ -116,7 +105,6 @@ func (c *flowServiceClient) MirrorStatus(ctx context.Context, in *MirrorStatusRe // All implementations must embed UnimplementedFlowServiceServer // for forward compatibility type FlowServiceServer interface { - ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) ValidatePeer(context.Context, *ValidatePeerRequest) (*ValidatePeerResponse, error) CreatePeer(context.Context, *CreatePeerRequest) (*CreatePeerResponse, error) CreateCDCFlow(context.Context, *CreateCDCFlowRequest) (*CreateCDCFlowResponse, error) @@ -130,9 +118,6 @@ type FlowServiceServer interface { type UnimplementedFlowServiceServer struct { } -func (UnimplementedFlowServiceServer) ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") -} func (UnimplementedFlowServiceServer) ValidatePeer(context.Context, *ValidatePeerRequest) (*ValidatePeerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidatePeer not implemented") } @@ -164,24 +149,6 @@ func RegisterFlowServiceServer(s grpc.ServiceRegistrar, srv FlowServiceServer) { s.RegisterService(&FlowService_ServiceDesc, srv) } -func _FlowService_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPeersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FlowServiceServer).ListPeers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: FlowService_ListPeers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FlowServiceServer).ListPeers(ctx, req.(*ListPeersRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _FlowService_ValidatePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ValidatePeerRequest) if err := dec(in); err != nil { @@ -297,10 +264,6 @@ var FlowService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "peerdb_route.FlowService", HandlerType: (*FlowServiceServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "ListPeers", - Handler: _FlowService_ListPeers_Handler, - }, { MethodName: "ValidatePeer", Handler: _FlowService_ValidatePeer_Handler, diff --git a/nexus/pt/src/peerdb_route.rs b/nexus/pt/src/peerdb_route.rs index bf0085ef8e..5d25ad217b 100644 --- a/nexus/pt/src/peerdb_route.rs +++ b/nexus/pt/src/peerdb_route.rs @@ -47,16 +47,6 @@ pub struct ShutdownResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListPeersRequest { -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListPeersResponse { - #[prost(message, repeated, tag="1")] - pub peers: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatePeerRequest { #[prost(message, optional, tag="1")] pub peer: ::core::option::Option, diff --git a/nexus/pt/src/peerdb_route.serde.rs b/nexus/pt/src/peerdb_route.serde.rs index b6b8c2fc12..2202406e18 100644 --- a/nexus/pt/src/peerdb_route.serde.rs +++ b/nexus/pt/src/peerdb_route.serde.rs @@ -991,173 +991,6 @@ impl<'de> serde::Deserialize<'de> for CreateQRepFlowResponse { deserializer.deserialize_struct("peerdb_route.CreateQRepFlowResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListPeersRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("peerdb_route.ListPeersRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListPeersRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - Ok(GeneratedField::__SkipField__) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListPeersRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct peerdb_route.ListPeersRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; - } - Ok(ListPeersRequest { - }) - } - } - deserializer.deserialize_struct("peerdb_route.ListPeersRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ListPeersResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.peers.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("peerdb_route.ListPeersResponse", len)?; - if !self.peers.is_empty() { - struct_ser.serialize_field("peers", &self.peers)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListPeersResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "peers", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Peers, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "peers" => Ok(GeneratedField::Peers), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListPeersResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct peerdb_route.ListPeersResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut peers__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Peers => { - if peers__.is_some() { - return Err(serde::de::Error::duplicate_field("peers")); - } - peers__ = Some(map.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; - } - } - } - Ok(ListPeersResponse { - peers: peers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("peerdb_route.ListPeersResponse", FIELDS, GeneratedVisitor) - } -} impl serde::Serialize for MirrorStatusRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/nexus/pt/src/peerdb_route.tonic.rs b/nexus/pt/src/peerdb_route.tonic.rs index bbebc8ab85..33c035e715 100644 --- a/nexus/pt/src/peerdb_route.tonic.rs +++ b/nexus/pt/src/peerdb_route.tonic.rs @@ -86,32 +86,6 @@ pub mod flow_service_client { self } /// - pub async fn list_peers( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/peerdb_route.FlowService/ListPeers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("peerdb_route.FlowService", "ListPeers")); - self.inner.unary(req, path, codec).await - } - /// pub async fn validate_peer( &mut self, request: impl tonic::IntoRequest, @@ -276,14 +250,6 @@ pub mod flow_service_server { /// Generated trait containing gRPC methods that should be implemented for use with FlowServiceServer. #[async_trait] pub trait FlowService: Send + Sync + 'static { - /// - async fn list_peers( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; /// async fn validate_peer( &self, @@ -413,50 +379,6 @@ pub mod flow_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/peerdb_route.FlowService/ListPeers" => { - #[allow(non_camel_case_types)] - struct ListPeersSvc(pub Arc); - impl< - T: FlowService, - > tonic::server::UnaryService - for ListPeersSvc { - type Response = super::ListPeersResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).list_peers(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ListPeersSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } "/peerdb_route.FlowService/ValidatePeer" => { #[allow(non_camel_case_types)] struct ValidatePeerSvc(pub Arc); diff --git a/protos/route.proto b/protos/route.proto index b2a83a3f35..c1892f3c89 100644 --- a/protos/route.proto +++ b/protos/route.proto @@ -37,13 +37,6 @@ message ShutdownResponse { string error_message = 2; } -message ListPeersRequest { -} - -message ListPeersResponse { - repeated peerdb_peers.Peer peers = 1; -} - message ValidatePeerRequest { peerdb_peers.Peer peer = 1; } @@ -120,10 +113,24 @@ message MirrorStatusResponse { } service FlowService { - rpc ListPeers(ListPeersRequest) returns (ListPeersResponse) {} - rpc ValidatePeer(ValidatePeerRequest) returns (ValidatePeerResponse) {} - rpc CreatePeer(CreatePeerRequest) returns (CreatePeerResponse) {} - rpc CreateCDCFlow(CreateCDCFlowRequest) returns (CreateCDCFlowResponse) {} + rpc ValidatePeer(ValidatePeerRequest) returns (ValidatePeerResponse) { + option (google.api.http) = { + post: "/v1/peers/validate", + body: "*" + }; + } + rpc CreatePeer(CreatePeerRequest) returns (CreatePeerResponse) { + option (google.api.http) = { + post: "/v1/peers/create", + body: "*" + }; + } + rpc CreateCDCFlow(CreateCDCFlowRequest) returns (CreateCDCFlowResponse) { + option (google.api.http) = { + post: "/v1/flows/cdc/create", + body: "*" + }; + } rpc CreateQRepFlow(CreateQRepFlowRequest) returns (CreateQRepFlowResponse) {} rpc ShutdownFlow(ShutdownRequest) returns (ShutdownResponse) {} rpc MirrorStatus(MirrorStatusRequest) returns (MirrorStatusResponse) { diff --git a/ui/app/api/mirrors/cdc/route.ts b/ui/app/api/mirrors/cdc/route.ts index ccb37ae797..5505871a06 100644 --- a/ui/app/api/mirrors/cdc/route.ts +++ b/ui/app/api/mirrors/cdc/route.ts @@ -1,21 +1,31 @@ +import { UCreateMirrorResponse } from '@/app/dto/MirrorsDTO'; import { CreateCDCFlowRequest, CreateCDCFlowResponse, } from '@/grpc_generated/route'; -import { GetFlowServiceClientFromEnv } from '@/rpc/rpc'; +import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; export async function POST(request: Request) { const body = await request.json(); const { config } = body; - const flowServiceClient = GetFlowServiceClientFromEnv(); + const flowServiceAddr = GetFlowHttpAddressFromEnv(); const req: CreateCDCFlowRequest = { connectionConfigs: config, createCatalogEntry: true, }; - const createStatus: CreateCDCFlowResponse = - await flowServiceClient.createCdcFlow(req); - if (!createStatus.worflowId) { - return new Response('Failed to create CDC mirror'); - } - return new Response('created'); + const createStatus: CreateCDCFlowResponse = await fetch( + `${flowServiceAddr}/v1/cdc/create`, + { + method: 'POST', + body: JSON.stringify(req), + } + ).then((res) => { + return res.json(); + }); + + let response: UCreateMirrorResponse = { + created: !!createStatus.worflowId, + }; + + return new Response(JSON.stringify(response)); } diff --git a/ui/app/api/peers/route.ts b/ui/app/api/peers/route.ts index b43ad771ba..21c11bb224 100644 --- a/ui/app/api/peers/route.ts +++ b/ui/app/api/peers/route.ts @@ -1,4 +1,6 @@ +import { UCreatePeerResponse, UValidatePeerResponse } from '@/app/dto/PeersDTO'; import { PeerConfig } from '@/app/peers/create/configuration/types'; +import prisma from '@/app/utils/prisma'; import { DBType, Peer, @@ -9,12 +11,11 @@ import { CreatePeerRequest, CreatePeerResponse, CreatePeerStatus, - ListPeersRequest, ValidatePeerRequest, ValidatePeerResponse, ValidatePeerStatus, } from '@/grpc_generated/route'; -import { GetFlowServiceClientFromEnv } from '@/rpc/rpc'; +import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; const constructPeer = ( name: string, @@ -42,32 +43,45 @@ const constructPeer = ( export async function POST(request: Request) { const body = await request.json(); const { name, type, config, mode } = body; - const flowServiceClient = GetFlowServiceClientFromEnv(); + const flowServiceAddr = GetFlowHttpAddressFromEnv(); const peer = constructPeer(name, type, config); if (mode === 'validate') { const validateReq: ValidatePeerRequest = { peer }; - const validateStatus: ValidatePeerResponse = - await flowServiceClient.validatePeer(validateReq); - if (validateStatus.status === ValidatePeerStatus.INVALID) { - return new Response(validateStatus.message); - } else if (validateStatus.status === ValidatePeerStatus.VALID) { - return new Response('valid'); - } + const validateStatus: ValidatePeerResponse = await fetch( + `${flowServiceAddr}/v1/peers/validate`, + { + method: 'POST', + body: JSON.stringify(validateReq), + } + ).then((res) => { + return res.json(); + }); + let response: UValidatePeerResponse = { + valid: validateStatus.status === ValidatePeerStatus.VALID, + message: validateStatus.message, + }; + return new Response(JSON.stringify(response)); } else if (mode === 'create') { const req: CreatePeerRequest = { peer }; - const createStatus: CreatePeerResponse = - await flowServiceClient.createPeer(req); - if (createStatus.status === CreatePeerStatus.FAILED) { - return new Response(createStatus.message); - } else if (createStatus.status === CreatePeerStatus.CREATED) { - return new Response('created'); - } else return new Response('status of peer creation is unknown'); - } else return new Response('mode of peer creation is unknown'); + const createStatus: CreatePeerResponse = await fetch( + `${flowServiceAddr}/v1/peers/create`, + { + method: 'POST', + body: JSON.stringify(req), + } + ).then((res) => { + return res.json(); + }); + let response: UCreatePeerResponse = { + created: createStatus.status === CreatePeerStatus.CREATED, + message: createStatus.message, + }; + return new Response(JSON.stringify(response)); + } } +// GET all the peers from the database export async function GET(request: Request) { - let flowServiceClient = GetFlowServiceClientFromEnv(); - let req: ListPeersRequest = {}; - let peers = await flowServiceClient.listPeers(req); + const peers = await prisma.peers.findMany(); return new Response(JSON.stringify(peers)); } diff --git a/ui/app/dto/MirrorsDTO.ts b/ui/app/dto/MirrorsDTO.ts new file mode 100644 index 0000000000..792ad4a93f --- /dev/null +++ b/ui/app/dto/MirrorsDTO.ts @@ -0,0 +1,3 @@ +export type UCreateMirrorResponse = { + created: boolean; +}; diff --git a/ui/app/dto/PeersDTO.ts b/ui/app/dto/PeersDTO.ts new file mode 100644 index 0000000000..21eed2d849 --- /dev/null +++ b/ui/app/dto/PeersDTO.ts @@ -0,0 +1,9 @@ +export type UValidatePeerResponse = { + valid: boolean; + message: string; +}; + +export type UCreatePeerResponse = { + created: boolean; + message: string; +}; diff --git a/ui/app/mirrors/create/handlers.ts b/ui/app/mirrors/create/handlers.ts index 9da47bb4b4..600e9a4b0f 100644 --- a/ui/app/mirrors/create/handlers.ts +++ b/ui/app/mirrors/create/handlers.ts @@ -1,14 +1,9 @@ -import { ListPeersResponse } from '@/grpc_generated/route'; +import { UCreateMirrorResponse } from '@/app/dto/MirrorsDTO'; import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context'; import { Dispatch, SetStateAction } from 'react'; import { MirrorConfig, TableMapRow } from '../types'; import { cdcSchema, tableMappingSchema } from './schema'; -export const listAllPeers = async () => { - const peers = await fetch('../api/peers').then((res) => res.json()); - return peers as ListPeersResponse; -}; - const validateFlowFields = ( tableMapping: TableMapRow[], setMsg: Dispatch>, @@ -64,14 +59,14 @@ export const handleCreate = async ( config['tableMappings'] = tableNameMapping; config['flowJobName'] = flowJobName; setLoading(true); - const statusMessage = await fetch('/api/mirrors/cdc', { + const statusMessage: UCreateMirrorResponse = await fetch('/api/mirrors/cdc', { method: 'POST', body: JSON.stringify({ config, }), - }).then((res) => res.text()); - if (statusMessage !== 'created') { - setMsg({ ok: false, msg: statusMessage }); + }).then((res) => res.json()); + if (!statusMessage.created) { + setMsg({ ok: false, msg: 'unable to create mirror.' }); setLoading(false); return; } diff --git a/ui/app/mirrors/create/page.tsx b/ui/app/mirrors/create/page.tsx index ffc07a28c9..1a9e8aec06 100644 --- a/ui/app/mirrors/create/page.tsx +++ b/ui/app/mirrors/create/page.tsx @@ -14,10 +14,11 @@ import { useRouter } from 'next/navigation'; import { useEffect, useState } from 'react'; import { TableMapRow } from '../types'; import MirrorConfig from './config'; -import { handleCreate, listAllPeers } from './handlers'; +import { handleCreate } from './handlers'; import { cdcSettings } from './helpers/cdc'; import { blankCDCSetting } from './helpers/common'; import TableMapping from './tablemapping'; + export default function CreateMirrors() { const router = useRouter(); const [mirrorName, setMirrorName] = useState(''); @@ -33,7 +34,11 @@ export default function CreateMirrors() { { source: '', destination: '' }, ]); useEffect(() => { - listAllPeers().then((peers) => setPeers(peers.peers)); + fetch('/api/peers') + .then((res) => res.json()) + .then((res) => { + setPeers(res.peers); + }); }, []); return ( diff --git a/ui/app/mirrors/edit/[mirrorId]/page.tsx b/ui/app/mirrors/edit/[mirrorId]/page.tsx index 34fb6a80e6..6a7eff8637 100644 --- a/ui/app/mirrors/edit/[mirrorId]/page.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/page.tsx @@ -36,7 +36,7 @@ export default function EditMirror({ params: { mirrorId } }: EditMirrorProps) { } = useSWR(() => [`/api/mirrors/status`, mirrorId], fetcher); if (isValidating) { - return ; + return ; } if (error) { diff --git a/ui/app/mirrors/page.tsx b/ui/app/mirrors/page.tsx index 64bec76782..16a771dd5e 100644 --- a/ui/app/mirrors/page.tsx +++ b/ui/app/mirrors/page.tsx @@ -8,9 +8,9 @@ import { LayoutMain } from '@/lib/Layout'; import { Panel } from '@/lib/Panel'; import { SearchField } from '@/lib/SearchField'; import { Table, TableCell, TableRow } from '@/lib/Table'; -import { PrismaClient } from '@prisma/client'; import moment from 'moment'; import Link from 'next/link'; +import prisma from '../utils/prisma'; export const dynamic = 'force-dynamic'; @@ -34,7 +34,6 @@ const Badges = [ ]; async function CDCFlows() { - const prisma = new PrismaClient(); const flows = await prisma.flows.findMany({ include: { sourcePeer: true, @@ -116,7 +115,6 @@ async function CDCFlows() { // query replication flows table like CDC flows table async function QRepFlows() { - const prisma = new PrismaClient(); const flows = await prisma.flows.findMany({ include: { sourcePeer: true, diff --git a/ui/app/peers/create/configuration/handlers.ts b/ui/app/peers/create/configuration/handlers.ts index 80ab6688f2..2965e77eab 100644 --- a/ui/app/peers/create/configuration/handlers.ts +++ b/ui/app/peers/create/configuration/handlers.ts @@ -1,3 +1,4 @@ +import { UCreatePeerResponse, UValidatePeerResponse } from '@/app/dto/PeersDTO'; import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context'; import { Dispatch, SetStateAction } from 'react'; import { pgSchema, sfSchema } from './schema'; @@ -45,7 +46,7 @@ export const handleValidate = async ( const isValid = validateFields(type, config, setMessage, name); if (!isValid) return; setLoading(true); - const statusMessage = await fetch('/api/peers/', { + const valid: UValidatePeerResponse = await fetch('/api/peers/', { method: 'POST', body: JSON.stringify({ name, @@ -53,9 +54,9 @@ export const handleValidate = async ( config, mode: 'validate', }), - }).then((res) => res.text()); - if (statusMessage !== 'valid') { - setMessage({ ok: false, msg: statusMessage }); + }).then((res) => res.json()); + if (!valid.valid) { + setMessage({ ok: false, msg: valid.message }); setLoading(false); return; } else { @@ -76,7 +77,7 @@ export const handleCreate = async ( let isValid = validateFields(type, config, setMessage, name); if (!isValid) return; setLoading(true); - const statusMessage = await fetch('/api/peers/', { + const createdPeer: UCreatePeerResponse = await fetch('/api/peers/', { method: 'POST', body: JSON.stringify({ name, @@ -84,14 +85,13 @@ export const handleCreate = async ( config, mode: 'create', }), - }).then((res) => res.text()); - if (statusMessage !== 'created') { - setMessage({ ok: false, msg: statusMessage }); + }).then((res) => res.json()); + if (!createdPeer.created) { + setMessage({ ok: false, msg: createdPeer.message }); setLoading(false); return; - } else { - setMessage({ ok: true, msg: 'Peer created successfully' }); - router.push('/peers'); } + setMessage({ ok: true, msg: 'Peer created successfully' }); + router.push('/peers'); setLoading(false); }; diff --git a/ui/app/peers/handler.ts b/ui/app/peers/handler.ts deleted file mode 100644 index 824a4f51e6..0000000000 --- a/ui/app/peers/handler.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ListPeersRequest } from '@/grpc_generated/route'; -import { GetFlowServiceClientFromEnv } from '@/rpc/rpc'; -export async function fetchPeers() { - let flowServiceClient = GetFlowServiceClientFromEnv(); - let req: ListPeersRequest = {}; - let peers = await flowServiceClient.listPeers(req); - return peers.peers; -} diff --git a/ui/app/peers/page.tsx b/ui/app/peers/page.tsx index 75fbafa617..0ec8e00195 100644 --- a/ui/app/peers/page.tsx +++ b/ui/app/peers/page.tsx @@ -1,4 +1,4 @@ -import { Peer } from '@/grpc_generated/peers'; +import { DBType, Peer } from '@/grpc_generated/peers'; import { Button } from '@/lib/Button'; import { Checkbox } from '@/lib/Checkbox'; import { Icon } from '@/lib/Icon'; @@ -8,14 +8,14 @@ import { Panel } from '@/lib/Panel'; import { SearchField } from '@/lib/SearchField'; import { Select } from '@/lib/Select'; import { Table, TableCell, TableRow } from '@/lib/Table'; -import { fetchPeers } from './handler'; - import Link from 'next/link'; import { Suspense } from 'react'; import { Header } from '../../lib/Header'; +import prisma from '../utils/prisma'; export const dynamic = 'force-dynamic'; function PeerRow({ peer }: { peer: Peer }) { + const peerType = DBType[peer.type]; return ( @@ -27,12 +27,17 @@ function PeerRow({ peer }: { peer: Peer }) { - + ); } +async function fetchPeers() { + const peers = await prisma.peers.findMany({}); + return peers; +} + async function PeersTable({ title }: { title: string }) { let peers = await fetchPeers(); return ( diff --git a/ui/app/utils/prisma.ts b/ui/app/utils/prisma.ts new file mode 100644 index 0000000000..4e54f7a77e --- /dev/null +++ b/ui/app/utils/prisma.ts @@ -0,0 +1,5 @@ +import { PrismaClient } from '@prisma/client'; + +const prisma = new PrismaClient(); + +export default prisma; diff --git a/ui/grpc_generated/route.ts b/ui/grpc_generated/route.ts index df68fcd19c..d6099faecc 100644 --- a/ui/grpc_generated/route.ts +++ b/ui/grpc_generated/route.ts @@ -126,13 +126,6 @@ export interface ShutdownResponse { errorMessage: string; } -export interface ListPeersRequest { -} - -export interface ListPeersResponse { - peers: Peer[]; -} - export interface ValidatePeerRequest { peer: Peer | undefined; } @@ -631,106 +624,6 @@ export const ShutdownResponse = { }, }; -function createBaseListPeersRequest(): ListPeersRequest { - return {}; -} - -export const ListPeersRequest = { - encode(_: ListPeersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListPeersRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListPeersRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(_: any): ListPeersRequest { - return {}; - }, - - toJSON(_: ListPeersRequest): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): ListPeersRequest { - return ListPeersRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): ListPeersRequest { - const message = createBaseListPeersRequest(); - return message; - }, -}; - -function createBaseListPeersResponse(): ListPeersResponse { - return { peers: [] }; -} - -export const ListPeersResponse = { - encode(message: ListPeersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.peers) { - Peer.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListPeersResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListPeersResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.peers.push(Peer.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(object: any): ListPeersResponse { - return { peers: Array.isArray(object?.peers) ? object.peers.map((e: any) => Peer.fromJSON(e)) : [] }; - }, - - toJSON(message: ListPeersResponse): unknown { - const obj: any = {}; - if (message.peers?.length) { - obj.peers = message.peers.map((e) => Peer.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): ListPeersResponse { - return ListPeersResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ListPeersResponse { - const message = createBaseListPeersResponse(); - message.peers = object.peers?.map((e) => Peer.fromPartial(e)) || []; - return message; - }, -}; - function createBaseValidatePeerRequest(): ValidatePeerRequest { return { peer: undefined }; } @@ -1611,15 +1504,6 @@ export const MirrorStatusResponse = { export type FlowServiceService = typeof FlowServiceService; export const FlowServiceService = { - listPeers: { - path: "/peerdb_route.FlowService/ListPeers", - requestStream: false, - responseStream: false, - requestSerialize: (value: ListPeersRequest) => Buffer.from(ListPeersRequest.encode(value).finish()), - requestDeserialize: (value: Buffer) => ListPeersRequest.decode(value), - responseSerialize: (value: ListPeersResponse) => Buffer.from(ListPeersResponse.encode(value).finish()), - responseDeserialize: (value: Buffer) => ListPeersResponse.decode(value), - }, validatePeer: { path: "/peerdb_route.FlowService/ValidatePeer", requestStream: false, @@ -1677,7 +1561,6 @@ export const FlowServiceService = { } as const; export interface FlowServiceServer extends UntypedServiceImplementation { - listPeers: handleUnaryCall; validatePeer: handleUnaryCall; createPeer: handleUnaryCall; createCdcFlow: handleUnaryCall; @@ -1687,21 +1570,6 @@ export interface FlowServiceServer extends UntypedServiceImplementation { } export interface FlowServiceClient extends Client { - listPeers( - request: ListPeersRequest, - callback: (error: ServiceError | null, response: ListPeersResponse) => void, - ): ClientUnaryCall; - listPeers( - request: ListPeersRequest, - metadata: Metadata, - callback: (error: ServiceError | null, response: ListPeersResponse) => void, - ): ClientUnaryCall; - listPeers( - request: ListPeersRequest, - metadata: Metadata, - options: Partial, - callback: (error: ServiceError | null, response: ListPeersResponse) => void, - ): ClientUnaryCall; validatePeer( request: ValidatePeerRequest, callback: (error: ServiceError | null, response: ValidatePeerResponse) => void, diff --git a/ui/rpc/http.ts b/ui/rpc/http.ts index 9a6e8a4485..c0d9b75542 100644 --- a/ui/rpc/http.ts +++ b/ui/rpc/http.ts @@ -1,3 +1,5 @@ +import 'server-only'; + export function GetFlowHttpAddressFromEnv() { return process.env.PEERDB_FLOW_SERVER_HTTP!; } diff --git a/ui/rpc/promisify.ts b/ui/rpc/promisify.ts deleted file mode 100644 index b561f7c011..0000000000 --- a/ui/rpc/promisify.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { - CallOptions, - Client, - ClientUnaryCall, - Metadata, - ServiceError, -} from '@grpc/grpc-js'; - -type OriginalCall = ( - request: T, - metadata: Metadata, - options: Partial, - callback: (err: ServiceError | null, res?: U) => void -) => ClientUnaryCall; - -type PromisifiedCall = ( - request: T, - metadata?: Metadata, - options?: Partial -) => Promise; - -export type PromisifiedClient = { $: C } & { - [prop in Exclude]: C[prop] extends OriginalCall< - infer T, - infer U - > - ? PromisifiedCall - : never; -}; - -export function promisifyClient(client: C) { - return new Proxy(client, { - get: (target, descriptor) => { - const key = descriptor as keyof PromisifiedClient; - - if (key === '$') return target; - - const func = target[key]; - if (typeof func === 'function') - return (...args: unknown[]) => - new Promise((resolve, reject) => - func.call( - target, - ...[ - ...args, - (err: unknown, res: unknown) => - err ? reject(err) : resolve(res), - ] - ) - ); - }, - }) as unknown as PromisifiedClient; -} diff --git a/ui/rpc/rpc.ts b/ui/rpc/rpc.ts deleted file mode 100644 index e2f014d6b8..0000000000 --- a/ui/rpc/rpc.ts +++ /dev/null @@ -1,13 +0,0 @@ -import 'server-only'; - -import { FlowServiceClient } from '@/grpc_generated/route'; -import { credentials } from '@grpc/grpc-js'; -import { promisifyClient } from './promisify'; - -export function GetFlowServiceClientFromEnv() { - let address = process.env.PEERDB_FLOW_SERVER_ADDRESS!; - console.log(`Connecting to Flow server at ${address}`); - return promisifyClient( - new FlowServiceClient(address, credentials.createInsecure()) - ); -}