logics

package
v3.0.8-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const SplitFlag = "##"
View Source
const TopoModuleName = "TopModuleName"
View Source
const TopoSetName = "TopSetName"

Variables

This section is empty.

Functions

func AddHost

func AddHost(req *restful.Request, ownerID string, appID int, hostInfos map[int]map[string]interface{}, inputType string, moduleID []int, cc *api.APIResource) (error, []string, []string, []string)

AddHost, return error info

func EnterIP

func EnterIP(req *restful.Request, ownerID string, appID, moduleID int, ip string, cloudID int64, host map[string]interface{}, isIncrement bool, cc *api.APIResource) error

EnterIP 将机器导入到制定模块或者空闲机器, 已经存在机器,不操作

func GetAppIDByCond

func GetAppIDByCond(req *restful.Request, objURL string, cond []interface{}) ([]int, error)

GetAppIDByCond get appid by cond

func GetAppInfo

func GetAppInfo(req *restful.Request, fields string, conditon map[string]interface{}, objAddr string, defLang language.DefaultCCLanguageIf) (map[string]interface{}, error)

GetAppInfo get app info

func GetAppMapByCond

func GetAppMapByCond(req *restful.Request, fields string, objURL string, cond interface{}) (map[int]interface{}, error)

GetAppMapByCond get appmap by cond

func GetConfigByCond

func GetConfigByCond(req *restful.Request, hostURL string, cond map[string]interface{}) ([]map[string]int, error)

GetConfigByCond get config by condition

func GetDefaultAppID

func GetDefaultAppID(req *restful.Request, ownerID, fields, objAddr string, defLang language.DefaultCCLanguageIf) (int, error)

GetDefaultAppID get default biz id

func GetDefaultAppIDBySupplierID

func GetDefaultAppIDBySupplierID(req *restful.Request, supplierID int, fields, objAddr string, defLang language.DefaultCCLanguageIf) (int, error)

GetDefaultAppID get supplier ID

func GetHostIDByCond

func GetHostIDByCond(req *restful.Request, hostURL string, cond interface{}) ([]int, error)

GetHostIDByCond get module host config

func GetHostIDByInstID

func GetHostIDByInstID(req *restful.Request, asstObjId string, objURL string, instIDArr []int) []int

getHostIDByInstID get host Id by inst Id

func GetHostInfoByConds

func GetHostInfoByConds(req *restful.Request, hostURL string, conds map[string]interface{}, defLang language.DefaultCCLanguageIf) ([]interface{}, error)

func GetHostLogFields

func GetHostLogFields(req *restful.Request, ownerID, objCtrl string) ([]metadata.Header, int)

GetHostLogFields get host fields

func GetHttpResult

func GetHttpResult(req *restful.Request, url, method string, params interface{}) (bool, string, interface{})

GetHttpResult get http result

func GetModuleByModuleID

func GetModuleByModuleID(req *restful.Request, appID int, moduleID int, hostAddr string) ([]interface{}, error)

GetModuleByModuleID get module by module id

func GetModuleIDByCond

func GetModuleIDByCond(req *restful.Request, objURL string, cond []interface{}) ([]int, error)

get moduleid by cond

func GetModuleMapByCond

func GetModuleMapByCond(req *restful.Request, fields string, objURL string, cond interface{}) (map[int]interface{}, error)

get modulemap by cond

func GetObjectFields

func GetObjectFields(forward *sourceAPI.ForwardParam, ownerID, objID, ObjAddr, sort string) ([]sourceAPI.ObjAttDes, error)

GetObjectFields get object fields

func GetObjectInstByCond

func GetObjectInstByCond(req *restful.Request, objID string, objURL string, cond []interface{}) []int

getObjectInstByCond get object inst id by condtion

func GetSetIDByCond

func GetSetIDByCond(req *restful.Request, objURL string, cond []interface{}) ([]int, error)

GetSetIDByCond get setid by cond

func GetSetIDByObjectCond

func GetSetIDByObjectCond(req *restful.Request, objURL string, appID int, objectCond []interface{}) []int

GetSetIDByObjectCond get set id by object condition

func GetSetMapByCond

func GetSetMapByCond(req *restful.Request, fields string, objURL string, cond interface{}) (map[int]interface{}, error)

GetSetMapByCond get setmap by cond

func GetSingleApp

func GetSingleApp(req *restful.Request, objURL string, cond interface{}) (map[string]interface{}, error)

GetSingleApp get single app

func GetSingleModuleID

func GetSingleModuleID(req *restful.Request, conds interface{}, hostAddr string) (int, error)

GetSingleModuleID get single module id

func GetSystemConfig

func GetSystemConfig(req *restful.Request, objURL string) bool

GetSystemConfig get system config by condition

func GetTopoIDByName

func GetTopoIDByName(req *restful.Request, ownerID, appName, setName, moduleName, objURL string, defErr errors.DefaultCCErrorIf) (int, int, int, error)

GetTopoIDByName get topo id by name

func HostSearch

func HostSearch(req *restful.Request, data hostParse.HostCommonSearch, isDetail bool, hostCtrl, objCtrl string) (interface{}, error)

HostSearch search host by mutiple condition

func IsExistHostIDInApp

func IsExistHostIDInApp(CC *api.APIResource, req *restful.Request, appID int, hostID int, defLang language.DefaultCCLanguageIf) (bool, error)

IsExistHostIDInApp is host exsit in app

func IsExistPlat

func IsExistPlat(req *restful.Request, objURL string, cond interface{}) (bool, error)

IsExistPlat plat is exist

func MoveHost2ResourcePool

func MoveHost2ResourcePool(CC *api.APIResource, req *restful.Request, appID int, hostID []int) (interface{}, error)

MoveHostToResourcePool move host to resource pool

func NewHostSyncValidModule

func NewHostSyncValidModule(req *restful.Request, appID int, moduleID []int, objAddr string) ([]int, error)

NewHostSyncValidModule 1. check module is exist, 2. multiple moduleID Check whether all the module default 0

func NewHostsInstance

func NewHostsInstance(req *restful.Request, ownerID, inputType string, cloudID int, cc *api.APIResource) (*hostsInstance, error)

func ParseHostSnap

func ParseHostSnap(data string) (common.KvMap, error)

ParseHostSnap parse host snap

Types

type HostLog

type HostLog struct {
	// contains filtered or unexported fields
}

func NewHostLog

func NewHostLog(req *restful.Request, ownerID, instID, hostCtl, objCtrl string, headers []metadata.Header) *HostLog

func (*HostLog) GetHostLog

func (h *HostLog) GetHostLog(instID string, isDel bool) (*metadata.Content, int)

func (*HostLog) GetInnerIP

func (h *HostLog) GetInnerIP() string

GetInnerIP return innerip for host detail

func (*HostLog) GetPreHostData

func (h *HostLog) GetPreHostData() *metadata.Content

type HostModuleConfigLog

type HostModuleConfigLog struct {
	// contains filtered or unexported fields
}

func NewHostModuleConfigLog

func NewHostModuleConfigLog(req *restful.Request, instID []int, hostCtl, objCtrl, auditCtrl string) (*HostModuleConfigLog, error)

func (*HostModuleConfigLog) SaveLog

func (h *HostModuleConfigLog) SaveLog(appID, user string) error

func (*HostModuleConfigLog) SetDesc

func (h *HostModuleConfigLog) SetDesc(desc string)

func (*HostModuleConfigLog) SetHostID

func (h *HostModuleConfigLog) SetHostID(hostID []int) error

set host id, host id must be nil

type ObjectData

type ObjectData struct {
	Count int                      `json:"count"`
	Info  []map[string]interface{} `json:"info"`
}

type ObjectSResult

type ObjectSResult struct {
	Result  bool        `json:"result"`
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
	Data    ObjectData  `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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