logics

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

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

HostSearch search host by mutiple condition

Variables

This section is empty.

Functions

func ExtractDataFromAssociationField

func ExtractDataFromAssociationField(instID int64, input map[string]interface{}, asstDes []metadata.Association) []*metadata.InstAsst

func NewAsstObjectInst

func NewAsstObjectInst(pheader http.Header, engine *backbone.Engine, ownerID string, fields map[string]*metadata.ObjAttDes) *asstObjectInst

func NewImportInstance

func NewImportInstance(ownerID string, pheader http.Header, engine *backbone.Engine) *importInstance

func ParseHostSnap

func ParseHostSnap(data string) (map[string]interface{}, error)

Types

type HostLog

type HostLog struct {
	Content *metadata.Content
	// contains filtered or unexported fields
}

func (*HostLog) AuditLog

func (h *HostLog) AuditLog(hostID int64) *auditoplog.AuditLogExt

func (*HostLog) GetContent

func (h *HostLog) GetContent(hostID int64) *metadata.Content

func (*HostLog) WithCurrent

func (h *HostLog) WithCurrent(hostID string) error

func (*HostLog) WithPrevious

func (h *HostLog) WithPrevious(hostID string, headers []metadata.Header) error

type HostModuleLog

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

func (*HostModuleLog) SaveAudit

func (h *HostModuleLog) SaveAudit(appID, user, desc string) error

func (*HostModuleLog) WithCurrent

func (h *HostModuleLog) WithCurrent() error

func (*HostModuleLog) WithPrevious

func (h *HostModuleLog) WithPrevious() error

type InstNameAsst

type InstNameAsst struct {
	ID         string                 `json:"id"`
	ObjID      string                 `json:"bk_obj_id"`
	ObjIcon    string                 `json:"bk_obj_icon"`
	ObjectID   int                    `json:"bk_inst_id"`
	ObjectName string                 `json:"bk_obj_name"`
	Name       string                 `json:"bk_inst_name"`
	InstInfo   map[string]interface{} `json:"inst_info,omitempty"`
}

type Logics

type Logics struct {
	*backbone.Engine
}

func (*Logics) AddHost

func (lgc *Logics) AddHost(appID int64, moduleID []int64, ownerID string, pheader http.Header, hostInfos map[int64]map[string]interface{}, importType metadata.HostInputType) ([]string, []string, []string, error)

func (*Logics) CloneHostProperty

func (lgc *Logics) CloneHostProperty(input *meta.CloneHostPropertyParams, appID, cloudID int64, header http.Header) (interface{}, error)

func (*Logics) EnterIP

func (lgc *Logics) EnterIP(pheader http.Header, ownerID string, appID, moduleID int64, ip string, cloudID int64, host map[string]interface{}, isIncrement bool) error

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

func (*Logics) GetAgentStatus

func (lgc *Logics) GetAgentStatus(appID int64, gseConfg *options.Gse, header http.Header) (*meta.GetAgentStatusResult, error)

func (*Logics) GetAppDetails

func (lgc *Logics) GetAppDetails(fields string, condition map[string]interface{}, pheader http.Header) (types.MapStr, error)

func (*Logics) GetAppIDByCond

func (lgc *Logics) GetAppIDByCond(pheader http.Header, cond []metadata.ConditionItem) ([]int64, error)

func (*Logics) GetAppMapByCond

func (lgc *Logics) GetAppMapByCond(pheader http.Header, fields string, cond interface{}) (map[int64]types.MapStr, error)

func (*Logics) GetConfigByCond

func (lgc *Logics) GetConfigByCond(pheader http.Header, cond map[string][]int64) ([]map[string]int64, error)

func (*Logics) GetDefaultAppID

func (lgc *Logics) GetDefaultAppID(ownerID string, pheader http.Header) (int64, error)

func (*Logics) GetDefaultAppIDWithSupplier

func (lgc *Logics) GetDefaultAppIDWithSupplier(pheader http.Header) (int64, error)

func (*Logics) GetHostAttributes

func (lgc *Logics) GetHostAttributes(ownerID string, header http.Header) ([]metadata.Header, error)

func (*Logics) GetHostIDByCond

func (lgc *Logics) GetHostIDByCond(pheader http.Header, cond map[string][]int64) ([]int64, error)

func (*Logics) GetHostIDByInstID

func (lgc *Logics) GetHostIDByInstID(pheader http.Header, asstObjId string, instIDArr []int64) ([]int64, error)

func (*Logics) GetHostInfoByConds

func (lgc *Logics) GetHostInfoByConds(pheader http.Header, cond map[string]interface{}) ([]map[string]interface{}, error)

func (*Logics) GetHostInstanceDetails

func (lgc *Logics) GetHostInstanceDetails(pheader http.Header, ownerID, hostID string) (map[string]interface{}, string, error)

func (*Logics) GetIPAndProxyByCompany

func (lgc *Logics) GetIPAndProxyByCompany(ipArr []string, cloudID, appID int64, header http.Header) (interface{}, error)

func (*Logics) GetInstAsstDetailsSub

func (lgc *Logics) GetInstAsstDetailsSub(pheader http.Header, objID, ownerID string, input []map[string]interface{}, page meta.BasePage) ([]map[string]interface{}, error)

get inst detail sub with association object detail

func (*Logics) GetInstDetailsSub

func (lgc *Logics) GetInstDetailsSub(pheader http.Header, objID, ownerID string, input []map[string]interface{}, page meta.BasePage) ([]map[string]interface{}, error)

get inst detail sub without association object detail

func (*Logics) GetModuleByModuleID

func (lgc *Logics) GetModuleByModuleID(pheader http.Header, appID, moduleID int64) ([]mapstr.MapStr, error)

func (*Logics) GetModuleIDByCond

func (lgc *Logics) GetModuleIDByCond(phader http.Header, cond []metadata.ConditionItem) ([]int64, error)

func (*Logics) GetModuleMapByCond

func (lgc *Logics) GetModuleMapByCond(pheader http.Header, fields string, cond interface{}) (map[int64]types.MapStr, error)

func (*Logics) GetObjectAsst

func (lgc *Logics) GetObjectAsst(ownerID string, pheader http.Header) (map[string]string, error)

func (*Logics) GetObjectAttributes

func (lgc *Logics) GetObjectAttributes(ownerID, objID string, pheader http.Header, page meta.BasePage) ([]meta.Attribute, error)

get the object attributes

func (*Logics) GetObjectInstByCond

func (lgc *Logics) GetObjectInstByCond(pheader http.Header, objID string, cond []meta.ConditionItem) ([]int64, error)

func (*Logics) GetResoulePoolModuleID

func (lgc *Logics) GetResoulePoolModuleID(pheader http.Header, condition interface{}) (int64, error)

func (*Logics) GetSetIDByCond

func (lgc *Logics) GetSetIDByCond(pheader http.Header, cond []metadata.ConditionItem) ([]int64, error)

func (*Logics) GetSetIDByObjectCond

func (lgc *Logics) GetSetIDByObjectCond(pheader http.Header, appID int64, objectCond []meta.ConditionItem) ([]int64, error)

func (*Logics) GetSetMapByCond

func (lgc *Logics) GetSetMapByCond(pheader http.Header, fields string, cond interface{}) (map[int64]mapstr.MapStr, error)

func (*Logics) GetSingleApp

func (lgc *Logics) GetSingleApp(pheader http.Header, cond interface{}) (mapstr.MapStr, error)

func (*Logics) GetTopoIDByName

func (lgc *Logics) GetTopoIDByName(pheader http.Header, c *meta.HostToAppModule) (int64, int64, int64, error)

func (*Logics) IsHostExistInApp

func (lgc *Logics) IsHostExistInApp(appID, hostID int64, pheader http.Header) (bool, error)

func (*Logics) IsPlatExist

func (lgc *Logics) IsPlatExist(pheader http.Header, cond interface{}) (bool, error)

func (*Logics) LockHost

func (lgc *Logics) LockHost(ctx context.Context, header http.Header, input *metadata.HostLockRequest) errors.CCError

func (*Logics) NewHostLog

func (lgc *Logics) NewHostLog(pheader http.Header, ownerID string) *HostLog

func (*Logics) NewHostModuleLog

func (lgc *Logics) NewHostModuleLog(header http.Header, instID []int64) *HostModuleLog

func (*Logics) NewPHPAPI

func (lgc *Logics) NewPHPAPI(header http.Header) *PHPAPI

NewPHPAPI return php api struct

func (*Logics) QueryHostLock

func (lgc *Logics) QueryHostLock(ctx context.Context, header http.Header, input *metadata.QueryHostLockRequest) (map[string]bool, errors.CCError)

func (*Logics) SearchHost

func (lgc *Logics) SearchHost(pheader http.Header, data *metadata.HostCommonSearch, isDetail bool) (*metadata.SearchHost, error)

func (*Logics) UnlockHost

func (lgc *Logics) UnlockHost(ctx context.Context, header http.Header, input *metadata.HostLockRequest) errors.CCError

func (*Logics) UpdateCustomProperty

func (lgc *Logics) UpdateCustomProperty(hostID, appID int64, proeprtyJson map[string]interface{}, header http.Header) (interface{}, error)

func (*Logics) UpdateHost

func (lgc *Logics) UpdateHost(input map[string]interface{}, appID int64, header http.Header) (interface{}, int, error)

func (*Logics) UpdateHostByAppID

func (lgc *Logics) UpdateHostByAppID(input *meta.UpdateHostParams, appID int64, header http.Header) (interface{}, int, error)

type PHPAPI

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

PHPAPI ee,ce version api

func (*PHPAPI) AddHost

func (phpapi *PHPAPI) AddHost(data map[string]interface{}) (int64, error)

func (*PHPAPI) AddModuleHostConfig

func (phpapi *PHPAPI) AddModuleHostConfig(hostID, appID int64, moduleIDs []int64) error

func (*PHPAPI) GetCustomerPropertyByOwner

func (phpapi *PHPAPI) GetCustomerPropertyByOwner(objType string) ([]meta.Attribute, error)

func (*PHPAPI) GetDefaultModules

func (phpapi *PHPAPI) GetDefaultModules(appID int) (types.MapStr, error)

func (*PHPAPI) GetHostByCond

func (phpapi *PHPAPI) GetHostByCond(param *meta.QueryInput) ([]types.MapStr, error)

func (*PHPAPI) GetHostByIPAndSource

func (phpapi *PHPAPI) GetHostByIPAndSource(innerIP string, platID int64) ([]types.MapStr, error)

func (*PHPAPI) GetHostDataByConfig

func (phpapi *PHPAPI) GetHostDataByConfig(configData []map[string]int64) ([]interface{}, error)

GetHostDataByConfig get host info

func (*PHPAPI) GetHostMapByCond

func (phpapi *PHPAPI) GetHostMapByCond(condition map[string]interface{}) (map[int64]map[string]interface{}, []int64, error)

search host helpers

func (*PHPAPI) In_existIpArr

func (phpapi *PHPAPI) In_existIpArr(arr []string, ip string) bool

In_existIpArr exsit ip in array

func (*PHPAPI) SetHostData

func (phpapi *PHPAPI) SetHostData(moduleHostConfig []map[string]int64, hostMap map[int64]map[string]interface{}) ([]interface{}, error)

func (*PHPAPI) UpdateHostMain

func (phpapi *PHPAPI) UpdateHostMain(hostCondition, data map[string]interface{}, appID int64) (string, error)

helpers

Jump to

Keyboard shortcuts

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