From 219ed138ba4098b6673ca96993ee40f2b3822a19 Mon Sep 17 00:00:00 2001 From: Fabian Helm <fabian.helm@stud.h-da.de> Date: Thu, 27 Jan 2022 17:11:58 +0100 Subject: [PATCH] added repeated pid/did for getPnd/Ond Request --- go/gosdn/core/core.pb.go | 10 +++++----- go/gosdn/core/core.pb.gw.go | 4 ++-- go/gosdn/pnd/pnd.pb.go | 12 ++++++------ go/gosdn/pnd/pnd.pb.gw.go | 4 ++-- openapiv2/gosdn_northbound.swagger.json | 24 +++++++++++++++++------- proto/gosdn/core/core.proto | 2 +- proto/gosdn/pnd/pnd.proto | 2 +- 7 files changed, 34 insertions(+), 24 deletions(-) diff --git a/go/gosdn/core/core.pb.go b/go/gosdn/core/core.pb.go index 1ffa1a7..01dee43 100644 --- a/go/gosdn/core/core.pb.go +++ b/go/gosdn/core/core.pb.go @@ -123,8 +123,8 @@ type GetPndRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. + Pid []string `protobuf:"bytes,3,rep,name=pid,proto3" json:"pid,omitempty"` } func (x *GetPndRequest) Reset() { @@ -166,11 +166,11 @@ func (x *GetPndRequest) GetTimestamp() int64 { return 0 } -func (x *GetPndRequest) GetPid() string { +func (x *GetPndRequest) GetPid() []string { if x != nil { return x.Pid } - return "" + return nil } type GetPndListResponse struct { @@ -581,7 +581,7 @@ var file_gosdn_core_core_proto_rawDesc = []byte{ 0x50, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x12, 0x47, 0x65, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, diff --git a/go/gosdn/core/core.pb.gw.go b/go/gosdn/core/core.pb.gw.go index 8c56242..f20b6b3 100644 --- a/go/gosdn/core/core.pb.gw.go +++ b/go/gosdn/core/core.pb.gw.go @@ -51,7 +51,7 @@ func request_CoreService_GetPnd_0(ctx context.Context, marshaler runtime.Marshal return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pid") } - protoReq.Pid, err = runtime.String(val) + protoReq.Pid, err = runtime.StringSlice(val, ",") if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } @@ -84,7 +84,7 @@ func local_request_CoreService_GetPnd_0(ctx context.Context, marshaler runtime.M return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pid") } - protoReq.Pid, err = runtime.String(val) + protoReq.Pid, err = runtime.StringSlice(val, ",") if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } diff --git a/go/gosdn/pnd/pnd.pb.go b/go/gosdn/pnd/pnd.pb.go index a22332f..748b56d 100644 --- a/go/gosdn/pnd/pnd.pb.go +++ b/go/gosdn/pnd/pnd.pb.go @@ -294,9 +294,9 @@ type GetOndRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Did string `protobuf:"bytes,3,opt,name=did,proto3" json:"did,omitempty"` - Pid string `protobuf:"bytes,4,opt,name=pid,proto3" json:"pid,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. + Did []string `protobuf:"bytes,3,rep,name=did,proto3" json:"did,omitempty"` + Pid string `protobuf:"bytes,4,opt,name=pid,proto3" json:"pid,omitempty"` } func (x *GetOndRequest) Reset() { @@ -338,11 +338,11 @@ func (x *GetOndRequest) GetTimestamp() int64 { return 0 } -func (x *GetOndRequest) GetDid() string { +func (x *GetOndRequest) GetDid() []string { if x != nil { return x.Did } - return "" + return nil } func (x *GetOndRequest) GetPid() string { @@ -2306,7 +2306,7 @@ var file_gosdn_pnd_pnd_proto_rawDesc = []byte{ 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, diff --git a/go/gosdn/pnd/pnd.pb.gw.go b/go/gosdn/pnd/pnd.pb.gw.go index 352d623..05cade7 100644 --- a/go/gosdn/pnd/pnd.pb.gw.go +++ b/go/gosdn/pnd/pnd.pb.gw.go @@ -131,7 +131,7 @@ func request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") } - protoReq.Did, err = runtime.String(val) + protoReq.Did, err = runtime.StringSlice(val, ",") if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) } @@ -174,7 +174,7 @@ func local_request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") } - protoReq.Did, err = runtime.String(val) + protoReq.Did, err = runtime.StringSlice(val, ",") if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) } diff --git a/openapiv2/gosdn_northbound.swagger.json b/openapiv2/gosdn_northbound.swagger.json index e1e3776..0ac935c 100644 --- a/openapiv2/gosdn_northbound.swagger.json +++ b/openapiv2/gosdn_northbound.swagger.json @@ -17,9 +17,6 @@ { "name": "PndService" }, - { - "name": "Collector" - }, { "name": "gNMI" }, @@ -27,10 +24,13 @@ "name": "CsbiService" }, { - "name": "AgentManager" + "name": "CoreService" }, { - "name": "CoreService" + "name": "Collector" + }, + { + "name": "AgentManager" } ], "consumes": [ @@ -63,7 +63,12 @@ "name": "pid", "in": "path", "required": true, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "minItems": 1 }, { "name": "timestamp", @@ -339,7 +344,12 @@ "name": "did", "in": "path", "required": true, - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "minItems": 1 }, { "name": "timestamp", diff --git a/proto/gosdn/core/core.proto b/proto/gosdn/core/core.proto index 0a63a27..affbac0 100644 --- a/proto/gosdn/core/core.proto +++ b/proto/gosdn/core/core.proto @@ -41,7 +41,7 @@ message GetPndListRequest { message GetPndRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - string pid = 3; + repeated string pid = 3; } message GetPndListResponse { diff --git a/proto/gosdn/pnd/pnd.proto b/proto/gosdn/pnd/pnd.proto index 41d4cba..6aa9bf9 100644 --- a/proto/gosdn/pnd/pnd.proto +++ b/proto/gosdn/pnd/pnd.proto @@ -124,7 +124,7 @@ message GetOndListRequest { message GetOndRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - string did = 3; + repeated string did = 3; string pid = 4; } -- GitLab