summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-18 15:06:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-20 10:33:10 +0900
commita88e0b5592b5f344981983d91f4f55a6d3f002bf (patch)
tree2fb183724091e4c1b2e2e6b70179821ea9c4b0fe /api
parent7cb50ce1cfdf959a74dad516ef65a6c6c34aaec8 (diff)
api: support statement modification via grpc
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api')
-rw-r--r--api/gobgp.pb.go44
-rw-r--r--api/gobgp.proto6
2 files changed, 50 insertions, 0 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index d3bdc1e4..e3d4e8b3 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -16,6 +16,7 @@ It has these top-level messages:
MrtArguments
ModVrfArguments
ModDefinedSetArguments
+ ModStatementArguments
Path
Destination
PeerConf
@@ -302,6 +303,22 @@ func (m *ModDefinedSetArguments) GetSet() *DefinedSet {
return nil
}
+type ModStatementArguments struct {
+ Operation Operation `protobuf:"varint,1,opt,name=operation,enum=gobgpapi.Operation" json:"operation,omitempty"`
+ Statement *Statement `protobuf:"bytes,2,opt,name=statement" json:"statement,omitempty"`
+}
+
+func (m *ModStatementArguments) Reset() { *m = ModStatementArguments{} }
+func (m *ModStatementArguments) String() string { return proto.CompactTextString(m) }
+func (*ModStatementArguments) ProtoMessage() {}
+
+func (m *ModStatementArguments) GetStatement() *Statement {
+ if m != nil {
+ return m.Statement
+ }
+ return nil
+}
+
type Path struct {
Nlri []byte `protobuf:"bytes,1,opt,name=nlri,proto3" json:"nlri,omitempty"`
Pattrs [][]byte `protobuf:"bytes,2,rep,name=pattrs,proto3" json:"pattrs,omitempty"`
@@ -751,6 +768,7 @@ type GobgpApiClient interface {
ModDefinedSet(ctx context.Context, in *ModDefinedSetArguments, opts ...grpc.CallOption) (*Error, error)
GetStatement(ctx context.Context, in *Statement, opts ...grpc.CallOption) (*Statement, error)
GetStatements(ctx context.Context, in *Statement, opts ...grpc.CallOption) (GobgpApi_GetStatementsClient, error)
+ ModStatement(ctx context.Context, in *ModStatementArguments, opts ...grpc.CallOption) (*Error, error)
}
type gobgpApiClient struct {
@@ -1335,6 +1353,15 @@ func (x *gobgpApiGetStatementsClient) Recv() (*Statement, error) {
return m, nil
}
+func (c *gobgpApiClient) ModStatement(ctx context.Context, in *ModStatementArguments, opts ...grpc.CallOption) (*Error, error) {
+ out := new(Error)
+ err := grpc.Invoke(ctx, "/gobgpapi.GobgpApi/ModStatement", in, out, c.cc, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// Server API for GobgpApi service
type GobgpApiServer interface {
@@ -1366,6 +1393,7 @@ type GobgpApiServer interface {
ModDefinedSet(context.Context, *ModDefinedSetArguments) (*Error, error)
GetStatement(context.Context, *Statement) (*Statement, error)
GetStatements(*Statement, GobgpApi_GetStatementsServer) error
+ ModStatement(context.Context, *ModStatementArguments) (*Error, error)
}
func RegisterGobgpApiServer(s *grpc.Server, srv GobgpApiServer) {
@@ -1849,6 +1877,18 @@ func (x *gobgpApiGetStatementsServer) Send(m *Statement) error {
return x.ServerStream.SendMsg(m)
}
+func _GobgpApi_ModStatement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
+ in := new(ModStatementArguments)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ out, err := srv.(GobgpApiServer).ModStatement(ctx, in)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
var _GobgpApi_serviceDesc = grpc.ServiceDesc{
ServiceName: "gobgpapi.GobgpApi",
HandlerType: (*GobgpApiServer)(nil),
@@ -1909,6 +1949,10 @@ var _GobgpApi_serviceDesc = grpc.ServiceDesc{
MethodName: "GetStatement",
Handler: _GobgpApi_GetStatement_Handler,
},
+ {
+ MethodName: "ModStatement",
+ Handler: _GobgpApi_ModStatement_Handler,
+ },
},
Streams: []grpc.StreamDesc{
{
diff --git a/api/gobgp.proto b/api/gobgp.proto
index ad070e60..84eb8c74 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -48,6 +48,7 @@ service GobgpApi {
rpc ModDefinedSet(ModDefinedSetArguments) returns (Error) {}
rpc GetStatement(Statement) returns (Statement) {}
rpc GetStatements(Statement) returns (stream Statement) {}
+ rpc ModStatement(ModStatementArguments) returns (Error) {}
}
message Error {
@@ -97,6 +98,11 @@ message ModDefinedSetArguments {
DefinedSet set = 2;
}
+message ModStatementArguments {
+ Operation operation = 1;
+ Statement statement = 2;
+}
+
enum Resource {
GLOBAL = 0;
LOCAL = 1;