common

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: 10 Imported by: 0

README

common files

Documentation

Index

Constants

View Source
const (
	// HTTPCreate create method
	HTTPCreate = "POST"

	// HTTPSelectPost select method
	HTTPSelectPost = "POST"

	// HTTPSelectGet select method
	HTTPSelectGet = "GET"

	// HTTPUpdate update method
	HTTPUpdate = "PUT"

	// HTTPDelete delete method
	HTTPDelete = "DELETE"

	// BKNoLimit no limit definition
	BKNoLimit = 999999999
	// max limit of a page
	BKMaxPageSize = 1000

	// max limit of instance count
	BKMaxInstanceLimit = 500

	// 一次最大操作记录数
	BKMaxRecordsAtOnce = 2000

	// BKDefaultLimit the default limit definition
	BKDefaultLimit = 20

	// BKAuditLogPageLimit the audit log page limit
	BKAuditLogPageLimit = 200

	// BKParent the parent code
	BKParent = 1
	// BKChild the child code
	BKChild = 2

	// BKParentStr the parent name
	BKParentStr = "bk_parentid"

	// BKChildStr the child name
	BKChildStr = "bk_childid"

	// BKInstParentStr the inst parent name
	BKInstParentStr = "bk_parent_id"

	// BKDefaultOwnerID the default owner value
	BKDefaultOwnerID = "0"

	// BKSuperOwnerID the super owner value
	BKSuperOwnerID = "superadmin"

	// BKDefaultDirSubArea the default dir subarea
	BKDefaultDirSubArea = 0

	// BKTimeTypeParseFlag the time flag
	BKTimeTypeParseFlag = "cc_time_type"

	// BKTopoBusinessLevelLimit the mainline topo level limit
	BKTopoBusinessLevelLimit = "level.businessTopoMax"

	// BKTopoBusinessLevelDefault the mainline topo level default level
	BKTopoBusinessLevelDefault = 7
)
View Source
const (
	// BKInnerObjIDApp the inner object
	BKInnerObjIDApp = "biz"

	// BKInnerObjIDSet the inner object
	BKInnerObjIDSet = "set"

	// BKInnerObjIDModule the inner object
	BKInnerObjIDModule = "module"

	// BKInnerObjIDHost the inner object
	BKInnerObjIDHost = "host"

	// BKInnerObjIDObject the inner object
	BKInnerObjIDObject = "object"

	// BKInnerObjIDProc the inner object
	BKInnerObjIDProc = "process"

	// BKInnerObjIDConfigTemp the inner object
	BKInnerObjIDConfigTemp = "config_template"

	// BKInnerObjIDTempVerion the inner object
	BKInnerObjIDTempVersion = "template_version"

	// BKInnerObjIDPlat the inner object
	BKInnerObjIDPlat = "plat"

	// BKInnerObjIDSwitch the inner object
	BKInnerObjIDSwitch = "bk_switch"
	// BKInnerObjIDRouter the inner object
	BKInnerObjIDRouter = "bk_router"
	// BKInnerObjIDBlance the inner object
	BKInnerObjIDBlance = "bk_load_balance"
	// BKInnerObjIDFirewall the inner object
	BKInnerObjIDFirewall = "bk_firewall"
	// BKInnerObjIDWeblogic the inner object
	BKInnerObjIDWeblogic = "bk_weblogic"
	// BKInnerObjIDTomcat the inner object
	BKInnerObjIDTomcat = "bk_tomcat"
	// BKInnerObjIDApache the inner object
	BKInnerObjIDApache = "bk_apache"
)
View Source
const (
	RevisionEnterprise = "enterprise"
	RevisionCommunity  = "community"
	RevisionOpensource = "opensource"
)

Revision

View Source
const (
	// used only for host search
	BKDBMULTIPLELike = "$multilike"

	// BKDBIN the db operator
	BKDBIN = "$in"

	// BKDBOR the db operator
	BKDBOR = "$or"

	// BKDBAND the db operator
	BKDBAND = "$and"

	// BKDBLIKE the db operator
	BKDBLIKE = "$regex"

	// BKDBOPTIONS the db operator,used with $regex
	// detail to see https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options
	BKDBOPTIONS = "$options"

	// BKDBEQ the db operator
	BKDBEQ = "$eq"

	// BKDBNE the db operator
	BKDBNE = "$ne"

	// BKDBNIN the db oeprator
	BKDBNIN = "$nin"

	// BKDBLT the db operator
	BKDBLT = "$lt"

	// BKDBLTE the db operator
	BKDBLTE = "$lte"

	// BKDBGT the db operator
	BKDBGT = "$gt"

	// BKDBGTE the db opeartor
	BKDBGTE = "$gte"

	// BKDBExists the db opeartor
	BKDBExists = "$exists"

	// BKDBNot the db opeartor
	BKDBNot = "$not"

	// BKDBCount the db opeartor
	BKDBCount = "$count"

	// BKDBGroup the db opeartor
	BKDBGroup = "$group"

	// BKDBMatch the db opeartor
	BKDBMatch = "$match"

	// BKDBSum the db opeartor
	BKDBSum = "$sum"

	// BKDBPush the db opeartor
	BKDBPush = "$push"

	// BKDBUNSET the db opeartor
	BKDBUNSET = "$unset"

	// BKDBAddToSet The $addToSet operator adds a value to an array unless the value is already present, in which case $addToSet does nothing to that array.
	BKDBAddToSet = "$addToSet"

	// BKDBPull The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
	BKDBPull = "$pull"

	// BKDBAll matches arrays that contain all elements specified in the query.
	BKDBAll = "$all"

	// BKDBSize selects documents if the array field is a specified size.
	BKDBSize = "$size"

	// BKDBSortFieldSep the db sort field split char
	BKDBSortFieldSep = ","
)
View Source
const (
	// DefaultResModuleName the default idle module name
	DefaultResModuleName string = "空闲机"
	// DefaultFaultModuleName the default fault module name
	DefaultFaultModuleName string = "故障机"
	// DefaultRecycleModuleName the default fault module name
	DefaultRecycleModuleName string = "待回收"
)
View Source
const (
	// BKFieldID the id definition
	BKFieldID   = "id"
	BKFieldName = "name"

	// BKDefaultField the default field
	BKDefaultField = "default"

	// BKOwnerIDField the owner field
	BKOwnerIDField = "bk_supplier_account"

	// BKAppIDField the appid field
	BKAppIDField = "bk_biz_id"

	// BKIPArr the ip address
	BKIPArr = "ipArr"

	// BKAssetIDField  the asset id field
	BKAssetIDField = "bk_asset_id"

	// BKSNField  the sn  field
	BKSNField = "bk_sn"

	// BKHostInnerIPField the host innerip field
	BKHostInnerIPField = "bk_host_innerip"

	// BKHostCloudRegionField the host cloud region field
	BKHostCloudRegionField = "bk_cloud_region"

	// BKHostOuterIPField the host outerip field
	BKHostOuterIPField = "bk_host_outerip"

	// BKCloudInstIDField the cloud instance id field
	BKCloudInstIDField = "bk_cloud_inst_id"

	// BKCloudHostStatusField the cloud host status field
	BKCloudHostStatusField = "bk_cloud_host_status"

	// TimeTransferModel the time transferModel field
	TimeTransferModel = "2006-01-02 15:04:05"

	// BKCloudTaskID the cloud sync task id
	BKCloudTaskID = "bk_task_id"

	// BKNewAddHost the cloud sync new add hosts
	BKNewAddHost = "new_add"

	// BKImportFrom the host import from field
	BKImportFrom = "import_from"

	// BKHostIDField the host id field
	BKHostIDField = "bk_host_id"

	// BKHostNameField the host name field
	BKHostNameField = "bk_host_name"

	// BKAppNameField the app name field
	BKAppNameField = "bk_biz_name"

	// BKSetIDField the setid field
	BKSetIDField = "bk_set_id"

	// BKSetNameField the set name field
	BKSetNameField = "bk_set_name"

	// BKModuleIDField the module id field
	BKModuleIDField = "bk_module_id"

	// BKModuleNameField the module name field
	BKModuleNameField = "bk_module_name"

	HostApplyEnabledField = "host_apply_enabled"

	// BKSubscriptionIDField the subscription id field
	BKSubscriptionIDField = "subscription_id"
	// BKSubscriptionNameField the subscription name field
	BKSubscriptionNameField = "subscription_name"

	// BKOSTypeField the os type field
	BKOSTypeField = "bk_os_type"

	// BKOSNameField the os name field
	BKOSNameField = "bk_os_name"

	// BKHttpGet the http get
	BKHttpGet = "GET"

	// BKTencentCloudTimeOut the tencent cloud timeout
	BKTencentCloudTimeOut = 10

	// TencentCloudUrl the tencent cloud url
	TencentCloudUrl = "cvm.tencentcloudapi.com"

	// TencentCloudSignMethod the tencent cloud sign method
	TencentCloudSignMethod = "HmacSHA1"

	// BKCloudIDField the cloud id field
	BKCloudIDField = "bk_cloud_id"

	// BKCloudNameField the cloud name field
	BKCloudNameField = "bk_cloud_name"

	// BKObjIDField the obj id field
	BKObjIDField = "bk_obj_id"

	// BKObjNameField the obj name field
	BKObjNameField = "bk_obj_name"

	// BKObjIconField the obj icon field
	BKObjIconField = "bk_obj_icon"

	// BKInstIDField the inst id field
	BKInstIDField = "bk_inst_id"

	// BKInstNameField the inst name field
	BKInstNameField = "bk_inst_name"

	// ExportCustomFields the use custom display columns
	ExportCustomFields = "export_custom_fields"

	// BKProcIDField the proc id field
	BKProcIDField = "bk_process_id"

	// BKConfTempId is the config template id field
	BKConfTempIdField = "bk_conftemp_id"

	// BKProcNameField the proc name field
	BKProcNameField = "bk_process_name"

	// BKTemlateIDField the process template id field
	BKTemlateIDField = "template_id"

	// BKVesionIDField the version id field
	BKVersionIDField = "version_id"

	// BKTemplateNameField the template name field
	BKTemplateNameField = "template_name"

	// BKFileNameField the file name field
	BKFileNameField = "file_name"

	// BKPropertyIDField the propety id field
	BKPropertyIDField = "bk_property_id"

	// BKPropertyNameField the property name field
	BKPropertyNameField = "bk_property_name"

	BKPropertyIndexField = "bk_property_index"

	// BKPropertyTypeField the property type field
	BKPropertyTypeField = "bk_property_type"

	BKPropertyGroupField = "bk_property_group"

	// BKPropertyValueField the property value field
	BKPropertyValueField = "bk_property_value"

	// BKObjAttIDField the obj att id field
	BKObjAttIDField = "bk_object_att_id"

	// BKClassificationIDField the classification id field
	BKClassificationIDField = "bk_classification_id"

	// BKClassificationNameField the classification name field
	BKClassificationNameField = "bk_classification_name"

	// BKClassificationIconField the classification icon field
	BKClassificationIconField = "bk_classification_icon"

	// BKPropertyGroupIDField the property group id field
	BKPropertyGroupIDField = "bk_group_id"

	// BKPropertyGroupNameField the property group name field
	BKPropertyGroupNameField = "bk_group_name"

	// BKPropertyGroupIndexField the property group index field
	BKPropertyGroupIndexField = "bk_group_index"

	// BKAsstObjIDField the property obj id field
	BKAsstObjIDField = "bk_asst_obj_id"

	// BKAsstInstIDField the property inst id field
	BKAsstInstIDField = "bk_asst_inst_id"

	// BKOptionField the option field
	BKOptionField = "option"

	// BKAuditTypeField the audit type field
	BKAuditTypeField = "audit_type"

	// BKResourceTypeField the audit resource type field
	BKResourceTypeField = "resource_type"

	// BKOperateFromField the platform where operation from field
	BKOperateFromField = "operate_from"

	// BKOperationDetailField the audit operation detail field
	BKOperationDetailField = "operation_detail"

	// BKOperationTimeField the audit operation time field
	BKOperationTimeField = "operation_time"

	// BKResourceIDField the audit resource ID field
	BKResourceIDField = "resource_id"

	// BKResourceNameField the audit resource name field
	BKResourceNameField = "resource_name"

	// BKLabelField the audit resource name field
	BKLabelField = "label"

	// BKSetEnvField the set env field
	BKSetEnvField = "bk_set_env"

	// BKSetStatusField the set status field
	BKSetStatusField = "bk_service_status"

	// BKSetDescField the set desc field
	BKSetDescField = "bk_set_desc"

	// BKSetCapacityField the set capacity field
	BKSetCapacityField = "bk_capacity"

	// BKPort the port
	BKPort = "port"

	// BKProcPortEnable whether enable port,  enable port use for monitor app. default value
	BKProcPortEnable = "bk_enable_port"

	// BKProcGatewayIP the process gateway ip
	BKProcGatewayIP = "bk_gateway_ip"

	// BKProcGatewayPort the process gateway port
	BKProcGatewayPort = "bk_gateway_port"

	// BKProcGatewayProtocol the process gateway protocol
	BKProcGatewayProtocol = "bk_gateway_protocol"

	// BKProcGatewayCity the process gateway city
	BKProcGatewayCity = "bk_gateway_city"

	// BKProcBindInfo the process bind info
	BKProcBindInfo = "bind_info"

	// BKUser the user
	BKUser = "user"

	// BKProtocol the protocol
	BKProtocol = "protocol"

	// BKIP the ip
	BKIP = "ip"

	// BKEnable the enable
	BKEnable = "enable"

	// the process object name
	BKProcessObjectName = "process"

	// BKProcessIDField the process id field
	BKProcessIDField = "bk_process_id"

	BKServiceInstanceIDField = "service_instance_id"
	BKServiceTemplateIDField = "service_template_id"
	BKProcessTemplateIDField = "process_template_id"
	BKServiceCategoryIDField = "service_category_id"

	BKSetTemplateIDField      = "set_template_id"
	BKSetTemplateVersionField = "set_template_version"

	HostApplyRuleIDField = "host_apply_rule_id"

	BKParentIDField = "bk_parent_id"
	BKRootIDField   = "bk_root_id"

	// BKProcessNameField the process name field
	BKProcessNameField = "bk_process_name"

	// BKFuncIDField the func id field
	BKFuncIDField = "bk_func_id"

	// BKFuncName the function name
	BKFuncName = "bk_func_name"

	BKStartParamRegex = "bk_start_param_regex"

	// BKBindIP the bind ip
	BKBindIP = "bind_ip"

	// BKWorkPath the work path
	BKWorkPath = "work_path"

	// BKIsPre the ispre field
	BKIsPre = "ispre"

	// BKIsIncrementField the isincrement field
	BKIsIncrementField = "is_increment"

	BKIsCollapseField = "is_collapse"

	// BKProxyListField the proxy list field
	BKProxyListField = "bk_proxy_list"

	// BKIPListField the ip list field
	BKIPListField = "ip_list"

	// BKInvalidIPSField the invalid ips field
	BKInvalidIPSField = "invalid_ips"

	// BKGseProxyField the gse proxy
	BKGseProxyField = "bk_gse_proxy"

	// BKSubAreaField the sub area field
	BKSubAreaField = "bk_cloud_id"

	// BKProcField the proc field
	BKProcField = "bk_process"

	// BKMaintainersField the maintainers field
	BKMaintainersField = "bk_biz_maintainer"

	// BKProductPMField the product pm field
	BKProductPMField = "bk_biz_productor"

	// BKTesterField the tester field
	BKTesterField = "bk_biz_tester"

	// BKOperatorField the operator field
	BKOperatorField = "operator" // the operator of app of module, is means a job position

	// BKLifeCycleField the life cycle field
	BKLifeCycleField = "life_cycle"

	// BKDeveloperField the developer field
	BKDeveloperField = "bk_biz_developer"

	// BKLanguageField the language field
	BKLanguageField = "language"

	// BKBakOperatorField the bak operator field
	BKBakOperatorField = "bk_bak_operator"

	// BKTimeZoneField the time zone field
	BKTimeZoneField = "time_zone"

	// BKIsRequiredField the required field
	BKIsRequiredField = "isrequired"

	// BKModuleTypeField the module type field
	BKModuleTypeField = "bk_module_type"

	// BKOrgIPField the org ip field
	BKOrgIPField = "bk_org_ip"

	// BKDstIPField the dst ip field
	BKDstIPField = "bk_dst_ip"

	// BKDescriptionField the description field
	BKDescriptionField = "description"

	// BKIsOnlyField the isonly name field
	BKIsOnlyField = "isonly"
	// BKGseTaskIdField the gse taskid
	BKGseTaskIDField = "task_id"
	// BKTaskIdField the gse taskid
	BKTaskIDField = "task_id"
	// BKGseOpTaskIDField the gse taskid
	BKGseOpTaskIDField = "gse_task_id"
	BKProcPidFile      = "pid_file"
	BKProcStartCmd     = "start_cmd"
	BKProcStopCmd      = "stop_cmd"
	BKProcReloadCmd    = "reload_cmd"
	BKProcRestartCmd   = "restart_cmd"
	BKProcTimeOut      = "timeout"
	BKProcWorkPath     = "work_path"
	BKProcInstNum      = "proc_num"

	// BKInstKeyField the inst key field for metric discover
	BKInstKeyField = "bk_inst_key"

	// for net collect device
	BKDeviceIDField    = "device_id"
	BKDeviceNameField  = "device_name"
	BKDeviceModelField = "device_model"
	BKVendorField      = "bk_vendor"

	// for net collect property of device
	BKNetcollectPropertyIDField = "netcollect_property_id"
	BKOIDField                  = "oid"
	BKPeriodField               = "period"
	BKActionField               = "action"
	BKProcinstanceID            = "proc_instance_id"

	// BKGseOpProcTaskDetailField gse operate process return detail
	BKGseOpProcTaskDetailField = "detail"
	BKGroupField               = "group"

	BKAttributeIDField = "bk_attribute_id"
)
View Source
const (
	BKRequestField = "bk_request_id"
	BKTxnIDField   = "bk_txn_id"
)
View Source
const (
	// CreatorField the creator
	CreatorField = "creator"

	// CreateTimeField the create time field
	CreateTimeField = "create_time"

	// ConfirmTimeField the cloud resource confirm time filed
	ConfirmTimeField = "confirm_time"

	// StartTimeField the cloud sync start time field
	StartTimeFiled = "start_time"

	// ModifierField the modifier field
	ModifierField = "modifier"

	// LastTimeField the last time field
	LastTimeField = "last_time"
)

the inst record's logging information

View Source
const (
	// ValidCreate valid create
	ValidCreate = "create"

	// ValidUpdate valid update
	ValidUpdate = "update"
)
View Source
const (
	SNMPActionGet = "get"

	SNMPActionGetNext = "getnext"
)
View Source
const (
	// DefaultResModuleFlag the default resource module flag
	DefaultResModuleFlag int = 1

	// DefaultFaultModuleFlag the default fault module flag
	DefaultFaultModuleFlag int = 2

	// NormalModuleFlag create module by user , default =0
	NormalModuleFlag int = 0

	// NormalSetDefaultFlag user create set default field value
	NormalSetDefaultFlag int64 = 0

	// DefaultRecycleModuleFlag default recycle module flag
	DefaultRecycleModuleFlag int = 3

	// DefaultResSelfDefinedModuleFlag the default resource self-defined module flag
	DefaultResSelfDefinedModuleFlag int = 4
)
View Source
const (
	// FieldTypeSingleChar the single char filed type
	FieldTypeSingleChar string = "singlechar"

	// FieldTypeLongChar the long char field type
	FieldTypeLongChar string = "longchar"

	// FieldTypeInt the int field type
	FieldTypeInt string = "int"

	// FieldTypeFloat the float field type
	FieldTypeFloat string = "float"

	// FieldTypeEnum the enum field type
	FieldTypeEnum string = "enum"

	// FieldTypeDate the date field type
	FieldTypeDate string = "date"

	// FieldTypeTime the time field type
	FieldTypeTime string = "time"

	// FieldTypeUser the user field type
	FieldTypeUser string = "objuser"

	// FieldTypeTimeZone the timezone field type
	FieldTypeTimeZone string = "timezone"

	// FieldTypeBool the bool type
	FieldTypeBool string = "bool"

	// FieldTypeList the list type
	FieldTypeList string = "list"

	// FieldTypeTable the table type, inner type.
	FieldTypeTable string = "table"

	// FieldTypeOrganization the organization field type
	FieldTypeOrganization string = "organization"

	// FieldTypeSingleLenChar the single char length limit
	FieldTypeSingleLenChar int = 256

	// FieldTypeLongLenChar the long char length limit
	FieldTypeLongLenChar int = 2000

	// FieldTypeUserLenChar the user char length limit
	FieldTypeUserLenChar int = 2000

	//FieldTypeStrictCharRegexp the single char regex expression
	FieldTypeStrictCharRegexp string = `^[a-zA-Z]\w*$`

	//FieldTypeServiceCategoryRegexp the service category regex expression
	FieldTypeServiceCategoryRegexp string = `^([\w\p{Han}]|[:\-\(\)])+$`

	//FieldTypeMainlineRegexp the mainline instance name regex expression
	FieldTypeMainlineRegexp string = `^[^#/,><|]+$`

	//FieldTypeSingleCharRegexp the single char regex expression
	//FieldTypeSingleCharRegexp string = `^([\w\p{Han}]|[,。?!={}|?<>~~、:#;%*——……&·$()‘’“”\[\]『』〔〕{}【】¥£♀‖〖〗《》「」:,;\."'\/\\\+\-\s#@\(\)])+$`
	FieldTypeSingleCharRegexp string = `\S`

	//FieldTypeLongCharRegexp the long char regex expression\
	//FieldTypeLongCharRegexp string = `^([\w\p{Han}]|[,。?!={}|?<>~~、:#;%*——……&·$()‘’“”\[\]『』〔〕{}【】¥£♀‖〖〗《》「」:,;\."'\/\\\+\-\s#@\(\)])+$`
	FieldTypeLongCharRegexp string = `\S`
)
View Source
const (
	// HostAddMethodExcel add a host method
	HostAddMethodExcel = "1"

	// HostAddMethodAgent add a  agent method
	HostAddMethodAgent = "2"

	// HostAddMethodAPI add api method
	HostAddMethodAPI = "3"

	// HostAddMethodExcelIndexOffset the height of the table header
	HostAddMethodExcelIndexOffset = 3

	// HostAddMethodExcelAssociationIndexOffset
	HostAddMethodExcelAssociationIndexOffset = 1

	// ExcelHeaderFirstRowColor cell bg color
	ExcelHeaderFirstRowColor = "FF92D050"
	// ExcelHeaderFirstRowFontColor  font color
	ExcelHeaderFirstRowFontColor = "00000000"
	// ExcelHeaderFirstRowRequireFontColor require font color
	ExcelHeaderFirstRowRequireFontColor = "FFFF0000"
	// ExcelHeaderOtherRowColor cell bg color
	ExcelHeaderOtherRowColor = "FFC6EFCE"
	// ExcelHeaderOtherRowFontColor font color
	ExcelHeaderOtherRowFontColor = "FF000000"
	// ExcelCellDefaultBorderColor black color
	ExcelCellDefaultBorderColor = "FFD4D4D4"
	// ExcelHeaderFirstColumnColor light gray
	ExcelHeaderFirstColumnColor = "fee9da"
	// ExcelFirstColumnCellColor dark gray
	ExcelFirstColumnCellColor = "fabf8f"

	// ExcelAsstPrimaryKeySplitChar split char
	ExcelAsstPrimaryKeySplitChar = ","
	// ExcelAsstPrimaryKeyJoinChar split char
	ExcelAsstPrimaryKeyJoinChar = "="
	// ExcelAsstPrimaryKeyRowChar split char
	ExcelAsstPrimaryKeyRowChar = "\n"

	// ExcelDelAsstObjectRelation delete asst object relation
	ExcelDelAsstObjectRelation = "/"

	// ExcelDataValidationListLen excel dropdown list item count
	ExcelDataValidationListLen = 50

	// ExcelCommentSheetCotentLangPrefixKey excel comment sheet centent language prefixe key
	ExcelCommentSheetCotentLangPrefixKey = "import_comment"

	// ExcelFirstColumnFieldName export excel first column for tips
	ExcelFirstColumnFieldName = "field_name"
	ExcelFirstColumnFieldType = "field_type"
	ExcelFirstColumnFieldID   = "field_id"
	ExcelFirstColumnInstData  = "inst_data"
)
View Source
const (
	// InputTypeExcel  data from excel
	InputTypeExcel = "excel"

	// InputTypeApiHostSync data from api for synchronize new host
	InputTypeApiNewHostSync = "api_sync_host"

	// BatchHostAddMaxRow batch sync add host max row
	BatchHostAddMaxRow = 128
)
View Source
const (
	// HTTPBKAPIErrorMessage apiserver error message
	HTTPBKAPIErrorMessage = "bk_error_msg"

	// HTTPBKAPIErrorCode apiserver error code
	HTTPBKAPIErrorCode = "bk_error_code"
)
View Source
const (
	// CCSystemOperatorUserName the system user
	CCSystemOperatorUserName  = "cc_system"
	CCSystemCollectorUserName = "cc_collector"
)
View Source
const (
	EventCacheEventIDKey             = BKCacheKeyV3Prefix + "event:inst_id"
	EventCacheEventQueueKey          = BKCacheKeyV3Prefix + "event:inst_queue"
	EventCacheEventTxnQueuePrefix    = BKCacheKeyV3Prefix + "event:inst_txn_queue:"
	EventCacheEventTxnCommitQueueKey = BKCacheKeyV3Prefix + "event:inst_txn_commit_queue"
	EventCacheEventTxnAbortQueueKey  = BKCacheKeyV3Prefix + "event:inst_txn_abort_queue"
	RedisSnapKeyPrefix               = BKCacheKeyV3Prefix + "snapshot:"
)

event cache keys

View Source
const (
	// BKHTTPHeaderUser current request http request header fields name for login user
	BKHTTPHeaderUser = "BK_User"
	// BKHTTPLanguage the language key word
	BKHTTPLanguage = "HTTP_BLUEKING_LANGUAGE"
	// BKHTTPOwnerID the owner
	BKHTTPOwner = "HTTP_BK_SUPPLIER_ACCOUNT"
	// BKHTTPOwnerID the owner id
	BKHTTPOwnerID           = "HTTP_BLUEKING_SUPPLIER_ID"
	BKHTTPCookieLanugageKey = "blueking_language"
	BKHTTPRequestAppCode    = "Bk-App-Code"
	BKHTTPRequestRealIP     = "X-Real-Ip"

	// BKHTTPCCRequestID cc request id cc_request_id
	BKHTTPCCRequestID = "Cc_Request_Id"
	// BKHTTPOtherRequestID esb request id  X-Bkapi-Request-Id
	BKHTTPOtherRequestID = "X-Bkapi-Request-Id"

	BKHTTPSecretsToken   = "BK-Secrets-Token"
	BKHTTPSecretsProject = "BK-Secrets-Project"
	BKHTTPSecretsEnv     = "BK-Secrets-Env"
)
View Source
const (
	TransactionIdHeader      = "cc_transaction_id_string"
	TransactionTimeoutHeader = "cc_transaction_timeout"

	// mongodb default transaction timeout is 1 minute.
	TransactionDefaultTimeout = 2 * time.Minute
)

transaction related

View Source
const (
	HostOSTypeEnumLinux   = "1"
	HostOSTypeEnumWindows = "2"
	HostOSTypeEnumAIX     = "3"
)

Host OS type enumeration value

View Source
const (
	MaxUint64  = ^uint64(0)
	MinUint64  = 0
	MaxInt64   = int64(MaxUint64 >> 1)
	MinInt64   = -MaxInt64 - 1
	MaxUint    = ^uint(0)
	MinUint    = 0
	MaxInt     = int(MaxUint >> 1)
	MinInt     = -MaxInt - 1
	MaxFloat64 = math.MaxFloat64
	MinFloat64 = -math.MaxFloat64
)

integer const

View Source
const (
	ConfigAdminID         = "configadmin"
	ConfigAdminValueField = "config"
)

config admin

View Source
const (
	// URLFilterWhiteList url filter white list not execute any filter
	// multiple url separated by commas
	URLFilterWhiteListSuffix = "/healthz,/version"

	URLFilterWhiteListSepareteChar = ","
)
View Source
const (
	BKDataStatusField   = "bk_data_status"
	BKDataRecoverSuffix = "(recover)"
)
View Source
const (
	BKNetDevice   = "net_device"
	BKNetProperty = "net_property"
)

netcollect

View Source
const (
	// login type
	BKBluekingLoginPluginVersion   = "blueking"
	BKOpenSourceLoginPluginVersion = "opensource"
	BKSkipLoginPluginVersion       = "skip-login"

	HTTPCookieBKToken = "bk_token"

	WEBSessionUinKey           = "username"
	WEBSessionChineseNameKey   = "chName"
	WEBSessionPhoneKey         = "phone"
	WEBSessionEmailKey         = "email"
	WEBSessionRoleKey          = "role"
	WEBSessionOwnerUinKey      = "owner_uin"
	WEBSessionOwnerUinListeKey = "owner_uin_list"
	WEBSessionAvatarUrlKey     = "avatar_url"
	WEBSessionMultiSupplierKey = "multisupplier"

	LoginSystemMultiSupplierTrue  = "1"
	LoginSystemMultiSupplierFalse = "0"

	LogoutHTTPSchemeCookieKey = "http_scheme"
	LogoutHTTPSchemeHTTP      = "http"
	LogoutHTTPSchemeHTTPS     = "https"
)
View Source
const (
	HostFieldDockerClientVersion = "docker_client_version"
	HostFieldDockerServerVersion = "docker_server_version"
)
View Source
const (
	BKProcInstanceOpUser             = "proc instance user"
	BKSynchronizeDataTaskDefaultUser = "synchronize task user"

	BKCloudSyncUser = "cloud_sync_user"
)
View Source
const (
	RedisProcSrvHostInstanceRefreshModuleKey  = BKCacheKeyV3Prefix + "prochostinstancerefresh:set"
	RedisProcSrvHostInstanceAllRefreshLockKey = BKCacheKeyV3Prefix + "lock:prochostinstancerefresh"
	RedisProcSrvQueryProcOPResultKey          = BKCacheKeyV3Prefix + "procsrv:query:opresult:set"
	RedisCloudSyncInstancePendingStart        = BKCacheKeyV3Prefix + "cloudsyncinstancependingstart:list"
	RedisCloudSyncInstanceStarted             = BKCacheKeyV3Prefix + "cloudsyncinstancestarted:list"
	RedisCloudSyncInstancePendingStop         = BKCacheKeyV3Prefix + "cloudsyncinstancependingstop:list"
	RedisMongoCacheSyncKey                    = BKCacheKeyV3Prefix + "mongodb:cache"
)
View Source
const (
	// the id of the association kind
	AssociationKindIDField    = "bk_asst_id"
	AssociationKindNameField  = "bk_asst_name"
	AssociationObjAsstIDField = "bk_obj_asst_id"
	AssociatedObjectIDField   = "bk_asst_obj_id"
)

association fields

View Source
const (
	AssociationKindMainline = "bk_mainline"
	AssociationTypeBelong   = "belong"
	AssociationTypeGroup    = "group"
	AssociationTypeRun      = "run"
	AssociationTypeConnect  = "connect"
	AssociationTypeDefault  = "default"
)

association

View Source
const (
	// MetaDataSynchronizeField Synchronous data aggregation field
	MetaDataSynchronizeField = "sync"
	// MetaDataSynchronizeFlagField synchronize flag
	MetaDataSynchronizeFlagField = "flag"
	// MetaDataSynchronizeVersionField synchronize version
	MetaDataSynchronizeVersionField = "version"
	// MetaDataSynchronizeIdentifierField 数据需要同步cmdb系统的身份标识, 值是数组
	MetaDataSynchronizeIdentifierField = "identifier"
	// MetaDataSynchronIdentifierFlagSyncAllValue 数据可以被任何系统同步
	MetaDataSynchronIdentifierFlagSyncAllValue = "__bk_cmdb__"

	// SynchronizeSignPrefix  synchronize sign , Should appear in the configuration file
	SynchronizeSignPrefix = "sync_blueking"

	// SynchronizeModelTypeClassification synchroneize model classification
	SynchronizeModelTypeClassification = "model_classification"
	// SynchronizeModelTypeAttribute synchroneize model attribute
	SynchronizeModelTypeAttribute = "model_attribute"
	// SynchronizeModelTypeAttributeGroup synchroneize model attribute group
	SynchronizeModelTypeAttributeGroup = "model_atrribute_group"
	// SynchronizeModelTypeBase synchroneize model attribute
	SynchronizeModelTypeBase = "model"

	// SynchronizeAssociationTypeModelHost synchroneize model ggroup
	SynchronizeAssociationTypeModelHost = "module_host"
)
View Source
const (
	AttributePlaceHolderMaxLength = 2000
	AttributeOptionMaxLength      = 2000
	AttributeIDMaxLength          = 128
	AttributeNameMaxLength        = 128
	AttributeUnitMaxLength        = 20
	AttributeOptionValueMaxLength = 128
	AttributeOptionArrayMaxLength = 200
	ServiceCategoryMaxLength      = 128
)
View Source
const (
	NameFieldMaxLength = 256

	// 用于表示还未设置服务模板的情况,比如没有绑定服务模板
	ServiceTemplateIDNotSet = 0
	SetTemplateIDNotSet     = 0

	MetadataLabelBiz = "metadata.label.bk_biz_id"

	DefaultServiceCategoryName = "Default"
)
View Source
const (
	ContextRequestIDField    = "request_id"
	ContextRequestUserField  = "request_user"
	ContextRequestOwnerField = "request_owner"
)
View Source
const (
	OperationCustom      = "custom"
	OperationReportType  = "report_type"
	OperationConfigID    = "config_id"
	BizModuleHostChart   = "biz_module_host_chart"
	HostOSChart          = "host_os_chart"
	HostBizChart         = "host_biz_chart"
	HostCloudChart       = "host_cloud_chart"
	HostChangeBizChart   = "host_change_biz_chart"
	ModelAndInstCount    = "model_and_inst_count"
	ModelInstChart       = "model_inst_chart"
	ModelInstChangeChart = "model_inst_change_chart"
	CreateObject         = "create object"
	DeleteObject         = "delete object"
	UpdateObject         = "update object"
	OperationDescription = "op_desc"
	OptionOther          = "其他"
	TimerPattern         = "^[\\d]+\\:[\\d]+$"
	SyncSetTaskName      = "sync-settemplate2set"

	BKHostState = "bk_state"
)
View Source
const (
	BKCloudAccountID             = "bk_account_id"
	BKCloudAccountName           = "bk_account_name"
	BKCloudVendor                = "bk_cloud_vendor"
	BKCloudSyncTaskName          = "bk_task_name"
	BKCloudSyncTaskID            = "bk_task_id"
	BKCloudSyncStatus            = "bk_sync_status"
	BKCloudSyncStatusDescription = "bk_status_description"
	BKCloudLastSyncTime          = "bk_last_sync_time"
	BKCreator                    = "bk_creator"
	BKStatus                     = "bk_status"
	BKStatusDetail               = "bk_status_detail"
	BKLastEditor                 = "bk_last_editor"
	BKSecretID                   = "bk_secret_id"
	BKVpcID                      = "bk_vpc_id"
	BKVpcName                    = "bk_vpc_name"
	BKRegion                     = "bk_region"
	BKCloudSyncVpcs              = "bk_sync_vpcs"

	// 是否为被销毁的云主机
	IsDestroyedCloudHost = "is_destroyed_cloud_host"
)

cloud sync const

View Source
const (
	BKCloudHostStatusUnknown   = "1"
	BKCloudHostStatusStarting  = "2"
	BKCloudHostStatusRunning   = "3"
	BKCloudHostStatusStopping  = "4"
	BKCloudHostStatusStopped   = "5"
	BKCloudHostStatusDestroyed = "6"
)
View Source
const (
	BKCloudAreaStatusNormal   = "1"
	BKCloudAreaStatusAbnormal = "2"
)
View Source
const (

	// CCSystemBusy the system is busy
	CCSystemBusy         = -1
	CCSystemUnknownError = -2
	CCSuccess            = 0
	CCSuccessStr         = "success"
	CCNoPermission       = 9900403

	// CCErrCommJSONUnmarshalFailed JSON deserialization failed
	CCErrCommJSONUnmarshalFailed = 1199000

	// CCErrCommJSONMarshalFailed JSON serialization failed
	CCErrCommJSONMarshalFailed = 1199001

	// CCErrCommHTTPDoRequestFailed the HTTP Request failed
	CCErrCommHTTPDoRequestFailed = 1199002

	// CCErrCommHTTPInputInvalid the input parameter is invalid, and the parameter here refers to the URL or Query parameter
	CCErrCommHTTPInputInvalid = 1199003

	// CCErrCommHTTPReadBodyFailed unable to read HTTP request body data
	CCErrCommHTTPReadBodyFailed = 1199004

	// CCErrCommHTTPBodyEmpty  HTTP request body data is not set
	CCErrCommHTTPBodyEmpty = 1199005

	// CCErrCommParamsInvalid parameter validation in the body is not pass
	CCErrCommParamsInvalid = 1199006

	// CCErrCommParamsNeedString  the parameter must be of type string
	CCErrCommParamsNeedString = 1199007

	// CCErrCommParamsLostField the parameter not specified
	CCErrCommParamsLostField = 1199008

	// CCErrCommParamsNeedInt the parameter must be of type int
	CCErrCommParamsNeedInt = 1199009

	// CCErrCommParamsNeedSet the parameter unassigned
	CCErrCommParamsNeedSet = 1199010

	// CCErrCommParamsIsInvalid the parameter is invalid or nonexistent
	CCErrCommParamsIsInvalid = 1199011

	// CCErrCommParseDataFailed failed to read data from data field
	CCErrCommParseDataFailed = 1199013

	// CCErrCommDuplicateItem duplicate data
	CCErrCommDuplicateItem = 1199014

	// CCErrCommOverLimit data length exceeds limit
	CCErrCommOverLimit = 1199015

	// CCErrFieldRegValidFailed regular verification failed
	CCErrFieldRegValidFailed = 1199016

	// CCErrCommDBSelectFailed database query failed
	CCErrCommDBSelectFailed = 1199017

	// CCErrCommDBInsertFailed database cannot add data
	CCErrCommDBInsertFailed = 1199018

	// CCErrCommNotFound the goal does not exist
	CCErrCommNotFound = 1199019

	// CCErrCommDBUpdateFailed database cannot update data
	CCErrCommDBUpdateFailed = 1199020

	// CCErrCommDBDeleteFailed database cannot delete data
	CCErrCommDBDeleteFailed = 1199021

	// CCErrCommRelyOnServerAddressFailed dependent service did not start
	CCErrCommRelyOnServerAddressFailed = 1199022

	// CCErrCommExcelTemplateFailed unable to generate and download
	CCErrCommExcelTemplateFailed = 1199023

	// CCErrCommParamsNeedTimeZone the parameter must be time zone type
	CCErrCommParamsNeedTimeZone = 1199024

	// CCErrCommParamsNeedBool the parameter must be bool type
	CCErrCommParamsNeedBool = 1199025

	// CCErrCommConfMissItem  missing configuration item
	CCErrCommConfMissItem = 1199026

	// CCErrCommNotAuthItem failed to get authorization information
	CCErrCommNotAuthItem = 1199027

	// CCErrCommNotAuthItem field validate failed
	CCErrCommFieldNotValid = 1199028

	// CCErrCommReplyDataFormatError Return data format error
	CCErrCommReplyDataFormatError = 1199029

	// CCErrCommReplyDataFormatError Return data format error
	CCErrCommPostInputParseError = 1199030

	// CCErrCommResourceInitFailed %s init failed
	CCErrCommResourceInitFailed = 1199031

	// CCErrCommParams should be string
	CCErrCommParamsShouldBeString = 1199032

	// CCErrCommSearchPropertyFailed get object property fields error
	CCErrCommSearchPropertyFailed = 1199033

	// CCErrCommParamsShouldBeEnum set enum
	CCErrCommParamsShouldBeEnum = 1199034

	// CCErrCommXXExceedLimit  xx exceed limit number
	CCErrCommXXExceedLimit = 1199035

	CCErrProxyRequestFailed      = 1199036
	CCErrRewriteRequestUriFailed = 1199037

	// CCErrCommLogicDataNil   need data %s is null
	CCErrCommInstDataNil = 1199038
	// CCErrCommInstFieldNotFound  %s field does not exist in %s
	CCErrCommInstFieldNotFound = 1199039
	// CCErrCommInstFieldConvertFail  convert %s  field %s to %s error %s
	CCErrCommInstFieldConvertFail = 1199040
	// CCErrCommUtilFail  handle %s error %s
	CCErrCommUtilHandleFail = 1199041
	// CCErrCommParamsNeedFloat the parameter must be float type
	CCErrCommParamsNeedFloat = 1199042
	// CCErrCommFieldNotValidFail  valid data error, %s
	CCErrCommFieldNotValidFail = 1199043

	CCErrCommNotAllSuccess = 1199044
	// parse auth attribute in api server rest filter failed.
	CCErrCommParseAuthAttributeFailed = 1199045

	// authorize request to auth center failed
	CCErrCommCheckAuthorizeFailed = 1199046

	// auth failed, do not have permission.
	CCErrCommAuthNotHavePermission = 1199047

	CCErrCommAuthorizeFailed             = 1199048
	CCErrCommRegistResourceToIAMFailed   = 1199049
	CCErrCommUnRegistResourceToIAMFailed = 1199050
	CCErrCommInappropriateVisitToIAM     = 1199051

	CCErrCommGetMultipleObject                = 1199052
	CCErrCommAuthCenterIsNotEnabled           = 1199053
	CCErrCommOperateBuiltInItemForbidden      = 1199054
	CCErrCommRemoveRecordHasChildrenForbidden = 1199055
	CCErrCommRemoveReferencedRecordForbidden  = 1199056
	CCErrCommParseBizIDFromMetadataInDBFailed = 1199057

	CCErrCommGenerateRecordIDFailed   = 1199058
	CCErrCommPageLimitIsExceeded      = 1199059
	CCErrCommUnexpectedParameterField = 1199060

	CCErrCommParseDBFailed                     = 1199061
	CCErrCommGetBusinessDefaultSetModuleFailed = 1199062

	CCErrCommParametersCountNotEnough         = 1199063
	CCErrCommFuncCalledWithInappropriateParam = 1199064

	// CCErrCommStartTransactionFailed start transaction failed
	CCErrCommStartTransactionFailed = 1199065
	// CCErrCommCommitTransactionFailed commit transaction failed
	CCErrCommCommitTransactionFailed = 1199066
	// CCErrCommAbortTransactionFailed abort transaction failed
	CCErrCommAbortTransactionFailed = 1199067

	CCErrCommListAuthorizedResourcedFromIAMFailed = 1199068
	CCErrParseAttrOptionEnumFailed                = 1199069

	// CCErrCommParamsNotSupportXXErr 参数%s的值%s 无效
	CCErrCommParamsValueInvalidError = 1199070

	// 构造DB查询条件失败
	CCErrConstructDBFilterFailed = 1199071
	CCErrGetNoAuthSkipURLFailed  = 1199072

	// CCErrCommValExceedMaxFailed %s field exceeds maximum value %v
	CCErrCommValExceedMaxFailed          = 1199073
	CCErrCommGlobalCCErrorNotInitialized = 1199074

	CCErrCommForbiddenOperateMainlineInstanceWithCommonAPI = 1199075
	CCErrTopoUpdateBuiltInCloudForbidden                   = 1199076

	// CCErrTopoModuleNotFoundError module [%s] does not exist in the business topology
	CCErrCommTopoModuleNotFoundError = 1199078
	// CCErrBizNotFoundError business [%s] does not exist
	CCErrCommBizNotFoundError      = 1199079
	CCErrParseAttrOptionListFailed = 1199080
	// one argument: maxValue
	CCErrExceedMaxOperationRecordsAtOnce = 1199081

	CCErrCommListAuthorizedResourceFromIAMFailed             = 1199082
	CCErrCommModifyFieldForbidden                            = 1199083
	CCErrCommForbiddenOperateInnerModelInstanceWithCommonAPI = 1199084
	CCErrCommUnexpectedFieldType                             = 1199085

	CCErrCommGetBusinessIDByHostIDFailed = 1199086

	// CCErrCommOPInProgressErr have the same task[%s] in progress
	CCErrCommOPInProgressErr = 1199087
	// CCErrCommRedisOPErr operate redis error.
	CCErrCommRedisOPErr = 1199088

	// CCErrArrayLengthWrong the length of the array is wrong
	CCErrArrayLengthWrong = 1199089

	// too many requests
	CCErrTooManyRequestErr = 1199997

	// unknown or unrecognized error
	CCErrorUnknownOrUnrecognizedError = 1199998

	// CCErrCommInternalServerError %s Internal Server Error
	CCErrCommInternalServerError = 1199999

	// apiserver 1100XXX
	CCErrAPIGetAuthorizedAppListFromAuthFailed = 1100001
	CCErrAPIGetUserResourceAuthStatusFailed    = 1100002
	CCErrAPINoObjectInstancesIsFound           = 1100003

	// toposerver 1101XXX
	// CCErrTopoInstCreateFailed unable to create the instance
	CCErrTopoInstCreateFailed = 1101000

	// CCErrTopoInstDeleteFailed unable to delete the instance
	CCErrTopoInstDeleteFailed = 1101001

	// CCErrTopoInstUpdateFailed unable to update the instance
	CCErrTopoInstUpdateFailed = 1101002

	// CCErrTopoInstSelectFailed unable to search the instance
	CCErrTopoInstSelectFailed = 1101003

	// CCErrTopoModuleCreateFailed unable to create a module
	CCErrTopoModuleCreateFailed = 1101004

	// CCErrTopoModuleDeleteFailed unable to delete a module
	CCErrTopoModuleDeleteFailed = 1101005

	// CCErrTopoModuleUpdateFailed unable to update a module
	CCErrTopoModuleUpdateFailed = 1101006

	// CCErrTopoModuleSelectFailed unable to select a module
	CCErrTopoModuleSelectFailed = 1101007

	// CCErrTopoSetCreateFailed unable to create a set
	CCErrTopoSetCreateFailed = 1101008

	// CCErrTopoSetDeleteFailed unable to delete a set
	CCErrTopoSetDeleteFailed = 1101009

	// CCErrTopoSetUpdateFailed unable to update a set
	CCErrTopoSetUpdateFailed = 1101010

	// CCErrTopoSetSelectFailed unable to select a set
	CCErrTopoSetSelectFailed = 1101011

	// CCErrTopoInstHasHostChild include hosts
	CCErrTopoInstHasHostChild = 1101012

	// CCErrTopoObjectCreateFailed unable to create a object
	CCErrTopoObjectCreateFailed = 1101013

	// CCErrTopoObjectDeleteFailed unable to delete a object
	CCErrTopoObjectDeleteFailed = 1101014

	// CCErrTopoObjectUpdateFailed unable to update a object
	CCErrTopoObjectUpdateFailed = 1101015

	// CCErrTopoObjectSelectFailed unable to select a object
	CCErrTopoObjectSelectFailed = 1101016

	// CCErrTopoObjectAttributeCreateFailed unable to create a object attribute
	CCErrTopoObjectAttributeCreateFailed = 1101017

	// CCErrTopoObjectAttributeDeleteFailed unable to delete a object attribute
	CCErrTopoObjectAttributeDeleteFailed = 1101018

	// CCErrTopoObjectAttributeUpdateFailed unable to update a object attribute
	CCErrTopoObjectAttributeUpdateFailed = 1101019

	// CCErrTopoObjectAttributeSelectFailed unable to select a object attribute
	CCErrTopoObjectAttributeSelectFailed = 1101020

	// CCErrTopoObjectClassificationCreateFailed unable to create a object classification
	CCErrTopoObjectClassificationCreateFailed = 1101021

	// CCErrTopoObjectClassificationDeleteFailed unbale to delete a object classification
	CCErrTopoObjectClassificationDeleteFailed = 1101022

	// CCErrTopoObjectClassificationUpdateFailed unable to update a object classification
	CCErrTopoObjectClassificationUpdateFailed = 1101023

	// CCErrTopoObjectClassificationSelectFailed unable to select a object classification
	CCErrTopoObjectClassificationSelectFailed = 1101024

	// CCErrTopoObjectGroupCreateFailed unable to create object group
	CCErrTopoObjectGroupCreateFailed = 1101025

	// CCErrTopoObjectGroupDeleteFailed unable to delete a object group
	CCErrTopoObjectGroupDeleteFailed = 1101026

	// CCErrTopoObjectGroupUpdateFailed unable to update a object group
	CCErrTopoObjectGroupUpdateFailed = 1101027

	// CCErrTopoObjectGroupSelectFailed unable to select a object group
	CCErrTopoObjectGroupSelectFailed = 1101028

	// CCErrTopoObjectClassificationHasObject the object classification can't be deleted under classification
	CCErrTopoObjectClassificationHasObject = 1101029

	// CCErrTopoHasHostCheckFailed cannot detect if host information is included
	CCErrTopoHasHostCheckFailed = 1101030

	// CCErrTopoHasHost include host
	CCErrTopoHasHost = 1101030

	// CCErrTopoGetCloudErrStrFailed get cloud error
	CCErrTopoGetCloudErrStrFailed = 1101031
	// CCErrTopoCloudNotFound   cloud area not found
	CCErrTopoCloudNotFound = 1101032

	// CCErrTopoGetAppFailed search app err %s
	CCErrTopoGetAppFailed = 1101033
	// CCErrTopoGetModuleFailed search  module err %s
	CCErrTopoGetModuleFailed = 1101034
	// CCErrTopoBizTopoOverLevel the mainline topo level over limit
	CCErrTopoBizTopoLevelOverLimit = 1101035
	// CCErrTopoInstHasBeenAssociation the instance has been associated
	CCErrTopoInstHasBeenAssociation = 1101036
	// it is forbidden to delete , that has some insts
	CCErrTopoObjectHasSomeInstsForbiddenToDelete = 1101037
	// the associations %s->%s already exist
	CCErrTopoAssociationAlreadyExist = 1101038
	// the source association object does not exist
	CCErrTopoAssociationSourceObjectNotExist = 1101039
	// the destination association object does not exist
	CCErrTopoAssociationDestinationObjectNotExist = 1101040
	// invalid object association id, should be int64
	CCErrTopoInvalidObjectAssociationID = 1101041
	// got multiple object association with one association id
	CCErrTopoGotMultipleAssociationInstance = 1101042
	// association with a object has multiple instance, can not be deleted.
	CCErrTopoAssociationHasAlreadyBeenInstantiated = 1101043
	// get association kind with id failed.
	CCErrTopoGetAssociationKindFailed = 1101044
	// create object association missing object kind id, src object id or destination object id.
	CCErrorTopoAssociationMissingParameters = 1101045
	// the given association id does not exist.
	CCErrorTopoObjectAssociationNotExist = 1101046
	// update object association, but update fields that can not be updated.
	CCErrorTopoObjectAssociationUpdateForbiddenFields = 1101047
	// mainline object association do not exist
	CCErrorTopoMainlineObjectAssociationNotExist = 1101048
	// CCErrorTopoImportAssociation  import association error
	CCErrorTopoImportAssociation = 1101049
	// got multiple association kind with a id
	CCErrorTopoGetMultipleAssocKindInstWithOneID = 1101050
	// delete a pre-defined association kind.
	CCErrorTopoDeletePredefinedAssociationKind = 1101051
	// create new instance for a new association, but association map is 1:1
	CCErrorTopoCreateMultipleInstancesForOneToOneAssociation = 1101052
	// the object has associate to another object, or has been associated by another one.
	CCErrorTopoObjectHasAlreadyAssociated = 1101053
	// update a pre-defined association, it's forbidden.
	CCErrorTopoUpdatePredefinedAssociation = 1101054
	// can not delete a pre-defined association.
	CCErrorTopoDeletePredefinedAssociation = 1101055
	// association do not exist.
	CCErrorTopoAssociationDoNotExist = 1101056
	// create model's instance batch, but instance's data missing field bk_inst_name
	CCErrorTopoObjectInstanceMissingInstanceNameField = 1101057
	// object instance's bk_inst_name filed is not string
	CCErrorTopoInvalidObjectInstanceNameFieldValue = 1101058
	// create model's instance patch, but instance's name is duplicate.
	CCErrorTopoMultipleObjectInstanceName = 1101059

	CCErrorTopoAssociationKindHasBeenUsed                     = 1101060
	CCErrorTopoCreateMultipleInstancesForOneToManyAssociation = 1101061
	CCErrTopoAppDeleteFailed                                  = 1101131
	CCErrTopoAppUpdateFailed                                  = 1101132
	CCErrTopoAppSearchFailed                                  = 1101133
	CCErrTopoAppCreateFailed                                  = 1101134
	CCErrTopoForbiddenToDeleteModelFailed                     = 1101135
	CCErrTopoMainlineCreatFailed                              = 1101137
	CCErrTopoMainlineDeleteFailed                             = 1101138
	CCErrTopoMainlineSelectFailed                             = 1101139
	CCErrTopoTopoSelectFailed                                 = 1101140
	CCErrTopoDeleteMainLineObjectAndInstNameRepeat            = 1101149
	CCErrHostNotAllowedToMutiBiz                              = 1101150
	CCErrTopoGraphicsSearchFailed                             = 1101151
	CCErrTopoGraphicsUpdateFailed                             = 1101152
	CCErrTopoObjectUniqueCreateFailed                         = 1101160
	CCErrTopoObjectUniqueUpdateFailed                         = 1101161
	CCErrTopoObjectUniqueDeleteFailed                         = 1101162
	CCErrTopoObjectUniqueSearchFailed                         = 1101163
	CCErrTopoObjectPropertyNotFound                           = 1101164
	CCErrTopoObjectPropertyUsedByUnique                       = 1101165
	CCErrTopoObjectUniqueKeyKindInvalid                       = 1101166
	CCErrTopoObjectUniquePresetCouldNotDelOrEdit              = 1101167
	CCErrTopoObjectUniqueCanNotHasMultipleMustCheck           = 1101168
	CCErrTopoObjectUniqueShouldHaveMoreThanOne                = 1101069
	// association kind has been apply to object
	CCErrorTopoAssKindHasApplyToObject = 1101070
	// pre definition association kind can not be delete
	CCErrorTopoPreAssKindCanNotBeDelete = 1101071
	CCErrorTopoAsstKindIsNotExist       = 1101072
	CCErrorAsstInstIsNotExist           = 1101073
	CCErrorInstToAsstIsNotExist         = 1101074
	CCErrorInstHasAsst                  = 1101075
	CCErrTopoCreateAssocKindFailed      = 1101076
	CCErrTopoUpdateAssoKindFailed       = 1101077
	CCErrTopoDeleteAssoKindFailed       = 1101078
	CCErrTopoModuleIDNotfoundFailed     = 1101080
	CCErrTopoBkAppNotAllowedDelete      = 1101081
	// CCErrorTopoAssociationKindMainlineUnavailable can't use bk_mainline in this case
	CCErrorTopoAssociationKindMainlineUnavailable = 1101082
	// CCErrorTopoAssociationKindInconsistent means AssociationKind parameter Inconsistent with caller method
	CCErrorTopoAssociationKindInconsistent = 1101083
	// CCErrorTopoModelStopped means model have been stopped to use
	CCErrorTopoModelStopped = 1101084
	// mainline's object unique can not be updated, deleted or create new rules.
	CCErrorTopoMainlineObjectCanNotBeChanged   = 1101085
	CCErrorTopoGetAuthorizedBusinessListFailed = 1101086
	CCErrTopoArchiveBusinessHasHost            = 1101087

	CCErrorTopoFullTextFindErr              = 1101088
	CCErrorTopoFullTextClientNotInitialized = 1101089

	CCErrorTopoUpdateModuleFromTplServiceCategoryForbidden = 1101090
	CCErrorTopoUpdateModuleFromTplNameForbidden            = 1101091
	CCErrTopoCanNotAddRequiredAttributeForMainlineModel    = 1101092
	CCErrorTopoObjectInstanceObjIDFieldConflictWithURL     = 1101093
	CCErrTopoImportMainlineForbidden                       = 1101094

	CCErrorTopoSyncModuleTaskFailed    = 1101095
	CCErrorTopoSyncModuleTaskIsRunning = 1101096

	CCErrorTopoForbiddenOperateModuleOnSetInitializedByTemplate = 1101097
	CCErrorTopoForbiddenDeleteBuiltInSetModule                  = 1101098
	CCErrorTopoModuleNameDuplicated                             = 1101099

	CCErrorTopoPathParamPaserFailed                = 1101100
	CCErrorTopoSearchModelAttriFailedPleaseRefresh = 1101101
	CCErrorTopoOnlyResourceDirNameCanBeUpdated     = 1101102
	CCErrorTopoOperateReourceDirFailNotExist       = 1101103
	CCErrorTopoResourceDirIdleModuleCanNotRemove   = 1101104
	CCErrorTopoResourceDirUsedInCloudSync          = 1101105

	CCErrorModelNotFound = 1101102

	// CCErrObjectPropertyGroupInsertFailed failed to save the property group
	CCErrObjectPropertyGroupInsertFailed = 1102000
	// CCErrObjectPropertyGroupDeleteFailed failed to delete the property group
	CCErrObjectPropertyGroupDeleteFailed = 1102001
	// CCErrObjectPropertyGroupSelectFailed failed to select the property group
	CCErrObjectPropertyGroupSelectFailed = 1102002
	// CCErrObjectPropertyGroupUpdateFailed failed to update the filed
	CCErrObjectPropertyGroupUpdateFailed = 1102003

	CCErrObjectCreateInstFailed       = 1102004
	CCErrObjectUpdateInstFailed       = 1102005
	CCErrObjectDeleteInstFailed       = 1102006
	CCErrObjectSelectInstFailed       = 1102007
	CCErrObjectSelectIdentifierFailed = 1102008

	// CCErrObjectDBOpErrno failed to operation database
	CCErrObjectDBOpErrno = 1102004

	// event_server 1103XXX
	// CCErrEventSubscribeInsertFailed failed to save the Subscribe
	CCErrEventSubscribeInsertFailed = 1103000

	// CCErrEventSubscribeDeleteFailed failed to delete the Subscribe
	CCErrEventSubscribeDeleteFailed = 1103001

	// CCErrEventSubscribeSelectFailed failed to select the Subscribe
	CCErrEventSubscribeSelectFailed = 1103002

	// CCErrEventSubscribeUpdateFailed failed to update the filed
	CCErrEventSubscribeUpdateFailed = 1103003

	// CCErrEventSubscribePingFailed failed to ping the target
	CCErrEventSubscribePingFailed = 1103004
	// CCErrEventSubscribePingFailed failed to telnet the target
	CCErrEventSubscribeTelnetFailed = 1103005
	// CCErrEventOperateSuccessBUtSentEventFailed failed to sent event
	CCErrEventPushEventFailed = 1103006

	// host 1104XXX
	CCErrHostModuleRelationAddFailed = 1104000

	// migrate 1105XXX
	//  CCErrCommMigrateFailed failed to migrate
	CCErrCommMigrateFailed        = 1105000
	CCErrCommInitAuthCenterFailed = 1105001

	// host controller 1106XXX
	CCErrHostSelectInst                  = 1106000
	CCErrHostCreateInst                  = 1106002
	CCErrHostGetSnapshot                 = 1106003
	CCErrHostTransferModule              = 1106004
	CCErrDelDefaultModuleHostConfig      = 1106005
	CCErrGetModule                       = 1106006
	CCErrDelOriginHostModuelRelationship = 1106007
	CCErrGetOriginHostModuelRelationship = 1106008
	CCErrTransferHostFromPool            = 1106009
	CCErrAlreadyAssign                   = 1106010
	CCErrNotBelongToIdleModule           = 1106011
	CCErrTransfer2ResourcePool           = 1106012
	CCErrCreateUserCustom                = 1106013
	CCErrHostFavouriteQueryFail          = 1106014
	CCErrHostFavouriteCreateFail         = 1106015
	CCErrHostFavouriteUpdateFail         = 1106016
	CCErrHostFavouriteDeleteFail         = 1106017
	CCErrHostFavouriteDupFail            = 1106018
	CCErrHostGetSnapshotChannelEmpty     = 1106019
	CCErrHostGetSnapshotChannelClose     = 1106020
	CCErrCloudCreateSyncTaskFail         = 1106021
	CCErrCloudConfirmHistoryAddFail      = 1106022
	CCErrCloudSyncHistorySearchFail      = 1106023
	CCErrHostGetSnapshotBatch            = 1106024

	// process controller 1107XXX
	CCErrProcDeleteProc2Module   = 1107001
	CCErrProcCreateProc2Module   = 1107002
	CCErrProcSelectProc2Module   = 1107003
	CCErrProcCreateProcConf      = 1107004
	CCErrProcDeleteProcConf      = 1107005
	CCErrProcGetProcConf         = 1107006
	CCErrProcUpdateProcConf      = 1107007
	CCErrProcCreateInstanceModel = 1107008
	CCErrProcGetInstanceModel    = 1107009
	CCErrProcDeleteInstanceModel = 1107010
	CCErrProcDeleteProc2Template = 1107011
	CCErrProcCreateProc2Template = 1107012
	CCErrProcSelectProc2Template = 1107013

	// process server 1108XXX
	CCErrProcSearchDetailFaile          = 1108001
	CCErrProcBindToMoudleFaile          = 1108002
	CCErrProcUnBindToMoudleFaile        = 1108003
	CCErrProcSelectBindToMoudleFaile    = 1108004
	CCErrProcUpdateProcessFailed        = 1108005
	CCErrProcSearchProcessFailed        = 1108006
	CCErrProcDeleteProcessFailed        = 1108007
	CCErrProcCreateProcessFailed        = 1108008
	CCErrProcFieldValidFaile            = 1108009
	CCErrProcGetByApplicationIDFail     = 1108010
	CCErrProcGetByIP                    = 1108011
	CCErrProcOperateFaile               = 1108012
	CCErrProcBindWithModule             = 1108013
	CCErrProcDeleteTemplateFail         = 1108014
	CCErrProcUpdateTemplateFail         = 1108015
	CCErrProcSearchTemplateFail         = 1108016
	CCErrProcBindToTemplateFailed       = 1108017
	CCErrProcUnBindToTemplateFailed     = 1108018
	CCErrProcSelectBindToTemplateFailed = 1108019
	CCErrProcQueryTaskInfoFail          = 1108020
	CCErrProcQueryTaskWaitOPFail        = 1108021
	CCErrProcQueryTaskOPErrFail         = 1108022
	CCErrProcCreateTemplateFail         = 1108023

	CCErrProcGetServiceInstancesFailed                    = 1108024
	CCErrProcCreateServiceInstancesFailed                 = 1108025
	CCErrProcDeleteServiceInstancesFailed                 = 1108026
	CCErrProcGetProcessTemplatesFailed                    = 1108027
	CCErrProcGetProcessInstanceFailed                     = 1108028
	CCErrProcGetProcessInstanceRelationFailed             = 1108029
	CCErrProcDeleteServiceTemplateFailed                  = 1108030
	CCErrProcCreateProcessTemplateFailed                  = 1108031
	CCErrProcUpdateProcessTemplateFailed                  = 1108032
	CCErrProcGetProcessTemplateFailed                     = 1108033
	CCErrProcGetDefaultServiceCategoryFailed              = 1108034
	CCErrProcEditProcessInstanceCreateByTemplateForbidden = 1108035
	CCErrProcServiceTemplateAndCategoryNotCoincide        = 1108036
	CCErrProcModuleNotBindWithTemplate                    = 1108037
	CCErrCreateServiceInstanceWithWrongHTTPMethod         = 1108038
	CCErrCreateRawProcessInstanceOnTemplateInstance       = 1108039
	CCErrProcRemoveTemplateBindingOnModule                = 1108040
	CCErrProcReconstructServiceInstanceNameFailed         = 1108041

	CCErrProcUnbindModuleServiceTemplateDisabled = 1108042
	CCErrProcGetServiceCategoryFailed            = 1108043

	CCErrHostTransferFinalModuleConflict = 1108044

	// audit log 1109XXX
	CCErrAuditSaveLogFailed      = 1109001
	CCErrAuditTakeSnapshotFailed = 1109002
	CCErrAuditSelectFailed       = 1109003

	// host server
	CCErrHostGetFail              = 1110001
	CCErrHostUpdateFail           = 1110002
	CCErrHostUpdateFieldFail      = 1110003
	CCErrHostCreateFail           = 1110004
	CCErrHostModifyFail           = 1110005
	CCErrHostDeleteFail           = 1110006
	CCErrHostFiledValdFail        = 1110007
	CCErrHostNotFound             = 1110008
	CCErrHostLength               = 1110009
	CCErrHostDetailFail           = 1111011
	CCErrHostSnap                 = 1110011
	CCErrHostFeildValidFail       = 1110012
	CCErrHostFavCreateFail        = 1110013
	CCErrHostEmptyFavName         = 1110014
	CCErrHostFavUpdateFail        = 1110015
	CCErrHostFavDeleteFail        = 1110016
	CCErrHostFavGetFail           = 1110017
	CCErrHostHisCreateFail        = 1110018
	CCErrHostHisGetFail           = 1110019
	CCErrHostCustomCreateFail     = 1110020
	CCErrHostCustomGetFail        = 1110021
	CCErrHostCustomGetDefaultFail = 1110022
	CCErrHostNotINAPP             = 1110023
	CCErrHostNotINAPPFail         = 1110024
	CCErrHostDELResourcePool      = 1110025
	CCErrHostAddRelationFail      = 1110026
	CCErrHostMoveResourcePoolFail = 1110027
	CCErrHostEditRelationPoolFail = 1110028
	CCErrAddHostToModule          = 1110029
	CCErrAddHostToModuleFailStr   = 1110030

	// hostserver api machinery new error code
	CCErrAddUserCustomQueryFailed       = 1110040
	CCErrUpdateUserCustomQueryFailed    = 1110041
	CCErrDeleteUserCustomQueryFailed    = 1110042
	CCErrSearchUserCustomQueryFailed    = 1110043
	CCErrGetUserCustomQueryDetailFailed = 1110044
	CCErrHostModuleConfigFailed         = 1110045
	CCErrHostGetSetFailed               = 1110046
	CCErrHostGetAPPFail                 = 1110047
	CCErrHostAPPNotFoundFail            = 1110048
	CCErrHostGetModuleFail              = 1110049
	CCErrHostAgentStatusFail            = 1110050
	// CCErrHostNotResourceFail The resource pool was not found"
	CCErrHostNotResourceFail = 1110051
	// CCErrHostBelongResourceFail The host is already in the resource pool
	CCErrHostBelongResourceFail = 1110052
	// CCErrHostGetResourceFail failed to get resource pool information, error message: %s
	CCErrHostGetResourceFail = 1110053
	// CCErrHostModuleNotExist get %s module not found
	CCErrHostModuleNotExist = 1110054
	// CCErrDeleteHostFromBusiness Delete the host under the business
	CCErrDeleteHostFromBusiness = 1110055
	// CCErrHostModuleConfigNotMatch hostID[%#v] not belong to business
	CCErrHostModuleConfigNotMatch = 1110056
	// CCErrHostModuleIDNotFoundORHasMultipleInnerModuleIDFailed Module does not exist or there are multiple built-in modules
	CCErrHostModuleIDNotFoundORHasMultipleInnerModuleIDFailed = 1110057
	CCErrHostSearchNeedObjectInstIDErr                        = 1110058
	CCErrHostSetNotExist                                      = 1110059
	CCErrHostSetNotBelongBusinessErr                          = 1110060
	CCErrHostModuleNotBelongBusinessErr                       = 1110061
	CCErrHostModuleNotBelongSetErr                            = 1110062
	CCErrHostPlatCloudNameIsrequired                          = 1110063
	CCErrHostPlatCloudNameAlreadyExist                        = 1110064
	CCErrHostFindManyCloudAreaAddHostCountFieldFail           = 1110065
	CCErrDeleteDefaultCloudAreaFail                           = 1110066
	CCErrHostFindManyCloudAreaAddSyncTaskIDsFieldFail         = 1110067

	// web 1111XXX
	CCErrWebFileNoFound                 = 1111001
	CCErrWebFileSaveFail                = 1111002
	CCErrWebOpenFileFail                = 1111003
	CCErrWebFileContentEmpty            = 1111004
	CCErrWebFileContentFail             = 1111005
	CCErrWebGetHostFail                 = 1111006
	CCErrWebCreateEXCELFail             = 1111007
	CCErrWebGetObjectFail               = 1111008
	CCErrWebGetAddNetDeviceResultFail   = 1111009
	CCErrWebGetAddNetPropertyResultFail = 1111010
	CCErrWebGetNetDeviceFail            = 1111011
	CCErrWebGetNetPropertyFail          = 1111012
	CCErrWebNeedFillinUsernamePasswd    = 1111013
	CCErrWebUsernamePasswdWrong         = 1111014
	CCErrWebNoUsernamePasswd            = 1111015
	CCErrWebUserinfoFormatWrong         = 1111016
	CCErrWebUnknownLoginVersion         = 1111017

	// datacollection 1112xxx
	CCErrCollectNetDeviceCreateFail            = 1112000
	CCErrCollectNetDeviceGetFail               = 1112001
	CCErrCollectNetDeviceDeleteFail            = 1112002
	CCErrCollectObjIDNotNetDevice              = 1112003
	CCErrCollectNetPropertyCreateFail          = 1112004
	CCErrCollectNetPropertyGetFail             = 1112005
	CCErrCollectNetPropertyDeleteFail          = 1112006
	CCErrCollectNetDeviceObjPropertyNotExist   = 1112007
	CCErrCollectDeviceNotExist                 = 1112008
	CCErrCollectPeriodFormatFail               = 1112009
	CCErrCollectNetDeviceHasPropertyDeleteFail = 1112010
	CCErrCollectNetCollectorSearchFail         = 1112011
	CCErrCollectNetCollectorUpdateFail         = 1112012
	CCErrCollectNetCollectorDiscoverFail       = 1112013
	CCErrCollectNetReportSearchFail            = 1112014
	CCErrCollectNetReportConfirmFail           = 1112015
	CCErrCollectNetHistorySearchFail           = 1112016
	CCErrCollectNetDeviceUpdateFail            = 1112017
	CCErrCollectNetPropertyUpdateFail          = 1112018

	// coreservice 1113xxx
	// CCErrorModelAttributeGroupHasSomeAttributes the group has some attributes
	CCErrCoreServiceModelAttributeGroupHasSomeAttributes = 1113001

	// CCErrCoreServiceHostNotBelongBusiness hostID [%#v] does not belong of  businessID [%d]
	CCErrCoreServiceHostNotBelongBusiness = 1113002
	// CCErrCoreServiceHostNotExist hostID [%#v] does not exist
	CCErrCoreServiceHostNotExist = 1113003
	// ModuleID [%#v] has not belong of  businessID [%d]
	CCErrCoreServiceHasModuleNotBelongBusiness = 1113004
	// CCErrCoreServiceModuleContainDefaultModuleErr  translate host to multiple module not contain default module
	CCErrCoreServiceModuleContainDefaultModuleErr = 1113005
	// CCErrCoreServiceBusinessNotExist Business [%#v] does not exist
	CCErrCoreServiceBusinessNotExist = 1113006
	// CCErrCoreServiceDefaultModuleNotExist Business [%#v] default module does not exist
	CCErrCoreServiceDefaultModuleNotExist = 1113007
	// CCErrCoreServiceModuleNotDefaultModuleErr   businessID [%d] of moduleID[%d] not default module
	CCErrCoreServiceModuleNotDefaultModuleErr = 1113008
	// CCErrCoreServiceTransferHostModuleErr   transfer module host config error. error detail in return data
	CCErrCoreServiceTransferHostModuleErr = 1113009
	// CCErrCoreServiceEventPushEventFailed failed to sent event
	CCErrCoreServiceEventPushEventFailed = 1113010

	// 禁止释放(转移到空闲机/故障机/资源池)已关联到服务实例的主机
	CCErrCoreServiceForbiddenReleaseHostReferencedByServiceInstance = 1113011

	CCErrHostRemoveFromDefaultModuleFailed                                    = 1113012
	CCErrCoreServiceTransferToDefaultModuleUseWrongMethod                     = 1113013
	CCErrCoreServiceModuleWithoutServiceTemplateCouldNotCreateServiceInstance = 1113014
	CCErrCoreServiceModuleNotFound                                            = 1113015
	CCErrCoreServiceInstanceAlreadyExist                                      = 1113016
	CCErrCoreServiceServiceCategoryNameDuplicated                             = 1113017
	CCErrCoreServiceModuleAndServiceInstanceTemplateNotCoincide               = 1113018
	CCErrCoreServiceProcessNameDuplicated                                     = 1113019
	CCErrCoreServiceFuncNameDuplicated                                        = 1113020
	CCErrCoreServiceModuleNotBoundWithTemplate                                = 1113021
	CCErrCoreServiceShouldNotRemoveProcessCreateByTemplate                    = 1113022
	// CCErrCoreServiceDeleteMultpleObjectIDRecordErr 删除多个模型中的%s数据
	CCErrCoreServiceDeleteMultpleObjectIDRecordErr = 1113023
	// CCErrCoreServiceDeleteMultipleObjectIDRecordErr 不允许删除在唯一校验中的字段
	CCErrCoreServiceNotAllowUniqueAttr = 1113024
	// CCErrCoreServiceNotUpdatePredefinedAttrErr 修改不允许修改的属性的描述
	CCErrCoreServiceNotUpdatePredefinedAttrErr = 1113025
	// CCErrCoreServiceNotAllowAddRequiredFieldErr 模型[%s]不允许新加必填字段
	CCErrCoreServiceNotAllowAddRequiredFieldErr = 1113026
	// CCErrCoreServiceNotAllowAddRequiredFieldErr 模型[%s]不允许修改必填字段
	CCErrCoreServiceNotAllowChangeRequiredFieldErr = 1113027
	// CCErrCoreServiceNotAllowAddFieldErr 模型[%s]不允许新加字段
	CCErrCoreServiceNotAllowAddFieldErr = 1113028
	// CCErrCoreServiceNotAllowDeleteErr 模型【%s】不允许删除
	CCErrCoreServiceNotAllowDeleteErr = 1113029
	// CCErrCoreServiceModelHasInstanceErr 模型下有示例数据
	CCErrCoreServiceModelHasInstanceErr = 1113030
	// CCErrCoreServiceModelHasAssociationErr 模型与其他模型有关联关系
	CCErrCoreServiceModelHasAssociationErr           = 1113031
	CCErrCoreServiceOnlyNodeServiceCategoryAvailable = 1113032
	// SearchTopoTreeScanTooManyData means hit too many data, we return directly.
	SearchTopoTreeScanTooManyData = 1113033

	// CCERrrCoreServiceUniqueRuleExist 模型唯一校验规则已经存在
	CCERrrCoreServiceSameUniqueCheckRuleExist = 1113050
	// CCErrCoreServiceResourceDirectoryNotExistErr 资源池目录不存在
	CCErrCoreServiceResourceDirectoryNotExistErr = 1113033
	// CCErrCoreServiceHostNotUnderAnyResourceDirectory 主机不在任意资源池目录下
	CCErrCoreServiceHostNotUnderAnyResourceDirectory = 11130034

	// synchronize data core service  11139xx
	CCErrCoreServiceSyncError = 1113900
	// CCErrCoreServiceSyncDataClassifyNotExistError %s type data synchronization, data of the same type %s does not exist
	CCErrCoreServiceSyncDataClassifyNotExistError = 1113901

	CCErrSynchronizeError = 1113903

	// operation_server 1116xxx
	CCErrOperationBizModuleHostAmountFail = 1116001
	CCErrOperationNewAddStatisticFail     = 1116002
	CCErrOperationChartAlreadyExist       = 1116003
	CCErrOperationDeleteChartFail         = 1116004
	CCErrOperationSearchChartFail         = 1116005
	CCErrOperationUpdateChartFail         = 1116006
	CCErrOperationGetChartDataFail        = 1116007
	CCErrOperationUpdateChartPositionFail = 1116008

	// task_server 1117xxx
	// CCErrTaskNotFound task not found
	CCErrTaskNotFound = 1117001
	// CCErrTaskSubTaskNotFound sub task not found
	CCErrTaskSubTaskNotFound = 1117002
	// CCErrTaskStatusNotAllowChangeTo task not allow status change to xx
	CCErrTaskStatusNotAllowChangeTo = 1117003
	// CCErrTaskErrResponseEmtpyFail error response empty
	CCErrTaskErrResponseEmtpyFail = 1117004
	CCErrTaskLockedTaskFail       = 1117005
	CCErrTaskUnLockedTaskFail     = 1117006
	CCErrTaskListTaskFail         = 1117007

	// cloud_server 1118xxx
	// CCErrCloudVendorNotSupport cloud vendor not support
	CCErrCloudVendorNotSupport                = 1118001
	CCErrCloudAccountNameAlreadyExist         = 1118002
	CCErrCloudValidAccountParamFail           = 1118003
	CCErrCloudAccountIDNoExistFail            = 1118004
	CCErrCloudSyncTaskNameAlreadyExist        = 1118005
	CCErrCloudValidSyncTaskParamFail          = 1118006
	CCErrCloudVpcIDIsRequired                 = 1118007
	CCErrCloudVendorInterfaceCalledFailed     = 1118008
	CCErrCloudAccountSecretIDAlreadyExist     = 1118009
	CCErrCloudTaskAlreadyExistInAccount       = 1118010
	CCErrCloudAccoutIDSecretWrong             = 1118011
	CCErrCloudHttpRequestTimeout              = 1118012
	CCErrCloudVpcGetFail                      = 1118013
	CCErrCloudRegionGetFail                   = 1118014
	CCErrCloudSyncDirNoChosen                 = 1118015
	CCErrCloudSyncDirNoExist                  = 1118016
	CCErrCloudIDNoProvided                    = 1118017
	CCErrCloudIDNoExist                       = 1118018
	CCErrDefaultCloudIDProvided               = 1118019
	CCErrCloudAccountCreateFail               = 1118020
	CCErrGetCloudAccountConfBatchFailed       = 1118021
	CCErrDeleteDestroyedHostRelatedFailed     = 1118022
	CCErrCloudAccountDeletedFailedForSyncTask = 1118023

	// json
	CCErrCommJsonDecode    = 3001
	CCErrCommJsonDecodeStr = "json decode failed!"
	CCErrCommJsonEncode    = 3002
	CCErrCommJsonEncodeStr = "json encode failed!"

	JsonMarshalErr    = 9000
	JsonMarshalErrStr = "json marshal error"
)

CC error number defined in this file Errno name is composed of the following format CCErr[XXX]

View Source
const (
	BkSupplierAccount = "bk_supplier_account"

	IndexAggName  = "index_agg"
	IndexAggField = "_index"
)
View Source
const (
	// PatternIP regular pattern for ip
	PatternIP = `^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.((1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.){2}(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$`
	// PatternMultipleIP regular pattern for Multiple ip
	PatternMultipleIP = `` /* 246-byte string literal not displayed */
	// PatternPort regular pattern for port range
	PatternPort = `(([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5]))`
)
View Source
const (
	// BKTableNameProcModule the table name of the process module
	BKTableNameProcModule = "cc_Proc2Module"

	// BKTableNameProcTemplate the table name of the process template config
	BKTableNameProcTemplate = "cc_Proc2Template"

	// BKTableNameProcInstanceModel the table name of the process instance
	BKTableNameProcInstanceModel = "cc_ProcInstanceModel"

	// BKTableNameProcInstanceDetail  the table name of the process instance detail
	BKTableNameProcInstanceDetail = "cc_ProcInstanceDetail"

	// BKTableNameProcOperateTask  the table name of the process instance operater task info
	BKTableNameProcOperateTask = "cc_ProcOpTask"

	// BKTableNamePropertyGroup the table name of the property group
	BKTableNamePropertyGroup = "cc_PropertyGroup"

	// BKTableNameObjDes the table name of the asst des
	BKTableNameAsstDes = "cc_AsstDes"

	// BKTableNameObjDes the table name of the object
	BKTableNameObjDes = "cc_ObjDes"

	// BKTableNameObjDes the table name of the object
	BKTableNameObjUnique = "cc_ObjectUnique"

	// BKTableNameObjAttDes the table name of the object attribute
	BKTableNameObjAttDes = "cc_ObjAttDes"

	// BKTableNameObjClassification the table name of the object classification
	BKTableNameObjClassification = "cc_ObjClassification"

	// BKTableNameInstAsst the table name of the inst association
	BKTableNameInstAsst = "cc_InstAsst"

	BKTableNameBaseApp     = "cc_ApplicationBase"
	BKTableNameBaseHost    = "cc_HostBase"
	BKTableNameBaseModule  = "cc_ModuleBase"
	BKTableNameBaseInst    = "cc_ObjectBase"
	BKTableNameBasePlat    = "cc_PlatBase"
	BKTableNameBaseSet     = "cc_SetBase"
	BKTableNameBaseProcess = "cc_Process"
	BKTableNameDelArchive  = "cc_DelArchive"

	BKTableNameModuleHostConfig = "cc_ModuleHostConfig"
	BKTableNameSystem           = "cc_System"
	BKTableNameHistory          = "cc_History"
	BKTableNameHostFavorite     = "cc_HostFavourite"
	BKTableNameAuditLog         = "cc_AuditLog"
	BKTableNameSubscription     = "cc_Subscription"
	BKTableNameUserAPI          = "cc_UserAPI"
	BKTableNameUserCustom       = "cc_UserCustom"
	BKTableNameObjAsst          = "cc_ObjAsst"
	BKTableNameTopoGraphics     = "cc_TopoGraphics"
	BKTableNameTransaction      = "cc_Transaction"
	BKTableNameIDgenerator      = "cc_idgenerator"

	BKTableNameNetcollectDevice   = "cc_NetcollectDevice"
	BKTableNameNetcollectProperty = "cc_NetcollectProperty"

	BKTableNameNetcollectConfig  = "cc_NetcollectConfig"
	BKTableNameNetcollectReport  = "cc_NetcollectReport"
	BKTableNameNetcollectHistory = "cc_NetcollectHistory"

	BKTableNameHostLock = "cc_HostLock"

	// Operation tables
	BKTableNameChartConfig   = "cc_ChartConfig"
	BKTableNameChartPosition = "cc_ChartPosition"
	BKTableNameChartData     = "cc_ChartData"

	// process tables
	BKTableNameServiceCategory         = "cc_ServiceCategory"
	BKTableNameServiceTemplate         = "cc_ServiceTemplate"
	BKTableNameServiceInstance         = "cc_ServiceInstance"
	BKTableNameProcessTemplate         = "cc_ProcessTemplate"
	BKTableNameProcessInstanceRelation = "cc_ProcessInstanceRelation"

	BKTableNameSetTemplate                = "cc_SetTemplate"
	BKTableNameSetServiceTemplateRelation = "cc_SetServiceTemplateRelation"
	BKTableNameAPITask                    = "cc_APITask"
	BKTableNameSetTemplateSyncStatus      = "cc_SetTemplateSyncStatus"
	BKTableNameSetTemplateSyncHistory     = "cc_SetTemplateSyncHistory"

	// rule for host property auto apply
	BKTableNameHostApplyRule = "cc_HostApplyRule"

	// cloud sync tables
	BKTableNameCloudSyncTask    = "cc_CloudSyncTask"
	BKTableNameCloudAccount     = "cc_CloudAccount"
	BKTableNameCloudSyncHistory = "cc_CloudSyncHistory"
)

table names

View Source
const (
	// APPConfigWaitTime application wait config from zookeeper time (unit sencend)
	APPConfigWaitTime = 15
)
View Source
const (
	ApiCacheLimiterRulePrefix = BKCacheKeyV3Prefix + "api:limiter_rule:"
)

api cache keys

View Source
const BKAppName string = "蓝鲸"

BKAppName the default app name

View Source
const (
	BKBizDefault = "bizdefault"
)
View Source
const (
	// BKCacheKeyV3Prefix the prefix definition
	BKCacheKeyV3Prefix = "cc:v3:"
)
View Source
const (
	BKDefaultConfigCenter = "zookeeper"
)

configcenter

View Source
const BKNetwork = "bk_network"

bk_classification_id value

View Source
const BKStatusField = "status"
View Source
const DefaultAppFlag int = 1

DefaultAppFlag the default app flag

View Source
const (
	// DefaultAppLifeCycleNormal  biz life cycle normal
	DefaultAppLifeCycleNormal = "2"
)
View Source
const DefaultAppName string = "资源池"

DefaultAppName the default app name

View Source
const DefaultCloudName string = "default area"
View Source
const DefaultFlagDefaultValue int = 0
View Source
const DefaultInstName string = "实例名"
View Source
const (
	DefaultModuleType string = "1"
)
View Source
const DefaultResSetFlag int = 1

DefaultResSetFlag the default resource set flat

View Source
const DefaultResSetName string = "空闲机池"

DefaultResSetName the inner module set

View Source
const HostCrossBizField = "hostcrossbiz"

flag

View Source
const HostCrossBizValue = "e76fd4d1683d163e4e7e79cef45a74c1"
View Source
const (
	// period default value
	Infinite = "∞"
)
View Source
const (
	// MetadataField data business key
	MetadataField = "metadata"
)
View Source
const WhiteListAppName = "蓝鲸"

WhiteListAppName the white list app name

View Source
const WhiteListModuleName = "gitserver"

WhiteListModuleName the white list module name

View Source
const WhiteListSetName = "公共组件"

WhiteListSetName the white list set name

Variables

AllTables alltables

View Source
var PatternMultiplePortRange = fmt.Sprintf(`^((%s-%s)|(%s))(,((%s)|(%s-%s)))*$`, PatternPort, PatternPort, PatternPort, PatternPort, PatternPort, PatternPort)

PatternMultiplePortRange regular pattern for multiple port range

Functions

func GetIdentification

func GetIdentification() string

func GetInstIDField

func GetInstIDField(objType string) string

GetInstIDField get primary key of object's collection/table

func GetInstNameField

func GetInstNameField(objID string) string

GetInstNameField returns the inst name field

func GetInstTableName

func GetInstTableName(objID string) string

GetInstTableName returns inst data table name

func GetObjByType

func GetObjByType(objType string) string

func GetServerInfo

func GetServerInfo() *types.ServerInfo

GetServerInfo Information about the current process in service governance

func IsInnerModel

func IsInnerModel(objType string) bool

func ReadPid

func ReadPid() (int, error)

ReadPid the pid from the configured file. It is an error if the pidfile hasn't been configured.

func SavePid

func SavePid() error

func SetIdentification

func SetIdentification(id string)

func SetPidfilePath

func SetPidfilePath(p string)

SetPidfilePath sets the pidfile path.

func SetServerInfo

func SetServerInfo(srvInfo *types.ServerInfo)

SetServerInfo Information about the current process in service governance

func WritePid

func WritePid() error

WritePid the pidfile based on the flag. It is an error if the pidfile hasn't been configured.

Types

type APIRsp

type APIRsp struct {
	HTTPCode int         `json:"-"`
	Result   bool        `json:"result"`
	Code     int         `json:"code"`
	Message  interface{} `json:"message"`
	Data     interface{} `json:"data"`
}

APIRsp the result the http requst

type AtomicFile

type AtomicFile struct {
	*os.File
	// contains filtered or unexported fields
}

AtomicFile behaves like os.File, but does an atomic rename operation at Close.

func AtomicFileNew

func AtomicFileNew(path string, mode os.FileMode) (*AtomicFile, error)

AtomicFileNew creates a new temporary file that will replace the file at the given path when Closed.

func (*AtomicFile) Abort

func (f *AtomicFile) Abort() error

Abort closes the file and removes it instead of replacing the configured file. This is useful if after starting to write to the file you decide you don't want it anymore.

func (*AtomicFile) Close

func (f *AtomicFile) Close() error

Close the file replacing the configured file.

type DataStatusFlag

type DataStatusFlag string
const (
	DataStatusDisabled DataStatusFlag = "disabled"
	DataStatusEnable   DataStatusFlag = "enable"
)

type KvMap

type KvMap map[string]interface{}

KvMap the map definition

type LanguageType

type LanguageType string

multiple language support

const (
	Chinese LanguageType = "zh-cn"
	English LanguageType = "en"
)

Directories

Path Synopsis
glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
core
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company.
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company.
resource
esb
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company.
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company.
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Tencent is pleased to support the open source community by making 蓝鲸 available.

Jump to

Keyboard shortcuts

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