common

package
v0.0.0-...-be0592b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: GPL-3.0 Imports: 9 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"

	// BKTrue the true definition
	BKTrue = 1

	// BKFalse the false definition
	BKFalse = 2

	// BKNoLimit no limit definition
	BKNoLimit = 999999999

	// BKDefaultLimit the default limit definition
	BKDefaultLimit = 20

	// 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"

	// BKDefaultSupplierID the default owner id
	BKDefaultSupplierID = 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 (
	// BKDBIN the db operator
	BKDBIN = "$in"

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

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

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

	// 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"

	// 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 = "故障机"
)
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"

	// BKSupplierIDField the supplier id field
	BKSupplierIDField = "bk_supplier_id"

	// BKAppIDField the appid field
	BKAppIDField = "bk_biz_id"

	// BKIPArr the ip address
	BKIPArr = "ipArr"

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

	// 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"

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

	// BKLastTimeCloudSync the last time cloud sync
	BKLastTimeCloudSync = "bk_last_sync_time"

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

	// BKSyncStatus the cloud sync status
	BKSyncStatus = "bk_sync_status"

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

	// BKAttrChangedHost the cloud sync attr changed hosts
	BKAttrChangedHost = "attr_changed"

	// BKCloudConfirm whether new add cloud hosts need confirm
	BKCloudConfirm = "bk_confirm"

	// BKAttrConfirm the cloud hosts attr changed need confirm
	BKAttrConfirm = "bk_attr_confirm"

	// BKCloudSyncTaskName the cloud sync task name field
	BKCloudSyncTaskName = "bk_task_name"

	// BKCloudAccountType the cloud account type field
	BKCloudAccountType = "bk_account_type"

	// BKCloudSyncAccountAdmin the cloud sync account admin
	BKCloudSyncAccountAdmin = "bk_account_admin"

	// BKResourceType the cloud sync resource type
	BKResourceType = "bk_resource_type"

	// 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"

	// 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"

	// 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"

	// BKPrivilegeField the privilege field
	BKPrivilegeField = "privilege"

	// BKUserGroupIDField the group id field
	BKUserGroupIDField = "group_id"

	// BKUserListField the user list field
	BKUserListField = "user_list"

	// BKContentField the content field
	BKContentField = "content"

	// BKExtKeyField the ext key field
	BKExtKeyField = "ext_key"

	// BKOpDescField the op desc field
	BKOpDescField = "op_desc"

	// BKOpTypeField the op type field
	BKOpTypeField = "op_type"

	// BKOpTargetField the op target field
	BKOpTargetField = "op_target"

	// BKOpTimeField the op time field
	BKOpTimeField = "op_time"

	// 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"

	// BKUser the user
	BKUser = "user"

	// BKProtocol the protocol
	BKProtocol = "protocol"

	// BKProcessIDField the process id field
	BKProcessIDField = "bk_process_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"

	// 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"

	// 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"
)
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
)
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"

	// FieldTypeSingleAsst the single association
	FieldTypeSingleAsst string = "singleasst"

	// FieldTypeMultiAsst the multi association
	FieldTypeMultiAsst string = "multiasst"

	// FieldTypeForeignKey the multi association
	FieldTypeForeignKey string = "foreignkey"

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

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

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

	// FieldTypeLongLenChar the long char length limit
	FieldTypeLongLenChar int = 2000
)
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"

	// 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"
)
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:"
	EventCacheEventTxnSet         = BKCacheKeyV3Prefix + "event:txn_set"
	RedisSnapKeyPrefix            = BKCacheKeyV3Prefix + "snapshot:"
)

event cache keys

View Source
const (
	// LocalHostName the local host name definition
	LocalHostName = "localhost"

	// LocalHostIP the local host ip definition
	LocalHostIP = "127.0.0.1"
)
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"
	//BKHTTPOwnerID = "HTTP_BLUEKING_OWNERID"
	BKHTTPCookieLanugageKey = "blueking_language"
	BKSessionLanugageKey    = "language"
	BKHTTPSupplierID        = "bk_supplier_id"

	// BKHTTPCCRequestID cc request id cc_request_id
	BKHTTPCCRequestID = "Cc_Request_Id"
	// BKHTTPOtherRequestID esb request id  X-Bkapi-Request-Id
	BKHTTPOtherRequestID  = "X-Bkapi-Request-Id"
	BKHTTPCCRequestTime   = "Cc_Request_Time"
	BKHTTPCCTransactionID = "Cc_Txn_Id"
)
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 (
	// URLFilterWhiteList url filter white list not execute any filter
	// multiple url separated by commas
	URLFilterWhiteListSuffix = "/healthz"

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

netcollect

View Source
const (
	BKDefaultLoginUserPluginVersion = "self"
	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"
	WEBSessionLanguageKey      = "language"
	WEBSessionSupplierID       = "supplier_id"

	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 (
	TemplateStatusDraft   = "draft"
	TemplateStatusOnline  = "online"
	TemplateStatusHistory = "history"
)
View Source
const (
	BKProcInstanceOpUser             = "proc instance user"
	BKSynchronizeDataTaskDefaultUser = "synchronize task user"
)
View Source
const (
	GSEProcOPStop           = 1
	GSEProcOPQueryStatus    = 2
	GSEProcOPRegister       = 3
	GSEProcOPUnregister     = 4
	GSEProcOPRegisterStart  = 5
	GSEProcOPUnregisterStop = 6
	GSEProcOPRestart        = 7
	GSEProcOPReload         = 8
	GSEProcOPKill           = 9
)
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"
	RedisCloudSyncStartLockKey                = BKCacheKeyV3Prefix + "lock:cloudsyncstart"
)
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 (
	MetaDataSynchronizeFlagField    = "metadata_sync_flag"
	MetaDataSynchronizeVersionField = "metadata_sync_version"

	// 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 group
	SynchronizeModelTypeBase = "model"
	// SynchronizeModelTypeModelClassificationRelation synchroneize model classification relation
	SynchronizeModelTypeModelClassificationRelation = "model_classification_relation"

	// SynchronizeAssociationTypeModelHost synchroneize model ggroup
	SynchronizeAssociationTypeModelHost = "module_host"
)
View Source
const (
	AttributePlaceHolderMaxLength = 300
	AttributeOptionMaxLength      = 1000
	AttributeIDMaxLength          = 20
	AttributeNameMaxLength        = 20
)
View Source
const (
	ContextRequestIDField   = "request_id"
	ContextRequestUserField = "request_user"
)
View Source
const (

	// CCSystemBusy the system is busy
	CCSystemBusy   = -1
	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 valide 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
	// CCErrCommInstFieldConvFail  convert %s  field %s to %s error %s
	CCErrCommInstFieldConvFail = 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 apiserver 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

	// 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 clssification
	CCErrTopoObjectClassificationHasObject = 1101029

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

	// CCErrTopoHasHost include host
	CCErrTopoHasHost = 1101030

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

	// CCErrTopoGetAppFaild search app err %s
	CCErrTopoGetAppFailed = 1101033
	// CCErrTopoGetModuleFailed search  module err %s
	CCErrTopoGetModuleFailed = 1101034
	// CCErrTopoBizTopoOverLevel the mainline topo level over limit
	CCErrTopoBizTopoLevelOverLimit = 1101035
	// CCErrTopoInstHasBeenAssociation the mainline topo level over limit
	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
	CCErrorTopoGetMultipleAssoKindInstWithOneID = 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 patch, 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.
	CCErrorTopoMutipleObjectInstanceName = 1101059

	CCErrorTopoAssociationKindHasBeenUsed                     = 1101060
	CCErrorTopoCreateMultipleInstancesForOneToManyAssociation = 1101061
	CCErrTopoAppDeleteFailed                                  = 1001031
	CCErrTopoAppUpdateFailed                                  = 1001032
	CCErrTopoAppSearchFailed                                  = 1001033
	CCErrTopoAppCreateFailed                                  = 1001034
	CCErrTopoForbiddenToDeleteModelFailed                     = 1001035
	CCErrTopoMainlineCreatFailed                              = 1001037
	CCErrTopoMainlineDeleteFailed                             = 1001038
	CCErrTopoMainlineSelectFailed                             = 1001039
	CCErrTopoTopoSelectFailed                                 = 1001040
	CCErrTopoUserGroupCreateFailed                            = 1001041
	CCErrTopoUserGroupDeleteFailed                            = 1001042
	CCErrTopoUserGroupUpdateFailed                            = 1001043
	CCErrTopoUserGroupSelectFailed                            = 1001044
	CCErrTopoUserGroupPrivilegeUpdateFailed                   = 1001045
	CCErrTopoUserGroupPrivilegeSelectFailed                   = 1001046
	CCErrTopoUserPrivilegeSelectFailed                        = 1001047
	CCErrTopoRolePrivilegeCreateFailed                        = 1001048
	CCErrTopoDeleteMainLineObjectAndInstNameRepeat            = 1001049
	CCErrHostNotAllowedToMutiBiz                              = 1001050
	CCErrTopoGraphicsSearchFailed                             = 1001051
	CCErrTopoGraphicsUpdateFailed                             = 1001052
	CCErrTopoObjectUniqueCreateFailed                         = 1001060
	CCErrTopoObjectUniqueUpdateFailed                         = 1001061
	CCErrTopoObjectUniqueDeleteFailed                         = 1001062
	CCErrTopoObjectUniqueSearchFailed                         = 1001063
	CCErrTopoObjectPropertyNotFound                           = 1001064
	CCErrTopoObjectPropertyUsedByUnique                       = 1001065
	CCErrTopoObjectUniqueKeyKindInvalid                       = 1001066
	CCErrTopoObjectUniquePresetCouldNotDelOrEdit              = 1001067
	CCErrTopoObjectUniqueCanNotHasMutiMustCheck               = 1001068
	CCErrTopoObjectUniqueShouldHaveMoreThanOne                = 1001069
	// 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
	CCErrTopoCreateAssoKindFailed       = 1101076
	CCErrTopoUpdateAssoKindFailed       = 1101077
	CCErrTopoDeleteAssoKindFailed       = 1101078
	CCErrTopoMulueIDNotfoundFailed      = 1101080
	CCErrTopoBkAppNotAllowedDelete      = 1101081
	// CCErrorTopoAssociationKindMainlineUnavailable can't use bk_mainline in this case
	CCErrorTopoAssociationKindMainlineUnavailable = 1101082
	// CCErrorTopoAssociationKindInconsistent means AssociationKind parameter Inconsistent with caller method
	CCErrorTopoAssociationKindInconsistent = 1101083
	// CCErrorTopoModleStopped means model have been stopped to use
	CCErrorTopoModleStopped = 1101084
	// mainline's object unique can not be updated, deleted or create new rules.
	CCErrorTopoMainlineObjectCanNotBeChanged   = 1101085
	CCErrorTopoGetAuthorizedBusinessListFailed = 1101086

	// 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

	// hostcontroller 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

	// proccontroller 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

	// procserver 1108XXX
	CCErrProcSearchDetailFaile          = 1108001
	CCErrProcBindToMoudleFaile          = 1108002
	CCErrProcUnBindToMoudleFaile        = 1108003
	CCErrProcSelectBindToMoudleFaile    = 1108004
	CCErrProcUpdateProcessFaile         = 1108005
	CCErrProcSearchProcessFaile         = 1108006
	CCErrProcDeleteProcessFaile         = 1108007
	CCErrProcCreateProcessFaile         = 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

	// auditlog 1109XXX
	CCErrAuditSaveLogFaile      = 1109001
	CCErrAuditTakeSnapshotFaile = 1109001

	//hostserver
	CCErrHostGetFail              = 1110001
	CCErrHostUpdateFail           = 1110002
	CCErrHostUpdateFieldFail      = 1110003
	CCErrHostCreateFail           = 1110004
	CCErrHostModifyFail           = 1110005
	CCErrHostDeleteFail           = 1110006
	CCErrHostFiledValdFail        = 1110007
	CCErrHostNotFound             = 1110008
	CCErrHostLength               = 1110009
	CCErrHostDetailFail           = 1110010
	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

	// CCErrCloudSyncCreateFail cloud hosts sync table create failed
	CCErrCloudSyncCreateFail = 1110031

	// CCErrCloudHistoryCreateFail cloud sync history table create failed
	CCErrCloudHistoryCreateFail     = 1110032
	CCErrCloudConfirmCreateFail     = 1110033
	CCErrCloudGetConfirmFail        = 1110034
	CCErrCloudAddConfirmHistoryFail = 1110035
	CCErrCloudGetTaskFail           = 1110036
	CCErrCloudGetConfirmHistoryFail = 1110037
	CCErrCloudTaskNameAlreadyExist  = 1110038
	CCErrCloudSyncStartFail         = 1110039

	// hostserver api machinery new error code
	CCErrAddUserCustomQueryFaild       = 1110040
	CCErrUpdateUserCustomQueryFaild    = 1110041
	CCErrDeleteUserCustomQueryFaild    = 1110042
	CCErrSearchUserCustomQueryFaild    = 1110043
	CCErrGetUserCustomQueryDetailFaild = 1110044
	CCErrHostModuleConfigFaild         = 1110045
	CCErrHostGetSetFaild               = 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
	// CCErrHostNotBelongIDLEModuleErr hostID[%#v] not belong to business
	CCErrHostNotBelongIDLEModuleErr = 1110056
	// CCErrHostMulueIDNotFoundORHasMutliInnerModuleIDFailed Module does not exist or there are multiple built-in modules
	CCErrHostMulueIDNotFoundORHasMutliInnerModuleIDFailed = 1110057
	CCErrHostSearchNeedObjectInstIDErr                    = 1110058

	//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

	// 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

	// 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

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

	// CCErrApiServerV2AppNameLenErr app name must be 1-32 len
	CCErrAPIServerV2APPNameLenErr = 1170001

	// CCErrAPIServerV2DirectErr  disply error
	CCErrAPIServerV2DirectErr = 1170002

	// CCErrAPIServerV2SetNameLenErr  set name must be < 24 len
	CCErrAPIServerV2SetNameLenErr = 1170003

	// CCErrAPIServerV2MultiModuleIDErr  single module id  is int
	CCErrAPIServerV2MultiModuleIDErr = 1170004

	// CCErrAPIServerV2MultiSetIDErr  single set id is int
	CCErrAPIServerV2MultiSetIDErr = 1170005

	// CCErrAPIServerV2OSTypeErr osType must be linux or windows
	CCErrAPIServerV2OSTypeErr = 1170006

	// CCErrAPIServerV2HostModuleContainDefaultModuleErr  translate host to multiple module not contain default module
	CCErrAPIServerV2HostModuleContainDefaultModuleErr = 1170007

	CCErrSynchronizeError = 1114001

	//json
	CC_ERR_Comm_JSON_DECODE     = 3001
	CC_ERR_Comm_JSON_DECODE_STR = "json decode failed!"
	CC_ERR_Comm_JSON_ENCODE     = 3002
	CC_ERR_Comm_JSON_ENCODE_STR = "json encode failed!"

	Json_Marshal_ERR     = 9000
	Json_Marshal_ERR_STR = "json marshal error"
)

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

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"

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

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

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

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

	// BKTableNamePrivilege the table name of the privilege module
	BKTableNamePrivilege = "cc_Privilege"

	// BKTableNameUserGroup the table name of the user group module
	BKTableNameUserGroup = "cc_UserGroup"

	// BKTableNameUserGroupPrivilege the table name of the user group privilege
	BKTableNameUserGroupPrivilege = "cc_UserGroupPrivilege"

	// 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"

	// BKTableNameObjClassifiction the table name of the object classification
	BKTableNameObjClassifiction = "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"

	BKTableNameModuleHostConfig = "cc_ModuleHostConfig"
	BKTableNameSystem           = "cc_System"
	BKTableNameHistory          = "cc_History"
	BKTableNameHostFavorite     = "cc_HostFavourite"
	BKTableNameOperationLog     = "cc_OperationLog"
	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"

	// Cloud sync tables
	BKTableNameCloudTask              = "cc_CloudTask"
	BKTableNameCloudSyncHistory       = "cc_CloudSyncHistory"
	BKTableNameCloudResourceConfirm   = "cc_CloudResourceConfirm"
	BKTableNameResourceConfirmHistory = "cc_ResourceConfirmHistory"
)

table names

View Source
const (
	// APPConfigWaitTime application wait config from zookeeper time (unit sencend)
	APPConfigWaitTime = 15
)
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 BKMainLine = "mainline"
View Source
const BKNetwork = "bk_network"

bk_classification_id value

View Source
const (
	BKSTRIDPrefix = "cc"
)
View Source
const BKStatusField = "status"
View Source
const (
	CCContextKeyJoinOption = CCContextKey("cc_context_joinoption")
)
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 DefaultInstName string = "实例名"
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 TemplateStatusField = "status"
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

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 CCContextKey

type CCContextKey string

type DataStatusFlag

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

type KvMap

type KvMap map[string]interface{}

KvMap the map definition

Directories

Path Synopsis
core
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Tencent is pleased to support the open source community by making 蓝鲸 available.
storage
dal
rpc
* 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