diff --git a/pkg/nodeconfigs/node_ip_addr.go b/pkg/nodeconfigs/node_ip_addr.go index 765b889..d66f15f 100644 --- a/pkg/nodeconfigs/node_ip_addr.go +++ b/pkg/nodeconfigs/node_ip_addr.go @@ -3,11 +3,10 @@ package nodeconfigs type NodeIPAddr struct { - Id int64 `json:"id"` - Name string `json:"name"` - Thresholds []*NodeValueThresholdConfig `json:"thresholds"` - IP string `json:"ip"` - IsOn bool `json:"isOn"` - IsUp bool `json:"isUp"` - CanAccess bool `json:"canAccess"` + Id int64 `json:"id"` + Name string `json:"name"` + IP string `json:"ip"` + IsOn bool `json:"isOn"` + IsUp bool `json:"isUp"` + CanAccess bool `json:"canAccess"` } diff --git a/pkg/nodeconfigs/node_value_item.go b/pkg/nodeconfigs/node_value_item.go index 752635b..8d1d60a 100644 --- a/pkg/nodeconfigs/node_value_item.go +++ b/pkg/nodeconfigs/node_value_item.go @@ -2,7 +2,9 @@ package nodeconfigs -import "encoding/json" +import ( + "encoding/json" +) // NodeValueItem 监控项 type NodeValueItem = string @@ -306,12 +308,3 @@ func UnmarshalNodeValue(valueJSON []byte) string { } return result } - -// NodeValueThresholdConfig 阈值 -type NodeValueThresholdConfig struct { - Item NodeValueItem `json:"item"` - Operator NodeValueOperator `json:"operator"` - Value int64 `json:"value"` - Duration int `json:"duration"` - DurationUnit NodeValueDurationUnit `json:"durationUnit"` -} diff --git a/pkg/nodeconfigs/node_value_thresholds.go b/pkg/nodeconfigs/node_value_thresholds.go new file mode 100644 index 0000000..197ba34 --- /dev/null +++ b/pkg/nodeconfigs/node_value_thresholds.go @@ -0,0 +1,46 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. + +package nodeconfigs + +import "github.com/iwind/TeaGo/maps" + +type IPAddressThresholdItem = string + +const ( + IPAddressThresholdItemAvgRequests IPAddressThresholdItem = "avgRequests" + IPAddressThresholdItemAvgTrafficOut IPAddressThresholdItem = "avgTrafficOut" // M + IPAddressThresholdItemAvgTrafficIn IPAddressThresholdItem = "avgTrafficIn" // M + IPAddressThresholdItemConnectivity IPAddressThresholdItem = "connectivity" // 0-100 +) + +// NodeValueThresholdConfig 阈值列表 +type NodeValueThresholdConfig struct { + Id int64 `json:"id"` + Items []*NodeValueThresholdItemConfig `json:"items"` + Actions []*NodeValueThresholdActionConfig `json:"actions"` +} + +// NodeValueThresholdItemConfig 阈值项目 +type NodeValueThresholdItemConfig struct { + Item NodeValueItem `json:"item"` + Operator NodeValueOperator `json:"operator"` + Value float64 `json:"value"` + Duration int `json:"duration"` + DurationUnit NodeValueDurationUnit `json:"durationUnit"` + Options maps.Map `json:"options"` // 附加选项 +} + +type NodeValueThresholdActionConfig struct { + Action string `json:"action"` + Options maps.Map `json:"options"` +} + +// NodeValueThresholdAction 动作 +type NodeValueThresholdAction = string + +const ( + NodeValueThresholdActionUp NodeValueThresholdAction = "up" // 上线 + NodeValueThresholdActionDown NodeValueThresholdAction = "down" // 下线 + NodeValueThresholdActionNotify NodeValueThresholdAction = "notify" // 通知 + NodeValueThresholdActionSwitch NodeValueThresholdAction = "switch" // 切换到备用IP +) diff --git a/pkg/rpc/pb/model_node_ip_address.pb.go b/pkg/rpc/pb/model_node_ip_address.pb.go index 84ae5da..d35efd2 100644 --- a/pkg/rpc/pb/model_node_ip_address.pb.go +++ b/pkg/rpc/pb/model_node_ip_address.pb.go @@ -31,18 +31,17 @@ type NodeIPAddress struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - State int64 `protobuf:"varint,6,opt,name=state,proto3" json:"state,omitempty"` - Order int64 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"` - CanAccess bool `protobuf:"varint,8,opt,name=canAccess,proto3" json:"canAccess,omitempty"` - IsOn bool `protobuf:"varint,9,opt,name=isOn,proto3" json:"isOn,omitempty"` - IsUp bool `protobuf:"varint,10,opt,name=isUp,proto3" json:"isUp,omitempty"` - ThresholdsJSON []byte `protobuf:"bytes,11,opt,name=thresholdsJSON,proto3" json:"thresholdsJSON,omitempty"` - Role string `protobuf:"bytes,12,opt,name=role,proto3" json:"role,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + State int64 `protobuf:"varint,6,opt,name=state,proto3" json:"state,omitempty"` + Order int64 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"` + CanAccess bool `protobuf:"varint,8,opt,name=canAccess,proto3" json:"canAccess,omitempty"` + IsOn bool `protobuf:"varint,9,opt,name=isOn,proto3" json:"isOn,omitempty"` + IsUp bool `protobuf:"varint,10,opt,name=isUp,proto3" json:"isUp,omitempty"` + Role string `protobuf:"bytes,12,opt,name=role,proto3" json:"role,omitempty"` } func (x *NodeIPAddress) Reset() { @@ -147,13 +146,6 @@ func (x *NodeIPAddress) GetIsUp() bool { return false } -func (x *NodeIPAddress) GetThresholdsJSON() []byte { - if x != nil { - return x.ThresholdsJSON - } - return nil -} - func (x *NodeIPAddress) GetRole() string { if x != nil { return x.Role @@ -166,7 +158,7 @@ var File_models_model_node_ip_address_proto protoreflect.FileDescriptor var file_models_model_node_ip_address_proto_rawDesc = []byte{ 0x0a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xab, 0x02, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x83, 0x02, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, @@ -181,12 +173,9 @@ var file_models_model_node_ip_address_proto_rawDesc = []byte{ 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x55, 0x70, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x55, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x74, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x4a, 0x53, - 0x4f, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x55, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/pb/model_node_ip_address_threshold.pb.go b/pkg/rpc/pb/model_node_ip_address_threshold.pb.go new file mode 100644 index 0000000..96057a2 --- /dev/null +++ b/pkg/rpc/pb/model_node_ip_address_threshold.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: models/model_node_ip_address_threshold.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type NodeIPAddressThreshold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ItemsJSON []byte `protobuf:"bytes,2,opt,name=itemsJSON,proto3" json:"itemsJSON,omitempty"` + ActionsJSON []byte `protobuf:"bytes,3,opt,name=actionsJSON,proto3" json:"actionsJSON,omitempty"` +} + +func (x *NodeIPAddressThreshold) Reset() { + *x = NodeIPAddressThreshold{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_node_ip_address_threshold_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeIPAddressThreshold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeIPAddressThreshold) ProtoMessage() {} + +func (x *NodeIPAddressThreshold) ProtoReflect() protoreflect.Message { + mi := &file_models_model_node_ip_address_threshold_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 NodeIPAddressThreshold.ProtoReflect.Descriptor instead. +func (*NodeIPAddressThreshold) Descriptor() ([]byte, []int) { + return file_models_model_node_ip_address_threshold_proto_rawDescGZIP(), []int{0} +} + +func (x *NodeIPAddressThreshold) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *NodeIPAddressThreshold) GetItemsJSON() []byte { + if x != nil { + return x.ItemsJSON + } + return nil +} + +func (x *NodeIPAddressThreshold) GetActionsJSON() []byte { + if x != nil { + return x.ActionsJSON + } + return nil +} + +var File_models_model_node_ip_address_threshold_proto protoreflect.FileDescriptor + +var file_models_model_node_ip_address_threshold_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, + 0x70, 0x62, 0x22, 0x68, 0x0a, 0x16, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_node_ip_address_threshold_proto_rawDescOnce sync.Once + file_models_model_node_ip_address_threshold_proto_rawDescData = file_models_model_node_ip_address_threshold_proto_rawDesc +) + +func file_models_model_node_ip_address_threshold_proto_rawDescGZIP() []byte { + file_models_model_node_ip_address_threshold_proto_rawDescOnce.Do(func() { + file_models_model_node_ip_address_threshold_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_node_ip_address_threshold_proto_rawDescData) + }) + return file_models_model_node_ip_address_threshold_proto_rawDescData +} + +var file_models_model_node_ip_address_threshold_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_node_ip_address_threshold_proto_goTypes = []interface{}{ + (*NodeIPAddressThreshold)(nil), // 0: pb.NodeIPAddressThreshold +} +var file_models_model_node_ip_address_threshold_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] 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_models_model_node_ip_address_threshold_proto_init() } +func file_models_model_node_ip_address_threshold_proto_init() { + if File_models_model_node_ip_address_threshold_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_model_node_ip_address_threshold_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeIPAddressThreshold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_model_node_ip_address_threshold_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_node_ip_address_threshold_proto_goTypes, + DependencyIndexes: file_models_model_node_ip_address_threshold_proto_depIdxs, + MessageInfos: file_models_model_node_ip_address_threshold_proto_msgTypes, + }.Build() + File_models_model_node_ip_address_threshold_proto = out.File + file_models_model_node_ip_address_threshold_proto_rawDesc = nil + file_models_model_node_ip_address_threshold_proto_goTypes = nil + file_models_model_node_ip_address_threshold_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_node_ip_address.pb.go b/pkg/rpc/pb/service_node_ip_address.pb.go index 60e50e8..3d32ff3 100644 --- a/pkg/rpc/pb/service_node_ip_address.pb.go +++ b/pkg/rpc/pb/service_node_ip_address.pb.go @@ -35,12 +35,11 @@ type CreateNodeIPAddressRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` - CanAccess bool `protobuf:"varint,5,opt,name=canAccess,proto3" json:"canAccess,omitempty"` - ThresholdsJSON []byte `protobuf:"bytes,6,opt,name=thresholdsJSON,proto3" json:"thresholdsJSON,omitempty"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` + CanAccess bool `protobuf:"varint,5,opt,name=canAccess,proto3" json:"canAccess,omitempty"` } func (x *CreateNodeIPAddressRequest) Reset() { @@ -110,13 +109,6 @@ func (x *CreateNodeIPAddressRequest) GetCanAccess() bool { return false } -func (x *CreateNodeIPAddressRequest) GetThresholdsJSON() []byte { - if x != nil { - return x.ThresholdsJSON - } - return nil -} - type CreateNodeIPAddressResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -175,7 +167,6 @@ type UpdateNodeIPAddressRequest struct { Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` CanAccess bool `protobuf:"varint,4,opt,name=canAccess,proto3" json:"canAccess,omitempty"` IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` - ThresholdsJSON []byte `protobuf:"bytes,6,opt,name=thresholdsJSON,proto3" json:"thresholdsJSON,omitempty"` } func (x *UpdateNodeIPAddressRequest) Reset() { @@ -245,13 +236,6 @@ func (x *UpdateNodeIPAddressRequest) GetIsOn() bool { return false } -func (x *UpdateNodeIPAddressRequest) GetThresholdsJSON() []byte { - if x != nil { - return x.ThresholdsJSON - } - return nil -} - // 修改IP地址所属节点 type UpdateNodeIPAddressNodeIdRequest struct { state protoimpl.MessageState @@ -902,7 +886,7 @@ var file_service_node_ip_address_proto_rawDesc = []byte{ 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, + 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, @@ -910,27 +894,22 @@ var file_service_node_ip_address_proto_rawDesc = []byte{ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, - 0x26, 0x0a, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, - 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x47, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, - 0x22, 0xc4, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, - 0x73, 0x4f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, - 0x26, 0x0a, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, - 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x64, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, + 0x47, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, + 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, + 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x22, 0x64, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, diff --git a/pkg/rpc/pb/service_node_ip_address_threshold.pb.go b/pkg/rpc/pb/service_node_ip_address_threshold.pb.go new file mode 100644 index 0000000..ae8b8cc --- /dev/null +++ b/pkg/rpc/pb/service_node_ip_address_threshold.pb.go @@ -0,0 +1,1014 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_node_ip_address_threshold.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// 创建阈值 +type CreateNodeIPAddressThresholdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressId int64 `protobuf:"varint,1,opt,name=nodeIPAddressId,proto3" json:"nodeIPAddressId,omitempty"` + ItemsJSON []byte `protobuf:"bytes,2,opt,name=itemsJSON,proto3" json:"itemsJSON,omitempty"` + ActionsJSON []byte `protobuf:"bytes,3,opt,name=actionsJSON,proto3" json:"actionsJSON,omitempty"` +} + +func (x *CreateNodeIPAddressThresholdRequest) Reset() { + *x = CreateNodeIPAddressThresholdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNodeIPAddressThresholdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeIPAddressThresholdRequest) ProtoMessage() {} + +func (x *CreateNodeIPAddressThresholdRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_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 CreateNodeIPAddressThresholdRequest.ProtoReflect.Descriptor instead. +func (*CreateNodeIPAddressThresholdRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateNodeIPAddressThresholdRequest) GetNodeIPAddressId() int64 { + if x != nil { + return x.NodeIPAddressId + } + return 0 +} + +func (x *CreateNodeIPAddressThresholdRequest) GetItemsJSON() []byte { + if x != nil { + return x.ItemsJSON + } + return nil +} + +func (x *CreateNodeIPAddressThresholdRequest) GetActionsJSON() []byte { + if x != nil { + return x.ActionsJSON + } + return nil +} + +type CreateNodeIPAddressThresholdResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressThresholdId int64 `protobuf:"varint,1,opt,name=nodeIPAddressThresholdId,proto3" json:"nodeIPAddressThresholdId,omitempty"` +} + +func (x *CreateNodeIPAddressThresholdResponse) Reset() { + *x = CreateNodeIPAddressThresholdResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNodeIPAddressThresholdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeIPAddressThresholdResponse) ProtoMessage() {} + +func (x *CreateNodeIPAddressThresholdResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_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 CreateNodeIPAddressThresholdResponse.ProtoReflect.Descriptor instead. +func (*CreateNodeIPAddressThresholdResponse) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateNodeIPAddressThresholdResponse) GetNodeIPAddressThresholdId() int64 { + if x != nil { + return x.NodeIPAddressThresholdId + } + return 0 +} + +// 修改阈值 +type UpdateNodeIPAddressThresholdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressThresholdId int64 `protobuf:"varint,1,opt,name=nodeIPAddressThresholdId,proto3" json:"nodeIPAddressThresholdId,omitempty"` + ItemsJSON []byte `protobuf:"bytes,2,opt,name=itemsJSON,proto3" json:"itemsJSON,omitempty"` + ActionsJSON []byte `protobuf:"bytes,3,opt,name=actionsJSON,proto3" json:"actionsJSON,omitempty"` +} + +func (x *UpdateNodeIPAddressThresholdRequest) Reset() { + *x = UpdateNodeIPAddressThresholdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeIPAddressThresholdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeIPAddressThresholdRequest) ProtoMessage() {} + +func (x *UpdateNodeIPAddressThresholdRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[2] + 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 UpdateNodeIPAddressThresholdRequest.ProtoReflect.Descriptor instead. +func (*UpdateNodeIPAddressThresholdRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateNodeIPAddressThresholdRequest) GetNodeIPAddressThresholdId() int64 { + if x != nil { + return x.NodeIPAddressThresholdId + } + return 0 +} + +func (x *UpdateNodeIPAddressThresholdRequest) GetItemsJSON() []byte { + if x != nil { + return x.ItemsJSON + } + return nil +} + +func (x *UpdateNodeIPAddressThresholdRequest) GetActionsJSON() []byte { + if x != nil { + return x.ActionsJSON + } + return nil +} + +// 删除阈值 +type DeleteNodeIPAddressThresholdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressThresholdId int64 `protobuf:"varint,1,opt,name=nodeIPAddressThresholdId,proto3" json:"nodeIPAddressThresholdId,omitempty"` +} + +func (x *DeleteNodeIPAddressThresholdRequest) Reset() { + *x = DeleteNodeIPAddressThresholdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteNodeIPAddressThresholdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteNodeIPAddressThresholdRequest) ProtoMessage() {} + +func (x *DeleteNodeIPAddressThresholdRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[3] + 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 DeleteNodeIPAddressThresholdRequest.ProtoReflect.Descriptor instead. +func (*DeleteNodeIPAddressThresholdRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteNodeIPAddressThresholdRequest) GetNodeIPAddressThresholdId() int64 { + if x != nil { + return x.NodeIPAddressThresholdId + } + return 0 +} + +// 查找IP的所有阈值 +type FindAllEnabledNodeIPAddressThresholdsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressId int64 `protobuf:"varint,1,opt,name=nodeIPAddressId,proto3" json:"nodeIPAddressId,omitempty"` +} + +func (x *FindAllEnabledNodeIPAddressThresholdsRequest) Reset() { + *x = FindAllEnabledNodeIPAddressThresholdsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledNodeIPAddressThresholdsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledNodeIPAddressThresholdsRequest) ProtoMessage() {} + +func (x *FindAllEnabledNodeIPAddressThresholdsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[4] + 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 FindAllEnabledNodeIPAddressThresholdsRequest.ProtoReflect.Descriptor instead. +func (*FindAllEnabledNodeIPAddressThresholdsRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{4} +} + +func (x *FindAllEnabledNodeIPAddressThresholdsRequest) GetNodeIPAddressId() int64 { + if x != nil { + return x.NodeIPAddressId + } + return 0 +} + +type FindAllEnabledNodeIPAddressThresholdsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressThresholds []*NodeIPAddressThreshold `protobuf:"bytes,1,rep,name=nodeIPAddressThresholds,proto3" json:"nodeIPAddressThresholds,omitempty"` +} + +func (x *FindAllEnabledNodeIPAddressThresholdsResponse) Reset() { + *x = FindAllEnabledNodeIPAddressThresholdsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledNodeIPAddressThresholdsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledNodeIPAddressThresholdsResponse) ProtoMessage() {} + +func (x *FindAllEnabledNodeIPAddressThresholdsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[5] + 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 FindAllEnabledNodeIPAddressThresholdsResponse.ProtoReflect.Descriptor instead. +func (*FindAllEnabledNodeIPAddressThresholdsResponse) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{5} +} + +func (x *FindAllEnabledNodeIPAddressThresholdsResponse) GetNodeIPAddressThresholds() []*NodeIPAddressThreshold { + if x != nil { + return x.NodeIPAddressThresholds + } + return nil +} + +// 计算IP阈值的数量 +type CountAllEnabledNodeIPAddressThresholdsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressId int64 `protobuf:"varint,1,opt,name=nodeIPAddressId,proto3" json:"nodeIPAddressId,omitempty"` +} + +func (x *CountAllEnabledNodeIPAddressThresholdsRequest) Reset() { + *x = CountAllEnabledNodeIPAddressThresholdsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledNodeIPAddressThresholdsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledNodeIPAddressThresholdsRequest) ProtoMessage() {} + +func (x *CountAllEnabledNodeIPAddressThresholdsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[6] + 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 CountAllEnabledNodeIPAddressThresholdsRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledNodeIPAddressThresholdsRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{6} +} + +func (x *CountAllEnabledNodeIPAddressThresholdsRequest) GetNodeIPAddressId() int64 { + if x != nil { + return x.NodeIPAddressId + } + return 0 +} + +// 批量更新阈值 +type UpdateAllNodeIPAddressThresholdsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIPAddressId int64 `protobuf:"varint,1,opt,name=nodeIPAddressId,proto3" json:"nodeIPAddressId,omitempty"` + NodeIPAddressThresholdsJSON []byte `protobuf:"bytes,2,opt,name=nodeIPAddressThresholdsJSON,proto3" json:"nodeIPAddressThresholdsJSON,omitempty"` +} + +func (x *UpdateAllNodeIPAddressThresholdsRequest) Reset() { + *x = UpdateAllNodeIPAddressThresholdsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAllNodeIPAddressThresholdsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAllNodeIPAddressThresholdsRequest) ProtoMessage() {} + +func (x *UpdateAllNodeIPAddressThresholdsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_ip_address_threshold_proto_msgTypes[7] + 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 UpdateAllNodeIPAddressThresholdsRequest.ProtoReflect.Descriptor instead. +func (*UpdateAllNodeIPAddressThresholdsRequest) Descriptor() ([]byte, []int) { + return file_service_node_ip_address_threshold_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateAllNodeIPAddressThresholdsRequest) GetNodeIPAddressId() int64 { + if x != nil { + return x.NodeIPAddressId + } + return 0 +} + +func (x *UpdateAllNodeIPAddressThresholdsRequest) GetNodeIPAddressThresholdsJSON() []byte { + if x != nil { + return x.NodeIPAddressThresholdsJSON + } + return nil +} + +var File_service_node_ip_address_threshold_proto protoreflect.FileDescriptor + +var file_service_node_ip_address_threshold_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, + 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2c, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x23, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, + 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, + 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x62, 0x0a, 0x24, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3a, 0x0a, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x49, 0x64, 0x22, 0xa1, 0x01, 0x0a, + 0x23, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x49, 0x64, + 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, + 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, + 0x22, 0x61, 0x0a, 0x23, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, + 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x49, + 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x2c, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x22, 0x85, 0x01, + 0x0a, 0x2d, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x54, 0x0a, 0x17, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x17, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x22, 0x59, 0x0a, 0x2d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, + 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, + 0x22, 0x95, 0x01, 0x0a, 0x27, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, + 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x1b, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x50, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1b, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xa7, 0x05, 0x0a, 0x1d, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x1c, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, + 0x1c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x27, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x57, 0x0a, 0x1c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, + 0x8c, 0x01, 0x0a, 0x25, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x12, 0x30, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, + 0x0a, 0x26, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, + 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x12, 0x31, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5f, 0x0a, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x12, 0x2b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_service_node_ip_address_threshold_proto_rawDescOnce sync.Once + file_service_node_ip_address_threshold_proto_rawDescData = file_service_node_ip_address_threshold_proto_rawDesc +) + +func file_service_node_ip_address_threshold_proto_rawDescGZIP() []byte { + file_service_node_ip_address_threshold_proto_rawDescOnce.Do(func() { + file_service_node_ip_address_threshold_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_node_ip_address_threshold_proto_rawDescData) + }) + return file_service_node_ip_address_threshold_proto_rawDescData +} + +var file_service_node_ip_address_threshold_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_service_node_ip_address_threshold_proto_goTypes = []interface{}{ + (*CreateNodeIPAddressThresholdRequest)(nil), // 0: pb.CreateNodeIPAddressThresholdRequest + (*CreateNodeIPAddressThresholdResponse)(nil), // 1: pb.CreateNodeIPAddressThresholdResponse + (*UpdateNodeIPAddressThresholdRequest)(nil), // 2: pb.UpdateNodeIPAddressThresholdRequest + (*DeleteNodeIPAddressThresholdRequest)(nil), // 3: pb.DeleteNodeIPAddressThresholdRequest + (*FindAllEnabledNodeIPAddressThresholdsRequest)(nil), // 4: pb.FindAllEnabledNodeIPAddressThresholdsRequest + (*FindAllEnabledNodeIPAddressThresholdsResponse)(nil), // 5: pb.FindAllEnabledNodeIPAddressThresholdsResponse + (*CountAllEnabledNodeIPAddressThresholdsRequest)(nil), // 6: pb.CountAllEnabledNodeIPAddressThresholdsRequest + (*UpdateAllNodeIPAddressThresholdsRequest)(nil), // 7: pb.UpdateAllNodeIPAddressThresholdsRequest + (*NodeIPAddressThreshold)(nil), // 8: pb.NodeIPAddressThreshold + (*RPCSuccess)(nil), // 9: pb.RPCSuccess + (*RPCCountResponse)(nil), // 10: pb.RPCCountResponse +} +var file_service_node_ip_address_threshold_proto_depIdxs = []int32{ + 8, // 0: pb.FindAllEnabledNodeIPAddressThresholdsResponse.nodeIPAddressThresholds:type_name -> pb.NodeIPAddressThreshold + 0, // 1: pb.NodeIPAddressThresholdService.createNodeIPAddressThreshold:input_type -> pb.CreateNodeIPAddressThresholdRequest + 2, // 2: pb.NodeIPAddressThresholdService.updateNodeIPAddressThreshold:input_type -> pb.UpdateNodeIPAddressThresholdRequest + 3, // 3: pb.NodeIPAddressThresholdService.deleteNodeIPAddressThreshold:input_type -> pb.DeleteNodeIPAddressThresholdRequest + 4, // 4: pb.NodeIPAddressThresholdService.findAllEnabledNodeIPAddressThresholds:input_type -> pb.FindAllEnabledNodeIPAddressThresholdsRequest + 6, // 5: pb.NodeIPAddressThresholdService.countAllEnabledNodeIPAddressThresholds:input_type -> pb.CountAllEnabledNodeIPAddressThresholdsRequest + 7, // 6: pb.NodeIPAddressThresholdService.updateAllNodeIPAddressThresholds:input_type -> pb.UpdateAllNodeIPAddressThresholdsRequest + 1, // 7: pb.NodeIPAddressThresholdService.createNodeIPAddressThreshold:output_type -> pb.CreateNodeIPAddressThresholdResponse + 9, // 8: pb.NodeIPAddressThresholdService.updateNodeIPAddressThreshold:output_type -> pb.RPCSuccess + 9, // 9: pb.NodeIPAddressThresholdService.deleteNodeIPAddressThreshold:output_type -> pb.RPCSuccess + 5, // 10: pb.NodeIPAddressThresholdService.findAllEnabledNodeIPAddressThresholds:output_type -> pb.FindAllEnabledNodeIPAddressThresholdsResponse + 10, // 11: pb.NodeIPAddressThresholdService.countAllEnabledNodeIPAddressThresholds:output_type -> pb.RPCCountResponse + 9, // 12: pb.NodeIPAddressThresholdService.updateAllNodeIPAddressThresholds:output_type -> pb.RPCSuccess + 7, // [7:13] is the sub-list for method output_type + 1, // [1:7] 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 extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_service_node_ip_address_threshold_proto_init() } +func file_service_node_ip_address_threshold_proto_init() { + if File_service_node_ip_address_threshold_proto != nil { + return + } + file_models_model_node_ip_address_threshold_proto_init() + file_models_rpc_messages_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_node_ip_address_threshold_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNodeIPAddressThresholdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNodeIPAddressThresholdResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeIPAddressThresholdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteNodeIPAddressThresholdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledNodeIPAddressThresholdsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledNodeIPAddressThresholdsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledNodeIPAddressThresholdsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_ip_address_threshold_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAllNodeIPAddressThresholdsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_node_ip_address_threshold_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_node_ip_address_threshold_proto_goTypes, + DependencyIndexes: file_service_node_ip_address_threshold_proto_depIdxs, + MessageInfos: file_service_node_ip_address_threshold_proto_msgTypes, + }.Build() + File_service_node_ip_address_threshold_proto = out.File + file_service_node_ip_address_threshold_proto_rawDesc = nil + file_service_node_ip_address_threshold_proto_goTypes = nil + file_service_node_ip_address_threshold_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// NodeIPAddressThresholdServiceClient is the client API for NodeIPAddressThresholdService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NodeIPAddressThresholdServiceClient interface { + // 创建阈值 + CreateNodeIPAddressThreshold(ctx context.Context, in *CreateNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*CreateNodeIPAddressThresholdResponse, error) + // 修改阈值 + UpdateNodeIPAddressThreshold(ctx context.Context, in *UpdateNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 删除阈值 + DeleteNodeIPAddressThreshold(ctx context.Context, in *DeleteNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 查找IP的所有阈值 + FindAllEnabledNodeIPAddressThresholds(ctx context.Context, in *FindAllEnabledNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeIPAddressThresholdsResponse, error) + // 计算IP阈值的数量 + CountAllEnabledNodeIPAddressThresholds(ctx context.Context, in *CountAllEnabledNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 批量更新阈值 + UpdateAllNodeIPAddressThresholds(ctx context.Context, in *UpdateAllNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) +} + +type nodeIPAddressThresholdServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNodeIPAddressThresholdServiceClient(cc grpc.ClientConnInterface) NodeIPAddressThresholdServiceClient { + return &nodeIPAddressThresholdServiceClient{cc} +} + +func (c *nodeIPAddressThresholdServiceClient) CreateNodeIPAddressThreshold(ctx context.Context, in *CreateNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*CreateNodeIPAddressThresholdResponse, error) { + out := new(CreateNodeIPAddressThresholdResponse) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/createNodeIPAddressThreshold", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeIPAddressThresholdServiceClient) UpdateNodeIPAddressThreshold(ctx context.Context, in *UpdateNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/updateNodeIPAddressThreshold", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeIPAddressThresholdServiceClient) DeleteNodeIPAddressThreshold(ctx context.Context, in *DeleteNodeIPAddressThresholdRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/deleteNodeIPAddressThreshold", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeIPAddressThresholdServiceClient) FindAllEnabledNodeIPAddressThresholds(ctx context.Context, in *FindAllEnabledNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeIPAddressThresholdsResponse, error) { + out := new(FindAllEnabledNodeIPAddressThresholdsResponse) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/findAllEnabledNodeIPAddressThresholds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeIPAddressThresholdServiceClient) CountAllEnabledNodeIPAddressThresholds(ctx context.Context, in *CountAllEnabledNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/countAllEnabledNodeIPAddressThresholds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeIPAddressThresholdServiceClient) UpdateAllNodeIPAddressThresholds(ctx context.Context, in *UpdateAllNodeIPAddressThresholdsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.NodeIPAddressThresholdService/updateAllNodeIPAddressThresholds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodeIPAddressThresholdServiceServer is the server API for NodeIPAddressThresholdService service. +type NodeIPAddressThresholdServiceServer interface { + // 创建阈值 + CreateNodeIPAddressThreshold(context.Context, *CreateNodeIPAddressThresholdRequest) (*CreateNodeIPAddressThresholdResponse, error) + // 修改阈值 + UpdateNodeIPAddressThreshold(context.Context, *UpdateNodeIPAddressThresholdRequest) (*RPCSuccess, error) + // 删除阈值 + DeleteNodeIPAddressThreshold(context.Context, *DeleteNodeIPAddressThresholdRequest) (*RPCSuccess, error) + // 查找IP的所有阈值 + FindAllEnabledNodeIPAddressThresholds(context.Context, *FindAllEnabledNodeIPAddressThresholdsRequest) (*FindAllEnabledNodeIPAddressThresholdsResponse, error) + // 计算IP阈值的数量 + CountAllEnabledNodeIPAddressThresholds(context.Context, *CountAllEnabledNodeIPAddressThresholdsRequest) (*RPCCountResponse, error) + // 批量更新阈值 + UpdateAllNodeIPAddressThresholds(context.Context, *UpdateAllNodeIPAddressThresholdsRequest) (*RPCSuccess, error) +} + +// UnimplementedNodeIPAddressThresholdServiceServer can be embedded to have forward compatible implementations. +type UnimplementedNodeIPAddressThresholdServiceServer struct { +} + +func (*UnimplementedNodeIPAddressThresholdServiceServer) CreateNodeIPAddressThreshold(context.Context, *CreateNodeIPAddressThresholdRequest) (*CreateNodeIPAddressThresholdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNodeIPAddressThreshold not implemented") +} +func (*UnimplementedNodeIPAddressThresholdServiceServer) UpdateNodeIPAddressThreshold(context.Context, *UpdateNodeIPAddressThresholdRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeIPAddressThreshold not implemented") +} +func (*UnimplementedNodeIPAddressThresholdServiceServer) DeleteNodeIPAddressThreshold(context.Context, *DeleteNodeIPAddressThresholdRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNodeIPAddressThreshold not implemented") +} +func (*UnimplementedNodeIPAddressThresholdServiceServer) FindAllEnabledNodeIPAddressThresholds(context.Context, *FindAllEnabledNodeIPAddressThresholdsRequest) (*FindAllEnabledNodeIPAddressThresholdsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledNodeIPAddressThresholds not implemented") +} +func (*UnimplementedNodeIPAddressThresholdServiceServer) CountAllEnabledNodeIPAddressThresholds(context.Context, *CountAllEnabledNodeIPAddressThresholdsRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodeIPAddressThresholds not implemented") +} +func (*UnimplementedNodeIPAddressThresholdServiceServer) UpdateAllNodeIPAddressThresholds(context.Context, *UpdateAllNodeIPAddressThresholdsRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAllNodeIPAddressThresholds not implemented") +} + +func RegisterNodeIPAddressThresholdServiceServer(s *grpc.Server, srv NodeIPAddressThresholdServiceServer) { + s.RegisterService(&_NodeIPAddressThresholdService_serviceDesc, srv) +} + +func _NodeIPAddressThresholdService_CreateNodeIPAddressThreshold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodeIPAddressThresholdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).CreateNodeIPAddressThreshold(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/CreateNodeIPAddressThreshold", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).CreateNodeIPAddressThreshold(ctx, req.(*CreateNodeIPAddressThresholdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeIPAddressThresholdService_UpdateNodeIPAddressThreshold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodeIPAddressThresholdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).UpdateNodeIPAddressThreshold(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/UpdateNodeIPAddressThreshold", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).UpdateNodeIPAddressThreshold(ctx, req.(*UpdateNodeIPAddressThresholdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeIPAddressThresholdService_DeleteNodeIPAddressThreshold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNodeIPAddressThresholdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).DeleteNodeIPAddressThreshold(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/DeleteNodeIPAddressThreshold", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).DeleteNodeIPAddressThreshold(ctx, req.(*DeleteNodeIPAddressThresholdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeIPAddressThresholdService_FindAllEnabledNodeIPAddressThresholds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindAllEnabledNodeIPAddressThresholdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).FindAllEnabledNodeIPAddressThresholds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/FindAllEnabledNodeIPAddressThresholds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).FindAllEnabledNodeIPAddressThresholds(ctx, req.(*FindAllEnabledNodeIPAddressThresholdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeIPAddressThresholdService_CountAllEnabledNodeIPAddressThresholds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledNodeIPAddressThresholdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).CountAllEnabledNodeIPAddressThresholds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/CountAllEnabledNodeIPAddressThresholds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).CountAllEnabledNodeIPAddressThresholds(ctx, req.(*CountAllEnabledNodeIPAddressThresholdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeIPAddressThresholdService_UpdateAllNodeIPAddressThresholds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAllNodeIPAddressThresholdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeIPAddressThresholdServiceServer).UpdateAllNodeIPAddressThresholds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeIPAddressThresholdService/UpdateAllNodeIPAddressThresholds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeIPAddressThresholdServiceServer).UpdateAllNodeIPAddressThresholds(ctx, req.(*UpdateAllNodeIPAddressThresholdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _NodeIPAddressThresholdService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.NodeIPAddressThresholdService", + HandlerType: (*NodeIPAddressThresholdServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createNodeIPAddressThreshold", + Handler: _NodeIPAddressThresholdService_CreateNodeIPAddressThreshold_Handler, + }, + { + MethodName: "updateNodeIPAddressThreshold", + Handler: _NodeIPAddressThresholdService_UpdateNodeIPAddressThreshold_Handler, + }, + { + MethodName: "deleteNodeIPAddressThreshold", + Handler: _NodeIPAddressThresholdService_DeleteNodeIPAddressThreshold_Handler, + }, + { + MethodName: "findAllEnabledNodeIPAddressThresholds", + Handler: _NodeIPAddressThresholdService_FindAllEnabledNodeIPAddressThresholds_Handler, + }, + { + MethodName: "countAllEnabledNodeIPAddressThresholds", + Handler: _NodeIPAddressThresholdService_CountAllEnabledNodeIPAddressThresholds_Handler, + }, + { + MethodName: "updateAllNodeIPAddressThresholds", + Handler: _NodeIPAddressThresholdService_UpdateAllNodeIPAddressThresholds_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_node_ip_address_threshold.proto", +} diff --git a/pkg/rpc/protos/models/model_node_ip_address.proto b/pkg/rpc/protos/models/model_node_ip_address.proto index 7072fef..efe87a1 100644 --- a/pkg/rpc/protos/models/model_node_ip_address.proto +++ b/pkg/rpc/protos/models/model_node_ip_address.proto @@ -15,6 +15,5 @@ message NodeIPAddress { bool canAccess = 8; bool isOn = 9; bool isUp = 10; - bytes thresholdsJSON = 11; string role = 12; } \ No newline at end of file diff --git a/pkg/rpc/protos/models/model_node_ip_address_threshold.proto b/pkg/rpc/protos/models/model_node_ip_address_threshold.proto new file mode 100644 index 0000000..9799333 --- /dev/null +++ b/pkg/rpc/protos/models/model_node_ip_address_threshold.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message NodeIPAddressThreshold { + int64 id = 1; + bytes itemsJSON = 2; + bytes actionsJSON = 3; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_node_ip_address.proto b/pkg/rpc/protos/service_node_ip_address.proto index 4cb7168..abeff81 100644 --- a/pkg/rpc/protos/service_node_ip_address.proto +++ b/pkg/rpc/protos/service_node_ip_address.proto @@ -42,7 +42,6 @@ message CreateNodeIPAddressRequest { string name = 3; string ip = 4; bool canAccess = 5; - bytes thresholdsJSON = 6; } message CreateNodeIPAddressResponse { @@ -56,7 +55,6 @@ message UpdateNodeIPAddressRequest { string ip = 3; bool canAccess = 4; bool isOn = 5; - bytes thresholdsJSON = 6; } // 修改IP地址所属节点 diff --git a/pkg/rpc/protos/service_node_ip_address_threshold.proto b/pkg/rpc/protos/service_node_ip_address_threshold.proto new file mode 100644 index 0000000..3d6f940 --- /dev/null +++ b/pkg/rpc/protos/service_node_ip_address_threshold.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_node_ip_address_threshold.proto"; +import "models/rpc_messages.proto"; + +// IP阈值相关服务 +service NodeIPAddressThresholdService { + // 创建阈值 + rpc createNodeIPAddressThreshold(CreateNodeIPAddressThresholdRequest) returns (CreateNodeIPAddressThresholdResponse); + + // 修改阈值 + rpc updateNodeIPAddressThreshold(UpdateNodeIPAddressThresholdRequest) returns (RPCSuccess); + + // 删除阈值 + rpc deleteNodeIPAddressThreshold(DeleteNodeIPAddressThresholdRequest) returns (RPCSuccess); + + // 查找IP的所有阈值 + rpc findAllEnabledNodeIPAddressThresholds(FindAllEnabledNodeIPAddressThresholdsRequest) returns (FindAllEnabledNodeIPAddressThresholdsResponse); + + // 计算IP阈值的数量 + rpc countAllEnabledNodeIPAddressThresholds(CountAllEnabledNodeIPAddressThresholdsRequest) returns (RPCCountResponse); + + // 批量更新阈值 + rpc updateAllNodeIPAddressThresholds(UpdateAllNodeIPAddressThresholdsRequest) returns (RPCSuccess); +} + +// 创建阈值 +message CreateNodeIPAddressThresholdRequest{ + int64 nodeIPAddressId = 1; + bytes itemsJSON = 2; + bytes actionsJSON = 3; +} + +message CreateNodeIPAddressThresholdResponse { + int64 nodeIPAddressThresholdId = 1; +} + +// 修改阈值 +message UpdateNodeIPAddressThresholdRequest { + int64 nodeIPAddressThresholdId = 1; + bytes itemsJSON = 2; + bytes actionsJSON = 3; +} + +// 删除阈值 +message DeleteNodeIPAddressThresholdRequest { + int64 nodeIPAddressThresholdId = 1; +} + +// 查找IP的所有阈值 +message FindAllEnabledNodeIPAddressThresholdsRequest { + int64 nodeIPAddressId = 1; +} + +message FindAllEnabledNodeIPAddressThresholdsResponse { + repeated NodeIPAddressThreshold nodeIPAddressThresholds = 1; +} + +// 计算IP阈值的数量 +message CountAllEnabledNodeIPAddressThresholdsRequest { + int64 nodeIPAddressId = 1; +} + +// 批量更新阈值 +message UpdateAllNodeIPAddressThresholdsRequest { + int64 nodeIPAddressId = 1; + bytes nodeIPAddressThresholdsJSON = 2; +} \ No newline at end of file