mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-02 05:40:27 +08:00
增加节点IP地址管理等功能
This commit is contained in:
@@ -16,6 +16,7 @@ pub ${ADMIN_PROJECT} admin
|
||||
pub ${ADMIN_PROJECT} node
|
||||
pub ${ADMIN_PROJECT} node_cluster
|
||||
pub ${ADMIN_PROJECT} node_grant
|
||||
pub ${ADMIN_PROJECT} node_ip_address
|
||||
pub ${ADMIN_PROJECT} server
|
||||
|
||||
cp ../internal/rpc/pb/model_*.go ${ADMIN_PROJECT}/internal/rpc/pb/
|
||||
|
||||
@@ -56,6 +56,7 @@ func (this *APINode) listenRPC() error {
|
||||
pb.RegisterServerServiceServer(rpcServer, &services.ServerService{})
|
||||
pb.RegisterNodeServiceServer(rpcServer, &services.NodeService{})
|
||||
pb.RegisterNodeClusterServiceServer(rpcServer, &services.NodeClusterService{})
|
||||
pb.RegisterNodeIPAddressServiceServer(rpcServer, &services.NodeIPAddressService{})
|
||||
err = rpcServer.Serve(listener)
|
||||
if err != nil {
|
||||
return errors.New("[API]start rpc failed: " + err.Error())
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -27,19 +29,21 @@ func NewNodeClusterDAO() *NodeClusterDAO {
|
||||
var SharedNodeClusterDAO = NewNodeClusterDAO()
|
||||
|
||||
// 启用条目
|
||||
func (this *NodeClusterDAO) EnableNodeCluster(id uint32) (rowsAffected int64, err error) {
|
||||
return this.Query().
|
||||
func (this *NodeClusterDAO) EnableNodeCluster(id int64) error {
|
||||
_, err := this.Query().
|
||||
Pk(id).
|
||||
Set("state", NodeClusterStateEnabled).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 禁用条目
|
||||
func (this *NodeClusterDAO) DisableNodeCluster(id uint32) (rowsAffected int64, err error) {
|
||||
return this.Query().
|
||||
func (this *NodeClusterDAO) DisableNodeCluster(id int64) error {
|
||||
_, err := this.Query().
|
||||
Pk(id).
|
||||
Set("state", NodeClusterStateDisabled).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 查找启用中的条目
|
||||
@@ -72,3 +76,50 @@ func (this *NodeClusterDAO) FindAllEnableClusters() (result []*NodeCluster, err
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
// 创建集群
|
||||
func (this *NodeClusterDAO) CreateCluster(name string, grantId int64, installDir string) (clusterId int64, err error) {
|
||||
op := NewNodeClusterOperator()
|
||||
op.Name = name
|
||||
op.GrantId = grantId
|
||||
op.InstallDir = installDir
|
||||
op.State = NodeClusterStateEnabled
|
||||
_, err = this.Save(op)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return types.Int64(op.Id), nil
|
||||
}
|
||||
|
||||
// 修改集群
|
||||
func (this *NodeClusterDAO) UpdateCluster(clusterId int64, name string, grantId int64, installDir string) error {
|
||||
if clusterId <= 0 {
|
||||
return errors.New("invalid clusterId")
|
||||
}
|
||||
op := NewNodeClusterOperator()
|
||||
op.Id = clusterId
|
||||
op.Name = name
|
||||
op.GrantId = grantId
|
||||
op.InstallDir = installDir
|
||||
_, err := this.Save(op)
|
||||
return err
|
||||
}
|
||||
|
||||
// 计算所有集群数量
|
||||
func (this *NodeClusterDAO) CountAllEnabledClusters() (int64, error) {
|
||||
return this.Query().
|
||||
State(NodeClusterStateEnabled).
|
||||
Count()
|
||||
}
|
||||
|
||||
// 列出单页集群
|
||||
func (this *NodeClusterDAO) ListEnabledClusters(offset, size int64) (result []*NodeCluster, err error) {
|
||||
_, err = this.Query().
|
||||
State(NodeClusterStateEnabled).
|
||||
Offset(offset).
|
||||
Limit(size).
|
||||
Slice(&result).
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2,19 +2,23 @@ package models
|
||||
|
||||
// 节点集群
|
||||
type NodeCluster struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
Name string `field:"name"` // 名称
|
||||
Order uint32 `field:"order"` // 排序
|
||||
CreatedAt uint32 `field:"createdAt"` // 创建时间
|
||||
State uint8 `field:"state"` // 状态
|
||||
Id uint32 `field:"id"` // ID
|
||||
Name string `field:"name"` // 名称
|
||||
InstallDir string `field:"installDir"` // 安装目录
|
||||
GrantId uint32 `field:"grantId"` // 默认认证方式
|
||||
Order uint32 `field:"order"` // 排序
|
||||
CreatedAt uint32 `field:"createdAt"` // 创建时间
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type NodeClusterOperator struct {
|
||||
Id interface{} // ID
|
||||
Name interface{} // 名称
|
||||
Order interface{} // 排序
|
||||
CreatedAt interface{} // 创建时间
|
||||
State interface{} // 状态
|
||||
Id interface{} // ID
|
||||
Name interface{} // 名称
|
||||
InstallDir interface{} // 安装目录
|
||||
GrantId interface{} // 默认认证方式
|
||||
Order interface{} // 排序
|
||||
CreatedAt interface{} // 创建时间
|
||||
State interface{} // 状态
|
||||
}
|
||||
|
||||
func NewNodeClusterOperator() *NodeClusterOperator {
|
||||
|
||||
@@ -169,14 +169,19 @@ func (this *NodeDAO) CountAllEnabledNodes() (int64, error) {
|
||||
}
|
||||
|
||||
// 列出单页节点
|
||||
func (this *NodeDAO) ListEnabledNodes(offset int64, size int64) (result []*Node, err error) {
|
||||
_, err = this.Query().
|
||||
func (this *NodeDAO) ListEnabledNodesMatch(offset int64, size int64, clusterId int64) (result []*Node, err error) {
|
||||
query := this.Query().
|
||||
State(NodeStateEnabled).
|
||||
Offset(offset).
|
||||
Limit(size).
|
||||
DescPk().
|
||||
Slice(&result).
|
||||
FindAll()
|
||||
Slice(&result)
|
||||
|
||||
if clusterId > 0 {
|
||||
query.Attr("clusterId", clusterId)
|
||||
}
|
||||
|
||||
_, err = query.FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -236,6 +241,16 @@ func (this *NodeDAO) FindAllNodeIdsMatch(clusterId int64) (result []int64, err e
|
||||
return
|
||||
}
|
||||
|
||||
// 计算节点数量
|
||||
func (this *NodeDAO) CountAllEnabledNodesMatch(clusterId int64) (int64, error) {
|
||||
query := this.Query()
|
||||
query.State(NodeStateEnabled)
|
||||
if clusterId > 0 {
|
||||
query.Attr("clusterId", clusterId)
|
||||
}
|
||||
return query.Count()
|
||||
}
|
||||
|
||||
// 更改节点状态
|
||||
func (this *NodeDAO) UpdateNodeStatus(nodeId int64, statusJSON []byte) error {
|
||||
_, err := this.Query().
|
||||
|
||||
129
internal/db/models/node_ip_address_dao.go
Normal file
129
internal/db/models/node_ip_address_dao.go
Normal file
@@ -0,0 +1,129 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
const (
|
||||
NodeIPAddressStateEnabled = 1 // 已启用
|
||||
NodeIPAddressStateDisabled = 0 // 已禁用
|
||||
)
|
||||
|
||||
type NodeIPAddressDAO dbs.DAO
|
||||
|
||||
func NewNodeIPAddressDAO() *NodeIPAddressDAO {
|
||||
return dbs.NewDAO(&NodeIPAddressDAO{
|
||||
DAOObject: dbs.DAOObject{
|
||||
DB: Tea.Env,
|
||||
Table: "edgeNodeIPAddresses",
|
||||
Model: new(NodeIPAddress),
|
||||
PkName: "id",
|
||||
},
|
||||
}).(*NodeIPAddressDAO)
|
||||
}
|
||||
|
||||
var SharedNodeIPAddressDAO = NewNodeIPAddressDAO()
|
||||
|
||||
// 启用条目
|
||||
func (this *NodeIPAddressDAO) EnableAddress(id int64) (err error) {
|
||||
_, err = this.Query().
|
||||
Pk(id).
|
||||
Set("state", NodeIPAddressStateEnabled).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 禁用IP地址
|
||||
func (this *NodeIPAddressDAO) DisableAddress(id int64) (err error) {
|
||||
_, err = this.Query().
|
||||
Pk(id).
|
||||
Set("state", NodeIPAddressStateDisabled).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 禁用节点的所有的IP地址
|
||||
func (this *NodeIPAddressDAO) DisableAllAddressesWithNodeId(nodeId int64) error {
|
||||
if nodeId <= 0 {
|
||||
return errors.New("invalid nodeId")
|
||||
}
|
||||
_, err := this.Query().
|
||||
Attr("nodeId", nodeId).
|
||||
Set("state", NodeIPAddressStateDisabled).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 查找启用中的IP地址
|
||||
func (this *NodeIPAddressDAO) FindEnabledAddress(id int64) (*NodeIPAddress, error) {
|
||||
result, err := this.Query().
|
||||
Pk(id).
|
||||
Attr("state", NodeIPAddressStateEnabled).
|
||||
Find()
|
||||
if result == nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.(*NodeIPAddress), err
|
||||
}
|
||||
|
||||
// 根据主键查找名称
|
||||
func (this *NodeIPAddressDAO) FindAddressName(id int64) (string, error) {
|
||||
return this.Query().
|
||||
Pk(id).
|
||||
Result("name").
|
||||
FindStringCol("")
|
||||
}
|
||||
|
||||
// 创建IP地址
|
||||
func (this *NodeIPAddressDAO) CreateAddress(nodeId int64, name string, ip string) (addressId int64, err error) {
|
||||
op := NewNodeIPAddressOperator()
|
||||
op.NodeId = nodeId
|
||||
op.Name = name
|
||||
op.IP = ip
|
||||
op.State = NodeIPAddressStateEnabled
|
||||
_, err = this.Save(op)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return types.Int64(op.Id), nil
|
||||
}
|
||||
|
||||
// 修改IP地址
|
||||
func (this *NodeIPAddressDAO) UpdateAddress(addressId int64, name string, ip string) (err error) {
|
||||
if addressId <= 0 {
|
||||
return errors.New("invalid addressId")
|
||||
}
|
||||
|
||||
op := NewNodeIPAddressOperator()
|
||||
op.Id = addressId
|
||||
op.Name = name
|
||||
op.IP = ip
|
||||
_, err = this.Save(op)
|
||||
return err
|
||||
}
|
||||
|
||||
// 修改IP地址所属节点
|
||||
func (this *NodeIPAddressDAO) UpdateAddressNodeId(addressId int64, nodeId int64) error {
|
||||
_, err := this.Query().
|
||||
Pk(addressId).
|
||||
Set("nodeId", nodeId).
|
||||
Set("state", NodeIPAddressStateEnabled). // 恢复状态
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
// 查找某个节点所有的IP地址
|
||||
func (this *NodeIPAddressDAO) FindAllEnabledAddressesWithNode(nodeId int64) (result []*NodeIPAddress, err error) {
|
||||
_, err = this.Query().
|
||||
Attr("nodeId", nodeId).
|
||||
State(NodeIPAddressStateEnabled).
|
||||
Desc("order").
|
||||
AscPk().
|
||||
Slice(&result).
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
5
internal/db/models/node_ip_address_dao_test.go
Normal file
5
internal/db/models/node_ip_address_dao_test.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
26
internal/db/models/node_ip_address_model.go
Normal file
26
internal/db/models/node_ip_address_model.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package models
|
||||
|
||||
//
|
||||
type NodeIPAddress struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
NodeId uint32 `field:"nodeId"` // 节点ID
|
||||
Name string `field:"name"` // 名称
|
||||
IP string `field:"ip"` // IP地址
|
||||
Description string `field:"description"` // 描述
|
||||
State uint8 `field:"state"` // 状态
|
||||
Order uint32 `field:"order"` // 排序
|
||||
}
|
||||
|
||||
type NodeIPAddressOperator struct {
|
||||
Id interface{} // ID
|
||||
NodeId interface{} // 节点ID
|
||||
Name interface{} // 名称
|
||||
IP interface{} // IP地址
|
||||
Description interface{} // 描述
|
||||
State interface{} // 状态
|
||||
Order interface{} // 排序
|
||||
}
|
||||
|
||||
func NewNodeIPAddressOperator() *NodeIPAddressOperator {
|
||||
return &NodeIPAddressOperator{}
|
||||
}
|
||||
1
internal/db/models/node_ip_address_model_ext.go
Normal file
1
internal/db/models/node_ip_address_model_ext.go
Normal file
@@ -0,0 +1 @@
|
||||
package models
|
||||
@@ -15,6 +15,8 @@ type Node struct {
|
||||
Status string `field:"status"` // 最新的状态
|
||||
Version uint32 `field:"version"` // 当前版本号
|
||||
LatestVersion uint32 `field:"latestVersion"` // 最后版本号
|
||||
InstallDir string `field:"installDir"` // 安装目录
|
||||
IsInstalled uint8 `field:"isInstalled"` // 是否已安装
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
@@ -32,6 +34,8 @@ type NodeOperator struct {
|
||||
Status interface{} // 最新的状态
|
||||
Version interface{} // 当前版本号
|
||||
LatestVersion interface{} // 最后版本号
|
||||
InstallDir interface{} // 安装目录
|
||||
IsInstalled interface{} // 是否已安装
|
||||
State interface{} // 状态
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,16 @@ type Node struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
|
||||
Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"`
|
||||
Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
|
||||
InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"`
|
||||
IsInstalled bool `protobuf:"varint,5,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"`
|
||||
Code string `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"`
|
||||
UniqueId string `protobuf:"bytes,7,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"`
|
||||
Secret string `protobuf:"bytes,8,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||
Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"`
|
||||
Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Node) Reset() {
|
||||
@@ -90,6 +95,41 @@ func (x *Node) GetStatus() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetInstallDir() string {
|
||||
if x != nil {
|
||||
return x.InstallDir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetIsInstalled() bool {
|
||||
if x != nil {
|
||||
return x.IsInstalled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Node) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetUniqueId() string {
|
||||
if x != nil {
|
||||
return x.UniqueId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetSecret() string {
|
||||
if x != nil {
|
||||
return x.Secret
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetCluster() *NodeCluster {
|
||||
if x != nil {
|
||||
return x.Cluster
|
||||
@@ -111,17 +151,26 @@ var file_model_node_proto_rawDesc = []byte{
|
||||
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f,
|
||||
0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67,
|
||||
0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64,
|
||||
0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x04, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
|
||||
0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a,
|
||||
0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52,
|
||||
0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69,
|
||||
0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a,
|
||||
0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
|
||||
0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
|
||||
0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
|
||||
0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
||||
0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -30,9 +30,11 @@ type NodeCluster struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
|
||||
GrantId int64 `protobuf:"varint,4,opt,name=grantId,proto3" json:"grantId,omitempty"`
|
||||
InstallDir string `protobuf:"bytes,5,opt,name=installDir,proto3" json:"installDir,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NodeCluster) Reset() {
|
||||
@@ -88,17 +90,35 @@ func (x *NodeCluster) GetCreatedAt() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeCluster) GetGrantId() int64 {
|
||||
if x != nil {
|
||||
return x.GrantId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeCluster) GetInstallDir() string {
|
||||
if x != nil {
|
||||
return x.InstallDir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_model_node_cluster_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_model_node_cluster_proto_rawDesc = []byte{
|
||||
0x0a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75,
|
||||
0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4f,
|
||||
0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42,
|
||||
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x89,
|
||||
0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e,
|
||||
0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
|
||||
0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
203
internal/rpc/pb/model_node_ip_address.pb.go
Normal file
203
internal/rpc/pb/model_node_ip_address.pb.go
Normal file
@@ -0,0 +1,203 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.12.3
|
||||
// source: model_node_ip_address.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 NodeIPAddress struct {
|
||||
state protoimpl.MessageState
|
||||
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"`
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) Reset() {
|
||||
*x = NodeIPAddress{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_model_node_ip_address_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodeIPAddress) ProtoMessage() {}
|
||||
|
||||
func (x *NodeIPAddress) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_model_node_ip_address_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 NodeIPAddress.ProtoReflect.Descriptor instead.
|
||||
func (*NodeIPAddress) Descriptor() ([]byte, []int) {
|
||||
return file_model_node_ip_address_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetNodeId() int64 {
|
||||
if x != nil {
|
||||
return x.NodeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetState() int64 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetOrder() int64 {
|
||||
if x != nil {
|
||||
return x.Order
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_model_node_ip_address_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_model_node_ip_address_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 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, 0xa9, 0x01, 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, 0x49, 0x64, 0x12, 0x12, 0x0a, 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,
|
||||
0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_model_node_ip_address_proto_rawDescOnce sync.Once
|
||||
file_model_node_ip_address_proto_rawDescData = file_model_node_ip_address_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_model_node_ip_address_proto_rawDescGZIP() []byte {
|
||||
file_model_node_ip_address_proto_rawDescOnce.Do(func() {
|
||||
file_model_node_ip_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_ip_address_proto_rawDescData)
|
||||
})
|
||||
return file_model_node_ip_address_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_model_node_ip_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_model_node_ip_address_proto_goTypes = []interface{}{
|
||||
(*NodeIPAddress)(nil), // 0: pb.NodeIPAddress
|
||||
}
|
||||
var file_model_node_ip_address_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_model_node_ip_address_proto_init() }
|
||||
func file_model_node_ip_address_proto_init() {
|
||||
if File_model_node_ip_address_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_model_node_ip_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NodeIPAddress); 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_model_node_ip_address_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_model_node_ip_address_proto_goTypes,
|
||||
DependencyIndexes: file_model_node_ip_address_proto_depIdxs,
|
||||
MessageInfos: file_model_node_ip_address_proto_msgTypes,
|
||||
}.Build()
|
||||
File_model_node_ip_address_proto = out.File
|
||||
file_model_node_ip_address_proto_rawDesc = nil
|
||||
file_model_node_ip_address_proto_goTypes = nil
|
||||
file_model_node_ip_address_proto_depIdxs = nil
|
||||
}
|
||||
@@ -227,17 +227,18 @@ func (x *CountAllEnabledNodesResponse) GetCount() int64 {
|
||||
}
|
||||
|
||||
// 列出单页节点
|
||||
type ListEnabledNodesRequest struct {
|
||||
type ListEnabledNodesMatchRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
|
||||
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
|
||||
ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesRequest) Reset() {
|
||||
*x = ListEnabledNodesRequest{}
|
||||
func (x *ListEnabledNodesMatchRequest) Reset() {
|
||||
*x = ListEnabledNodesMatchRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_node_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -245,13 +246,13 @@ func (x *ListEnabledNodesRequest) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesRequest) String() string {
|
||||
func (x *ListEnabledNodesMatchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListEnabledNodesRequest) ProtoMessage() {}
|
||||
func (*ListEnabledNodesMatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListEnabledNodesRequest) ProtoReflect() protoreflect.Message {
|
||||
func (x *ListEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_node_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -263,26 +264,33 @@ func (x *ListEnabledNodesRequest) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListEnabledNodesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListEnabledNodesRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ListEnabledNodesMatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListEnabledNodesMatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_service_node_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesRequest) GetOffset() int64 {
|
||||
func (x *ListEnabledNodesMatchRequest) GetOffset() int64 {
|
||||
if x != nil {
|
||||
return x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesRequest) GetSize() int64 {
|
||||
func (x *ListEnabledNodesMatchRequest) GetSize() int64 {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListEnabledNodesResponse struct {
|
||||
func (x *ListEnabledNodesMatchRequest) GetClusterId() int64 {
|
||||
if x != nil {
|
||||
return x.ClusterId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListEnabledNodesMatchResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -290,8 +298,8 @@ type ListEnabledNodesResponse struct {
|
||||
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesResponse) Reset() {
|
||||
*x = ListEnabledNodesResponse{}
|
||||
func (x *ListEnabledNodesMatchResponse) Reset() {
|
||||
*x = ListEnabledNodesMatchResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_node_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -299,13 +307,13 @@ func (x *ListEnabledNodesResponse) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesResponse) String() string {
|
||||
func (x *ListEnabledNodesMatchResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListEnabledNodesResponse) ProtoMessage() {}
|
||||
func (*ListEnabledNodesMatchResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListEnabledNodesResponse) ProtoReflect() protoreflect.Message {
|
||||
func (x *ListEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_node_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -317,12 +325,12 @@ func (x *ListEnabledNodesResponse) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListEnabledNodesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListEnabledNodesResponse) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ListEnabledNodesMatchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListEnabledNodesMatchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_service_node_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListEnabledNodesResponse) GetNodes() []*Node {
|
||||
func (x *ListEnabledNodesMatchResponse) GetNodes() []*Node {
|
||||
if x != nil {
|
||||
return x.Nodes
|
||||
}
|
||||
@@ -963,6 +971,101 @@ func (*SyncNodesVersionWithClusterResponse) Descriptor() ([]byte, []int) {
|
||||
return file_service_node_proto_rawDescGZIP(), []int{19}
|
||||
}
|
||||
|
||||
// 计算匹配的节点数量
|
||||
type CountAllEnabledNodesMatchRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchRequest) Reset() {
|
||||
*x = CountAllEnabledNodesMatchRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_node_proto_msgTypes[20]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CountAllEnabledNodesMatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_node_proto_msgTypes[20]
|
||||
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 CountAllEnabledNodesMatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CountAllEnabledNodesMatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_service_node_proto_rawDescGZIP(), []int{20}
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchRequest) GetClusterId() int64 {
|
||||
if x != nil {
|
||||
return x.ClusterId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CountAllEnabledNodesMatchResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchResponse) Reset() {
|
||||
*x = CountAllEnabledNodesMatchResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_node_proto_msgTypes[21]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CountAllEnabledNodesMatchResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_node_proto_msgTypes[21]
|
||||
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 CountAllEnabledNodesMatchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CountAllEnabledNodesMatchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_service_node_proto_rawDescGZIP(), []int{21}
|
||||
}
|
||||
|
||||
func (x *CountAllEnabledNodesMatchResponse) GetCount() int64 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_service_node_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_service_node_proto_rawDesc = []byte{
|
||||
@@ -985,107 +1088,125 @@ var file_service_node_proto_rawDesc = []byte{
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e,
|
||||
0x74, 0x22, 0x45, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66,
|
||||
0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e,
|
||||
0x6f, 0x64, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e,
|
||||
0x6f, 0x64, 0x65, 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, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 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, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63,
|
||||
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
|
||||
0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67,
|
||||
0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x14,
|
||||
0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 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, 0x22, 0x37, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e,
|
||||
0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22,
|
||||
0x1a, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x43,
|
||||
0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a,
|
||||
0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 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, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x42, 0x0a, 0x22, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56,
|
||||
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
|
||||
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75,
|
||||
0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c,
|
||||
0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8f, 0x06,
|
||||
0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a,
|
||||
0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x14, 0x63, 0x6f,
|
||||
0x74, 0x22, 0x68, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x1d, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05,
|
||||
0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x12,
|
||||
0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 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, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69,
|
||||
0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||
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, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49,
|
||||
0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
|
||||
0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x16,
|
||||
0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 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, 0x22, 0x37,
|
||||
0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x6f,
|
||||
0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e,
|
||||
0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72,
|
||||
0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 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, 0x1e,
|
||||
0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1a,
|
||||
0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x22, 0x53, 0x79,
|
||||
0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69,
|
||||
0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x25,
|
||||
0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c,
|
||||
0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75,
|
||||
0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c,
|
||||
0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x39, 0x0a, 0x21, 0x43, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x32, 0x88, 0x07, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x59, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c,
|
||||
0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c,
|
||||
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c,
|
||||
0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e,
|
||||
0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e,
|
||||
0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a,
|
||||
0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e,
|
||||
0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x3f, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e,
|
||||
0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74,
|
||||
0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01,
|
||||
0x12, 0x4d, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x6e, 0x0a, 0x1b, 0x73, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68,
|
||||
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
|
||||
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x63, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e,
|
||||
0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c,
|
||||
0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e,
|
||||
0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
|
||||
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44,
|
||||
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e,
|
||||
0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63,
|
||||
0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a,
|
||||
0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65,
|
||||
0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4d,
|
||||
0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a,
|
||||
0x1b, 0x73, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c,
|
||||
0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -1100,14 +1221,14 @@ func file_service_node_proto_rawDescGZIP() []byte {
|
||||
return file_service_node_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_service_node_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
|
||||
var file_service_node_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
|
||||
var file_service_node_proto_goTypes = []interface{}{
|
||||
(*CreateNodeRequest)(nil), // 0: pb.CreateNodeRequest
|
||||
(*CreateNodeResponse)(nil), // 1: pb.CreateNodeResponse
|
||||
(*CountAllEnabledNodesRequest)(nil), // 2: pb.CountAllEnabledNodesRequest
|
||||
(*CountAllEnabledNodesResponse)(nil), // 3: pb.CountAllEnabledNodesResponse
|
||||
(*ListEnabledNodesRequest)(nil), // 4: pb.ListEnabledNodesRequest
|
||||
(*ListEnabledNodesResponse)(nil), // 5: pb.ListEnabledNodesResponse
|
||||
(*ListEnabledNodesMatchRequest)(nil), // 4: pb.ListEnabledNodesMatchRequest
|
||||
(*ListEnabledNodesMatchResponse)(nil), // 5: pb.ListEnabledNodesMatchResponse
|
||||
(*DisableNodeRequest)(nil), // 6: pb.DisableNodeRequest
|
||||
(*DisableNodeResponse)(nil), // 7: pb.DisableNodeResponse
|
||||
(*UpdateNodeRequest)(nil), // 8: pb.UpdateNodeRequest
|
||||
@@ -1122,36 +1243,40 @@ var file_service_node_proto_goTypes = []interface{}{
|
||||
(*UpdateNodeStatusResponse)(nil), // 17: pb.UpdateNodeStatusResponse
|
||||
(*SyncNodesVersionWithClusterRequest)(nil), // 18: pb.SyncNodesVersionWithClusterRequest
|
||||
(*SyncNodesVersionWithClusterResponse)(nil), // 19: pb.SyncNodesVersionWithClusterResponse
|
||||
(*NodeLogin)(nil), // 20: pb.NodeLogin
|
||||
(*Node)(nil), // 21: pb.Node
|
||||
(*CountAllEnabledNodesMatchRequest)(nil), // 20: pb.CountAllEnabledNodesMatchRequest
|
||||
(*CountAllEnabledNodesMatchResponse)(nil), // 21: pb.CountAllEnabledNodesMatchResponse
|
||||
(*NodeLogin)(nil), // 22: pb.NodeLogin
|
||||
(*Node)(nil), // 23: pb.Node
|
||||
}
|
||||
var file_service_node_proto_depIdxs = []int32{
|
||||
20, // 0: pb.CreateNodeRequest.Login:type_name -> pb.NodeLogin
|
||||
21, // 1: pb.ListEnabledNodesResponse.nodes:type_name -> pb.Node
|
||||
20, // 2: pb.UpdateNodeRequest.Login:type_name -> pb.NodeLogin
|
||||
21, // 3: pb.FindEnabledNodeResponse.node:type_name -> pb.Node
|
||||
22, // 0: pb.CreateNodeRequest.Login:type_name -> pb.NodeLogin
|
||||
23, // 1: pb.ListEnabledNodesMatchResponse.nodes:type_name -> pb.Node
|
||||
22, // 2: pb.UpdateNodeRequest.Login:type_name -> pb.NodeLogin
|
||||
23, // 3: pb.FindEnabledNodeResponse.node:type_name -> pb.Node
|
||||
0, // 4: pb.NodeService.createNode:input_type -> pb.CreateNodeRequest
|
||||
2, // 5: pb.NodeService.countAllEnabledNodes:input_type -> pb.CountAllEnabledNodesRequest
|
||||
4, // 6: pb.NodeService.listEnabledNodes:input_type -> pb.ListEnabledNodesRequest
|
||||
6, // 7: pb.NodeService.disableNode:input_type -> pb.DisableNodeRequest
|
||||
8, // 8: pb.NodeService.updateNode:input_type -> pb.UpdateNodeRequest
|
||||
10, // 9: pb.NodeService.findEnabledNode:input_type -> pb.FindEnabledNodeRequest
|
||||
12, // 10: pb.NodeService.composeNodeConfig:input_type -> pb.ComposeNodeConfigRequest
|
||||
14, // 11: pb.NodeService.nodeStream:input_type -> pb.NodeStreamRequest
|
||||
16, // 12: pb.NodeService.updateNodeStatus:input_type -> pb.UpdateNodeStatusRequest
|
||||
18, // 13: pb.NodeService.syncNodesVersionWithCluster:input_type -> pb.SyncNodesVersionWithClusterRequest
|
||||
1, // 14: pb.NodeService.createNode:output_type -> pb.CreateNodeResponse
|
||||
3, // 15: pb.NodeService.countAllEnabledNodes:output_type -> pb.CountAllEnabledNodesResponse
|
||||
5, // 16: pb.NodeService.listEnabledNodes:output_type -> pb.ListEnabledNodesResponse
|
||||
7, // 17: pb.NodeService.disableNode:output_type -> pb.DisableNodeResponse
|
||||
9, // 18: pb.NodeService.updateNode:output_type -> pb.UpdateNodeResponse
|
||||
11, // 19: pb.NodeService.findEnabledNode:output_type -> pb.FindEnabledNodeResponse
|
||||
13, // 20: pb.NodeService.composeNodeConfig:output_type -> pb.ComposeNodeConfigResponse
|
||||
15, // 21: pb.NodeService.nodeStream:output_type -> pb.NodeStreamResponse
|
||||
17, // 22: pb.NodeService.updateNodeStatus:output_type -> pb.UpdateNodeStatusResponse
|
||||
19, // 23: pb.NodeService.syncNodesVersionWithCluster:output_type -> pb.SyncNodesVersionWithClusterResponse
|
||||
14, // [14:24] is the sub-list for method output_type
|
||||
4, // [4:14] is the sub-list for method input_type
|
||||
20, // 6: pb.NodeService.countAllEnabledNodesMatch:input_type -> pb.CountAllEnabledNodesMatchRequest
|
||||
4, // 7: pb.NodeService.listEnabledNodesMatch:input_type -> pb.ListEnabledNodesMatchRequest
|
||||
6, // 8: pb.NodeService.disableNode:input_type -> pb.DisableNodeRequest
|
||||
8, // 9: pb.NodeService.updateNode:input_type -> pb.UpdateNodeRequest
|
||||
10, // 10: pb.NodeService.findEnabledNode:input_type -> pb.FindEnabledNodeRequest
|
||||
12, // 11: pb.NodeService.composeNodeConfig:input_type -> pb.ComposeNodeConfigRequest
|
||||
14, // 12: pb.NodeService.nodeStream:input_type -> pb.NodeStreamRequest
|
||||
16, // 13: pb.NodeService.updateNodeStatus:input_type -> pb.UpdateNodeStatusRequest
|
||||
18, // 14: pb.NodeService.syncNodesVersionWithCluster:input_type -> pb.SyncNodesVersionWithClusterRequest
|
||||
1, // 15: pb.NodeService.createNode:output_type -> pb.CreateNodeResponse
|
||||
3, // 16: pb.NodeService.countAllEnabledNodes:output_type -> pb.CountAllEnabledNodesResponse
|
||||
21, // 17: pb.NodeService.countAllEnabledNodesMatch:output_type -> pb.CountAllEnabledNodesMatchResponse
|
||||
5, // 18: pb.NodeService.listEnabledNodesMatch:output_type -> pb.ListEnabledNodesMatchResponse
|
||||
7, // 19: pb.NodeService.disableNode:output_type -> pb.DisableNodeResponse
|
||||
9, // 20: pb.NodeService.updateNode:output_type -> pb.UpdateNodeResponse
|
||||
11, // 21: pb.NodeService.findEnabledNode:output_type -> pb.FindEnabledNodeResponse
|
||||
13, // 22: pb.NodeService.composeNodeConfig:output_type -> pb.ComposeNodeConfigResponse
|
||||
15, // 23: pb.NodeService.nodeStream:output_type -> pb.NodeStreamResponse
|
||||
17, // 24: pb.NodeService.updateNodeStatus:output_type -> pb.UpdateNodeStatusResponse
|
||||
19, // 25: pb.NodeService.syncNodesVersionWithCluster:output_type -> pb.SyncNodesVersionWithClusterResponse
|
||||
15, // [15:26] is the sub-list for method output_type
|
||||
4, // [4:15] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
@@ -1214,7 +1339,7 @@ func file_service_node_proto_init() {
|
||||
}
|
||||
}
|
||||
file_service_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListEnabledNodesRequest); i {
|
||||
switch v := v.(*ListEnabledNodesMatchRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -1226,7 +1351,7 @@ func file_service_node_proto_init() {
|
||||
}
|
||||
}
|
||||
file_service_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListEnabledNodesResponse); i {
|
||||
switch v := v.(*ListEnabledNodesMatchResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -1405,6 +1530,30 @@ func file_service_node_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CountAllEnabledNodesMatchRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_node_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CountAllEnabledNodesMatchResponse); 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{
|
||||
@@ -1412,7 +1561,7 @@ func file_service_node_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_service_node_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 20,
|
||||
NumMessages: 22,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
@@ -1442,8 +1591,10 @@ type NodeServiceClient interface {
|
||||
CreateNode(ctx context.Context, in *CreateNodeRequest, opts ...grpc.CallOption) (*CreateNodeResponse, error)
|
||||
// 节点数量
|
||||
CountAllEnabledNodes(ctx context.Context, in *CountAllEnabledNodesRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesResponse, error)
|
||||
// 计算匹配的节点数量
|
||||
CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error)
|
||||
// 列出单页节点
|
||||
ListEnabledNodes(ctx context.Context, in *ListEnabledNodesRequest, opts ...grpc.CallOption) (*ListEnabledNodesResponse, error)
|
||||
ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error)
|
||||
// 禁用节点
|
||||
DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error)
|
||||
// 修改节点
|
||||
@@ -1486,9 +1637,18 @@ func (c *nodeServiceClient) CountAllEnabledNodes(ctx context.Context, in *CountA
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) ListEnabledNodes(ctx context.Context, in *ListEnabledNodesRequest, opts ...grpc.CallOption) (*ListEnabledNodesResponse, error) {
|
||||
out := new(ListEnabledNodesResponse)
|
||||
err := c.cc.Invoke(ctx, "/pb.NodeService/listEnabledNodes", in, out, opts...)
|
||||
func (c *nodeServiceClient) CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error) {
|
||||
out := new(CountAllEnabledNodesMatchResponse)
|
||||
err := c.cc.Invoke(ctx, "/pb.NodeService/countAllEnabledNodesMatch", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error) {
|
||||
out := new(ListEnabledNodesMatchResponse)
|
||||
err := c.cc.Invoke(ctx, "/pb.NodeService/listEnabledNodesMatch", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1586,8 +1746,10 @@ type NodeServiceServer interface {
|
||||
CreateNode(context.Context, *CreateNodeRequest) (*CreateNodeResponse, error)
|
||||
// 节点数量
|
||||
CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error)
|
||||
// 计算匹配的节点数量
|
||||
CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error)
|
||||
// 列出单页节点
|
||||
ListEnabledNodes(context.Context, *ListEnabledNodesRequest) (*ListEnabledNodesResponse, error)
|
||||
ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error)
|
||||
// 禁用节点
|
||||
DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error)
|
||||
// 修改节点
|
||||
@@ -1614,8 +1776,11 @@ func (*UnimplementedNodeServiceServer) CreateNode(context.Context, *CreateNodeRe
|
||||
func (*UnimplementedNodeServiceServer) CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodes not implemented")
|
||||
}
|
||||
func (*UnimplementedNodeServiceServer) ListEnabledNodes(context.Context, *ListEnabledNodesRequest) (*ListEnabledNodesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodes not implemented")
|
||||
func (*UnimplementedNodeServiceServer) CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodesMatch not implemented")
|
||||
}
|
||||
func (*UnimplementedNodeServiceServer) ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodesMatch not implemented")
|
||||
}
|
||||
func (*UnimplementedNodeServiceServer) DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DisableNode not implemented")
|
||||
@@ -1679,20 +1844,38 @@ func _NodeService_CountAllEnabledNodes_Handler(srv interface{}, ctx context.Cont
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NodeService_ListEnabledNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListEnabledNodesRequest)
|
||||
func _NodeService_CountAllEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CountAllEnabledNodesMatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).ListEnabledNodes(ctx, in)
|
||||
return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pb.NodeService/ListEnabledNodes",
|
||||
FullMethod: "/pb.NodeService/CountAllEnabledNodesMatch",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).ListEnabledNodes(ctx, req.(*ListEnabledNodesRequest))
|
||||
return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, req.(*CountAllEnabledNodesMatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NodeService_ListEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListEnabledNodesMatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/pb.NodeService/ListEnabledNodesMatch",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, req.(*ListEnabledNodesMatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -1844,8 +2027,12 @@ var _NodeService_serviceDesc = grpc.ServiceDesc{
|
||||
Handler: _NodeService_CountAllEnabledNodes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "listEnabledNodes",
|
||||
Handler: _NodeService_ListEnabledNodes_Handler,
|
||||
MethodName: "countAllEnabledNodesMatch",
|
||||
Handler: _NodeService_CountAllEnabledNodesMatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "listEnabledNodesMatch",
|
||||
Handler: _NodeService_ListEnabledNodesMatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "disableNode",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1375
internal/rpc/pb/service_node_ip_address.pb.go
Normal file
1375
internal/rpc/pb/service_node_ip_address.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,11 @@ message Node {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
string status = 3;
|
||||
string installDir = 4;
|
||||
bool isInstalled = 5;
|
||||
string code = 6;
|
||||
string uniqueId = 7;
|
||||
string secret = 8;
|
||||
|
||||
NodeCluster cluster = 32;
|
||||
NodeLogin login = 33;
|
||||
|
||||
@@ -7,4 +7,6 @@ message NodeCluster {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
int64 createdAt = 3;
|
||||
int64 grantId = 4;
|
||||
string installDir = 5;
|
||||
}
|
||||
14
internal/rpc/protos/model_node_ip_address.proto
Normal file
14
internal/rpc/protos/model_node_ip_address.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
message NodeIPAddress {
|
||||
int64 id = 1;
|
||||
int64 nodeId = 2;
|
||||
string name = 3;
|
||||
string ip = 4;
|
||||
string description = 5;
|
||||
int64 state = 6;
|
||||
int64 order = 7;
|
||||
}
|
||||
@@ -12,8 +12,11 @@ service NodeService {
|
||||
// 节点数量
|
||||
rpc countAllEnabledNodes (CountAllEnabledNodesRequest) returns (CountAllEnabledNodesResponse);
|
||||
|
||||
// 计算匹配的节点数量
|
||||
rpc countAllEnabledNodesMatch (CountAllEnabledNodesMatchRequest) returns (CountAllEnabledNodesMatchResponse);
|
||||
|
||||
// 列出单页节点
|
||||
rpc listEnabledNodes (ListEnabledNodesRequest) returns (ListEnabledNodesResponse);
|
||||
rpc listEnabledNodesMatch (ListEnabledNodesMatchRequest) returns (ListEnabledNodesMatchResponse);
|
||||
|
||||
// 禁用节点
|
||||
rpc disableNode (DisableNodeRequest) returns (DisableNodeResponse);
|
||||
@@ -58,12 +61,13 @@ message CountAllEnabledNodesResponse {
|
||||
}
|
||||
|
||||
// 列出单页节点
|
||||
message ListEnabledNodesRequest {
|
||||
message ListEnabledNodesMatchRequest {
|
||||
int64 offset = 1;
|
||||
int64 size = 2;
|
||||
int64 clusterId = 3;
|
||||
}
|
||||
|
||||
message ListEnabledNodesResponse {
|
||||
message ListEnabledNodesMatchResponse {
|
||||
repeated Node nodes = 1;
|
||||
}
|
||||
|
||||
@@ -131,4 +135,13 @@ message SyncNodesVersionWithClusterRequest {
|
||||
}
|
||||
|
||||
message SyncNodesVersionWithClusterResponse {
|
||||
}
|
||||
|
||||
// 计算匹配的节点数量
|
||||
message CountAllEnabledNodesMatchRequest {
|
||||
int64 clusterId = 1;
|
||||
}
|
||||
|
||||
message CountAllEnabledNodesMatchResponse {
|
||||
int64 count = 1;
|
||||
}
|
||||
@@ -5,11 +5,29 @@ package pb;
|
||||
import "model_node_cluster.proto";
|
||||
|
||||
service NodeClusterService {
|
||||
// 创建集群
|
||||
rpc createNodeCluster (CreateNodeClusterRequest) returns (CreateNodeClusterResponse);
|
||||
|
||||
// 修改集群
|
||||
rpc updateNodeCluster (UpdateNodeClusterRequest) returns (UpdateNodeClusterResponse);
|
||||
|
||||
// 禁用集群
|
||||
rpc disableNodeCluster (DisableNodeClusterRequest) returns (DisableNodeClusterResponse);
|
||||
|
||||
// 查找单个集群信息
|
||||
rpc findEnabledNodeCluster (FindEnabledNodeClusterRequest) returns (FindEnabledNodeClusterResponse);
|
||||
|
||||
// 获取所有集群的信息
|
||||
rpc findAllEnabledClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse);
|
||||
rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse);
|
||||
|
||||
// 获取变更的集群
|
||||
rpc findAllChangedClusters (FindAllChangedClustersRequest) returns (FindAllChangedClustersResponse);
|
||||
rpc findAllChangedNodeClusters (FindAllChangedNodeClustersRequest) returns (FindAllChangedNodeClustersResponse);
|
||||
|
||||
// 计算所有集群数量
|
||||
rpc countAllEnabledNodeClusters (CountAllEnabledNodeClustersRequest) returns (CountAllEnabledNodeClustersResponse);
|
||||
|
||||
// 列出单页集群
|
||||
rpc listEnabledNodeClusters (ListEnabledNodeClustersRequest) returns (ListEnabledNodeClustersResponse);
|
||||
}
|
||||
|
||||
// 获取所有集群的信息
|
||||
@@ -22,10 +40,70 @@ message FindAllEnabledNodeClustersResponse {
|
||||
}
|
||||
|
||||
// 获取变更的集群
|
||||
message FindAllChangedClustersRequest {
|
||||
message FindAllChangedNodeClustersRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindAllChangedClustersResponse {
|
||||
message FindAllChangedNodeClustersResponse {
|
||||
repeated NodeCluster clusters = 1;
|
||||
}
|
||||
|
||||
// 创建集群
|
||||
message CreateNodeClusterRequest {
|
||||
string name = 1;
|
||||
int64 grantId = 2;
|
||||
string installDir = 3;
|
||||
}
|
||||
|
||||
message CreateNodeClusterResponse {
|
||||
int64 clusterId = 1;
|
||||
}
|
||||
|
||||
// 修改集群
|
||||
message UpdateNodeClusterRequest {
|
||||
int64 clusterId = 1;
|
||||
string name = 2;
|
||||
int64 grantId = 3;
|
||||
string installDir = 4;
|
||||
}
|
||||
|
||||
message UpdateNodeClusterResponse {
|
||||
|
||||
}
|
||||
|
||||
// 禁用集群
|
||||
message DisableNodeClusterRequest {
|
||||
int64 clusterId = 1;
|
||||
}
|
||||
|
||||
message DisableNodeClusterResponse {
|
||||
|
||||
}
|
||||
|
||||
// 查找单个集群信息
|
||||
message FindEnabledNodeClusterRequest {
|
||||
int64 clusterId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodeClusterResponse {
|
||||
NodeCluster cluster = 1;
|
||||
}
|
||||
|
||||
// 计算所有集群数量
|
||||
message CountAllEnabledNodeClustersRequest {
|
||||
|
||||
}
|
||||
|
||||
message CountAllEnabledNodeClustersResponse {
|
||||
int64 count = 1;
|
||||
}
|
||||
|
||||
// 列出单页集群
|
||||
message ListEnabledNodeClustersRequest {
|
||||
int64 offset = 1;
|
||||
int64 size = 2;
|
||||
}
|
||||
|
||||
message ListEnabledNodeClustersResponse {
|
||||
repeated NodeCluster clusters = 1;
|
||||
}
|
||||
97
internal/rpc/protos/service_node_ip_address.proto
Normal file
97
internal/rpc/protos/service_node_ip_address.proto
Normal file
@@ -0,0 +1,97 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "model_node_ip_address.proto";
|
||||
|
||||
service NodeIPAddressService {
|
||||
// 创建IP地址
|
||||
rpc createNodeIPAddress (CreateNodeIPAddressRequest) returns (CreateNodeIPAddressResponse);
|
||||
|
||||
// 修改IP地址
|
||||
rpc updateNodeIPAddress (UpdateNodeIPAddressRequest) returns (UpdateNodeIPAddressResponse);
|
||||
|
||||
// 修改IP地址所属节点
|
||||
rpc updateNodeIPAddressNodeId (UpdateNodeIPAddressNodeIdRequest) returns (UpdateNodeIPAddressNodeIdResponse);
|
||||
|
||||
// 禁用单个IP地址
|
||||
rpc disableNodeIPAddress (DisableNodeIPAddressRequest) returns (DisableNodeIPAddressResponse);
|
||||
|
||||
// 禁用节点的所有IP地址
|
||||
rpc disableAllIPAddressesWithNodeId (DisableAllIPAddressesWithNodeIdRequest) returns (DisableAllIPAddressesWithNodeIdResponse);
|
||||
|
||||
// 查找单个IP地址
|
||||
rpc findEnabledNodeIPAddress (FindEnabledNodeIPAddressRequest) returns (FindEnabledNodeIPAddressResponse);
|
||||
|
||||
// 查找节点的所有地址
|
||||
rpc findAllEnabledIPAddressesWithNodeId (FindAllEnabledIPAddressesWithNodeIdRequest) returns (FindAllEnabledIPAddressesWithNodeIdResponse);
|
||||
}
|
||||
|
||||
// 创建IP地址
|
||||
message CreateNodeIPAddressRequest {
|
||||
int64 nodeId = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
}
|
||||
|
||||
message CreateNodeIPAddressResponse {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
// 修改IP地址
|
||||
message UpdateNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
}
|
||||
|
||||
message UpdateNodeIPAddressResponse {
|
||||
|
||||
}
|
||||
|
||||
// 修改IP地址所属节点
|
||||
message UpdateNodeIPAddressNodeIdRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeId = 2;
|
||||
}
|
||||
|
||||
message UpdateNodeIPAddressNodeIdResponse {
|
||||
|
||||
}
|
||||
|
||||
// 禁用单个IP地址
|
||||
message DisableNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
message DisableNodeIPAddressResponse {
|
||||
|
||||
}
|
||||
|
||||
// 禁用节点的所有IP地址
|
||||
message DisableAllIPAddressesWithNodeIdRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message DisableAllIPAddressesWithNodeIdResponse {
|
||||
|
||||
}
|
||||
|
||||
// 查找单个IP地址
|
||||
message FindEnabledNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodeIPAddressResponse {
|
||||
NodeIPAddress ipAddress = 1;
|
||||
}
|
||||
|
||||
// 查找节点的所有地址
|
||||
message FindAllEnabledIPAddressesWithNodeIdRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message FindAllEnabledIPAddressesWithNodeIdResponse {
|
||||
repeated NodeIPAddress addresses = 1;
|
||||
}
|
||||
@@ -52,12 +52,25 @@ func (this *NodeService) CountAllEnabledNodes(ctx context.Context, req *pb.Count
|
||||
return &pb.CountAllEnabledNodesResponse{Count: count}, nil
|
||||
}
|
||||
|
||||
func (this *NodeService) ListEnabledNodes(ctx context.Context, req *pb.ListEnabledNodesRequest) (*pb.ListEnabledNodesResponse, error) {
|
||||
// 计算匹配的节点数量
|
||||
func (this *NodeService) CountAllEnabledNodesMatch(ctx context.Context, req *pb.CountAllEnabledNodesMatchRequest) (*pb.CountAllEnabledNodesMatchResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nodes, err := models.SharedNodeDAO.ListEnabledNodes(req.Offset, req.Size)
|
||||
count, err := models.SharedNodeDAO.CountAllEnabledNodesMatch(req.ClusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &pb.CountAllEnabledNodesMatchResponse{Count: count}, nil
|
||||
}
|
||||
|
||||
func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.ListEnabledNodesMatchRequest) (*pb.ListEnabledNodesMatchResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nodes, err := models.SharedNodeDAO.ListEnabledNodesMatch(req.Offset, req.Size, req.ClusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -80,7 +93,7 @@ func (this *NodeService) ListEnabledNodes(ctx context.Context, req *pb.ListEnabl
|
||||
})
|
||||
}
|
||||
|
||||
return &pb.ListEnabledNodesResponse{
|
||||
return &pb.ListEnabledNodesMatchResponse{
|
||||
Nodes: result,
|
||||
}, nil
|
||||
}
|
||||
@@ -171,9 +184,13 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable
|
||||
}
|
||||
|
||||
return &pb.FindEnabledNodeResponse{Node: &pb.Node{
|
||||
Id: int64(node.Id),
|
||||
Name: node.Name,
|
||||
Status: node.Status,
|
||||
Id: int64(node.Id),
|
||||
Name: node.Name,
|
||||
Status: node.Status,
|
||||
UniqueId: node.UniqueId,
|
||||
Secret: node.Secret,
|
||||
InstallDir: node.InstallDir,
|
||||
IsInstalled: node.IsInstalled == 1,
|
||||
Cluster: &pb.NodeCluster{
|
||||
Id: int64(node.ClusterId),
|
||||
Name: clusterName,
|
||||
|
||||
@@ -10,7 +10,78 @@ import (
|
||||
type NodeClusterService struct {
|
||||
}
|
||||
|
||||
func (this *NodeClusterService) FindAllEnabledClusters(ctx context.Context, req *pb.FindAllEnabledNodeClustersRequest) (*pb.FindAllEnabledNodeClustersResponse, error) {
|
||||
// 创建集群
|
||||
func (this *NodeClusterService) CreateNodeCluster(ctx context.Context, req *pb.CreateNodeClusterRequest) (*pb.CreateNodeClusterResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clusterId, err := models.SharedNodeClusterDAO.CreateCluster(req.Name, req.GrantId, req.InstallDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.CreateNodeClusterResponse{ClusterId: clusterId}, nil
|
||||
}
|
||||
|
||||
// 修改集群
|
||||
func (this *NodeClusterService) UpdateNodeCluster(ctx context.Context, req *pb.UpdateNodeClusterRequest) (*pb.UpdateNodeClusterResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeClusterDAO.UpdateCluster(req.ClusterId, req.Name, req.GrantId, req.InstallDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.UpdateNodeClusterResponse{}, nil
|
||||
}
|
||||
|
||||
// 禁用集群
|
||||
func (this *NodeClusterService) DisableNodeCluster(ctx context.Context, req *pb.DisableNodeClusterRequest) (*pb.DisableNodeClusterResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeClusterDAO.DisableNodeCluster(req.ClusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.DisableNodeClusterResponse{}, nil
|
||||
}
|
||||
|
||||
// 查找单个集群
|
||||
func (this *NodeClusterService) FindEnabledNodeCluster(ctx context.Context, req *pb.FindEnabledNodeClusterRequest) (*pb.FindEnabledNodeClusterResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cluster, err := models.SharedNodeClusterDAO.FindEnabledNodeCluster(req.ClusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if cluster == nil {
|
||||
return &pb.FindEnabledNodeClusterResponse{}, nil
|
||||
}
|
||||
|
||||
return &pb.FindEnabledNodeClusterResponse{Cluster: &pb.NodeCluster{
|
||||
Id: int64(cluster.Id),
|
||||
Name: cluster.Name,
|
||||
CreatedAt: int64(cluster.CreatedAt),
|
||||
InstallDir: cluster.InstallDir,
|
||||
GrantId: int64(cluster.GrantId),
|
||||
}}, nil
|
||||
}
|
||||
|
||||
// 查找所有可用的集群
|
||||
func (this *NodeClusterService) FindAllEnabledNodeClusters(ctx context.Context, req *pb.FindAllEnabledNodeClustersRequest) (*pb.FindAllEnabledNodeClustersResponse, error) {
|
||||
_ = req
|
||||
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
@@ -38,7 +109,7 @@ func (this *NodeClusterService) FindAllEnabledClusters(ctx context.Context, req
|
||||
}
|
||||
|
||||
// 查找所有变更的集群
|
||||
func (this *NodeClusterService) FindAllChangedClusters(ctx context.Context, req *pb.FindAllChangedClustersRequest) (*pb.FindAllChangedClustersResponse, error) {
|
||||
func (this *NodeClusterService) FindAllChangedNodeClusters(ctx context.Context, req *pb.FindAllChangedNodeClustersRequest) (*pb.FindAllChangedNodeClustersResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,7 +120,7 @@ func (this *NodeClusterService) FindAllChangedClusters(ctx context.Context, req
|
||||
return nil, err
|
||||
}
|
||||
if len(clusterIds) == 0 {
|
||||
return &pb.FindAllChangedClustersResponse{
|
||||
return &pb.FindAllChangedNodeClustersResponse{
|
||||
Clusters: []*pb.NodeCluster{},
|
||||
}, nil
|
||||
}
|
||||
@@ -68,5 +139,46 @@ func (this *NodeClusterService) FindAllChangedClusters(ctx context.Context, req
|
||||
CreatedAt: int64(cluster.CreatedAt),
|
||||
})
|
||||
}
|
||||
return &pb.FindAllChangedClustersResponse{Clusters: result}, nil
|
||||
return &pb.FindAllChangedNodeClustersResponse{Clusters: result}, nil
|
||||
}
|
||||
|
||||
// 计算所有集群数量
|
||||
func (this *NodeClusterService) CountAllEnabledNodeClusters(ctx context.Context, req *pb.CountAllEnabledNodeClustersRequest) (*pb.CountAllEnabledNodeClustersResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
count, err := models.SharedNodeClusterDAO.CountAllEnabledClusters()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.CountAllEnabledNodeClustersResponse{Count: count}, nil
|
||||
}
|
||||
|
||||
// 列出单页集群
|
||||
func (this *NodeClusterService) ListEnabledNodeClusters(ctx context.Context, req *pb.ListEnabledNodeClustersRequest) (*pb.ListEnabledNodeClustersResponse, error) {
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clusters, err := models.SharedNodeClusterDAO.ListEnabledClusters(req.Offset, req.Size)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := []*pb.NodeCluster{}
|
||||
for _, cluster := range clusters {
|
||||
result = append(result, &pb.NodeCluster{
|
||||
Id: int64(cluster.Id),
|
||||
Name: cluster.Name,
|
||||
CreatedAt: int64(cluster.CreatedAt),
|
||||
GrantId: int64(cluster.GrantId),
|
||||
InstallDir: cluster.InstallDir,
|
||||
})
|
||||
}
|
||||
|
||||
return &pb.ListEnabledNodeClustersResponse{Clusters: result}, nil
|
||||
}
|
||||
|
||||
149
internal/rpc/services/service_node_ip_address.go
Normal file
149
internal/rpc/services/service_node_ip_address.go
Normal file
@@ -0,0 +1,149 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
|
||||
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
|
||||
)
|
||||
|
||||
type NodeIPAddressService struct {
|
||||
}
|
||||
|
||||
// 创建IP地址
|
||||
func (this *NodeIPAddressService) CreateNodeIPAddress(ctx context.Context, req *pb.CreateNodeIPAddressRequest) (*pb.CreateNodeIPAddressResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
addressId, err := models.SharedNodeIPAddressDAO.CreateAddress(req.NodeId, req.Name, req.Ip)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.CreateNodeIPAddressResponse{AddressId: addressId}, nil
|
||||
}
|
||||
|
||||
// 修改IP地址
|
||||
func (this *NodeIPAddressService) UpdateNodeIPAddress(ctx context.Context, req *pb.UpdateNodeIPAddressRequest) (*pb.UpdateNodeIPAddressResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeIPAddressDAO.UpdateAddress(req.AddressId, req.Name, req.Ip)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.UpdateNodeIPAddressResponse{}, nil
|
||||
}
|
||||
|
||||
// 修改IP地址所属节点
|
||||
func (this *NodeIPAddressService) UpdateNodeIPAddressNodeId(ctx context.Context, req *pb.UpdateNodeIPAddressNodeIdRequest) (*pb.UpdateNodeIPAddressNodeIdResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeIPAddressDAO.UpdateAddressNodeId(req.AddressId, req.NodeId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.UpdateNodeIPAddressNodeIdResponse{}, nil
|
||||
}
|
||||
|
||||
// 禁用单个IP地址
|
||||
func (this *NodeIPAddressService) DisableNodeIPAddress(ctx context.Context, req *pb.DisableNodeIPAddressRequest) (*pb.DisableNodeIPAddressResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeIPAddressDAO.DisableAddress(req.AddressId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.DisableNodeIPAddressResponse{}, nil
|
||||
}
|
||||
|
||||
// 禁用某个节点的IP地址
|
||||
func (this *NodeIPAddressService) DisableAllIPAddressesWithNodeId(ctx context.Context, req *pb.DisableAllIPAddressesWithNodeIdRequest) (*pb.DisableAllIPAddressesWithNodeIdResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedNodeIPAddressDAO.DisableAllAddressesWithNodeId(req.NodeId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.DisableAllIPAddressesWithNodeIdResponse{}, nil
|
||||
}
|
||||
|
||||
// 查找单个IP地址
|
||||
func (this *NodeIPAddressService) FindEnabledNodeIPAddress(ctx context.Context, req *pb.FindEnabledNodeIPAddressRequest) (*pb.FindEnabledNodeIPAddressResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
address, err := models.SharedNodeIPAddressDAO.FindEnabledAddress(req.AddressId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var result *pb.NodeIPAddress = nil
|
||||
if address != nil {
|
||||
result = &pb.NodeIPAddress{
|
||||
Id: int64(address.Id),
|
||||
NodeId: int64(address.NodeId),
|
||||
Name: address.Name,
|
||||
Ip: address.IP,
|
||||
Description: address.Description,
|
||||
State: int64(address.State),
|
||||
Order: int64(address.Order),
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.FindEnabledNodeIPAddressResponse{IpAddress: result}, nil
|
||||
}
|
||||
|
||||
// 查找节点的所有地址
|
||||
func (this *NodeIPAddressService) FindAllEnabledIPAddressesWithNodeId(ctx context.Context, req *pb.FindAllEnabledIPAddressesWithNodeIdRequest) (*pb.FindAllEnabledIPAddressesWithNodeIdResponse, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
addresses, err := models.SharedNodeIPAddressDAO.FindAllEnabledAddressesWithNode(req.NodeId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := []*pb.NodeIPAddress{}
|
||||
for _, address := range addresses {
|
||||
result = append(result, &pb.NodeIPAddress{
|
||||
Id: int64(address.Id),
|
||||
NodeId: int64(address.NodeId),
|
||||
Name: address.Name,
|
||||
Ip: address.IP,
|
||||
Description: address.Description,
|
||||
State: int64(address.State),
|
||||
Order: int64(address.Order),
|
||||
})
|
||||
}
|
||||
|
||||
return &pb.FindAllEnabledIPAddressesWithNodeIdResponse{Addresses: result}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user