Skip to content
Snippets Groups Projects
Commit 00a5127b authored by Neil Schark's avatar Neil Schark
Browse files

wip

parent 829a982d
No related branches found
No related tags found
2 merge requests!406Draft: Add backup script,!404Enable export and import of SDN configuration
Pipeline #123841 failed
......@@ -22,55 +22,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Status int32
const (
Status_STATUS_UNSPECIFIED Status = 0
Status_STATUS_OK Status = 1
Status_STATUS_ERROR Status = 2
)
// Enum value maps for Status.
var (
Status_name = map[int32]string{
0: "STATUS_UNSPECIFIED",
1: "STATUS_OK",
2: "STATUS_ERROR",
}
Status_value = map[string]int32{
"STATUS_UNSPECIFIED": 0,
"STATUS_OK": 1,
"STATUS_ERROR": 2,
}
)
func (x Status) Enum() *Status {
p := new(Status)
*p = x
return p
}
func (x Status) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Status) Descriptor() protoreflect.EnumDescriptor {
return file_gosdn_configurationmanagement_configurationmanagement_proto_enumTypes[0].Descriptor()
}
func (Status) Type() protoreflect.EnumType {
return &file_gosdn_configurationmanagement_configurationmanagement_proto_enumTypes[0]
}
func (x Status) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Status.Descriptor instead.
func (Status) EnumDescriptor() ([]byte, []int) {
return file_gosdn_configurationmanagement_configurationmanagement_proto_rawDescGZIP(), []int{0}
}
type ExportSDNConfigRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -133,7 +84,6 @@ type ExportSDNConfigResponse struct {
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch.
SdnConfig string `protobuf:"bytes,2,opt,name=sdnConfig,proto3" json:"sdnConfig,omitempty"`
Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=gosdn.configurationmanagement.Status" json:"status,omitempty"`
}
func (x *ExportSDNConfigResponse) Reset() {
......@@ -182,13 +132,6 @@ func (x *ExportSDNConfigResponse) GetSdnConfig() string {
return ""
}
func (x *ExportSDNConfigResponse) GetStatus() Status {
if x != nil {
return x.Status
}
return Status_STATUS_UNSPECIFIED
}
type ImportSDNConfigRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -249,8 +192,7 @@ type ImportSDNConfigResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch.
Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.configurationmanagement.Status" json:"status,omitempty"`
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch.
}
func (x *ImportSDNConfigResponse) Reset() {
......@@ -292,13 +234,6 @@ func (x *ImportSDNConfigResponse) GetTimestamp() int64 {
return 0
}
func (x *ImportSDNConfigResponse) GetStatus() Status {
if x != nil {
return x.Status
}
return Status_STATUS_UNSPECIFIED
}
var File_gosdn_configurationmanagement_configurationmanagement_proto protoreflect.FileDescriptor
var file_gosdn_configurationmanagement_configurationmanagement_proto_rawDesc = []byte{
......@@ -315,58 +250,46 @@ var file_gosdn_configurationmanagement_configurationmanagement_proto_rawDesc = [
0x69, 0x67, 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, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x17, 0x45, 0x78,
0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x1c, 0x0a, 0x09, 0x73, 0x64, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x64, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x17, 0x45, 0x78, 0x70,
0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x1c, 0x0a, 0x09, 0x73, 0x64, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x64, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x22, 0x48, 0x0a, 0x16, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 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,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x76, 0x0a, 0x17, 0x49, 0x6d,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x17, 0x49, 0x6d,
0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x2a, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12,
0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f,
0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52,
0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0xd4, 0x02, 0x0a, 0x1e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70,
0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x2e, 0x67,
0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x70,
0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x7b, 0x70, 0x69,
0x64, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e,
0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x6d,
0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x22, 0x0d, 0x2f,
0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 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, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x61, 0x6d, 0x70, 0x32, 0xd4, 0x02, 0x0a, 0x1e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f, 0x72,
0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x73,
0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72,
0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x0f, 0x12, 0x0d, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d,
0x12, 0x97, 0x01, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f,
0x73, 0x64, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f,
0x72, 0x74, 0x53, 0x44, 0x4e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x22, 0x0d, 0x2f, 0x69, 0x6d,
0x70, 0x6f, 0x72, 0x74, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 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, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
......@@ -381,27 +304,23 @@ func file_gosdn_configurationmanagement_configurationmanagement_proto_rawDescGZI
return file_gosdn_configurationmanagement_configurationmanagement_proto_rawDescData
}
var file_gosdn_configurationmanagement_configurationmanagement_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_gosdn_configurationmanagement_configurationmanagement_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_gosdn_configurationmanagement_configurationmanagement_proto_goTypes = []interface{}{
(Status)(0), // 0: gosdn.configurationmanagement.Status
(*ExportSDNConfigRequest)(nil), // 1: gosdn.configurationmanagement.ExportSDNConfigRequest
(*ExportSDNConfigResponse)(nil), // 2: gosdn.configurationmanagement.ExportSDNConfigResponse
(*ImportSDNConfigRequest)(nil), // 3: gosdn.configurationmanagement.ImportSDNConfigRequest
(*ImportSDNConfigResponse)(nil), // 4: gosdn.configurationmanagement.ImportSDNConfigResponse
(*ExportSDNConfigRequest)(nil), // 0: gosdn.configurationmanagement.ExportSDNConfigRequest
(*ExportSDNConfigResponse)(nil), // 1: gosdn.configurationmanagement.ExportSDNConfigResponse
(*ImportSDNConfigRequest)(nil), // 2: gosdn.configurationmanagement.ImportSDNConfigRequest
(*ImportSDNConfigResponse)(nil), // 3: gosdn.configurationmanagement.ImportSDNConfigResponse
}
var file_gosdn_configurationmanagement_configurationmanagement_proto_depIdxs = []int32{
0, // 0: gosdn.configurationmanagement.ExportSDNConfigResponse.status:type_name -> gosdn.configurationmanagement.Status
0, // 1: gosdn.configurationmanagement.ImportSDNConfigResponse.status:type_name -> gosdn.configurationmanagement.Status
1, // 2: gosdn.configurationmanagement.ConfigurationManagementService.ExportSDNConfig:input_type -> gosdn.configurationmanagement.ExportSDNConfigRequest
3, // 3: gosdn.configurationmanagement.ConfigurationManagementService.ImportSDNConfig:input_type -> gosdn.configurationmanagement.ImportSDNConfigRequest
2, // 4: gosdn.configurationmanagement.ConfigurationManagementService.ExportSDNConfig:output_type -> gosdn.configurationmanagement.ExportSDNConfigResponse
4, // 5: gosdn.configurationmanagement.ConfigurationManagementService.ImportSDNConfig:output_type -> gosdn.configurationmanagement.ImportSDNConfigResponse
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
0, // 0: gosdn.configurationmanagement.ConfigurationManagementService.ExportSDNConfig:input_type -> gosdn.configurationmanagement.ExportSDNConfigRequest
2, // 1: gosdn.configurationmanagement.ConfigurationManagementService.ImportSDNConfig:input_type -> gosdn.configurationmanagement.ImportSDNConfigRequest
1, // 2: gosdn.configurationmanagement.ConfigurationManagementService.ExportSDNConfig:output_type -> gosdn.configurationmanagement.ExportSDNConfigResponse
3, // 3: gosdn.configurationmanagement.ConfigurationManagementService.ImportSDNConfig:output_type -> gosdn.configurationmanagement.ImportSDNConfigResponse
2, // [2:4] is the sub-list for method output_type
0, // [0:2] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_gosdn_configurationmanagement_configurationmanagement_proto_init() }
......@@ -464,14 +383,13 @@ func file_gosdn_configurationmanagement_configurationmanagement_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_gosdn_configurationmanagement_configurationmanagement_proto_rawDesc,
NumEnums: 1,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_gosdn_configurationmanagement_configurationmanagement_proto_goTypes,
DependencyIndexes: file_gosdn_configurationmanagement_configurationmanagement_proto_depIdxs,
EnumInfos: file_gosdn_configurationmanagement_configurationmanagement_proto_enumTypes,
MessageInfos: file_gosdn_configurationmanagement_configurationmanagement_proto_msgTypes,
}.Build()
File_gosdn_configurationmanagement_configurationmanagement_proto = out.File
......
......@@ -1838,9 +1838,6 @@
},
"sdnConfig": {
"type": "string"
},
"status": {
"$ref": "#/definitions/gosdnconfigurationmanagementStatus"
}
}
},
......@@ -1850,9 +1847,6 @@
"timestamp": {
"type": "string",
"format": "int64"
},
"status": {
"$ref": "#/definitions/gosdnconfigurationmanagementStatus"
}
}
},
......@@ -3036,15 +3030,6 @@
],
"default": "STATUS_UNSPECIFIED"
},
"gosdnconfigurationmanagementStatus": {
"type": "string",
"enum": [
"STATUS_UNSPECIFIED",
"STATUS_OK",
"STATUS_ERROR"
],
"default": "STATUS_UNSPECIFIED"
},
"gosdncoreStatus": {
"type": "string",
"enum": [
......
......@@ -30,7 +30,6 @@ message ExportSDNConfigRequest {
message ExportSDNConfigResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string sdnConfig = 2;
Status status = 3;
}
message ImportSDNConfigRequest {
......@@ -40,11 +39,4 @@ message ImportSDNConfigRequest {
message ImportSDNConfigResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
Status status = 2;
}
enum Status {
STATUS_UNSPECIFIED = 0;
STATUS_OK = 1;
STATUS_ERROR = 2;
}
package server
import (
"context"
"time"
cm "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/configurationmanagement"
ne "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// ConfigurationManagementServer represents a core server.
type ConfigurationManagementServer struct {
networkDomain networkdomain.NetworkDomain
//pndStore networkdomain.PndStore
}
// ConfigurationManagementServer receives a pndStore and returns a new coreServer.
func NewConfigurationManagementServer(networkDomain networkdomain.NetworkDomain) *ConfigurationManagementServer {
return &ConfigurationManagementServer{networkDomain: networkDomain}
}
// ExportSDNConfig returns the SDN configuration.
func (c ConfigurationManagementServer) ExportSDNConfig(ctx context.Context, request *cm.ExportSDNConfigRequest) (*cm.ExportSDNConfigResponse, error) {
//pnd := request.Pid
networkElements := c.networkDomain.NetworkElements()
convertedNetworkelements := []*ne.NetworkElement{}
for _, networkElement := range networkElements {
ygotStructAsJSON, err := networkElement.GetModelAsString()
if err != nil {
log.Error(err)
return nil, status.Errorf(codes.Aborted, "%v", err)
}
convertedNetworkelements = append(convertedNetworkelements, &ne.NetworkElement{
Id: networkElement.ID().String(),
Name: networkElement.Name(),
Model: ygotStructAsJSON,
})
}
return &cm.ExportSDNConfigResponse{
Timestamp: time.Now().UnixNano(),
SdnConfig: "nothing yet"}, nil
}
// ImportSDNConfig receives an SDN configuration and imports it.
func (s *NetworkElementServer) ImportSDNConfig(ctx context.Context, request *cm.ImportSDNConfigRequest) (*cm.ImportSDNConfigResponse, error) {
return &cm.ImportSDNConfigResponse{
Timestamp: time.Now().UnixNano()}, nil
}
......@@ -20,17 +20,18 @@ import (
// NorthboundInterface is the representation of the
// gRPC services used provided.
type NorthboundInterface struct {
Pnd *PndServer
Core *CoreServer
Csbi *CsbiServer
Sbi *SbiServer
Auth *AuthServer
User *UserServer
Role *RoleServer
Topology *TopologyServer
App *AppServer
NetworkElement *NetworkElementServer
Routes *RoutingTableServiceServer
Pnd *PndServer
Core *CoreServer
Csbi *CsbiServer
Sbi *SbiServer
Auth *AuthServer
User *UserServer
Role *RoleServer
Topology *TopologyServer
App *AppServer
NetworkElement *NetworkElementServer
Routes *RoutingTableServiceServer
ConfigurationManagement *ConfigurationManagementServer
}
// NewNBI receives a PndStore and returns a new gRPC *NorthboundInterface.
......@@ -48,17 +49,18 @@ func NewNBI(
) *NorthboundInterface {
return &NorthboundInterface{
Pnd: NewPndServer(pnds),
Core: NewCoreServer(pnds),
Csbi: NewCsbiServer(pnds),
Sbi: NewSbiServer(pnds),
Auth: NewAuthServer(&jwt, users),
User: NewUserServer(&jwt, users),
Role: NewRoleServer(&jwt, roles),
Topology: NewTopologyServer(topologyService, nodeService, portService),
App: NewAppServer(apps),
NetworkElement: NewNetworkElementServer(networkDomain),
Routes: NewRoutingTableServiceServer(routeService, nodeService, portService),
Pnd: NewPndServer(pnds),
Core: NewCoreServer(pnds),
Csbi: NewCsbiServer(pnds),
Sbi: NewSbiServer(pnds),
Auth: NewAuthServer(&jwt, users),
User: NewUserServer(&jwt, users),
Role: NewRoleServer(&jwt, roles),
Topology: NewTopologyServer(topologyService, nodeService, portService),
App: NewAppServer(apps),
NetworkElement: NewNetworkElementServer(networkDomain),
Routes: NewRoutingTableServiceServer(routeService, nodeService, portService),
ConfigurationManagement: NewConfigurationManagementServer(networkDomain),
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment