Documentation ¶
Index ¶
- func AddApp(m *App) (id int64, err error)
- func AddDefApp(userId int)
- func AddHost(hosts []*Host) (err error)
- func AddModule(m *Module) (id int64, err error)
- func AddSet(m *Set) (id int64, err error)
- func DelHostModule(appID int, moduleName string, hostIds []int) (num int64, err error)
- func DeleteApp(id int) (err error)
- func DeleteHost(id int) (err error)
- func DeleteHosts(id []int) (num int64, err error)
- func DeleteModule(id int) (err error)
- func DeleteModuleByAppId(id int) (num int64, err error)
- func DeleteSet(id int) (err error)
- func DeleteSetByAppId(id int) (num int64, err error)
- func ExistByName(name string) bool
- func GetAllApp(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllHost(query map[string]interface{}, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllModule(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllSet(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAppTopoById(id int) (ml []interface{}, err error)
- func GetCCModuleTree(id int) (ml []interface{}, err error)
- func GetDefAppByUserId(userId int) (info map[string]interface{}, err error)
- func GetEmptyById(id int) (info map[string]interface{}, options map[int]string, err error)
- func GetHostByInnerIp(inner_ip string) bool
- func GetHostCount(id int, field string) (cnt int64, err error)
- func ModHostModule(appID int, moduleID int, hostIds []int) (num int64, err error)
- func ResHostModule(ids []int, appID int) (num int64, err error)
- func UpdateAppById(m *App) (err error)
- func UpdateHostById(m *Host) (err error)
- func UpdateHostToApp(ids []int, appID int) (num int64, err error)
- func UpdateModuleById(m *Module) (err error)
- func UpdateSetById(m *Set) (err error)
- func UpdateUser(user *User, fields ...string) error
- type App
- type Host
- type Module
- type Set
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddModule ¶
AddModule insert a new Module into database and returns last inserted Id on success.
func DelHostModule ¶
移至空闲机/故障机
func DeleteApp ¶
DeleteApp deletes App by Id and returns error if the record to be deleted doesn't exist
func DeleteHost ¶
DeleteHost deletes Host by Id and returns error if the record to be deleted doesn't exist
func DeleteHosts ¶
func DeleteModule ¶
DeleteModule deletes Module by Id and returns error if the record to be deleted doesn't exist
func DeleteSet ¶
DeleteSet deletes Set by Id and returns error if the record to be deleted doesn't exist
func ExistByName ¶
func GetAllApp ¶
func GetAllApp(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllApp retrieves all App matches certain condition. Returns empty list if no records exist
func GetAllHost ¶
func GetAllHost(query map[string]interface{}, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllHost retrieves all Host matches certain condition. Returns empty list if no records exist
func GetAllModule ¶
func GetAllModule(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllModule retrieves all Module matches certain condition. Returns empty list if no records exist
func GetAllSet ¶
func GetAllSet(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllSet retrieves all Set matches certain condition. Returns empty list if no records exist
func GetAppTopoById ¶
func GetDefAppByUserId ¶
func GetEmptyById ¶
func GetHostByInnerIp ¶
GetHostById retrieves Host by Id. Returns error if Id doesn't exist
func ModHostModule ¶
转移主机
func UpdateAppById ¶
UpdateApp updates App by Id and returns error if the record to be updated doesn't exist
func UpdateHostById ¶
UpdateHost updates Host by Id and returns error if the record to be updated doesn't exist
func UpdateModuleById ¶
UpdateModule updates Module by Id and returns error if the record to be updated doesn't exist
func UpdateSetById ¶
UpdateSet updates Set by Id and returns error if the record to be updated doesn't exist
func UpdateUser ¶
Types ¶
type App ¶
type App struct { Id int `orm:"column(id);auto"` Type int8 `orm:"column(type)"` ApplicationName string `orm:"column(application_name);size(255)"` LifeCycle string `orm:"column(life_cycle);size(255)"` Level int8 `orm:"column(level)"` OwnerId int `orm:"column(owner_id)"` Default bool `orm:"column(default);null"` }
func GetAppById ¶
GetAppById retrieves App by Id. Returns error if Id doesn't exist
type Host ¶
type Host struct { HostID int `orm:"column(id);auto"` CreateTime time.Time `orm:"column(create_time);type(timestamp)"` Model string `orm:"column(model);size(255);null"` Cpu int `orm:"column(cpu)"` Memory int `orm:"column(memory)"` HostName string `orm:"column(host_name);size(255);null"` InnerIP string `orm:"column(inner_ip);size(32)"` InnerGate string `orm:"column(inner_gate);size(32)"` InnerInterface string `orm:"column(inner_interface);size(32)"` BgpIP string `orm:"column(bgp_ip);size(255);null"` BgpGate string `orm:"column(bgp_gate);size(32)"` BgpInterface string `orm:"column(bgp_interface);size(32)"` OuterIP string `orm:"column(outer_ip);size(32);null"` OuterGate string `orm:"column(outer_gate);size(32)"` OuterInterface string `orm:"column(outer_interface);size(32)"` IloIP string `orm:"column(ilo_ip);size(255);null"` Source int8 `orm:"column(source)"` ModuleID int `orm:"column(module_id);null"` ModuleName string `orm:"column(module_name);size(255);null"` SetID int `orm:"column(set_id);null"` SetName string `orm:"column(set_name);size(255);null"` ApplicationID int `orm:"column(application_id);null"` ApplicationName string `orm:"column(application_name);size(255);null"` Owner string `orm:"column(owner);size(255);null"` Checked string `orm:"column(checked);size(255);null"` IsDistributed bool `orm:"column(is_distributed)"` }
func GetHostById ¶
GetHostById retrieves Host by Id. Returns error if Id doesn't exist
type Module ¶
type Module struct { Id int `orm:"column(id);auto"` ModuleName string `orm:"column(module_name);size(255)"` Operator int `orm:"column(operator)"` BakOperator int `orm:"column(bak_operator)"` ApplicationId int `orm:"column(application_id)"` Owner int `orm:"column(owner);null"` SetId int `orm:"column(set_id);null"` }
func GetModuleById ¶
GetModuleById retrieves Module by Id. Returns error if Id doesn't exist
type Set ¶
type Set struct { SetID int `orm:"column(id);auto"` ApplicationID int `orm:"column(application_id)"` Capacity int `orm:"column(capacity)"` ChnName string `orm:"column(chn_name);size(255);null"` CreateTime time.Time `orm:"column(create_time);type(timestamp);null"` Default bool `orm:"column(default);null"` Description string `orm:"column(description);size(255);null"` EnviType int `orm:"column(envi_type)"` LastTime time.Time `orm:"column(last_time);type(timestamp);null"` OpenStatus string `orm:"column(open_status);size(255)"` ParentID int `orm:"column(parent_id);null"` ServiceStatus int `orm:"column(service_status)"` SetName string `orm:"column(set_name);size(255)"` Owner int `orm:"column(owner)"` }
func GetSetById ¶
GetSetById retrieves Set by Id. Returns error if Id doesn't exist