|
|
@@ -26,6 +26,26 @@ var _ = proto.Marshal
|
|
|
var _ = fmt.Errorf
|
|
|
var _ = math.Inf
|
|
|
|
|
|
+type AlarmType int32
|
|
|
+
|
|
|
+const (
|
|
|
+ AlarmType_NONE AlarmType = 0
|
|
|
+ AlarmType_NOSPACE AlarmType = 1
|
|
|
+)
|
|
|
+
|
|
|
+var AlarmType_name = map[int32]string{
|
|
|
+ 0: "NONE",
|
|
|
+ 1: "NOSPACE",
|
|
|
+}
|
|
|
+var AlarmType_value = map[string]int32{
|
|
|
+ "NONE": 0,
|
|
|
+ "NOSPACE": 1,
|
|
|
+}
|
|
|
+
|
|
|
+func (x AlarmType) String() string {
|
|
|
+ return proto.EnumName(AlarmType_name, int32(x))
|
|
|
+}
|
|
|
+
|
|
|
type RangeRequest_SortOrder int32
|
|
|
|
|
|
const (
|
|
|
@@ -127,6 +147,29 @@ func (x Compare_CompareTarget) String() string {
|
|
|
return proto.EnumName(Compare_CompareTarget_name, int32(x))
|
|
|
}
|
|
|
|
|
|
+type AlarmRequest_AlarmAction int32
|
|
|
+
|
|
|
+const (
|
|
|
+ AlarmRequest_GET AlarmRequest_AlarmAction = 0
|
|
|
+ AlarmRequest_ACTIVATE AlarmRequest_AlarmAction = 1
|
|
|
+ AlarmRequest_DEACTIVATE AlarmRequest_AlarmAction = 2
|
|
|
+)
|
|
|
+
|
|
|
+var AlarmRequest_AlarmAction_name = map[int32]string{
|
|
|
+ 0: "GET",
|
|
|
+ 1: "ACTIVATE",
|
|
|
+ 2: "DEACTIVATE",
|
|
|
+}
|
|
|
+var AlarmRequest_AlarmAction_value = map[string]int32{
|
|
|
+ "GET": 0,
|
|
|
+ "ACTIVATE": 1,
|
|
|
+ "DEACTIVATE": 2,
|
|
|
+}
|
|
|
+
|
|
|
+func (x AlarmRequest_AlarmAction) String() string {
|
|
|
+ return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x))
|
|
|
+}
|
|
|
+
|
|
|
type ResponseHeader struct {
|
|
|
ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
|
|
|
MemberId uint64 `protobuf:"varint,2,opt,name=member_id,proto3" json:"member_id,omitempty"`
|
|
|
@@ -1159,6 +1202,49 @@ func (m *DefragmentResponse) GetHeader() *ResponseHeader {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+type AlarmRequest struct {
|
|
|
+ Action AlarmRequest_AlarmAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.AlarmRequest_AlarmAction" json:"action,omitempty"`
|
|
|
+ // MemberID is the member raising the alarm request
|
|
|
+ MemberID int64 `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"`
|
|
|
+ Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmRequest) Reset() { *m = AlarmRequest{} }
|
|
|
+func (m *AlarmRequest) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*AlarmRequest) ProtoMessage() {}
|
|
|
+
|
|
|
+type AlarmMember struct {
|
|
|
+ MemberID uint64 `protobuf:"varint,1,opt,name=memberID,proto3" json:"memberID,omitempty"`
|
|
|
+ Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmMember) Reset() { *m = AlarmMember{} }
|
|
|
+func (m *AlarmMember) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*AlarmMember) ProtoMessage() {}
|
|
|
+
|
|
|
+type AlarmResponse struct {
|
|
|
+ Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
|
|
|
+ Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms" json:"alarms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmResponse) Reset() { *m = AlarmResponse{} }
|
|
|
+func (m *AlarmResponse) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*AlarmResponse) ProtoMessage() {}
|
|
|
+
|
|
|
+func (m *AlarmResponse) GetHeader() *ResponseHeader {
|
|
|
+ if m != nil {
|
|
|
+ return m.Header
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmResponse) GetAlarms() []*AlarmMember {
|
|
|
+ if m != nil {
|
|
|
+ return m.Alarms
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
type AuthEnableRequest struct {
|
|
|
}
|
|
|
|
|
|
@@ -1507,6 +1593,9 @@ func init() {
|
|
|
proto.RegisterType((*MemberListResponse)(nil), "etcdserverpb.MemberListResponse")
|
|
|
proto.RegisterType((*DefragmentRequest)(nil), "etcdserverpb.DefragmentRequest")
|
|
|
proto.RegisterType((*DefragmentResponse)(nil), "etcdserverpb.DefragmentResponse")
|
|
|
+ proto.RegisterType((*AlarmRequest)(nil), "etcdserverpb.AlarmRequest")
|
|
|
+ proto.RegisterType((*AlarmMember)(nil), "etcdserverpb.AlarmMember")
|
|
|
+ proto.RegisterType((*AlarmResponse)(nil), "etcdserverpb.AlarmResponse")
|
|
|
proto.RegisterType((*AuthEnableRequest)(nil), "etcdserverpb.AuthEnableRequest")
|
|
|
proto.RegisterType((*AuthDisableRequest)(nil), "etcdserverpb.AuthDisableRequest")
|
|
|
proto.RegisterType((*AuthenticateRequest)(nil), "etcdserverpb.AuthenticateRequest")
|
|
|
@@ -1535,10 +1624,12 @@ func init() {
|
|
|
proto.RegisterType((*RoleDeleteResponse)(nil), "etcdserverpb.RoleDeleteResponse")
|
|
|
proto.RegisterType((*RoleGrantResponse)(nil), "etcdserverpb.RoleGrantResponse")
|
|
|
proto.RegisterType((*RoleRevokeResponse)(nil), "etcdserverpb.RoleRevokeResponse")
|
|
|
+ proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value)
|
|
|
proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value)
|
|
|
proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value)
|
|
|
proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
|
|
|
proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
|
|
|
+ proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value)
|
|
|
}
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
@@ -2185,6 +2276,8 @@ var _Cluster_serviceDesc = grpc.ServiceDesc{
|
|
|
type MaintenanceClient interface {
|
|
|
// TODO: move Hash from kv to Maintenance
|
|
|
Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error)
|
|
|
+ // Alarm activates, deactivates, and queries alarms regarding cluster health.
|
|
|
+ Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error)
|
|
|
}
|
|
|
|
|
|
type maintenanceClient struct {
|
|
|
@@ -2204,11 +2297,22 @@ func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentReques
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
+func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) {
|
|
|
+ out := new(AlarmResponse)
|
|
|
+ err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, c.cc, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
// Server API for Maintenance service
|
|
|
|
|
|
type MaintenanceServer interface {
|
|
|
// TODO: move Hash from kv to Maintenance
|
|
|
Defragment(context.Context, *DefragmentRequest) (*DefragmentResponse, error)
|
|
|
+ // Alarm activates, deactivates, and queries alarms regarding cluster health.
|
|
|
+ Alarm(context.Context, *AlarmRequest) (*AlarmResponse, error)
|
|
|
}
|
|
|
|
|
|
func RegisterMaintenanceServer(s *grpc.Server, srv MaintenanceServer) {
|
|
|
@@ -2227,6 +2331,18 @@ func _Maintenance_Defragment_Handler(srv interface{}, ctx context.Context, dec f
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
+func _Maintenance_Alarm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
|
|
|
+ in := new(AlarmRequest)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ out, err := srv.(MaintenanceServer).Alarm(ctx, in)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
var _Maintenance_serviceDesc = grpc.ServiceDesc{
|
|
|
ServiceName: "etcdserverpb.Maintenance",
|
|
|
HandlerType: (*MaintenanceServer)(nil),
|
|
|
@@ -2235,6 +2351,10 @@ var _Maintenance_serviceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "Defragment",
|
|
|
Handler: _Maintenance_Defragment_Handler,
|
|
|
},
|
|
|
+ {
|
|
|
+ MethodName: "Alarm",
|
|
|
+ Handler: _Maintenance_Alarm_Handler,
|
|
|
+ },
|
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
}
|
|
|
@@ -4115,6 +4235,107 @@ func (m *DefragmentResponse) MarshalTo(data []byte) (int, error) {
|
|
|
return i, nil
|
|
|
}
|
|
|
|
|
|
+func (m *AlarmRequest) Marshal() (data []byte, err error) {
|
|
|
+ size := m.Size()
|
|
|
+ data = make([]byte, size)
|
|
|
+ n, err := m.MarshalTo(data)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return data[:n], nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmRequest) MarshalTo(data []byte) (int, error) {
|
|
|
+ var i int
|
|
|
+ _ = i
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.Action != 0 {
|
|
|
+ data[i] = 0x8
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.Action))
|
|
|
+ }
|
|
|
+ if m.MemberID != 0 {
|
|
|
+ data[i] = 0x10
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.MemberID))
|
|
|
+ }
|
|
|
+ if m.Alarm != 0 {
|
|
|
+ data[i] = 0x18
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.Alarm))
|
|
|
+ }
|
|
|
+ return i, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmMember) Marshal() (data []byte, err error) {
|
|
|
+ size := m.Size()
|
|
|
+ data = make([]byte, size)
|
|
|
+ n, err := m.MarshalTo(data)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return data[:n], nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmMember) MarshalTo(data []byte) (int, error) {
|
|
|
+ var i int
|
|
|
+ _ = i
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.MemberID != 0 {
|
|
|
+ data[i] = 0x8
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.MemberID))
|
|
|
+ }
|
|
|
+ if m.Alarm != 0 {
|
|
|
+ data[i] = 0x10
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.Alarm))
|
|
|
+ }
|
|
|
+ return i, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmResponse) Marshal() (data []byte, err error) {
|
|
|
+ size := m.Size()
|
|
|
+ data = make([]byte, size)
|
|
|
+ n, err := m.MarshalTo(data)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return data[:n], nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmResponse) MarshalTo(data []byte) (int, error) {
|
|
|
+ var i int
|
|
|
+ _ = i
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.Header != nil {
|
|
|
+ data[i] = 0xa
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
+ n29, err := m.Header.MarshalTo(data[i:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ i += n29
|
|
|
+ }
|
|
|
+ if len(m.Alarms) > 0 {
|
|
|
+ for _, msg := range m.Alarms {
|
|
|
+ data[i] = 0x12
|
|
|
+ i++
|
|
|
+ i = encodeVarintRpc(data, i, uint64(msg.Size()))
|
|
|
+ n, err := msg.MarshalTo(data[i:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ i += n
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return i, nil
|
|
|
+}
|
|
|
+
|
|
|
func (m *AuthEnableRequest) Marshal() (data []byte, err error) {
|
|
|
size := m.Size()
|
|
|
data = make([]byte, size)
|
|
|
@@ -4398,11 +4619,11 @@ func (m *AuthEnableResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n29, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n30, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n29
|
|
|
+ i += n30
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4426,11 +4647,11 @@ func (m *AuthDisableResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n30, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n31, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n30
|
|
|
+ i += n31
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4454,11 +4675,11 @@ func (m *AuthenticateResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n31, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n32, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n31
|
|
|
+ i += n32
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4482,11 +4703,11 @@ func (m *UserAddResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n32, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n33, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n32
|
|
|
+ i += n33
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4510,11 +4731,11 @@ func (m *UserGetResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n33, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n34, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n33
|
|
|
+ i += n34
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4538,11 +4759,11 @@ func (m *UserDeleteResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n34, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n35, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n34
|
|
|
+ i += n35
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4566,11 +4787,11 @@ func (m *UserChangePasswordResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n35, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n36, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n35
|
|
|
+ i += n36
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4594,11 +4815,11 @@ func (m *UserGrantResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n36, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n37, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n36
|
|
|
+ i += n37
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4622,11 +4843,11 @@ func (m *UserRevokeResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n37, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n38, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n37
|
|
|
+ i += n38
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4650,11 +4871,11 @@ func (m *RoleAddResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n38, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n39, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n38
|
|
|
+ i += n39
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4678,11 +4899,11 @@ func (m *RoleGetResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n39, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n40, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n39
|
|
|
+ i += n40
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4706,11 +4927,11 @@ func (m *RoleDeleteResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n40, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n41, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n40
|
|
|
+ i += n41
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4734,11 +4955,11 @@ func (m *RoleGrantResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n41, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n42, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n41
|
|
|
+ i += n42
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -4762,11 +4983,11 @@ func (m *RoleRevokeResponse) MarshalTo(data []byte) (int, error) {
|
|
|
data[i] = 0xa
|
|
|
i++
|
|
|
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
|
|
|
- n42, err := m.Header.MarshalTo(data[i:])
|
|
|
+ n43, err := m.Header.MarshalTo(data[i:])
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
}
|
|
|
- i += n42
|
|
|
+ i += n43
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
@@ -5431,6 +5652,49 @@ func (m *DefragmentResponse) Size() (n int) {
|
|
|
return n
|
|
|
}
|
|
|
|
|
|
+func (m *AlarmRequest) Size() (n int) {
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.Action != 0 {
|
|
|
+ n += 1 + sovRpc(uint64(m.Action))
|
|
|
+ }
|
|
|
+ if m.MemberID != 0 {
|
|
|
+ n += 1 + sovRpc(uint64(m.MemberID))
|
|
|
+ }
|
|
|
+ if m.Alarm != 0 {
|
|
|
+ n += 1 + sovRpc(uint64(m.Alarm))
|
|
|
+ }
|
|
|
+ return n
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmMember) Size() (n int) {
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.MemberID != 0 {
|
|
|
+ n += 1 + sovRpc(uint64(m.MemberID))
|
|
|
+ }
|
|
|
+ if m.Alarm != 0 {
|
|
|
+ n += 1 + sovRpc(uint64(m.Alarm))
|
|
|
+ }
|
|
|
+ return n
|
|
|
+}
|
|
|
+
|
|
|
+func (m *AlarmResponse) Size() (n int) {
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.Header != nil {
|
|
|
+ l = m.Header.Size()
|
|
|
+ n += 1 + l + sovRpc(uint64(l))
|
|
|
+ }
|
|
|
+ if len(m.Alarms) > 0 {
|
|
|
+ for _, e := range m.Alarms {
|
|
|
+ l = e.Size()
|
|
|
+ n += 1 + l + sovRpc(uint64(l))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return n
|
|
|
+}
|
|
|
+
|
|
|
func (m *AuthEnableRequest) Size() (n int) {
|
|
|
var l int
|
|
|
_ = l
|
|
|
@@ -9761,6 +10025,315 @@ func (m *DefragmentResponse) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
+func (m *AlarmRequest) Unmarshal(data []byte) error {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldNum := int32(wire >> 3)
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
+ switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
|
|
|
+ }
|
|
|
+ m.Action = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType)
|
|
|
+ }
|
|
|
+ m.MemberID = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.MemberID |= (int64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType)
|
|
|
+ }
|
|
|
+ m.Alarm = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.Alarm |= (AlarmType(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ iNdEx = preIndex
|
|
|
+ skippy, err := skipRpc(data[iNdEx:])
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if skippy < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx += skippy
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (m *AlarmMember) Unmarshal(data []byte) error {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldNum := int32(wire >> 3)
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
+ switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType)
|
|
|
+ }
|
|
|
+ m.MemberID = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.MemberID |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ if wireType != 0 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType)
|
|
|
+ }
|
|
|
+ m.Alarm = 0
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ m.Alarm |= (AlarmType(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ iNdEx = preIndex
|
|
|
+ skippy, err := skipRpc(data[iNdEx:])
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if skippy < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx += skippy
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (m *AlarmResponse) Unmarshal(data []byte) error {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldNum := int32(wire >> 3)
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
+ switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
|
|
|
+ }
|
|
|
+ var msglen int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ msglen |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if msglen < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ if m.Header == nil {
|
|
|
+ m.Header = &ResponseHeader{}
|
|
|
+ }
|
|
|
+ if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
+ case 2:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType)
|
|
|
+ }
|
|
|
+ var msglen int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowRpc
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ msglen |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if msglen < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ m.Alarms = append(m.Alarms, &AlarmMember{})
|
|
|
+ if err := m.Alarms[len(m.Alarms)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
+ default:
|
|
|
+ iNdEx = preIndex
|
|
|
+ skippy, err := skipRpc(data[iNdEx:])
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if skippy < 0 {
|
|
|
+ return ErrInvalidLengthRpc
|
|
|
+ }
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx += skippy
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
func (m *AuthEnableRequest) Unmarshal(data []byte) error {
|
|
|
l := len(data)
|
|
|
iNdEx := 0
|