mirror of https://github.com/dragonflyoss/api.git
feat: add objectStoragePort to AnnounceHostRequest (#169)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
dab1ac6881
commit
8b4a651857
|
|
@ -671,6 +671,8 @@ type Host struct {
|
|||
Build *Build `protobuf:"bytes,16,opt,name=build,proto3,oneof" json:"build,omitempty"`
|
||||
// ID of the cluster to which the host belongs.
|
||||
SchedulerClusterId uint64 `protobuf:"varint,17,opt,name=scheduler_cluster_id,json=schedulerClusterId,proto3" json:"scheduler_cluster_id,omitempty"`
|
||||
// Port of object storage server.
|
||||
ObjectStoragePort int32 `protobuf:"varint,18,opt,name=object_storage_port,json=objectStoragePort,proto3" json:"object_storage_port,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Host) Reset() {
|
||||
|
|
@ -824,6 +826,13 @@ func (x *Host) GetSchedulerClusterId() uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *Host) GetObjectStoragePort() int32 {
|
||||
if x != nil {
|
||||
return x.ObjectStoragePort
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
type CPU struct {
|
||||
state protoimpl.MessageState
|
||||
|
|
@ -1855,7 +1864,7 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{
|
|||
0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbb, 0x05, 0x0a,
|
||||
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfb, 0x05, 0x0a,
|
||||
0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b,
|
||||
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42,
|
||||
|
|
@ -1896,7 +1905,11 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{
|
|||
0x69, 0x6c, 0x64, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
|
||||
0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x11,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43,
|
||||
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x63, 0x70, 0x75,
|
||||
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x13, 0x6f, 0x62, 0x6a, 0x65,
|
||||
0x63, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18,
|
||||
0x12, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x1a, 0x09, 0x10, 0xff, 0xff, 0x03,
|
||||
0x28, 0x80, 0x08, 0x40, 0x01, 0x52, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x63, 0x70, 0x75,
|
||||
0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f,
|
||||
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x64, 0x69, 0x73, 0x6b,
|
||||
0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x22, 0xee, 0x01, 0x0a, 0x03, 0x43,
|
||||
|
|
|
|||
|
|
@ -752,6 +752,21 @@ func (m *Host) validate(all bool) error {
|
|||
|
||||
// no validation rules for SchedulerClusterId
|
||||
|
||||
if m.GetObjectStoragePort() != 0 {
|
||||
|
||||
if val := m.GetObjectStoragePort(); val < 1024 || val >= 65535 {
|
||||
err := HostValidationError{
|
||||
field: "ObjectStoragePort",
|
||||
reason: "value must be inside range [1024, 65535)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if m.Cpu != nil {
|
||||
|
||||
if all {
|
||||
|
|
|
|||
|
|
@ -208,6 +208,8 @@ message Host {
|
|||
optional Build build = 16;
|
||||
// ID of the cluster to which the host belongs.
|
||||
uint64 scheduler_cluster_id = 17;
|
||||
// Port of object storage server.
|
||||
int32 object_storage_port = 18 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
|
|
|
|||
|
|
@ -1247,6 +1247,8 @@ type AnnounceHostRequest struct {
|
|||
Build *Build `protobuf:"bytes,16,opt,name=build,proto3" json:"build,omitempty"`
|
||||
// ID of the cluster to which the host belongs.
|
||||
SchedulerClusterId uint64 `protobuf:"varint,17,opt,name=scheduler_cluster_id,json=schedulerClusterId,proto3" json:"scheduler_cluster_id,omitempty"`
|
||||
// Port of object storage server.
|
||||
ObjectStoragePort int32 `protobuf:"varint,18,opt,name=object_storage_port,json=objectStoragePort,proto3" json:"object_storage_port,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AnnounceHostRequest) Reset() {
|
||||
|
|
@ -1400,6 +1402,13 @@ func (x *AnnounceHostRequest) GetSchedulerClusterId() uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *AnnounceHostRequest) GetObjectStoragePort() int32 {
|
||||
if x != nil {
|
||||
return x.ObjectStoragePort
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
type CPU struct {
|
||||
state protoimpl.MessageState
|
||||
|
|
@ -2665,7 +2674,7 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_rawDesc = []byte{
|
|||
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22,
|
||||
0x2b, 0x0a, 0x10, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcc, 0x05, 0x0a,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8c, 0x06, 0x0a,
|
||||
0x13, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a,
|
||||
|
|
@ -2710,7 +2719,11 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_rawDesc = []byte{
|
|||
0x10, 0x01, 0x52, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68,
|
||||
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0xe9, 0x01, 0x0a, 0x03,
|
||||
0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x13, 0x6f,
|
||||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x1a, 0x09, 0x10,
|
||||
0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x40, 0x01, 0x52, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
|
||||
0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x22, 0xe9, 0x01, 0x0a, 0x03,
|
||||
0x43, 0x50, 0x55, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x69,
|
||||
0x63, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x68, 0x79, 0x73,
|
||||
|
|
|
|||
|
|
@ -2499,6 +2499,21 @@ func (m *AnnounceHostRequest) validate(all bool) error {
|
|||
|
||||
// no validation rules for SchedulerClusterId
|
||||
|
||||
if m.GetObjectStoragePort() != 0 {
|
||||
|
||||
if val := m.GetObjectStoragePort(); val < 1024 || val >= 65535 {
|
||||
err := AnnounceHostRequestValidationError{
|
||||
field: "ObjectStoragePort",
|
||||
reason: "value must be inside range [1024, 65535)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return AnnounceHostRequestMultiError(errors)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,6 +267,8 @@ message AnnounceHostRequest{
|
|||
Build build = 16 [(validate.rules).message.required = true];
|
||||
// ID of the cluster to which the host belongs.
|
||||
uint64 scheduler_cluster_id = 17;
|
||||
// Port of object storage server.
|
||||
int32 object_storage_port = 18 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@ message Host {
|
|||
optional Build build = 16;
|
||||
// ID of the cluster to which the host belongs.
|
||||
uint64 scheduler_cluster_id = 17;
|
||||
// Port of object storage server.
|
||||
int32 object_storage_port = 18;
|
||||
}
|
||||
|
||||
// CPU Stat.
|
||||
|
|
|
|||
|
|
@ -153,6 +153,9 @@ pub struct Host {
|
|||
/// ID of the cluster to which the host belongs.
|
||||
#[prost(uint64, tag = "17")]
|
||||
pub scheduler_cluster_id: u64,
|
||||
/// Port of object storage server.
|
||||
#[prost(int32, tag = "18")]
|
||||
pub object_storage_port: i32,
|
||||
}
|
||||
/// CPU Stat.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue