diff --git a/api/go/gosdn/plugin/plugin.pb.go b/api/go/gosdn/plugin/plugin.pb.go index a65274f011b9b0814a41aff8b317e4eeedf7a7da..0950bf0d781c0f891f5552db3add0418a425eba6 100644 --- a/api/go/gosdn/plugin/plugin.pb.go +++ b/api/go/gosdn/plugin/plugin.pb.go @@ -728,6 +728,100 @@ func (x *ValidateChangeResponse) GetModel() []byte { return nil } +type PruneConfigFalseRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *PruneConfigFalseRequest) Reset() { + *x = PruneConfigFalseRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_plugin_plugin_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PruneConfigFalseRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PruneConfigFalseRequest) ProtoMessage() {} + +func (x *PruneConfigFalseRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_plugin_plugin_proto_msgTypes[14] + 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 PruneConfigFalseRequest.ProtoReflect.Descriptor instead. +func (*PruneConfigFalseRequest) Descriptor() ([]byte, []int) { + return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{14} +} + +func (x *PruneConfigFalseRequest) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type PruneConfigFalseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Model []byte `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` +} + +func (x *PruneConfigFalseResponse) Reset() { + *x = PruneConfigFalseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_plugin_plugin_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PruneConfigFalseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PruneConfigFalseResponse) ProtoMessage() {} + +func (x *PruneConfigFalseResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_plugin_plugin_proto_msgTypes[15] + 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 PruneConfigFalseResponse.ProtoReflect.Descriptor instead. +func (*PruneConfigFalseResponse) Descriptor() ([]byte, []int) { + return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{15} +} + +func (x *PruneConfigFalseResponse) GetModel() []byte { + if x != nil { + return x.Model + } + return nil +} + type SchemaTreeGzipRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -737,7 +831,7 @@ type SchemaTreeGzipRequest struct { func (x *SchemaTreeGzipRequest) Reset() { *x = SchemaTreeGzipRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_plugin_plugin_proto_msgTypes[14] + mi := &file_gosdn_plugin_plugin_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -750,7 +844,7 @@ func (x *SchemaTreeGzipRequest) String() string { func (*SchemaTreeGzipRequest) ProtoMessage() {} func (x *SchemaTreeGzipRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_plugin_plugin_proto_msgTypes[14] + mi := &file_gosdn_plugin_plugin_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,7 +857,7 @@ func (x *SchemaTreeGzipRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SchemaTreeGzipRequest.ProtoReflect.Descriptor instead. func (*SchemaTreeGzipRequest) Descriptor() ([]byte, []int) { - return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{14} + return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{16} } type Payload struct { @@ -777,7 +871,7 @@ type Payload struct { func (x *Payload) Reset() { *x = Payload{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_plugin_plugin_proto_msgTypes[15] + mi := &file_gosdn_plugin_plugin_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -790,7 +884,7 @@ func (x *Payload) String() string { func (*Payload) ProtoMessage() {} func (x *Payload) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_plugin_plugin_proto_msgTypes[15] + mi := &file_gosdn_plugin_plugin_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -803,7 +897,7 @@ func (x *Payload) ProtoReflect() protoreflect.Message { // Deprecated: Use Payload.ProtoReflect.Descriptor instead. func (*Payload) Descriptor() ([]byte, []int) { - return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{15} + return file_gosdn_plugin_plugin_proto_rawDescGZIP(), []int{17} } func (x *Payload) GetChunk() []byte { @@ -880,52 +974,65 @@ var file_gosdn_plugin_plugin_proto_rawDesc = []byte{ 0x65, 0x22, 0x2e, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x72, 0x65, 0x65, 0x47, - 0x7a, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x32, 0xe5, 0x04, 0x0a, 0x06, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x09, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, - 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, - 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1a, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x44, 0x69, 0x66, 0x66, 0x12, - 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x44, - 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x54, 0x72, 0x65, 0x65, 0x47, 0x7a, 0x69, 0x70, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x72, - 0x65, 0x65, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x32, 0x5a, 0x30, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, - 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x22, 0x2f, 0x0a, 0x17, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x46, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x30, 0x0a, 0x18, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x72, + 0x65, 0x65, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x32, 0xc8, + 0x05, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x09, 0x55, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x46, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x44, 0x69, + 0x66, 0x66, 0x12, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x44, 0x69, 0x66, + 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0e, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x54, 0x72, 0x65, 0x65, 0x47, 0x7a, 0x69, 0x70, 0x12, 0x23, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x54, 0x72, 0x65, 0x65, 0x47, 0x7a, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x0e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x10, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x61, 0x6c, 0x73, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x32, 0x5a, 0x30, 0x63, 0x6f, 0x64, + 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, + 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, + 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -940,58 +1047,62 @@ func file_gosdn_plugin_plugin_proto_rawDescGZIP() []byte { return file_gosdn_plugin_plugin_proto_rawDescData } -var file_gosdn_plugin_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_gosdn_plugin_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_gosdn_plugin_plugin_proto_goTypes = []interface{}{ - (*UnmarshalRequest)(nil), // 0: gosdn.plugin.UnmarshalRequest - (*UnmarshalResponse)(nil), // 1: gosdn.plugin.UnmarshalResponse - (*SetNodeRequest)(nil), // 2: gosdn.plugin.SetNodeRequest - (*SetNodeResponse)(nil), // 3: gosdn.plugin.SetNodeResponse - (*GetNodeRequest)(nil), // 4: gosdn.plugin.GetNodeRequest - (*GetNodeResponse)(nil), // 5: gosdn.plugin.GetNodeResponse - (*DeleteNodeRequest)(nil), // 6: gosdn.plugin.DeleteNodeRequest - (*DeleteNodeResponse)(nil), // 7: gosdn.plugin.DeleteNodeResponse - (*ModelRequest)(nil), // 8: gosdn.plugin.ModelRequest - (*ModelResponse)(nil), // 9: gosdn.plugin.ModelResponse - (*DiffRequest)(nil), // 10: gosdn.plugin.DiffRequest - (*DiffResponse)(nil), // 11: gosdn.plugin.DiffResponse - (*ValidateChangeRequest)(nil), // 12: gosdn.plugin.ValidateChangeRequest - (*ValidateChangeResponse)(nil), // 13: gosdn.plugin.ValidateChangeResponse - (*SchemaTreeGzipRequest)(nil), // 14: gosdn.plugin.SchemaTreeGzipRequest - (*Payload)(nil), // 15: gosdn.plugin.Payload - (*gnmi.Path)(nil), // 16: gnmi.Path - (*gnmi.TypedValue)(nil), // 17: gnmi.TypedValue - (*gnmi.Notification)(nil), // 18: gnmi.Notification - (pnd.ApiOperation)(0), // 19: gosdn.pnd.ApiOperation + (*UnmarshalRequest)(nil), // 0: gosdn.plugin.UnmarshalRequest + (*UnmarshalResponse)(nil), // 1: gosdn.plugin.UnmarshalResponse + (*SetNodeRequest)(nil), // 2: gosdn.plugin.SetNodeRequest + (*SetNodeResponse)(nil), // 3: gosdn.plugin.SetNodeResponse + (*GetNodeRequest)(nil), // 4: gosdn.plugin.GetNodeRequest + (*GetNodeResponse)(nil), // 5: gosdn.plugin.GetNodeResponse + (*DeleteNodeRequest)(nil), // 6: gosdn.plugin.DeleteNodeRequest + (*DeleteNodeResponse)(nil), // 7: gosdn.plugin.DeleteNodeResponse + (*ModelRequest)(nil), // 8: gosdn.plugin.ModelRequest + (*ModelResponse)(nil), // 9: gosdn.plugin.ModelResponse + (*DiffRequest)(nil), // 10: gosdn.plugin.DiffRequest + (*DiffResponse)(nil), // 11: gosdn.plugin.DiffResponse + (*ValidateChangeRequest)(nil), // 12: gosdn.plugin.ValidateChangeRequest + (*ValidateChangeResponse)(nil), // 13: gosdn.plugin.ValidateChangeResponse + (*PruneConfigFalseRequest)(nil), // 14: gosdn.plugin.PruneConfigFalseRequest + (*PruneConfigFalseResponse)(nil), // 15: gosdn.plugin.PruneConfigFalseResponse + (*SchemaTreeGzipRequest)(nil), // 16: gosdn.plugin.SchemaTreeGzipRequest + (*Payload)(nil), // 17: gosdn.plugin.Payload + (*gnmi.Path)(nil), // 18: gnmi.Path + (*gnmi.TypedValue)(nil), // 19: gnmi.TypedValue + (*gnmi.Notification)(nil), // 20: gnmi.Notification + (pnd.ApiOperation)(0), // 21: gosdn.pnd.ApiOperation } var file_gosdn_plugin_plugin_proto_depIdxs = []int32{ - 16, // 0: gosdn.plugin.UnmarshalRequest.path:type_name -> gnmi.Path - 17, // 1: gosdn.plugin.UnmarshalRequest.value:type_name -> gnmi.TypedValue - 16, // 2: gosdn.plugin.SetNodeRequest.path:type_name -> gnmi.Path - 17, // 3: gosdn.plugin.SetNodeRequest.value:type_name -> gnmi.TypedValue - 16, // 4: gosdn.plugin.GetNodeRequest.path:type_name -> gnmi.Path - 18, // 5: gosdn.plugin.GetNodeResponse.nodes:type_name -> gnmi.Notification - 16, // 6: gosdn.plugin.DeleteNodeRequest.path:type_name -> gnmi.Path - 18, // 7: gosdn.plugin.DiffResponse.notification:type_name -> gnmi.Notification - 19, // 8: gosdn.plugin.ValidateChangeRequest.operation:type_name -> gosdn.pnd.ApiOperation - 16, // 9: gosdn.plugin.ValidateChangeRequest.path:type_name -> gnmi.Path + 18, // 0: gosdn.plugin.UnmarshalRequest.path:type_name -> gnmi.Path + 19, // 1: gosdn.plugin.UnmarshalRequest.value:type_name -> gnmi.TypedValue + 18, // 2: gosdn.plugin.SetNodeRequest.path:type_name -> gnmi.Path + 19, // 3: gosdn.plugin.SetNodeRequest.value:type_name -> gnmi.TypedValue + 18, // 4: gosdn.plugin.GetNodeRequest.path:type_name -> gnmi.Path + 20, // 5: gosdn.plugin.GetNodeResponse.nodes:type_name -> gnmi.Notification + 18, // 6: gosdn.plugin.DeleteNodeRequest.path:type_name -> gnmi.Path + 20, // 7: gosdn.plugin.DiffResponse.notification:type_name -> gnmi.Notification + 21, // 8: gosdn.plugin.ValidateChangeRequest.operation:type_name -> gosdn.pnd.ApiOperation + 18, // 9: gosdn.plugin.ValidateChangeRequest.path:type_name -> gnmi.Path 0, // 10: gosdn.plugin.Plugin.Unmarshal:input_type -> gosdn.plugin.UnmarshalRequest 2, // 11: gosdn.plugin.Plugin.SetNode:input_type -> gosdn.plugin.SetNodeRequest 4, // 12: gosdn.plugin.Plugin.GetNode:input_type -> gosdn.plugin.GetNodeRequest 6, // 13: gosdn.plugin.Plugin.DeleteNode:input_type -> gosdn.plugin.DeleteNodeRequest 8, // 14: gosdn.plugin.Plugin.Model:input_type -> gosdn.plugin.ModelRequest 10, // 15: gosdn.plugin.Plugin.Diff:input_type -> gosdn.plugin.DiffRequest - 14, // 16: gosdn.plugin.Plugin.SchemaTreeGzip:input_type -> gosdn.plugin.SchemaTreeGzipRequest + 16, // 16: gosdn.plugin.Plugin.SchemaTreeGzip:input_type -> gosdn.plugin.SchemaTreeGzipRequest 12, // 17: gosdn.plugin.Plugin.ValidateChange:input_type -> gosdn.plugin.ValidateChangeRequest - 1, // 18: gosdn.plugin.Plugin.Unmarshal:output_type -> gosdn.plugin.UnmarshalResponse - 3, // 19: gosdn.plugin.Plugin.SetNode:output_type -> gosdn.plugin.SetNodeResponse - 5, // 20: gosdn.plugin.Plugin.GetNode:output_type -> gosdn.plugin.GetNodeResponse - 7, // 21: gosdn.plugin.Plugin.DeleteNode:output_type -> gosdn.plugin.DeleteNodeResponse - 9, // 22: gosdn.plugin.Plugin.Model:output_type -> gosdn.plugin.ModelResponse - 11, // 23: gosdn.plugin.Plugin.Diff:output_type -> gosdn.plugin.DiffResponse - 15, // 24: gosdn.plugin.Plugin.SchemaTreeGzip:output_type -> gosdn.plugin.Payload - 13, // 25: gosdn.plugin.Plugin.ValidateChange:output_type -> gosdn.plugin.ValidateChangeResponse - 18, // [18:26] is the sub-list for method output_type - 10, // [10:18] is the sub-list for method input_type + 14, // 18: gosdn.plugin.Plugin.PruneConfigFalse:input_type -> gosdn.plugin.PruneConfigFalseRequest + 1, // 19: gosdn.plugin.Plugin.Unmarshal:output_type -> gosdn.plugin.UnmarshalResponse + 3, // 20: gosdn.plugin.Plugin.SetNode:output_type -> gosdn.plugin.SetNodeResponse + 5, // 21: gosdn.plugin.Plugin.GetNode:output_type -> gosdn.plugin.GetNodeResponse + 7, // 22: gosdn.plugin.Plugin.DeleteNode:output_type -> gosdn.plugin.DeleteNodeResponse + 9, // 23: gosdn.plugin.Plugin.Model:output_type -> gosdn.plugin.ModelResponse + 11, // 24: gosdn.plugin.Plugin.Diff:output_type -> gosdn.plugin.DiffResponse + 17, // 25: gosdn.plugin.Plugin.SchemaTreeGzip:output_type -> gosdn.plugin.Payload + 13, // 26: gosdn.plugin.Plugin.ValidateChange:output_type -> gosdn.plugin.ValidateChangeResponse + 15, // 27: gosdn.plugin.Plugin.PruneConfigFalse:output_type -> gosdn.plugin.PruneConfigFalseResponse + 19, // [19:28] is the sub-list for method output_type + 10, // [10:19] is the sub-list for method input_type 10, // [10:10] is the sub-list for extension type_name 10, // [10:10] is the sub-list for extension extendee 0, // [0:10] is the sub-list for field type_name @@ -1172,7 +1283,7 @@ func file_gosdn_plugin_plugin_proto_init() { } } file_gosdn_plugin_plugin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaTreeGzipRequest); i { + switch v := v.(*PruneConfigFalseRequest); i { case 0: return &v.state case 1: @@ -1184,6 +1295,30 @@ func file_gosdn_plugin_plugin_proto_init() { } } file_gosdn_plugin_plugin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PruneConfigFalseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_plugin_plugin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SchemaTreeGzipRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_plugin_plugin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Payload); i { case 0: return &v.state @@ -1202,7 +1337,7 @@ func file_gosdn_plugin_plugin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gosdn_plugin_plugin_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/gosdn/plugin/plugin_grpc.pb.go b/api/go/gosdn/plugin/plugin_grpc.pb.go index 3b597b77108df190cd37f1af26d1a766fdf12796..c7a66d4cd21d1caf9191bdd739a76c93a2405bee 100644 --- a/api/go/gosdn/plugin/plugin_grpc.pb.go +++ b/api/go/gosdn/plugin/plugin_grpc.pb.go @@ -26,6 +26,7 @@ type PluginClient interface { Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) SchemaTreeGzip(ctx context.Context, in *SchemaTreeGzipRequest, opts ...grpc.CallOption) (Plugin_SchemaTreeGzipClient, error) ValidateChange(ctx context.Context, in *ValidateChangeRequest, opts ...grpc.CallOption) (*ValidateChangeResponse, error) + PruneConfigFalse(ctx context.Context, in *PruneConfigFalseRequest, opts ...grpc.CallOption) (*PruneConfigFalseResponse, error) } type pluginClient struct { @@ -131,6 +132,15 @@ func (c *pluginClient) ValidateChange(ctx context.Context, in *ValidateChangeReq return out, nil } +func (c *pluginClient) PruneConfigFalse(ctx context.Context, in *PruneConfigFalseRequest, opts ...grpc.CallOption) (*PruneConfigFalseResponse, error) { + out := new(PruneConfigFalseResponse) + err := c.cc.Invoke(ctx, "/gosdn.plugin.Plugin/PruneConfigFalse", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // PluginServer is the server API for Plugin service. // All implementations must embed UnimplementedPluginServer // for forward compatibility @@ -143,6 +153,7 @@ type PluginServer interface { Diff(context.Context, *DiffRequest) (*DiffResponse, error) SchemaTreeGzip(*SchemaTreeGzipRequest, Plugin_SchemaTreeGzipServer) error ValidateChange(context.Context, *ValidateChangeRequest) (*ValidateChangeResponse, error) + PruneConfigFalse(context.Context, *PruneConfigFalseRequest) (*PruneConfigFalseResponse, error) mustEmbedUnimplementedPluginServer() } @@ -174,6 +185,9 @@ func (UnimplementedPluginServer) SchemaTreeGzip(*SchemaTreeGzipRequest, Plugin_S func (UnimplementedPluginServer) ValidateChange(context.Context, *ValidateChangeRequest) (*ValidateChangeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateChange not implemented") } +func (UnimplementedPluginServer) PruneConfigFalse(context.Context, *PruneConfigFalseRequest) (*PruneConfigFalseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PruneConfigFalse not implemented") +} func (UnimplementedPluginServer) mustEmbedUnimplementedPluginServer() {} // UnsafePluginServer may be embedded to opt out of forward compatibility for this service. @@ -334,6 +348,24 @@ func _Plugin_ValidateChange_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Plugin_PruneConfigFalse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PruneConfigFalseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).PruneConfigFalse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.plugin.Plugin/PruneConfigFalse", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).PruneConfigFalse(ctx, req.(*PruneConfigFalseRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Plugin_ServiceDesc is the grpc.ServiceDesc for Plugin service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -369,6 +401,10 @@ var Plugin_ServiceDesc = grpc.ServiceDesc{ MethodName: "ValidateChange", Handler: _Plugin_ValidateChange_Handler, }, + { + MethodName: "PruneConfigFalse", + Handler: _Plugin_PruneConfigFalse_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/api/openapiv2/gosdn_northbound.swagger.json b/api/openapiv2/gosdn_northbound.swagger.json index 10877fe7b669e5048f54c214e99b334c54c60598..2ebb1bc7f9746946d0c8bed21986755ec32f2a44 100644 --- a/api/openapiv2/gosdn_northbound.swagger.json +++ b/api/openapiv2/gosdn_northbound.swagger.json @@ -3329,6 +3329,15 @@ } } }, + "pluginPruneConfigFalseResponse": { + "type": "object", + "properties": { + "model": { + "type": "string", + "format": "byte" + } + } + }, "pluginSetNodeResponse": { "type": "object", "properties": { diff --git a/api/proto/gosdn/plugin/plugin.proto b/api/proto/gosdn/plugin/plugin.proto index edbed3d42af3830fa8be0a708d6b0cd9c37c3355..25f22a2fcec72e2cc5a553643cff09fc37c7fd22 100644 --- a/api/proto/gosdn/plugin/plugin.proto +++ b/api/proto/gosdn/plugin/plugin.proto @@ -16,6 +16,7 @@ service Plugin { rpc Diff(DiffRequest) returns (DiffResponse); rpc SchemaTreeGzip(SchemaTreeGzipRequest) returns (stream Payload); rpc ValidateChange(ValidateChangeRequest) returns (ValidateChangeResponse); + rpc PruneConfigFalse(PruneConfigFalseRequest) returns (PruneConfigFalseResponse); } message UnmarshalRequest { @@ -80,6 +81,14 @@ message ValidateChangeResponse { bytes model = 1; } +message PruneConfigFalseRequest { + bytes value = 1; +} + +message PruneConfigFalseResponse { + bytes model = 1; +} + message SchemaTreeGzipRequest { } diff --git a/cli/cmd/list.go b/cli/cmd/list.go index a7c112f76aa00df025b5cc54b55fd662c6eab4ce..7ff31bcbf4b03fde3963bc09f1855722ea51e1f6 100644 --- a/cli/cmd/list.go +++ b/cli/cmd/list.go @@ -38,9 +38,6 @@ import ( "github.com/spf13/viper" ) -// TODO: this requires us to make getDevices in grpc.go of gosdn public and we -// also need to implement GetSBI() -// pndCmd represents the pnd command. var listCmd = &cobra.Command{ Use: "list", Aliases: []string{"ls"}, diff --git a/cli/cmd/networkElementCreate.go b/cli/cmd/networkElementCreate.go index c16d2acac24541540aca996a42da96717e8afdb3..eeb8c151994754d3046adc9aed5361334a43a882 100644 --- a/cli/cmd/networkElementCreate.go +++ b/cli/cmd/networkElementCreate.go @@ -96,14 +96,12 @@ var mneName string var opcode string var pluginID string -var pluginIDFlagName = "plugin-id" - func init() { networkElementCmd.AddCommand(networkElementCreateCmd) networkElementCreateCmd.Flags().StringVar(&mneName, "name", "", "add a network element name (optional)") networkElementCreateCmd.Flags().StringVar(&opcode, "type", "", "generation target (csbi or plugin)") - networkElementCreateCmd.Flags().StringVar(&pluginID, pluginIDFlagName, "", "the plugin ID of the plugin to be used") + networkElementCreateCmd.Flags().StringVar(&pluginID, "plugin-id", "", "the plugin ID of the plugin to be used") networkElementCreateCmd.Flags().StringVarP(&address, "address", "a", "", "address of a gnmi target, e.g. 192.168.1.1:6030") networkElementCreateCmd.Flags().StringVarP(&username, "username", "u", "", "username for a gnmi resource") networkElementCreateCmd.Flags().StringVarP(&password, "password", "p", "", "password for a gnmi resource") diff --git a/cli/cmd/prompt.go b/cli/cmd/prompt.go index 945c6d78dec8f4ae4e855d802c01900de41c1f03..230370d10de8bce2a50e030c33f8853759c28be5 100644 --- a/cli/cmd/prompt.go +++ b/cli/cmd/prompt.go @@ -220,9 +220,9 @@ func completionBasedOnCmd(c *PromptCompleter, cmd *cobra.Command, inputSplit []s } case networkElementCreateCmd: if len(inputFlags) != 0 { - if inputFlags[len(inputFlags)-1] == pluginIDFlagName && - ((inputSplit[len(inputSplit)-1] == pluginIDFlagName && d.GetWordBeforeCursor() == "") || - (inputSplit[len(inputSplit)-2] == pluginIDFlagName && d.GetWordBeforeCursor() != "")) { + if inputFlags[len(inputFlags)-1] == "--plugin-id" && + ((inputSplit[len(inputSplit)-1] == "--plugin-id" && d.GetWordBeforeCursor() == "") || + (inputSplit[len(inputSplit)-2] == "--plugin-id" && d.GetWordBeforeCursor() != "")) { return c.updateSuggestionsThroughFunc(d, getAvailablePlugins) } else { return cobraCommandCompletion(cmd, d, inputFlags, []prompt.Suggest{}) diff --git a/controller/nucleus/plugin.go b/controller/nucleus/plugin.go index 27384db2a2e08023236d41d4a2ee8d341916b0c5..8851e16a9aa8248cde209faa9921ef2cc2001609 100644 --- a/controller/nucleus/plugin.go +++ b/controller/nucleus/plugin.go @@ -54,7 +54,7 @@ func NewPlugin(id uuid.UUID) (*Plugin, error) { model, ok := raw.(shared.DeviceModel) if !ok { return nil, customerrs.InvalidTypeAssertionError{ - Value: model, + Value: raw, Type: (*shared.DeviceModel)(nil), } } diff --git a/controller/nucleus/principalNetworkDomain.go b/controller/nucleus/principalNetworkDomain.go index 18a548bf6ca8bf3c5dcb77cfcdb4aa65735c743a..4d034a546777373a5e65687a625e034016b83a15 100644 --- a/controller/nucleus/principalNetworkDomain.go +++ b/controller/nucleus/principalNetworkDomain.go @@ -203,23 +203,6 @@ func (pnd *pndImplementation) AddNetworkElement(name string, opt *tpb.TransportO start := metrics.StartHook(labels, networkElementCreationsTotal) defer metrics.FinishHook(labels, start, networkElementCreationDurationSecondsTotal, networkElementCreationDurationSeconds) - // TODO: SouthboundService and SouthboundStorage have to be changed to a - // PluginService and PluginStore. - // NOTE: currently this is commented out; since for testing purposes a - // basic example plugin is returned. - //plugin, err := pnd.southboundService.Get(store.Query{ID: pluginID}) - //if err != nil { - // switch err.(type) { - // case *customerrs.CouldNotFindError: - // plugin, err = pnd.requestPlugin() - // if err != nil { - // return uuid.Nil, err - // } - // default: - // return uuid.Nil, err - // } - //} - plugin, err := requestPluginFunc(pluginID) if err != nil { return uuid.Nil, err @@ -266,8 +249,6 @@ func (pnd *pndImplementation) UpdateNetworkElement(networkElementID uuid.UUID, m return err } - //TODO: check if it could be worth to provide the method with a network - //element instead of an ID. err = pnd.ensureIntendedConfigurationIsAppliedOnNetworkElement(networkElementID) if err != nil { return err @@ -341,8 +322,6 @@ func (pnd *pndImplementation) MarshalNetworkElement(identifier string) (string, } // Request sends a get request to a specific network element. -// TODO: this method needs some heavy refactoring, especially in regards to the -// UpdateModel call. func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Message, error) { mne, err := pnd.networkElementService.Get(store.Query{ ID: uuid, @@ -376,7 +355,6 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag return nil, err } - // TODO(path): We probably have to remove this when we address path request handling. err = pnd.networkElementService.UpdateModel(uuid, modelAsString) if err != nil { return nil, err @@ -463,12 +441,15 @@ func (pnd *pndImplementation) ChangeMNE(duid uuid.UUID, operation ppb.ApiOperati plugin := mne.GetPlugin() - marshaledModel, err := plugin.ValidateChange(operation, p, []byte(value[0])) + validatedChangeModel, err := plugin.ValidateChange(operation, p, []byte(value[0])) if err != nil { return uuid.Nil, err } - //TODO: provide a filtered mashaledModel + filteredMarshaledModel, err := plugin.PruneConfigFalse(validatedChangeModel) + if err != nil { + return uuid.Nil, err + } if operation != ppb.ApiOperation_API_OPERATION_DELETE && len(value) != 1 { return uuid.Nil, &customerrs.InvalidParametersError{ @@ -487,13 +468,12 @@ func (pnd *pndImplementation) ChangeMNE(duid uuid.UUID, operation ppb.ApiOperati return pnd.networkElementService.Update(mne) } - //TODO: provide a filtered model - currentModel, err := mne.GetModel() + currentModel, err := mne.GetModelAsFilteredCopy() if err != nil { return uuid.Nil, err } - ch := NewChange(duid, currentModel, marshaledModel, callback) + ch := NewChange(duid, currentModel, filteredMarshaledModel, callback) if err := pnd.changes.Add(ch); err != nil { return uuid.Nil, err @@ -588,10 +568,6 @@ func (pnd *pndImplementation) handleCsbiDeletion(mne networkelement.NetworkEleme if err != nil { return err } - //err = pnd.southboundService.Delete(mne.SBI()) - //if err != nil { - // return err - //} log.WithFields(log.Fields{ "uuid": mne.ID().String(), "status": resp.Status, @@ -599,7 +575,7 @@ func (pnd *pndImplementation) handleCsbiDeletion(mne networkelement.NetworkEleme return nil } -//TODO: can probably be removed +//NOTE: csbi is currently not support; will be removed in the near future. //func (pnd *pndImplementation) handleCsbiEnrolment(name string, opt *tpb.TransportOption) (uuid.UUID, error) { // g := new(errgroup.Group) // ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5) @@ -632,7 +608,7 @@ func (pnd *pndImplementation) handleCsbiDeletion(mne networkelement.NetworkEleme // return mneID, nil //} -//TODO: can probably be removed +//NOTE: csbi is currently not support; will be removed in the near future. // createCsbiNetworkElement is a helper method for cSBI network element creation. The method // waits for a SYN (which indicates that the cSBI is running and addressable) // of the commissioned cSBI and creates the network element within the controller. @@ -726,7 +702,6 @@ func (pnd *pndImplementation) handleCsbiDeletion(mne networkelement.NetworkEleme // return uuid.Nil, nil //} -// TODO: update // requestPlugin request a plugin from the plugin-registry. func (pnd *pndImplementation) requestPlugin(requestID uuid.UUID) (plugin.Plugin, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute*1) diff --git a/controller/plugin/shared/grpc.go b/controller/plugin/shared/grpc.go index 79177934fccc852a306b30d1438baaf818824c37..f0cd4e684037f0015f2b759a01cde0235b4d1941 100644 --- a/controller/plugin/shared/grpc.go +++ b/controller/plugin/shared/grpc.go @@ -78,6 +78,13 @@ func (m *DeviceModelClient) ValidateChange(operation ppb.ApiOperation, path *gpb return resp.GetModel(), err } +func (m *DeviceModelClient) PruneConfigFalse(value []byte) ([]byte, error) { + resp, err := m.client.PruneConfigFalse(context.Background(), &pb.PruneConfigFalseRequest{ + Value: value, + }) + return resp.GetModel(), err +} + func (m *DeviceModelClient) SchemaTreeGzip() ([]byte, error) { schemaTreeGzipClient, err := m.client.SchemaTreeGzip(context.Background(), &pb.SchemaTreeGzipRequest{}) if err != nil { @@ -164,6 +171,13 @@ func (m *DeviceModelServer) ValidateChange( return &pb.ValidateChangeResponse{Model: model}, err } +func (m *DeviceModelServer) PruneConfigFalse( + ctx context.Context, + req *pb.PruneConfigFalseRequest) (*pb.PruneConfigFalseResponse, error) { + model, err := m.Impl.PruneConfigFalse(req.GetValue()) + return &pb.PruneConfigFalseResponse{Model: model}, err +} + func (m *DeviceModelServer) SchemaTreeGzip( req *pb.SchemaTreeGzipRequest, stream pb.Plugin_SchemaTreeGzipServer) error { diff --git a/controller/plugin/shared/interface.go b/controller/plugin/shared/interface.go index 2f2c99696e7696ddf1da296e5152be1e78d23c33..a1f9ffc96b13d6efd858cf8aa56372a6c9dd13f0 100644 --- a/controller/plugin/shared/interface.go +++ b/controller/plugin/shared/interface.go @@ -22,18 +22,17 @@ var PluginMap = map[string]plugin.Plugin{ } type DeviceModel interface { - // TODO: also allow to provide unmarshal options + // TODO: It should be possible to pass methods like Unmarshal, SetNode, + // GetNode, etc. ytypes.Unmarshal-|Set-|GetOptions Unmarshal(json []byte, path *gpb.Path) error - // TODO: also allow to provide SetNode options SetNode(path *gpb.Path, value *gpb.TypedValue) error - // TODO: also allow to provide SetNode options GetNode(path *gpb.Path) ([]*gpb.Notification, error) - // TODO: also allow to provide SetNode options DeleteNode(path *gpb.Path) error Model(filterReadOnly bool) ([]byte, error) Diff(original, modified []byte) (*gpb.Notification, error) SchemaTreeGzip() ([]byte, error) ValidateChange(operation ppb.ApiOperation, path *gpb.Path, value []byte) ([]byte, error) + PruneConfigFalse(value []byte) ([]byte, error) } // DeviceModelPlugin implements a hashicorp gRPC plugin. diff --git a/plugins/sdk/deviceModel.go b/plugins/sdk/deviceModel.go index d2c7b79037837c4dc929eca9bfa376a3c933fb9e..8a3b71da4ae41f8e7928f0384a7ffaed8884b7c2 100644 --- a/plugins/sdk/deviceModel.go +++ b/plugins/sdk/deviceModel.go @@ -186,14 +186,6 @@ func (d *DeviceModel) Diff(original, modified []byte) (*gpb.Notification, error) return nil, err } - //TODO: This should be changed to be optional - if err := ygot.PruneConfigFalse(d.schema.RootSchema(), originalAsValidatedCopy); err != nil { - return nil, err - } - if err := ygot.PruneConfigFalse(d.schema.RootSchema(), modifiedAsValidatedCopy); err != nil { - return nil, err - } - return ygot.Diff(originalAsValidatedCopy, modifiedAsValidatedCopy) } @@ -238,31 +230,21 @@ func (d *DeviceModel) ValidateChange(operation ppb.ApiOperation, path *gpb.Path, return ygot.Marshal7951(modelCopy, getYgotMarshal7951Config(), ygot.JSONIndent("")) } -//TODO: add PruneConfigFalse for the plugin; e.g., filtered copy -////remove read-only fields -//err = ygot.PruneConfigFalse(schema.RootSchema(), validatedCpy) -//if err != nil { -// return uuid.Nil, err -//} -//func createFilteredCopy(n networkelement.NetworkElement) (ygot.GoStruct, error) { -// modelCopy, err := n.CreateModelCopy() -// if err != nil { -// return nil, err -// } -// -// schema, err := n.SBI().Schema() -// if err != nil { -// return nil, err -// } -// -// //remove read-only fields -// err = ygot.PruneConfigFalse(schema.RootSchema(), modelCopy) -// if err != nil { -// return nil, err -// } -// -// return modelCopy, nil -//} +func (d *DeviceModel) PruneConfigFalse(value []byte) ([]byte, error) { + validatedCopy, err := createValidatedCopy(d.schema.Root) + if err != nil { + return nil, err + } + opts := []ytypes.UnmarshalOpt{&ytypes.IgnoreExtraFields{}} + if err := d.generatedUnmarshalFn(value, validatedCopy, opts...); err != nil { + return nil, err + } + if err := ygot.PruneConfigFalse(d.schema.RootSchema(), validatedCopy); err != nil { + return nil, err + } + + return ygot.Marshal7951(validatedCopy, getYgotMarshal7951Config(), ygot.JSONIndent("")) +} // convertStringToGnmiTypedValue allows to convert a string into a // gnmi.TypedValue; this conversion is based on the provided YANG type.