Skip to content
Snippets Groups Projects
Commit e6a62399 authored by Malte Bauch's avatar Malte Bauch
Browse files

Add a new gRPC service to request southbound schema information

For the prompt mode in the CLI we need to transport the southbound
specific ygot generated yang schema.
parent 8041238a
Branches
No related tags found
No related merge requests found
...@@ -75,6 +75,116 @@ func (Type) EnumDescriptor() ([]byte, []int) { ...@@ -75,6 +75,116 @@ func (Type) EnumDescriptor() ([]byte, []int) {
return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{0} return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{0}
} }
type GetSchemaRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"`
Sid string `protobuf:"bytes,3,opt,name=sid,proto3" json:"sid,omitempty"`
}
func (x *GetSchemaRequest) Reset() {
*x = GetSchemaRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetSchemaRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetSchemaRequest) ProtoMessage() {}
func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[0]
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 GetSchemaRequest.ProtoReflect.Descriptor instead.
func (*GetSchemaRequest) Descriptor() ([]byte, []int) {
return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{0}
}
func (x *GetSchemaRequest) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *GetSchemaRequest) GetPid() string {
if x != nil {
return x.Pid
}
return ""
}
func (x *GetSchemaRequest) GetSid() string {
if x != nil {
return x.Sid
}
return ""
}
type Payload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
}
func (x *Payload) Reset() {
*x = Payload{}
if protoimpl.UnsafeEnabled {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Payload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Payload) ProtoMessage() {}
func (x *Payload) ProtoReflect() protoreflect.Message {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Payload.ProtoReflect.Descriptor instead.
func (*Payload) Descriptor() ([]byte, []int) {
return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{1}
}
func (x *Payload) GetChunk() []byte {
if x != nil {
return x.Chunk
}
return nil
}
type SouthboundInterface struct { type SouthboundInterface struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
...@@ -87,7 +197,7 @@ type SouthboundInterface struct { ...@@ -87,7 +197,7 @@ type SouthboundInterface struct {
func (x *SouthboundInterface) Reset() { func (x *SouthboundInterface) Reset() {
*x = SouthboundInterface{} *x = SouthboundInterface{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[0] mi := &file_gosdn_southbound_southbound_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
...@@ -100,7 +210,7 @@ func (x *SouthboundInterface) String() string { ...@@ -100,7 +210,7 @@ func (x *SouthboundInterface) String() string {
func (*SouthboundInterface) ProtoMessage() {} func (*SouthboundInterface) ProtoMessage() {}
func (x *SouthboundInterface) ProtoReflect() protoreflect.Message { func (x *SouthboundInterface) ProtoReflect() protoreflect.Message {
mi := &file_gosdn_southbound_southbound_proto_msgTypes[0] mi := &file_gosdn_southbound_southbound_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
...@@ -113,7 +223,7 @@ func (x *SouthboundInterface) ProtoReflect() protoreflect.Message { ...@@ -113,7 +223,7 @@ func (x *SouthboundInterface) ProtoReflect() protoreflect.Message {
// Deprecated: Use SouthboundInterface.ProtoReflect.Descriptor instead. // Deprecated: Use SouthboundInterface.ProtoReflect.Descriptor instead.
func (*SouthboundInterface) Descriptor() ([]byte, []int) { func (*SouthboundInterface) Descriptor() ([]byte, []int) {
return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{0} return file_gosdn_southbound_southbound_proto_rawDescGZIP(), []int{2}
} }
func (x *SouthboundInterface) GetId() string { func (x *SouthboundInterface) GetId() string {
...@@ -138,21 +248,35 @@ var file_gosdn_southbound_southbound_proto_rawDesc = []byte{ ...@@ -138,21 +248,35 @@ var file_gosdn_southbound_southbound_proto_rawDesc = []byte{
0x6f, 0x74, 0x6f, 0x12, 0x10, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68,
0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x13, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x63,
0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x1f, 0x0a,
0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e,
0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x51,
0x0a, 0x13, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65,
0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74,
0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x2a, 0x5a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x43, 0x4f, 0x4e, 0x46,
0x49, 0x47, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4e,
0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x49, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x03, 0x32, 0x5a, 0x0a,
0x0a, 0x53, 0x62, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x47,
0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53,
0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67,
0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e,
0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0x5a, 0x0a, 0x04, 0x54, 0x79, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x63, 0x6f, 0x64,
0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50, 0x45, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e,
0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x2f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x12, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x49, 0x74, 0x6f, 0x33,
0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4c,
0x55, 0x47, 0x49, 0x4e, 0x10, 0x03, 0x42, 0x30, 0x5a, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66,
0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x73, 0x6f,
0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
...@@ -168,15 +292,19 @@ func file_gosdn_southbound_southbound_proto_rawDescGZIP() []byte { ...@@ -168,15 +292,19 @@ func file_gosdn_southbound_southbound_proto_rawDescGZIP() []byte {
} }
var file_gosdn_southbound_southbound_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_gosdn_southbound_southbound_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_gosdn_southbound_southbound_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_gosdn_southbound_southbound_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_gosdn_southbound_southbound_proto_goTypes = []interface{}{ var file_gosdn_southbound_southbound_proto_goTypes = []interface{}{
(Type)(0), // 0: gosdn.southbound.Type (Type)(0), // 0: gosdn.southbound.Type
(*SouthboundInterface)(nil), // 1: gosdn.southbound.SouthboundInterface (*GetSchemaRequest)(nil), // 1: gosdn.southbound.GetSchemaRequest
(*Payload)(nil), // 2: gosdn.southbound.Payload
(*SouthboundInterface)(nil), // 3: gosdn.southbound.SouthboundInterface
} }
var file_gosdn_southbound_southbound_proto_depIdxs = []int32{ var file_gosdn_southbound_southbound_proto_depIdxs = []int32{
0, // 0: gosdn.southbound.SouthboundInterface.type:type_name -> gosdn.southbound.Type 0, // 0: gosdn.southbound.SouthboundInterface.type:type_name -> gosdn.southbound.Type
1, // [1:1] is the sub-list for method output_type 1, // 1: gosdn.southbound.SbiService.GetSchema:input_type -> gosdn.southbound.GetSchemaRequest
1, // [1:1] is the sub-list for method input_type 2, // 2: gosdn.southbound.SbiService.GetSchema:output_type -> gosdn.southbound.Payload
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee 1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name 0, // [0:1] is the sub-list for field type_name
...@@ -189,6 +317,30 @@ func file_gosdn_southbound_southbound_proto_init() { ...@@ -189,6 +317,30 @@ func file_gosdn_southbound_southbound_proto_init() {
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_gosdn_southbound_southbound_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_gosdn_southbound_southbound_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSchemaRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_gosdn_southbound_southbound_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Payload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_gosdn_southbound_southbound_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SouthboundInterface); i { switch v := v.(*SouthboundInterface); i {
case 0: case 0:
return &v.state return &v.state
...@@ -207,9 +359,9 @@ func file_gosdn_southbound_southbound_proto_init() { ...@@ -207,9 +359,9 @@ func file_gosdn_southbound_southbound_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_gosdn_southbound_southbound_proto_rawDesc, RawDescriptor: file_gosdn_southbound_southbound_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 1, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 1,
}, },
GoTypes: file_gosdn_southbound_southbound_proto_goTypes, GoTypes: file_gosdn_southbound_southbound_proto_goTypes,
DependencyIndexes: file_gosdn_southbound_southbound_proto_depIdxs, DependencyIndexes: file_gosdn_southbound_southbound_proto_depIdxs,
......
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package southbound
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// SbiServiceClient is the client API for SbiService service.
//
// 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 SbiServiceClient interface {
GetSchema(ctx context.Context, in *GetSchemaRequest, opts ...grpc.CallOption) (SbiService_GetSchemaClient, error)
}
type sbiServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSbiServiceClient(cc grpc.ClientConnInterface) SbiServiceClient {
return &sbiServiceClient{cc}
}
func (c *sbiServiceClient) GetSchema(ctx context.Context, in *GetSchemaRequest, opts ...grpc.CallOption) (SbiService_GetSchemaClient, error) {
stream, err := c.cc.NewStream(ctx, &SbiService_ServiceDesc.Streams[0], "/gosdn.southbound.SbiService/GetSchema", opts...)
if err != nil {
return nil, err
}
x := &sbiServiceGetSchemaClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type SbiService_GetSchemaClient interface {
Recv() (*Payload, error)
grpc.ClientStream
}
type sbiServiceGetSchemaClient struct {
grpc.ClientStream
}
func (x *sbiServiceGetSchemaClient) Recv() (*Payload, error) {
m := new(Payload)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SbiServiceServer is the server API for SbiService service.
// All implementations must embed UnimplementedSbiServiceServer
// for forward compatibility
type SbiServiceServer interface {
GetSchema(*GetSchemaRequest, SbiService_GetSchemaServer) error
mustEmbedUnimplementedSbiServiceServer()
}
// UnimplementedSbiServiceServer must be embedded to have forward compatible implementations.
type UnimplementedSbiServiceServer struct {
}
func (UnimplementedSbiServiceServer) GetSchema(*GetSchemaRequest, SbiService_GetSchemaServer) error {
return status.Errorf(codes.Unimplemented, "method GetSchema not implemented")
}
func (UnimplementedSbiServiceServer) mustEmbedUnimplementedSbiServiceServer() {}
// UnsafeSbiServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SbiServiceServer will
// result in compilation errors.
type UnsafeSbiServiceServer interface {
mustEmbedUnimplementedSbiServiceServer()
}
func RegisterSbiServiceServer(s grpc.ServiceRegistrar, srv SbiServiceServer) {
s.RegisterService(&SbiService_ServiceDesc, srv)
}
func _SbiService_GetSchema_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(GetSchemaRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SbiServiceServer).GetSchema(m, &sbiServiceGetSchemaServer{stream})
}
type SbiService_GetSchemaServer interface {
Send(*Payload) error
grpc.ServerStream
}
type sbiServiceGetSchemaServer struct {
grpc.ServerStream
}
func (x *sbiServiceGetSchemaServer) Send(m *Payload) error {
return x.ServerStream.SendMsg(m)
}
// SbiService_ServiceDesc is the grpc.ServiceDesc for SbiService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SbiService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gosdn.southbound.SbiService",
HandlerType: (*SbiServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "GetSchema",
Handler: _SbiService_GetSchema_Handler,
ServerStreams: true,
},
},
Metadata: "gosdn/southbound/southbound.proto",
}
...@@ -21,13 +21,16 @@ ...@@ -21,13 +21,16 @@
"name": "gNMI" "name": "gNMI"
}, },
{ {
"name": "CoreService" "name": "AgentManager"
},
{
"name": "SbiService"
}, },
{ {
"name": "Collector" "name": "Collector"
}, },
{ {
"name": "AgentManager" "name": "CoreService"
}, },
{ {
"name": "CsbiService" "name": "CsbiService"
...@@ -910,15 +913,6 @@ ...@@ -910,15 +913,6 @@
} }
} }
}, },
"csbiPayload": {
"type": "object",
"properties": {
"chunk": {
"type": "string",
"format": "byte"
}
}
},
"fakeBoolList": { "fakeBoolList": {
"type": "object", "type": "object",
"properties": { "properties": {
...@@ -1963,6 +1957,15 @@ ...@@ -1963,6 +1957,15 @@
} }
} }
}, },
"gosdncsbiPayload": {
"type": "object",
"properties": {
"chunk": {
"type": "string",
"format": "byte"
}
}
},
"gosdncsbiState": { "gosdncsbiState": {
"type": "string", "type": "string",
"enum": [ "enum": [
...@@ -2006,6 +2009,15 @@ ...@@ -2006,6 +2009,15 @@
], ],
"default": "STATUS_UNSPECIFIED" "default": "STATUS_UNSPECIFIED"
}, },
"gosdnsouthboundPayload": {
"type": "object",
"properties": {
"chunk": {
"type": "string",
"format": "byte"
}
}
},
"gosdnsouthboundType": { "gosdnsouthboundType": {
"type": "string", "type": "string",
"enum": [ "enum": [
...@@ -2015,7 +2027,7 @@ ...@@ -2015,7 +2027,7 @@
"TYPE_PLUGIN" "TYPE_PLUGIN"
], ],
"default": "TYPE_UNSPECIFIED", "default": "TYPE_UNSPECIFIED",
"title": "Changed accoprding to style guide: \r\nhttps://docs.buf.build/best-practices/style-guide#enums" "title": "Changed accoprding to style guide:\r\nhttps://docs.buf.build/best-practices/style-guide#enums"
}, },
"pndApiOperation": { "pndApiOperation": {
"type": "string", "type": "string",
......
...@@ -6,6 +6,8 @@ import "gosdn/transport/transport.proto"; ...@@ -6,6 +6,8 @@ import "gosdn/transport/transport.proto";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/csbi"; option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/csbi";
// only used from within the controller; therefore we do not provide
// grpc-gateway definitions
service CsbiService { service CsbiService {
rpc Get(GetRequest) returns (GetResponse); rpc Get(GetRequest) returns (GetResponse);
rpc GetGoStruct(GetRequest) returns (stream Payload); rpc GetGoStruct(GetRequest) returns (stream Payload);
......
...@@ -3,7 +3,6 @@ syntax = "proto3"; ...@@ -3,7 +3,6 @@ syntax = "proto3";
package gosdn.pnd; package gosdn.pnd;
import "google/api/annotations.proto"; import "google/api/annotations.proto";
//import "protoc-gen-openapiv2/options/annotations.proto";
import "google/protobuf/descriptor.proto"; import "google/protobuf/descriptor.proto";
import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto";
import "gosdn/transport/transport.proto"; import "gosdn/transport/transport.proto";
...@@ -358,4 +357,4 @@ enum Status { ...@@ -358,4 +357,4 @@ enum Status {
STATUS_UNSPECIFIED = 0; STATUS_UNSPECIFIED = 0;
STATUS_OK = 1; STATUS_OK = 1;
STATUS_ERROR = 2; STATUS_ERROR = 2;
} }
\ No newline at end of file
...@@ -6,13 +6,32 @@ import "google/protobuf/descriptor.proto"; ...@@ -6,13 +6,32 @@ import "google/protobuf/descriptor.proto";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/southbound"; option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/southbound";
service SbiService {
rpc GetSchema(GetSchemaRequest) returns (stream Payload);
//{
// NOTE: probably the most intuitive route, but obviously we should go for
// something like: /pnd/{pid}/sbi/{sid}/schema and provide the information
// about the schema
// get: "/pnds/{pid}/onds/{did}/schema"
//};
}
message GetSchemaRequest {
int64 timestamp = 1;
string pid = 2;
string sid = 3;
}
message Payload {
bytes chunk = 1;
}
message SouthboundInterface { message SouthboundInterface {
string id = 1; string id = 1;
Type type = 2; Type type = 2;
} }
// Changed accoprding to style guide: // Changed according to style guide:
// https://docs.buf.build/best-practices/style-guide#enums // https://docs.buf.build/best-practices/style-guide#enums
enum Type { enum Type {
TYPE_UNSPECIFIED = 0; TYPE_UNSPECIFIED = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment