Documentation ¶
Index ¶
- Constants
- func NewImportInstance(kit *rest.Kit, ownerID string, lgc *Logics) *importInstance
- func NewSearchHost(kit *rest.Kit, lgc *Logics, hostSearchParam *metadata.HostCommonSearch) searchHostInterface
- type InstNameAsst
- type Logics
- func (lgc *Logics) AddHost(kit *rest.Kit, appID int64, moduleIDs []int64, ownerID string, ...) ([]int64, []string, []string, []string, error)
- func (lgc *Logics) AddHostToResourcePool(kit *rest.Kit, hostList metadata.AddHostToResourcePoolHostList) ([]int64, *metadata.AddHostToResourcePoolResult, error)
- func (lgc *Logics) AssignHostToApp(kit *rest.Kit, conf *metadata.DefaultModuleHostConfigParams) ([]metadata.ExceptionResult, error)
- func (lgc *Logics) CloneHostProperty(kit *rest.Kit, appID int64, srcHostID int64, dstHostID int64) errors.CCErrorCoder
- func (lgc *Logics) DeleteHostBusinessAttributes(kit *rest.Kit, hostIDArr []int64, bizID int64) error
- func (lgc *Logics) DeleteHostFromBusiness(kit *rest.Kit, bizID int64, hostIDArr []int64) ([]metadata.ExceptionResult, errors.CCError)
- func (lgc *Logics) EnterIP(kit *rest.Kit, appID, moduleID int64, ip string, cloudID int64, ...) errors.CCError
- func (lgc *Logics) ExistHostIDSInApp(kit *rest.Kit, appID int64, hostIDArray []int64) ([]int64, error)
- func (lgc *Logics) ExistInnerModule(kit *rest.Kit, moduleIDArr []int64) (bool, errors.CCErrorCoder)
- func (lgc *Logics) FindHostByModuleIDs(kit *rest.Kit, data *metadata.HostModuleFind, isDetail bool) (*metadata.SearchHost, error)
- func (lgc *Logics) GetAllHostIDByCond(kit *rest.Kit, cond metadata.HostModuleRelationRequest) ([]int64, errors.CCError)
- func (lgc *Logics) GetAppDetails(kit *rest.Kit, fields string, condition map[string]interface{}) (types.MapStr, errors.CCError)
- func (lgc *Logics) GetAppIDByCond(kit *rest.Kit, cond []metadata.ConditionItem) ([]int64, errors.CCError)
- func (lgc *Logics) GetAppMapByCond(kit *rest.Kit, fields []string, cond mapstr.MapStr) (map[int64]types.MapStr, errors.CCError)
- func (lgc *Logics) GetConfigByCond(kit *rest.Kit, input metadata.HostModuleRelationRequest) ([]metadata.ModuleHost, errors.CCError)
- func (lgc *Logics) GetDefaultAppID(kit *rest.Kit) (int64, errors.CCError)
- func (lgc *Logics) GetDefaultAppIDWithSupplier(kit *rest.Kit) (int64, errors.CCError)
- func (lgc *Logics) GetHostAttributes(kit *rest.Kit, bizMetaOpt mapstr.MapStr) ([]metadata.Attribute, error)
- func (lgc *Logics) GetHostIDByCond(kit *rest.Kit, cond metadata.HostModuleRelationRequest) ([]int64, errors.CCError)
- func (lgc *Logics) GetHostIDByInstID(kit *rest.Kit, asstObjId string, instIDArr []int64) ([]int64, errors.CCError)
- func (lgc *Logics) GetHostInfoByConds(kit *rest.Kit, cond map[string]interface{}) ([]mapstr.MapStr, errors.CCErrorCoder)
- func (lgc *Logics) GetHostInstanceDetails(kit *rest.Kit, hostID int64) (map[string]interface{}, string, errors.CCError)
- func (lgc *Logics) GetHostModuleRelation(kit *rest.Kit, cond metadata.HostModuleRelationRequest) (*metadata.HostConfigData, errors.CCErrorCoder)
- func (lgc *Logics) GetModuleIDAndIsInternal(kit *rest.Kit, bizID, moduleID int64) (int64, bool, error)
- func (lgc *Logics) GetModuleIDByCond(kit *rest.Kit, cond []metadata.ConditionItem) ([]int64, errors.CCError)
- func (lgc *Logics) GetModuleMapByCond(kit *rest.Kit, fields []string, cond mapstr.MapStr) (map[int64]types.MapStr, errors.CCError)
- func (lgc *Logics) GetNormalModuleByModuleID(kit *rest.Kit, appID, moduleID int64) ([]mapstr.MapStr, errors.CCError)
- func (lgc *Logics) GetObjectAttributes(kit *rest.Kit, objID string, page meta.BasePage) ([]meta.Attribute, errors.CCError)
- func (lgc *Logics) GetObjectInstByCond(kit *rest.Kit, objID string, cond []meta.ConditionItem) ([]int64, errors.CCError)
- func (lgc *Logics) GetResourcePoolModuleID(kit *rest.Kit, condition mapstr.MapStr) (int64, errors.CCError)
- func (lgc *Logics) GetSetIDByCond(kit *rest.Kit, cond []metadata.ConditionItem) ([]int64, errors.CCError)
- func (lgc *Logics) GetSetIDByObjectCond(kit *rest.Kit, appID int64, objectCond []meta.ConditionItem) ([]int64, errors.CCError)
- func (lgc *Logics) GetSetIDsByTopo(kit *rest.Kit, objID string, instID int64) ([]int64, error)
- func (lgc *Logics) GetSetMapByCond(kit *rest.Kit, fields []string, cond mapstr.MapStr) (map[int64]mapstr.MapStr, errors.CCError)
- func (lgc *Logics) GetSingleApp(kit *rest.Kit, cond mapstr.MapStr) (mapstr.MapStr, errors.CCError)
- func (lgc *Logics) GetTopoIDByName(kit *rest.Kit, c *meta.HostToAppModule) (int64, int64, int64, errors.CCError)
- func (lgc *Logics) IPCloudToHost(kit *rest.Kit, ip string, cloudID int64) (HostMap mapstr.MapStr, hostID int64, err errors.CCErrorCoder)
- func (lgc *Logics) IsHostExistInApp(kit *rest.Kit, appID, hostID int64) (bool, errors.CCErrorCoder)
- func (lgc *Logics) IsPlatExist(kit *rest.Kit, cond mapstr.MapStr) (bool, errors.CCError)
- func (lgc *Logics) LockHost(kit *rest.Kit, input *metadata.HostLockRequest) errors.CCError
- func (lgc *Logics) MoveHostToResourcePool(kit *rest.Kit, conf *metadata.DefaultModuleHostConfigParams) ([]metadata.ExceptionResult, error)
- func (lgc *Logics) NewSpecial(kit *rest.Kit) SpecialHandle
- func (lgc *Logics) QueryHostLock(kit *rest.Kit, input *metadata.QueryHostLockRequest) (map[int64]bool, errors.CCError)
- func (lgc *Logics) SearchHost(kit *rest.Kit, data *metadata.HostCommonSearch, isDetail bool) (*metadata.SearchHost, error)
- func (lgc *Logics) SearchHostInfo(kit *rest.Kit, cond metadata.QueryCondition) ([]mapstr.MapStr, errors.CCErrorCoder)
- func (lgc *Logics) TransferHostAcrossBusiness(kit *rest.Kit, srcBizID, dstAppID int64, hostID []int64, moduleID []int64) errors.CCError
- func (lgc *Logics) UnlockHost(kit *rest.Kit, input *metadata.HostLockRequest) errors.CCError
- type SpecialHandle
Constants ¶
const ( SplitFlag = "##" TopoSetName = "TopSetName" TopoModuleName = "TopModuleName" )
HostSearch search host by multiple condition
Variables ¶
This section is empty.
Functions ¶
func NewImportInstance ¶
func NewSearchHost ¶
func NewSearchHost(kit *rest.Kit, lgc *Logics, hostSearchParam *metadata.HostCommonSearch) searchHostInterface
Types ¶
type InstNameAsst ¶
type Logics ¶
type Logics struct { *backbone.Engine AuthManager *extensions.AuthManager // contains filtered or unexported fields }
func NewLogics ¶
func NewLogics(b *backbone.Engine, cache *redis.Client, authManager *extensions.AuthManager) *Logics
NewLogics get logics handle
func (*Logics) AddHostToResourcePool ¶
func (lgc *Logics) AddHostToResourcePool(kit *rest.Kit, hostList metadata.AddHostToResourcePoolHostList) ([]int64, *metadata.AddHostToResourcePoolResult, error)
func (*Logics) AssignHostToApp ¶
func (lgc *Logics) AssignHostToApp(kit *rest.Kit, conf *metadata.DefaultModuleHostConfigParams) ([]metadata.ExceptionResult, error)
AssignHostToApp transfer resource host to idle module
func (*Logics) CloneHostProperty ¶
func (lgc *Logics) CloneHostProperty(kit *rest.Kit, appID int64, srcHostID int64, dstHostID int64) errors.CCErrorCoder
CloneHostProperty clone host info and host and module relation in same application
func (*Logics) DeleteHostBusinessAttributes ¶
func (lgc *Logics) DeleteHostBusinessAttributes(kit *rest.Kit, hostIDArr []int64, bizID int64) error
DeleteHostBusinessAttributes delete host business private property
func (*Logics) DeleteHostFromBusiness ¶
func (lgc *Logics) DeleteHostFromBusiness(kit *rest.Kit, bizID int64, hostIDArr []int64) ([]metadata.ExceptionResult, errors.CCError)
DeleteHostFromBusiness delete host from business,
func (*Logics) EnterIP ¶
func (lgc *Logics) EnterIP(kit *rest.Kit, appID, moduleID int64, ip string, cloudID int64, host map[string]interface{}, isIncrement bool) errors.CCError
EnterIP 将机器导入到指定模块或者空闲模块, 已经存在机器,不操作
func (*Logics) ExistHostIDSInApp ¶
func (lgc *Logics) ExistHostIDSInApp(kit *rest.Kit, appID int64, hostIDArray []int64) ([]int64, error)
ExistHostIDSInApp exist host id in app return []int64 don't exist in app hostID, error handle logics error
func (*Logics) ExistInnerModule ¶
func (*Logics) FindHostByModuleIDs ¶
func (lgc *Logics) FindHostByModuleIDs(kit *rest.Kit, data *metadata.HostModuleFind, isDetail bool) (*metadata.SearchHost, error)
func (*Logics) GetAllHostIDByCond ¶
func (lgc *Logics) GetAllHostIDByCond(kit *rest.Kit, cond metadata.HostModuleRelationRequest) ([]int64, errors.CCError)
GetAllHostIDByCond 专用结构, page start 和limit 无效, 获取条件所有满足条件的主机
func (*Logics) GetAppDetails ¶
func (*Logics) GetAppIDByCond ¶
func (*Logics) GetAppMapByCond ¶
func (*Logics) GetConfigByCond ¶
func (lgc *Logics) GetConfigByCond(kit *rest.Kit, input metadata.HostModuleRelationRequest) ([]metadata.ModuleHost, errors.CCError)
GetConfigByCond get hosts owned set, module info, where hosts must match condition specify by cond.
func (*Logics) GetDefaultAppID ¶
func (*Logics) GetDefaultAppIDWithSupplier ¶
func (*Logics) GetHostAttributes ¶
func (*Logics) GetHostIDByCond ¶
func (lgc *Logics) GetHostIDByCond(kit *rest.Kit, cond metadata.HostModuleRelationRequest) ([]int64, errors.CCError)
GetHostIDByCond query hostIDs by condition base on cc_ModuleHostConfig available condition fields are bk_supplier_account, bk_biz_id, bk_host_id, bk_module_id, bk_set_id
func (*Logics) GetHostIDByInstID ¶
func (*Logics) GetHostInfoByConds ¶
func (*Logics) GetHostInstanceDetails ¶
func (*Logics) GetHostModuleRelation ¶
func (lgc *Logics) GetHostModuleRelation(kit *rest.Kit, cond metadata.HostModuleRelationRequest) (*metadata.HostConfigData, errors.CCErrorCoder)
GetHostModuleRelation query host and module relation, condition key use appID, moduleID,setID,HostID
func (*Logics) GetModuleIDAndIsInternal ¶
func (*Logics) GetModuleIDByCond ¶
func (*Logics) GetModuleMapByCond ¶
func (*Logics) GetNormalModuleByModuleID ¶
func (*Logics) GetObjectAttributes ¶
func (lgc *Logics) GetObjectAttributes(kit *rest.Kit, objID string, page meta.BasePage) ([]meta.Attribute, errors.CCError)
get the object attributes
func (*Logics) GetObjectInstByCond ¶
func (*Logics) GetResourcePoolModuleID ¶
func (*Logics) GetSetIDByCond ¶
func (*Logics) GetSetIDByObjectCond ¶
func (*Logics) GetSetIDsByTopo ¶
GetSetIDsByTopo get set IDs by custom layer node
func (*Logics) GetSetMapByCond ¶
func (*Logics) GetSingleApp ¶
func (*Logics) GetTopoIDByName ¶
func (*Logics) IPCloudToHost ¶
func (lgc *Logics) IPCloudToHost(kit *rest.Kit, ip string, cloudID int64) (HostMap mapstr.MapStr, hostID int64, err errors.CCErrorCoder)
IPCloudToHost get host id by ip and cloud
func (*Logics) IsHostExistInApp ¶
func (*Logics) IsPlatExist ¶
func (*Logics) MoveHostToResourcePool ¶
func (lgc *Logics) MoveHostToResourcePool(kit *rest.Kit, conf *metadata.DefaultModuleHostConfigParams) ([]metadata.ExceptionResult, error)
func (*Logics) NewSpecial ¶
func (lgc *Logics) NewSpecial(kit *rest.Kit) SpecialHandle
NewSpecial return handle special logic
func (*Logics) QueryHostLock ¶
func (*Logics) SearchHost ¶
func (lgc *Logics) SearchHost(kit *rest.Kit, data *metadata.HostCommonSearch, isDetail bool) (*metadata.SearchHost, error)
func (*Logics) SearchHostInfo ¶
func (lgc *Logics) SearchHostInfo(kit *rest.Kit, cond metadata.QueryCondition) ([]mapstr.MapStr, errors.CCErrorCoder)
SearchHostInfo search host info by QueryCondition
func (*Logics) TransferHostAcrossBusiness ¶
func (lgc *Logics) TransferHostAcrossBusiness(kit *rest.Kit, srcBizID, dstAppID int64, hostID []int64, moduleID []int64) errors.CCError
TransferHostAcrossBusiness Transfer host across business, delete old business host and module relation
func (*Logics) UnlockHost ¶
type SpecialHandle ¶
type SpecialHandle interface {
BkSystemInstall(ctx context.Context, appName string, input *metadata.BkSystemInstallRequest) errors.CCError
}
SpecialHandle 用来做隔离, 不让logic 正常逻辑调用