cluster

package
v0.0.0-...-46d4b59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRpcCall

func InitRpcCall(ctCmd *ClusterTopoCmd) error

func NewClusterTopoCmd

func NewClusterTopoCmd() *cobra.Command

func ReadClusterMap

func ReadClusterMap(ctCmd *ClusterTopoCmd) error

read cluster map

Types

type ClusterTopoCmd

type ClusterTopoCmd struct {
	basecmd.FinalCurveCmd
	// contains filtered or unexported fields
}

func (*ClusterTopoCmd) AddFlags

func (ctCmd *ClusterTopoCmd) AddFlags()

func (*ClusterTopoCmd) CheckPhysicalPool

func (ctCmd *ClusterTopoCmd) CheckPhysicalPool(poolName string) *cmderror.CmdError

Check if the physicalPool that a server belongs to exists in the cluster. if not exist return error

func (*ClusterTopoCmd) CreatePhysicalPools

func (ctCmd *ClusterTopoCmd) CreatePhysicalPools() *cmderror.CmdError

func (*ClusterTopoCmd) CreateZones

func (ctCmd *ClusterTopoCmd) CreateZones() *cmderror.CmdError

func (*ClusterTopoCmd) Init

func (ctCmd *ClusterTopoCmd) Init(cmd *cobra.Command, args []string) error

func (*ClusterTopoCmd) Print

func (ctCmd *ClusterTopoCmd) Print(cmd *cobra.Command, args []string) error

func (*ClusterTopoCmd) RegistServers

func (ctCmd *ClusterTopoCmd) RegistServers() *cmderror.CmdError

func (*ClusterTopoCmd) ResultPlainOutput

func (ctCmd *ClusterTopoCmd) ResultPlainOutput() error

func (*ClusterTopoCmd) RunCommand

func (ctCmd *ClusterTopoCmd) RunCommand(cmd *cobra.Command, args []string) error

type CreatePhyPoolRpc

type CreatePhyPoolRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.PhysicalPoolRequest
	TopologyClient topology.TopologyServiceClient
}

func (*CreatePhyPoolRpc) NewRpcClient

func (cpRpc *CreatePhyPoolRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*CreatePhyPoolRpc) Stub_Func

func (cpRpc *CreatePhyPoolRpc) Stub_Func(ctx context.Context) (interface{}, error)

type CreateZoneRpc

type CreateZoneRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ZoneRequest
	TopologyClient topology.TopologyServiceClient
}

func (*CreateZoneRpc) NewRpcClient

func (czRpc *CreateZoneRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*CreateZoneRpc) Stub_Func

func (czRpc *CreateZoneRpc) Stub_Func(ctx context.Context) (interface{}, error)

type DelPhyPoolRpc

type DelPhyPoolRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.PhysicalPoolRequest
	TopologyClient topology.TopologyServiceClient
}

func (*DelPhyPoolRpc) NewRpcClient

func (dpoolRpc *DelPhyPoolRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*DelPhyPoolRpc) Stub_Func

func (dpoolRpc *DelPhyPoolRpc) Stub_Func(ctx context.Context) (interface{}, error)

type DelServerRpc

type DelServerRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.DeleteServerRequest
	TopologyClient topology.TopologyServiceClient
}

func (*DelServerRpc) NewRpcClient

func (dsRpc *DelServerRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*DelServerRpc) Stub_Func

func (dsRpc *DelServerRpc) Stub_Func(ctx context.Context) (interface{}, error)

type DelZoneRpc

type DelZoneRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ZoneRequest
	TopologyClient topology.TopologyServiceClient
}

func (*DelZoneRpc) NewRpcClient

func (dzRpc *DelZoneRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*DelZoneRpc) Stub_Func

func (dzRpc *DelZoneRpc) Stub_Func(ctx context.Context) (interface{}, error)

type ListPhyPoolsRpc

type ListPhyPoolsRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ListPhysicalPoolRequest
	TopologyClient topology.TopologyServiceClient
}

func (*ListPhyPoolsRpc) NewRpcClient

func (lPRpc *ListPhyPoolsRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListPhyPoolsRpc) Stub_Func

func (lPRpc *ListPhyPoolsRpc) Stub_Func(ctx context.Context) (interface{}, error)

type ListServersRpc

type ListServersRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ListZoneServerRequest
	TopologyClient topology.TopologyServiceClient
}

func (*ListServersRpc) NewRpcClient

func (lSRpc *ListServersRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListServersRpc) Stub_Func

func (lSRpc *ListServersRpc) Stub_Func(ctx context.Context) (interface{}, error)

type ListZonesRpc

type ListZonesRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ListPoolZoneRequest
	TopologyClient topology.TopologyServiceClient
}

func (*ListZonesRpc) NewRpcClient

func (lZRpc *ListZonesRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListZonesRpc) Stub_Func

func (lZRpc *ListZonesRpc) Stub_Func(ctx context.Context) (interface{}, error)

type LogicalPool

type LogicalPool struct {
	CopysetNum   uint32                   `json:"copysetnum"`
	Name         string                   `json:"name"`
	PhysicalPool string                   `json:"physicalpool"`
	ReplicasNum  uint32                   `json:"replicasnum"`
	ScatterWidth uint32                   `json:"scatterwidth"`
	Type         topology.LogicalPoolType `json:"type"`
	ZoneNum      uint32                   `json:"zonenum"`
}

type PhysicalPool

type PhysicalPool struct {
	Name string `json:"name"`
	Desc string `json:"desc"`
}

type RegServerRpc

type RegServerRpc struct {
	Info           *basecmd.Rpc
	Request        *topology.ServerRegistRequest
	TopologyClient topology.TopologyServiceClient
}

func (*RegServerRpc) NewRpcClient

func (rsRpc *RegServerRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*RegServerRpc) Stub_Func

func (rsRpc *RegServerRpc) Stub_Func(ctx context.Context) (interface{}, error)

type Server

type Server struct {
	Name         string `json:"name"`
	InternalIp   string `json:"internalip"`
	InternalPort uint32 `json:"internalport"`
	ExternalIp   string `json:"externalip"`
	ExternalPort uint32 `json:"externalport"`
	Zone         string `json:"zone"`
	PhysicalPool string `json:"physicalpool"`
}

type Topology

type Topology struct {
	Servers       []Server       `json:"servers"`
	Zones         []Zone         `json:"-"`
	PhysicalPools []PhysicalPool `json:"-"`
	LogicalPools  []LogicalPool  `json:"logicalpools"`
}

type Zone

type Zone struct {
	Name         string
	PhysicalPool string
	Desc         string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL