service

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ESIndexPrefix = "cmdb"

	TypeHost        = "host"
	TypeObject      = "object"
	TypeApplication = "biz"

	BkBizMetaKey = "metadata.label.bk_biz_id"
)

Variables

View Source
var ForbiddenModifyMainlineObjectUniqueWhiteList = []string{
	common.BKInnerObjIDHost,
}
View Source
var (
	SpecialChar = []string{"`", "~", "!", "@", "#", "$", "%", "^", "&", "*",
		"(", ")", "-", "_", "=", "+", "[", "{", "]", "}",
		"\\", "|", ";", ":", "'", "\"", ",", "<", ".", ">", "/", "?"}
)

Functions

func SortTopoInst

func SortTopoInst(instData []*metadata.TopoInstRst)

Types

type Aggregation

type Aggregation struct {
	Key   interface{} `json:"key"`
	Count int64       `json:"count"`
}

type MapStrWithModelBizID

type MapStrWithModelBizID struct {
	ModelBizID int64
	Data       mapstr.MapStr
}

func (*MapStrWithModelBizID) UnmarshalJSON

func (m *MapStrWithModelBizID) UnmarshalJSON(data []byte) error

type ModelType

type ModelType struct {
	BizID int64 `json:"bk_biz_id"`
}

ModelType is model type bk_biz_id == 0 : public model bk_biz_id > 0 : private model

type Page

type Page struct {
	Start int `json:"start"`
	Limit int `json:"limit"`
}

type Query

type Query struct {
	Paging      Page     `json:"page"`
	QueryString string   `json:"query_string"`
	TypeFilter  []string `json:"filter"`
	BkObjId     string   `json:"bk_obj_id"`
	BkBizId     string   `json:"bk_biz_id"`
}

func NewQuery

func NewQuery() *Query

type SearchResult

type SearchResult struct {
	Source    map[string]interface{} `json:"source"` // data from mongo, key/value
	Highlight map[string][]string    `json:"highlight"`
	Type      string                 `json:"type"` // object, host, process, model
	Score     float64                `json:"score"`
}

type SearchResults

type SearchResults struct {
	Total        int64          `json:"total"`
	Aggregations []Aggregation  `json:"aggregations"`
	Hits         []SearchResult `json:"hits"`
}

type Service

type Service struct {
	Engine      *backbone.Engine
	Core        core.Core
	Config      options.Config
	AuthManager *extensions.AuthManager
	Es          *elasticsearch.EsSrv
	Error       errors.CCErrorIf
	Language    language.CCLanguageIf
	EnableTxn   bool
}

func (*Service) BatchCheckSetInstUpdateToDateStatus

func (s *Service) BatchCheckSetInstUpdateToDateStatus(ctx *rest.Contexts)

func (*Service) BatchCreateSet

func (s *Service) BatchCreateSet(ctx *rest.Contexts)

func (*Service) CheckIsBuiltInModule

func (s *Service) CheckIsBuiltInModule(kit *rest.Kit, moduleIDs ...int64) errors.CCErrorCoder

func (*Service) CheckIsBuiltInSet

func (s *Service) CheckIsBuiltInSet(kit *rest.Kit, setIDs ...int64) errors.CCErrorCoder

func (*Service) CheckSetInstUpdateToDateStatus

func (s *Service) CheckSetInstUpdateToDateStatus(ctx *rest.Contexts)

func (*Service) CreateAssociationInst

func (s *Service) CreateAssociationInst(ctx *rest.Contexts)

func (*Service) CreateAssociationType

func (s *Service) CreateAssociationType(ctx *rest.Contexts)

func (*Service) CreateBusiness

func (s *Service) CreateBusiness(ctx *rest.Contexts)

CreateBusiness create a new business

func (*Service) CreateClassification

func (s *Service) CreateClassification(ctx *rest.Contexts)

CreateClassification create a new object classification

func (*Service) CreateDefaultBusiness

func (s *Service) CreateDefaultBusiness(ctx *rest.Contexts)

CreateDefaultBusiness create the default business

func (*Service) CreateInst

func (s *Service) CreateInst(ctx *rest.Contexts)

CreateInst create a new inst

func (*Service) CreateMainLineObject

func (s *Service) CreateMainLineObject(ctx *rest.Contexts)

CreateMainLineObject create a new model in the main line topo

func (*Service) CreateModule

func (s *Service) CreateModule(ctx *rest.Contexts)

CreateModule create a new module

func (*Service) CreateObject

func (s *Service) CreateObject(ctx *rest.Contexts)

CreateObject create a new object

func (*Service) CreateObjectAssociation

func (s *Service) CreateObjectAssociation(ctx *rest.Contexts)

CreateObjectAssociation create a new object association

func (*Service) CreateObjectAttribute

func (s *Service) CreateObjectAttribute(ctx *rest.Contexts)

CreateObjectAttribute create a new object attribute

func (*Service) CreateObjectBatch

func (s *Service) CreateObjectBatch(ctx *rest.Contexts)

CreateObjectBatch batch to create some objects

func (*Service) CreateObjectGroup

func (s *Service) CreateObjectGroup(ctx *rest.Contexts)

func (*Service) CreateObjectUnique

func (s *Service) CreateObjectUnique(ctx *rest.Contexts)

CreateObjectUnique create a new object unique

func (*Service) CreateResourceDirectory

func (s *Service) CreateResourceDirectory(ctx *rest.Contexts)

func (*Service) CreateSet

func (s *Service) CreateSet(ctx *rest.Contexts)

CreateSet create a new set

func (*Service) CreateSetTemplate

func (s *Service) CreateSetTemplate(ctx *rest.Contexts)

func (*Service) DeleteAssociationInst

func (s *Service) DeleteAssociationInst(ctx *rest.Contexts)

func (*Service) DeleteAssociationType

func (s *Service) DeleteAssociationType(ctx *rest.Contexts)

func (*Service) DeleteBusiness

func (s *Service) DeleteBusiness(ctx *rest.Contexts)

DeleteBusiness delete the business

func (*Service) DeleteClassification

func (s *Service) DeleteClassification(ctx *rest.Contexts)

DeleteClassification delete the object classification

func (*Service) DeleteInst

func (s *Service) DeleteInst(ctx *rest.Contexts)

DeleteInst delete the inst

func (*Service) DeleteInsts

func (s *Service) DeleteInsts(ctx *rest.Contexts)

func (*Service) DeleteMainLineObject

func (s *Service) DeleteMainLineObject(ctx *rest.Contexts)

DeleteMainLineObject delete a object int the main line topo

func (*Service) DeleteModule

func (s *Service) DeleteModule(ctx *rest.Contexts)

DeleteModule delete the module

func (*Service) DeleteObject

func (s *Service) DeleteObject(ctx *rest.Contexts)

DeleteObject delete the object

func (*Service) DeleteObjectAssociation

func (s *Service) DeleteObjectAssociation(ctx *rest.Contexts)

DeleteObjectAssociation delete object association

func (*Service) DeleteObjectAttribute

func (s *Service) DeleteObjectAttribute(ctx *rest.Contexts)

DeleteObjectAttribute delete the object attribute

func (*Service) DeleteObjectAttributeGroup

func (s *Service) DeleteObjectAttributeGroup(ctx *rest.Contexts)

func (*Service) DeleteObjectGroup

func (s *Service) DeleteObjectGroup(ctx *rest.Contexts)

DeleteObjectGroup delete the object group

func (*Service) DeleteObjectUnique

func (s *Service) DeleteObjectUnique(ctx *rest.Contexts)

DeleteObjectUnique delete a object unique

func (*Service) DeleteResourceDirectory

func (s *Service) DeleteResourceDirectory(ctx *rest.Contexts)

func (*Service) DeleteSet

func (s *Service) DeleteSet(ctx *rest.Contexts)

DeleteSet delete the set

func (*Service) DeleteSetTemplate

func (s *Service) DeleteSetTemplate(ctx *rest.Contexts)

func (*Service) DeleteSets

func (s *Service) DeleteSets(ctx *rest.Contexts)

func (*Service) DiffSetTplWithInst

func (s *Service) DiffSetTplWithInst(ctx *rest.Contexts)

func (*Service) FullTextFind

func (s *Service) FullTextFind(ctx *rest.Contexts)

func (*Service) GetBusinessBasicInfo

func (s *Service) GetBusinessBasicInfo(ctx *rest.Contexts)

func (*Service) GetInternalModule

func (s *Service) GetInternalModule(ctx *rest.Contexts)

func (*Service) GetInternalModuleWithStatistics

func (s *Service) GetInternalModuleWithStatistics(ctx *rest.Contexts)

func (*Service) GetModelStatistics

func (s *Service) GetModelStatistics(ctx *rest.Contexts)

GetModelStatistics 用于统计各个模型的实例数(Web页面展示需要)

func (*Service) GetResourceDirsInCloudSync

func (s *Service) GetResourceDirsInCloudSync(ctx *rest.Contexts) (map[int64]bool, error)

获取云同步任务有关联的所有资源池目录

func (*Service) GetSetSyncDetails

func (s *Service) GetSetSyncDetails(ctx *rest.Contexts)

func (*Service) GetSetTemplate

func (s *Service) GetSetTemplate(ctx *rest.Contexts)

func (*Service) Healthz

func (s *Service) Healthz(req *restful.Request, resp *restful.Response)

func (*Service) ImportInstanceAssociation

func (s *Service) ImportInstanceAssociation(ctx *rest.Contexts)

ImportInstanceAssociation import instance association

func (*Service) IsSetInitializedByTemplate

func (s *Service) IsSetInitializedByTemplate(kit *rest.Kit, setID int64) (bool, errors.CCErrorCoder)

func (*Service) ListAllBusinessSimplify

func (s *Service) ListAllBusinessSimplify(ctx *rest.Contexts)

ListAllBusinessSimplify list all businesses with return only several fields

func (*Service) ListHostModelAttribute

func (s *Service) ListHostModelAttribute(ctx *rest.Contexts)

ListHostModelAttribute list host model's attributes

func (*Service) ListModulesByServiceTemplateID

func (s *Service) ListModulesByServiceTemplateID(ctx *rest.Contexts)

func (*Service) ListSetTemplate

func (s *Service) ListSetTemplate(ctx *rest.Contexts)

func (*Service) ListSetTemplateSyncHistory

func (s *Service) ListSetTemplateSyncHistory(ctx *rest.Contexts)

func (*Service) ListSetTemplateSyncStatus

func (s *Service) ListSetTemplateSyncStatus(ctx *rest.Contexts)

func (*Service) ListSetTemplateWeb

func (s *Service) ListSetTemplateWeb(ctx *rest.Contexts)

func (*Service) ListSetTplRelatedSets

func (s *Service) ListSetTplRelatedSets(kit *rest.Kit, bizID int64, setTemplateID int64, option metadata.ListSetByTemplateOption) (*metadata.QueryConditionResult, error)

ListSetTplRelatedSets get SetTemplate related sets

func (*Service) ListSetTplRelatedSetsWeb

func (s *Service) ListSetTplRelatedSetsWeb(ctx *rest.Contexts)

ListSetTplRelatedSetsWeb get SetTemplate related sets, just for web

func (*Service) ListSetTplRelatedSvcTpl

func (s *Service) ListSetTplRelatedSvcTpl(ctx *rest.Contexts)

func (*Service) ListSetTplRelatedSvcTplWithStatistics

func (s *Service) ListSetTplRelatedSvcTplWithStatistics(ctx *rest.Contexts)

func (*Service) SearchAssociationInst

func (s *Service) SearchAssociationInst(ctx *rest.Contexts)

func (*Service) SearchAssociationType

func (s *Service) SearchAssociationType(ctx *rest.Contexts)

func (*Service) SearchAuditDetail

func (s *Service) SearchAuditDetail(ctx *rest.Contexts)

SearchAuditDetail search audit log detail by id

func (*Service) SearchAuditDict

func (s *Service) SearchAuditDict(ctx *rest.Contexts)

SearchAuditDict returns all audit types with their name and actions for front-end display

func (*Service) SearchAuditList

func (s *Service) SearchAuditList(ctx *rest.Contexts)

SearchAuditList search audit log list, only contains information for front-end table display

func (*Service) SearchBusiness

func (s *Service) SearchBusiness(ctx *rest.Contexts)

SearchBusiness search the business by condition func (s *Service) SearchBusiness(ctx *rest.Contexts) {

func (*Service) SearchBusinessTopo

func (s *Service) SearchBusinessTopo(ctx *rest.Contexts)

func (*Service) SearchBusinessTopoWithStatistics

func (s *Service) SearchBusinessTopoWithStatistics(ctx *rest.Contexts)

SearchBusinessTopoWithStatistics calculate how many service instances on each topo instance node

func (*Service) SearchClassification

func (s *Service) SearchClassification(ctx *rest.Contexts)

SearchClassification search the classifications

func (*Service) SearchClassificationWithObjects

func (s *Service) SearchClassificationWithObjects(ctx *rest.Contexts)

SearchClassificationWithObjects search the classification with objects

func (*Service) SearchGroupByObject

func (s *Service) SearchGroupByObject(ctx *rest.Contexts)

SearchGroupByObject search the groups by the object

func (*Service) SearchIdentifier

func (s *Service) SearchIdentifier(ctx *rest.Contexts)

func (*Service) SearchInstAndAssociationDetail

func (s *Service) SearchInstAndAssociationDetail(ctx *rest.Contexts)

SearchInstAndAssociationDetail search the inst with association details

func (*Service) SearchInstAssociation

func (s *Service) SearchInstAssociation(ctx *rest.Contexts)

Deprecated 2019-09-30 废弃接口

func (*Service) SearchInstAssociationUI

func (s *Service) SearchInstAssociationUI(ctx *rest.Contexts)

func (*Service) SearchInstAssociationWithOtherObject

func (s *Service) SearchInstAssociationWithOtherObject(ctx *rest.Contexts)

SearchInstAssociationWithOtherObject 要求根据实例信息(实例的模型ID,实例ID)和模型ID(关联关系中的源,目的模型ID) 返回实例关联或者被关联模型实例得数据。

func (*Service) SearchInstByAssociation

func (s *Service) SearchInstByAssociation(ctx *rest.Contexts)

SearchInstByAssociation search inst by the association inst

func (*Service) SearchInstByInstID

func (s *Service) SearchInstByInstID(ctx *rest.Contexts)

SearchInstByInstID search the inst by inst ID

func (*Service) SearchInstByObject

func (s *Service) SearchInstByObject(ctx *rest.Contexts)

SearchInstByObject search the inst of the object

func (*Service) SearchInstChildTopo

func (s *Service) SearchInstChildTopo(ctx *rest.Contexts)

SearchInstChildTopo search the child inst topo for a inst

func (*Service) SearchInstTopo

func (s *Service) SearchInstTopo(ctx *rest.Contexts)

SearchInstTopo search the inst topo

func (*Service) SearchInsts

func (s *Service) SearchInsts(ctx *rest.Contexts)

SearchInst search the inst

func (*Service) SearchMainLineChildInstTopo

func (s *Service) SearchMainLineChildInstTopo(ctx *rest.Contexts)

SearchMainLineChildInstTopo search the child inst topo by a inst

func (*Service) SearchMainLineObjectTopo

func (s *Service) SearchMainLineObjectTopo(ctx *rest.Contexts)

SearchMainLineObjectTopo search the main line topo

func (*Service) SearchModule

func (s *Service) SearchModule(ctx *rest.Contexts)

SearchModule search the modules

func (*Service) SearchModuleBatch

func (s *Service) SearchModuleBatch(ctx *rest.Contexts)

SearchModuleBatch search the modules in one biz

func (*Service) SearchObject

func (s *Service) SearchObject(ctx *rest.Contexts)

SearchObject search some objects by condition

func (*Service) SearchObjectAssocWithAssocKindList

func (s *Service) SearchObjectAssocWithAssocKindList(ctx *rest.Contexts)

func (*Service) SearchObjectAssociation

func (s *Service) SearchObjectAssociation(ctx *rest.Contexts)

SearchObjectAssociation search object association by object id

func (*Service) SearchObjectAttribute

func (s *Service) SearchObjectAttribute(ctx *rest.Contexts)

SearchObjectAttribute search the object attributes

func (*Service) SearchObjectBatch

func (s *Service) SearchObjectBatch(ctx *rest.Contexts)

SearchObjectBatch batch to search some objects

func (*Service) SearchObjectByClassificationID

func (s *Service) SearchObjectByClassificationID(ctx *rest.Contexts)

SearchObjectByClassificationID search the object by classification ID

func (*Service) SearchObjectTopo

func (s *Service) SearchObjectTopo(ctx *rest.Contexts)

SearchObjectTopo search the object topo

func (*Service) SearchObjectUnique

func (s *Service) SearchObjectUnique(ctx *rest.Contexts)

SearchObjectUnique search object uniques

func (*Service) SearchOwnerResourcePoolBusiness

func (s *Service) SearchOwnerResourcePoolBusiness(ctx *rest.Contexts)

SearchOwnerResourcePoolBusiness search archived business by condition

func (*Service) SearchReducedBusinessList

func (s *Service) SearchReducedBusinessList(ctx *rest.Contexts)

find business list with these info: 1. have any authorized resources in a business. 2. only returned with a few field for this business info.

func (*Service) SearchResourceDirectory

func (s *Service) SearchResourceDirectory(ctx *rest.Contexts)

func (*Service) SearchRuleRelatedTopoNodes

func (s *Service) SearchRuleRelatedTopoNodes(ctx *rest.Contexts)

func (*Service) SearchSet

func (s *Service) SearchSet(ctx *rest.Contexts)

SearchSet search the set

func (*Service) SearchSetBatch

func (s *Service) SearchSetBatch(ctx *rest.Contexts)

SearchSetBatch search the sets in one biz

func (*Service) SearchTopoPath

func (s *Service) SearchTopoPath(ctx *rest.Contexts)

func (*Service) SearchTopologyNodePath

func (s *Service) SearchTopologyNodePath(ctx *rest.Contexts)

func (*Service) SearchTopologyTree

func (s *Service) SearchTopologyTree(ctx *rest.Contexts)

func (*Service) SelectObjectTopoGraphics

func (s *Service) SelectObjectTopoGraphics(ctx *rest.Contexts)

func (*Service) SyncModuleTaskHandler

func (s *Service) SyncModuleTaskHandler(ctx *rest.Contexts)

func (*Service) SyncSetTplToInst

func (s *Service) SyncSetTplToInst(ctx *rest.Contexts)

func (*Service) UpdateAssociationType

func (s *Service) UpdateAssociationType(ctx *rest.Contexts)

func (*Service) UpdateBusiness

func (s *Service) UpdateBusiness(ctx *rest.Contexts)

UpdateBusiness update the business

func (*Service) UpdateBusinessStatus

func (s *Service) UpdateBusinessStatus(ctx *rest.Contexts)

UpdateBusinessStatus update the business status

func (*Service) UpdateClassification

func (s *Service) UpdateClassification(ctx *rest.Contexts)

UpdateClassification update the object classification

func (*Service) UpdateInst

func (s *Service) UpdateInst(ctx *rest.Contexts)

UpdateInst update the inst

func (*Service) UpdateInsts

func (s *Service) UpdateInsts(ctx *rest.Contexts)

func (*Service) UpdateModule

func (s *Service) UpdateModule(ctx *rest.Contexts)

UpdateModule update the module

func (*Service) UpdateModuleHostApplyEnableStatus

func (s *Service) UpdateModuleHostApplyEnableStatus(ctx *rest.Contexts)

func (*Service) UpdateObject

func (s *Service) UpdateObject(ctx *rest.Contexts)

UpdateObject update the object

func (*Service) UpdateObjectAssociation

func (s *Service) UpdateObjectAssociation(ctx *rest.Contexts)

UpdateObjectAssociation update object association

func (*Service) UpdateObjectAttribute

func (s *Service) UpdateObjectAttribute(ctx *rest.Contexts)

UpdateObjectAttribute update the object attribute

func (*Service) UpdateObjectAttributeGroupProperty

func (s *Service) UpdateObjectAttributeGroupProperty(ctx *rest.Contexts)

UpdateObjectAttributeGroupProperty update the object attribute belongs to group information

func (*Service) UpdateObjectAttributeIndex

func (s *Service) UpdateObjectAttributeIndex(ctx *rest.Contexts)

func (*Service) UpdateObjectGroup

func (s *Service) UpdateObjectGroup(ctx *rest.Contexts)

UpdateObjectGroup update the object group information

func (*Service) UpdateObjectTopoGraphics

func (s *Service) UpdateObjectTopoGraphics(ctx *rest.Contexts)

func (*Service) UpdateObjectTopoGraphicsNew

func (s *Service) UpdateObjectTopoGraphicsNew(ctx *rest.Contexts)

func (*Service) UpdateObjectUnique

func (s *Service) UpdateObjectUnique(ctx *rest.Contexts)

UpdateObjectUnique update a object unique

func (*Service) UpdateResourceDirectory

func (s *Service) UpdateResourceDirectory(ctx *rest.Contexts)

func (*Service) UpdateSet

func (s *Service) UpdateSet(ctx *rest.Contexts)

UpdateSet update the set

func (*Service) UpdateSetTemplate

func (s *Service) UpdateSetTemplate(ctx *rest.Contexts)

func (*Service) UpdateSetVersion

func (s *Service) UpdateSetVersion(kit *rest.Kit, bizID, setID, setTemplateVersion int64) errors.CCErrorCoder

func (*Service) WebService

func (s *Service) WebService() *restful.Container

WebService the web service

Jump to

Keyboard shortcuts

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