Documentation ¶
Index ¶
- Constants
- Variables
- func CancelSnapshot(r *pigeon.Request, snapshots []Snapshot) errno.Errno
- func ChangePassWord(r *pigeon.Request, oldPassword, newPassword string) errno.Errno
- func CleanRecycleBin(r *pigeon.Request, expiration uint64) errno.Errno
- func CloneVolume(r *pigeon.Request, src, dest, user string, lazy bool) errno.Errno
- func CreateNameSpace(r *pigeon.Request, name, user, passwrord string) errno.Errno
- func CreateSnapshot(r *pigeon.Request, volumeName, user, snapshotName string) errno.Errno
- func CreateUser(r *pigeon.Request, name, passwd, email string, permission int) errno.Errno
- func CreateVolume(r *pigeon.Request, name, user string, passwrord string, ...) errno.Errno
- func DeleteSnapshot(r *pigeon.Request, fileName, user string, uuids []string, failed bool) errno.Errno
- func DeleteUser(r *pigeon.Request, name string) errno.Errno
- func DeleteVolume(r *pigeon.Request, volumes map[string]string, force bool) errno.Errno
- func ExtendVolume(r *pigeon.Request, name string, length uint64) errno.Errno
- func Flatten(r *pigeon.Request, volumeName, user string) errno.Errno
- func GetAlertCandidate(r *pigeon.Request) (interface{}, errno.Errno)
- func GetAlertConf(r *pigeon.Request) (interface{}, errno.Errno)
- func GetChunkServerStatus(l *pigeon.Logger, rId string) (interface{}, errno.Errno)
- func GetClusterPerformance(r *pigeon.Request, start, end, interval uint64) (interface{}, errno.Errno)
- func GetClusterSpace(l *pigeon.Logger, rId string) (interface{}, errno.Errno)
- func GetClusterSpaceTrend(r *pigeon.Request, start, end, interval uint64) (interface{}, errno.Errno)
- func GetClusterStatus(l *pigeon.Logger, rId string) interface{}
- func GetCurrentClusterServicesAddr() (clusterServicesAddr, error)
- func GetEtcdStatus(r *pigeon.Request) (interface{}, errno.Errno)
- func GetHost(r *pigeon.Request, hostname string, start, end, interval uint64) (interface{}, errno.Errno)
- func GetLogicalPool(r *pigeon.Request, poolId uint32, start, end, interval uint64) (interface{}, errno.Errno)
- func GetMdsStatus(r *pigeon.Request) (interface{}, errno.Errno)
- func GetSnapShotCloneServerStatus(r *pigeon.Request) (interface{}, errno.Errno)
- func GetSnapshot(r *pigeon.Request, size, page uint32, uuid, user, fileName, status string) (interface{}, errno.Errno)
- func GetSysAlert(r *pigeon.Request, start, end int64, page, size uint32, ...) (interface{}, errno.Errno)
- func GetSysLog(r *pigeon.Request, start, end int64, page, size uint32, filter string) (interface{}, errno.Errno)
- func GetUnreadSysAlertNum(r *pigeon.Request) (int64, errno.Errno)
- func GetUser(r *pigeon.Request) (interface{}, errno.Errno)
- func GetVolume(r *pigeon.Request, volumeName string, start, end, interval uint64) (interface{}, errno.Errno)
- func Init(cfg *pigeon.Configure, logger *pigeon.Logger) error
- func InitClients(logger *pigeon.Logger) error
- func ListDisk(r *pigeon.Request, size, page uint32, hostname string) (interface{}, errno.Errno)
- func ListHost(r *pigeon.Request, size, page uint32) (interface{}, errno.Errno)
- func ListLogicalPool(r *pigeon.Request) (interface{}, errno.Errno)
- func ListTopology(r *pigeon.Request) (interface{}, errno.Errno)
- func ListUser(r *pigeon.Request, size, page uint32, userName string) (interface{}, errno.Errno)
- func ListVolume(r *pigeon.Request, size, page uint32, path, key string, direction int) (interface{}, errno.Errno)
- func Login(r *pigeon.Request, name, passwd string) (interface{}, errno.Errno)
- func Logout(r *pigeon.Request) errno.Errno
- func ProxyPass(r *pigeon.Request, body interface{}, method string) bool
- func RecoverVolume(r *pigeon.Request, ids map[string]uint64) errno.Errno
- func ResetPassWord(r *pigeon.Request, name string) errno.Errno
- func UpdateAlertConf(r *pigeon.Request, enable bool, interval, times uint32, rule, name string, ...) errno.Errno
- func UpdateAlertUser(r *pigeon.Request, alert string, users []string) errno.Errno
- func UpdateReadSysAlertId(r *pigeon.Request, id int64) errno.Errno
- func UpdateUserEmail(r *pigeon.Request, email string) errno.Errno
- func UpdateUserPermission(r *pigeon.Request, name string, permission int) errno.Errno
- func VolumeThrottle(r *pigeon.Request, name, throttleType string, limit, burst, burstLength uint64) errno.Errno
- func WriteSystemLog(ip, user, module, method, error_msg, content string, error_code int)
- type Alert
- type AlertConf
- type AuthInfo
- type ChunkServerStatus
- type ClusterStatus
- type Copyset
- type CopysetNum
- type DiskInfo
- type HostInfo
- type HostInfoWithPerformance
- type ListDiskInfo
- type ListHostInfo
- type ListUserInfo
- type ListVolumeInfo
- type NetWorkTraffic
- type Pool
- type PoolInfo
- type PoolInfoWithPerformance
- type Server
- type Snapshot
- type Space
- type UserInfo
- type VersionNum
- type VolumeInfo
- type VolumePoolInfo
- type Zone
Constants ¶
View Source
const ( SYSTEM_LOG_EXPIRATION_DAYS = "system.log.expiration.days" DEFAULT_SYSTEM_LOG_EXPIRATION_DAYS = 30 SYSTEM_ALERT_EXPIRATION_DAYS = "system.alert.expiration.days" DEFAULT_SYSTEM_ALERT_EXPIRATION_DAYS = 30 )
View Source
const ( ALERT_REQUEST_ID = "alert" CLEAR_ALERT_INTERVAL = 1 * time.Hour ALERT_CLUSTER = "cluster" ALERT_SPACE = "space" ALERT_ETCD = "etcd" ALERT_MDS = "mds" ALERT_CHUNKSERVER = "chunkserver" ALERT_SNAPSHOT_CLONE_SERVER = "snapshotcloneserver" UPDATE_ALERT_CONF_INTERVAL_SEC = 1 * 30 CLUSTER_ALERT_INTERVAL_SEC = 1 * 60 CLUSTER_ALERT_TRIGGER_TIMES = 3 CLUSTER_ALERT_RULE = "cluster is not healthy" CLUSTER_ALERT_DESC = "check cluster healthy" CAPACITY_ALERT_INTERVAL_SEC = 1 * 60 * 60 CAPACITY_ALERT_TRIGGER_TIMES = 1 CAPACITY_ALERT_LIMIT_PERCENT = 80 CAPACITY_ALERT_DESC = "check cluster space used" SERVICE_ALERT_INTERVAL_SEC = 1 * 60 SERVICE_ALERT_TRIGGER_TIMES = 1 SERVICE_ALERT_RULE = "leaderNum != 1 or offlineNum > 0" SERVICE_ALERT_DESC = "check service status" )
View Source
const ( // copyset status check result COPYSET_CHECK_HEALTHY = "healthy" COPYSET_CHECK_PARSE_ERROR = "parse_error" COPYSET_CHECK_NO_LEADER = "no leader" COPYSET_CHECK_PEERS_NO_SUFFICIENT = "peers_no_sufficient" COPYSET_CHECK_LOG_INDEX_TOO_BIG = "log_index_gap_too_big" COPYSET_CHECK_INSTALLING_SNAPSHOT = "installing_snapshot" COPYSET_CHECK_MINORITY_PEER_OFFLINE = "minority_peer_offline" COPYSET_CHECK_MAJORITY_PEER_OFFLINE = "majority_peer_offline" COPYSET_CHECK_INCONSISTENT = "Three copies inconsistent" COPYSET_CHECK_OTHER_ERROR = "other_error" COPYSET_TOTAL = "total" )
View Source
const ( CURVEADM_SERVICE_ADDRESS = "curveadm.service.address" CLUSTER_SERVICES_ADDRESS = "cluster.service.addr" METHOD_DEPLOY_CLUSTER = "cluster.deploy" METHOD_CHECKOUT_CLUSTER = "cluster.checkout" )
View Source
const ( // node disk info DEVICE = "device" MODEL = "model" // request GET_DISK_FILESYSTEM_INFO = "GetDiskFileSystemInfo" GET_DISK_TYPE = "GetDiskType" GET_DISK_WRITE_CACHE_ENABLE_FLAG = "GetDiskWriteCacheEnableFlag" )
View Source
const ( // request GET_HOST_INFO = "GetHostInfo" GET_HOST_CPU_INFO = "GetHostCPUInfo" GET_HOST_MEM_INFO = "GetHostMemoryInfo" LIST_DISK_INFO = "ListDiskInfo" GET_HOST_CPU_UTILIZATION = "GetHostCPUUtilization" GET_HOST_MEM_UTILIZATION = "GetHostMemUtilization" GET_HOST_DISK_PERFORMANCE = "GetDiskPerformance" GET_HOST_NETWORK_TRAFFIC = "GetNetWorkTraffic" )
View Source
const ( WRITE_SYSTEM_LOG_INTERVAL = 1 * time.Second CLEAR_SYSTEM_LOG_INTERVAL = 1 * time.Hour )
View Source
const ( SERVICE_ETCD = "etcd" SERVICE_MDS = "mds" SERVICE_CHUNKSERVER = "chunkserver" SERVICE_SNAPSHOT_CLONE_SERVER = "snapshotcloneserver" )
View Source
const ( ROOT_DIR = "/" RECYCLEBIN_NAME = "RecycleBin" CLONE_NAME = "clone" ORDER_BY_ID = "id" ORDER_BY_CTIME = "ctime" ORDER_BY_LENGTH = "length" ORDER_DIRECTION_INCREASE = 1 ORDER_DIRECTION_DECREASE = -1 FILE_NOT_EXIST = "kFileNotExists" PARAM_ERROR = "kParaError" )
View Source
const (
ENABLE_MULTIPLE_WRITER_USER_LOGIN = "enable.multiple.write.user.login"
)
Variables ¶
View Source
var ( READ_PERM = 4 WRITE_PERM = 2 MANAGER_PERM = 1 )
View Source
var RECYCLEBIN_DIR = path.Join(ROOT_DIR, RECYCLEBIN_NAME)
Functions ¶
func ChangePassWord ¶
func CloneVolume ¶
func CreateNameSpace ¶
func CreateSnapshot ¶
func CreateUser ¶
func CreateVolume ¶
func DeleteSnapshot ¶
func DeleteVolume ¶
func GetChunkServerStatus ¶
func GetClusterPerformance ¶
func GetClusterSpace ¶
func GetClusterSpaceTrend ¶
func GetClusterStatus ¶
func GetCurrentClusterServicesAddr ¶
func GetCurrentClusterServicesAddr() (clusterServicesAddr, error)
func GetLogicalPool ¶
func GetSnapshot ¶
func GetSysAlert ¶
func InitClients ¶
func ListVolume ¶
func UpdateAlertConf ¶
func UpdateAlertUser ¶
func UpdateUserPermission ¶
func VolumeThrottle ¶
func WriteSystemLog ¶
Types ¶
type ChunkServerStatus ¶
type ChunkServerStatus struct { TotalNum int `json:"totalNum"` OnlineNum int `json:"onlineNum"` Versions []VersionNum `json:"versions"` NotOnlines []string `json:"-"` }
type ClusterStatus ¶
type ClusterStatus struct { Healthy bool `json:"healthy" binding:"required"` PoolNum uint32 `json:"poolNum" binding:"required"` CopysetNum CopysetNum `json:"copysetNum" binding:"required"` }
type Copyset ¶
type Copyset struct {
// contains filtered or unexported fields
}
func NewCopyset ¶
func NewCopyset() *Copyset
type CopysetNum ¶
type DiskInfo ¶
type DiskInfo struct { HostName string `json:"hostName" binding:"required"` Device string `json:"device" binding:"required"` DiskType string `json:"diskType" binding:"required"` Model string `json:"model" binding:"required"` WriteCache string `json:"writeCache"` MountPoint string `json:"mountPoint"` SpaceTotal uint32 `json:"spaceTotal"` SpaceUsed uint32 `json:"spaceUsed"` }
type HostInfo ¶
type HostInfo struct { HostName string `json:"hostName" binding:"required"` IP string `json:"ip" binding:"required"` Machine string `json:"machine" binding:"required"` Release string `json:"kernelRelease" binding:"required"` Version string `json:"kernelVersion" binding:"required"` System string `json:"operatingSystem" binding:"required"` CPUCores metricomm.CPUInfo `json:"cpuCores" binding:"required"` DiskNum uint32 `json:"diskNum" binding:"required"` MemoryTotal uint64 `json:"memory" binding:"required"` // contains filtered or unexported fields }
type HostInfoWithPerformance ¶
type HostInfoWithPerformance struct { Host HostInfo `json:"host" binding:"required"` CPUUtilization []metricomm.RangeMetricItem `json:"cpuUtilization" binding:"required"` MemUtilization []metricomm.RangeMetricItem `json:"memUtilization" binding:"required"` DiskPerformance map[string][]metricomm.Performance `json:"diskPerformance" binding:"required"` NetWorkTraffic NetWorkTraffic `json:"networkTraffic" binding:"required"` }
type ListDiskInfo ¶
type ListHostInfo ¶
type ListUserInfo ¶
type ListVolumeInfo ¶
type NetWorkTraffic ¶
type NetWorkTraffic struct { NetWorkReceive map[string][]metricomm.RangeMetricItem `json:"receive" binding:"required"` NetWorkTransmit map[string][]metricomm.RangeMetricItem `json:"transmit" binding:"required"` }
type PoolInfo ¶
type PoolInfo struct { Id uint32 `json:"id" binding:"required"` Name string `json:"name" binding:"required"` PhysicalPoolId uint32 `json:"physicalPoolId" binding:"required"` Type string `json:"type" binding:"required"` CreateTime string `json:"createTime" binding:"required"` AllocateStatus string `json:"allocateStatus" binding:"required"` ScanEnable bool `json:"scanEnable"` ServerNum uint32 `json:"serverNum" binding:"required"` ChunkServerNum uint32 `json:"chunkServerNum" binding:"required"` CopysetNum uint32 `json:"copysetNum" binding:"required"` Space Space `json:"space" binding:"required"` }
type PoolInfoWithPerformance ¶
type PoolInfoWithPerformance struct { Info PoolInfo `json:"info" binding:"required"` Performance []metricomm.Performance `json:"performance" binding:"required"` }
type Server ¶
type Server struct { Id uint32 `json:"id" binding:"required"` Hostname string `json:"hostname" binding:"required"` InternalIp string `json:"internalIp" binding:"required"` InternalPort uint32 `json:"internalPort" binding:"required"` ExternalIp string `json:"externalIp" binding:"required"` ExternalPort uint32 `json:"externalPort" binding:"required"` ChunkServers []curvebs.ChunkServer `json:"chunkservers" binding:"required"` }
type VersionNum ¶
type VolumeInfo ¶
type VolumeInfo struct { Info curvebs.FileInfo `json:"info" binding:"required"` Pools []VolumePoolInfo `json:"pools"` Performance []metricomm.UserPerformance `json:"performance" binding:"required"` }
type VolumePoolInfo ¶
Click to show internal directories.
Click to hide internal directories.