common

package
v3.0.7-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 6 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

	// BKDefaultDirSubArea the default dir subarea
	BKDefaultDirSubArea = 0

	// BKTimeTypeParseFlag the time flag
	BKTimeTypeParseFlag = "cc_time_type"
)
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"

	// BKInnerObjIDPlat the inner object
	BKInnerObjIDPlat = "plat"
)
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"

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

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

	// BKDBNE the db operator
	BKDBNE = "$ne"
)
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"

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

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

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

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

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

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

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

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

	// BKProcNameField the proc name field
	BKProcNameField = "bk_process_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"

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

	// 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"
)
View Source
const (
	// CreatorField the creator
	CreatorField = "creator"

	// CreateTimeField the create time field
	CreateTimeField = "create_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 (

	// DefaultResModuleFlag the default resource module flag
	DefaultResModuleFlag int = 1

	// DefaultFaultModuleFlag the default fault module flag
	DefaultFaultModuleFlag int = 2
)
View Source
const (

	// FiledTypeSingleChar the single char filed type
	FiledTypeSingleChar string = "singlechar"

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

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

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

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

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

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

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

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

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

	// FiledTypeBool the bool type
	FiledTypeBool string = "bool"

	// FiledTypeSingleCharName the single char data type name
	FiledTypeSingleCharName string = "短字符"

	// FiledTypeLongCharName the long char data type name
	FiledTypeLongCharName string = "长字符"

	// FiledTypeIntName the int data type name
	FiledTypeIntName string = "数字"

	// FiledTypeEnumName the enum data type name
	FiledTypeEnumName string = "枚举"

	// FiledTypeDateName the date data type name
	FiledTypeDateName string = "日期"

	// FiledTypeTimeName the time data type name
	FiledTypeTimeName string = "时间"

	// FiledTypeUserName the user data type name
	FiledTypeUserName string = "用户"

	// FiledTypeSingleAsstName the single association data type name
	FiledTypeSingleAsstName string = "单关联"

	// FiledTypeMultiAsstName the multi association data type nme
	FiledTypeMultiAsstName string = "多关联"

	// FiledTypeTimeZoneName the time zone data type name
	FiledTypeTimeZoneName string = "时区"

	// FiledTypeBoolName the bool data type name
	FiledTypeBoolName string = "布尔"

	// FiledTypeSingleLenChar the single char length limit
	FiledTypeSingleLenChar int = 48

	// FiledTypeLongLenChar the long char length limit
	FiledTypeLongLenChar int = 512
)
View Source
const (

	// HostAddMethodExcel add a host method
	HostAddMethodExcel = "excel"

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

	// HostAddMethodAPI add api method
	HostAddMethodAPI = "api"

	// HostAddMethodExcelIndexOffset the height of the table header
	HostAddMethodExcelIndexOffset = 3
)
View Source
const (
	// BKTableNameProcModule the table name of the process module
	BKTableNameProcModule = "cc_Proc2Module"

	// 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 object
	BKTableNameObjDes = "cc_ObjDes"

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

table names

View Source
const (
	// HTTPBKAPIErrorMessage apiserver error message
	HTTPBKAPIErrorMessage = "bk_error_msg"

	// HTTPBKAPIErrorCode apiserver error code
	HTTPBKAPIErrorCode = "bk_error_code"
)
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  lhttp request header fields name for login user
	BKHTTPHeaderUser = "BK_User"
	// BKHTTPLanguage the language key word
	BKHTTPLanguage = "HTTP_BLUEKING_LANGUAGE"
	// BKHTTPOwnerID the owner id
	BKHTTPOwnerID = "HTTP_BLUEKING_SUPPLIER_ID"
)
View Source
const (

	// CCSystemBusy the system is busy
	CCSystemBusy = -1
	CCSuccess    = 0
	CCSuccessStr = "success"

	// 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 paased
	CCErrCommParamsInvalid = 1199006

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

	// CCErrCommParamsLostField the prameter not specified
	CCErrCommParamsLostField = 1199008

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

	// CCErrCommParamsNeedSet the parameter unassigned
	CCErrCommParamsNeedSet = 1199010

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

	// CCErrCommUniqueCheckFailed the uniqueness validation fails
	CCErrCommUniqueCheckFailed = 1199012

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

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

	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

	CCErrTopoMulueIDNotfoundFailed = 1101080
	CCErrTopoBkAppNotAllowedDelete = 1101081

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

	// 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 filed
	CCErrEventSubscribePingFailed = 1103004
	// CCErrEventSubscribePingFailed failed to telnet the filed
	CCErrEventSubscribeTelnetFailed = 1103005

	// host 1104XXX
	CCErrHostModuleRelationAddFailed = 1104000

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

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

	// proccontroller 1107XXX
	CCErrProcDeleteProc2Module = 1107001
	CCErrProcCreateProc2Module = 1107002
	CCErrProcSelectProc2Module = 1107003

	// procserver 1108XXX
	CCErrProcSearchDetailFaile       = 1108001
	CCErrProcBindToMoudleFaile       = 1108002
	CCErrProcUnBindToMoudleFaile     = 1108003
	CCErrProcSelectBindToMoudleFaile = 1108004
	CCErrProcUpdateProcessFaile      = 1108005
	CCErrProcSearchProcessFaile      = 1108006
	CCErrProcDeleteProcessFaile      = 1108007
	CCErrProcCreateProcessFaile      = 1108008

	// auditlog 11009XXX
	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

	CC_Err_Comm_HOST_CREATE_FAIL          = 4300
	CC_Err_Comm_HOST_CREATE_FAIL_STR      = "create host fail"
	CC_Err_Comm_HOST_MODIFY_FAIL          = 4301
	CC_Err_Comm_HOST_MODIFY_FAIL_STR      = "modify host fail"
	CC_Err_Comm_HOST_Field_VALID_FAIL     = 4302
	CC_Err_Comm_HOST_Field_VALID_FAIL_STR = "host field valid fail"

	CC_Err_Comm_Host_Get_FAIL             = 4303
	CC_Err_Comm_Host_Get_FAIL_STR         = "get host fail"
	CC_Err_Comm_Host_Update_Field_ERR     = 4304
	CC_Err_Comm_Host_Update_Field_ERR_STR = "update host field err"
	CC_Err_Comm_Host_Update_FAIL_ERR      = 4305
	CC_Err_Comm_Host_Update_FAIL_ERR_STR  = "update host fail err"
	CC_Err_Comm_Host_Not_Founded_ERR      = 4306
	CC_Err_Comm_Host_Not_Founded_ERR_STR  = "find no host by condition"
	CC_Err_Comm_Host_Length_ERR           = 4307
	CC_Err_Comm_Host_Length_ERR_STR       = "not expected host length"

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

	// db
	CC_ERR_Comm_DB_OP_ERRNO = 1000

	CC_ERR_Comm_DB_OP_ERRNO_STR  = "database return some exception"
	CC_Err_Comm_DB_Insert_Failed = "insert data failed"
	CC_Err_Comm_DB_Delete_Failed = "delete data failed"
	CC_Err_Comm_DB_Update_Failed = "update data failed"
	CC_Err_Comm_DB_Select_Failed = "select data failed"

	//http
	CC_Err_Comm_http_DO               = 2000
	CC_Err_Comm_http_DO_STR           = "do http request failed!"
	CC_Err_Comm_http_Input_Params     = 2001
	CC_Err_Comm_http_Input_Params_STR = "input params error!"
	CC_Err_Comm_http_ReadReqBody      = 2002
	CC_Err_Comm_http_ReadReqBody_STR  = "read http request body failed!"

	//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!"
	CC_ERR_Comm_JSON_GET        = 3003

	//app
	CC_Err_Comm_APP_ID_ERR               = 4001
	CC_Err_Comm_APP_ID_ERR_STR           = "app id error"
	CC_Err_Comm_APP_DEL_FAIL             = 4002
	CC_Err_Comm_APP_DEL_FAIL_STR         = "delete app fail"
	CC_Err_Comm_APP_Create_FAIL          = 4003
	CC_Err_Comm_APP_Create_FAIL_STR      = "create app fail"
	CC_Err_Comm_APP_Create_Field_ERR     = 4004
	CC_Err_Comm_APP_Create_Field_ERR_STR = "create app lack field"
	CC_Err_Comm_APP_Create_Name_DUP      = 4005
	CC_Err_Comm_APP_Create_Name_DUP_STR  = "duplicate application name"
	CC_Err_Comm_APP_Update_FAIL          = 4006
	CC_Err_Comm_APP_Update_FAIL_STR      = "update application fail"
	CC_Err_Comm_APP_Field_VALID_FAIL     = 4007
	CC_Err_Comm_APP_Field_VALID_FAIL_STR = "app field valid fail"
	CC_Err_Comm_APP_QUERY_FAIL           = 4008
	CC_Err_Comm_APP_QUERY_FAIL_STR       = "query app fail"
	CC_Err_Comm_APP_CHECK_HOST_FAIL      = 4009
	CC_Err_Comm_APP_CHECK_HOST_FAIL_STR  = "failed to check host for app"
	CC_Err_Comm_APP_HAS_HOST_FAIL        = 4010
	CC_Err_Comm_APP_HAS_HOST_FAIL_STR    = "failed to delete app, because of it has some hosts"
	//set
	CC_Err_Comm_Set_QUERY_FAIL      = 4100
	CC_Err_Comm_Set_QUERY_FAIL_STR  = "get set fail"
	CC_Err_Comm_Set_CREATE_FAIL     = 4101
	CC_Err_Comm_Set_CREATE_FAIL_STR = "create set fail"
	CC_Err_Comm_Set_Update_FAIL     = 4102
	CC_Err_Comm_Set_Update_FAIL_STR = "update set fail"
	CC_Err_Comm_Set_Delete_FAIL     = 4103
	CC_Err_Comm_Set_Delete_FAIL_STR = "delete set fail"
	//module
	CC_Err_Comm_Module_QUERY_FAIL      = 4200
	CC_Err_Comm_Module_QUERY_FAIL_STR  = "get module fail"
	CC_Err_Comm_Module_Update_FAIL     = 4201
	CC_Err_Comm_Module_Update_FAIL_STR = "update module error"

	CC_Err_Comm_Host_SNAPSHOT_GET_FAIL_ERR     = 4306
	CC_Err_Comm_Host_SNAPSHOT_GET_FAIL_ERR_STR = "get host snapshot fail err"
	//process
	CC_Err_Comm_PROC_Create_FAIL            = 4400
	CC_Err_Comm_PROC_Create_FAIL_STR        = "create process fail"
	CC_Err_Comm_PROC_Create_Field_ERR       = 4401
	CC_Err_Comm_PROC_Create_Field_ERR_STR   = "create process lack field"
	CC_Err_Comm_PROC_Field_VALID_FAIL       = 4402
	CC_Err_Comm_PROC_Field_VALID_FAIL_STR   = "process field valid fail"
	CC_Err_Comm_PROC_DELETE_FAIL            = 4403
	CC_Err_Comm_PROC_DELETE_FAIL_STR        = "delete process  fail"
	CC_Err_Comm_PROC_SEARCH_FAIL            = 4404
	CC_Err_Comm_PROC_SEARCH_FAIL_STR        = "search process  fail"
	CC_Err_Comm_CREATE_PROC_MODULE_FAIL     = 4405
	CC_Err_Comm_CREATE_PROC_MODULE_FAIL_STR = "create process module config  fail"
	CC_Err_Comm_GET_PROC_FAIL               = 4406
	CC_Err_Comm_GET_PROC_FAIL_STR           = "get process fail"
	CC_Err_Comm_GET_PROC_MODULE_FAIL        = 4407
	CC_Err_Comm_GET_PROC_MODULE_FAIL_STR    = "get process module config  fail"
	CC_Err_Comm_BIND_PROC_MODULE_FAIL       = 4408
	CC_Err_Comm_BIND_PROC_MODULE_FAIL_STR   = "bind process module config  fail"
	CC_Err_Comm_PROC_UPDATE_FAIL            = 4409
	CC_Err_Comm_PROC_UPDATE_FAIL_STR        = "update process  fail"
	CC_Err_Comm_DELETE_PROC_MODULE_FAIL     = 4410
	CC_Err_Comm_DELETE_PROC_MODULE_FAIL_STR = "delete process  fail"
	//主机历史
	CC_Err_Comm_HOST_HISTORY_Create_FAIL     = 4400
	CC_Err_Comm_HOST_HISTORY_Create_FAIL_STR = "create app fail"

	//collect
	CC_Err_Comm_HOST_FAVOURITE_CREATE_FAIL     = 4401
	CC_Err_Comm_HOST_FAVOURITE_CREATE_FAIL_STR = "create host favourite fail"
	CC_Err_Comm_HOST_FAVOURITE_QUERY_FAIL      = 4402
	CC_Err_Comm_HOST_FAVOURITE_QUERY_FAIL_STR  = "query host favourite fail"
	CC_Err_Comm_HOST_FAVOURITE_EDIT_FAIL       = 4403
	CC_Err_Comm_HOST_FAVOURITE_EDIT_FAIL_STR   = "modify host favourite fail"

	//user custom
	CC_Err_Comm_USER_CUSTOM_SAVE_FAIL      = 5000
	CC_Err_Comm_USER_CUSTOM_SAVE_FAIL_STR  = "save user custom fail"
	CC_Err_Comm_USER_CUSTOM_QUERY_FAIL     = 5001
	CC_Err_Comm_USER_CUSTOM_QUERY_FAIL_STR = "query user custom fail"
	CC_Err_Comm_USER_CUSTOM_EDIT_FAIL      = 5002
	CC_Err_Comm_USER_CUSTOM_EDIT_FAIL_STR  = "modify user custom fail"

	//privilege
	CC_Err_Comm_CREATE_ROLE_PRI_FAIL             = 7000
	CC_Err_Comm_CREATE_ROLE_PRI_FAIL_STR         = "create role privilege error"
	CC_Err_Comm_GET_ROLE_PRI_FAIL                = 7001
	CC_Err_Comm_GET_ROLE_PRI_FAIL_STR            = "get role privilege error"
	CC_Err_Comm_ROLE_PRI_EXIST                   = 7002
	CC_Err_Comm_ROLE_PRI_EXIST_STR               = "role privilege exist"
	CC_Err_Comm_UPDATE_ROLE_PRI_FAIL             = 7003
	CC_Err_Comm_UPDATE_ROLE_PRI_FAIL_STR         = "create role privilege error"
	CC_Err_Comm_CREATE_USER_GROUP_FAIL           = 7004
	CC_Err_Comm_CREATE_USER_GROUP_FAIL_STR       = "create user group error"
	CC_Err_Comm_UPDATE_USER_GROUP_FAIL           = 7005
	CC_Err_Comm_UPDATE_USER_GROUP_FAIL_STR       = "update user group error"
	CC_Err_Comm_SEARCH_USER_GROUP_FAIL           = 7006
	CC_Err_Comm_SEARCH_USER_GROUP_FAIL_STR       = "search user group error"
	CC_Err_Comm_DELETE_USER_GROUP_FAIL           = 7007
	CC_Err_Comm_DELETE_USER_GROUP_FAIL_STR       = "delete user group error"
	CC_Err_Comm_INSERT_USER_GROUP_PRIVI_FAIL     = 7008
	CC_Err_Comm_INSERT_USER_GROUP_PRIVI_FAIL_STR = "insert user group privilege error"
	CC_Err_Comm_UPDATE_USER_GROUP_PRIVI_FAIL     = 7009
	CC_Err_Comm_UPDATE_USER_GROUP_PRIVI_FAIL_STR = "update user group privilege error"
	CC_Err_Comm_GET_USER_GROUP_PRIVI_FAIL        = 7010
	CC_Err_Comm_GET_USER_GROUP_PRIVI_FAIL_STR    = "get user group privilege error"
	CC_Err_Comm_DUP_GROUP_NAME_ERR               = 7011
	CC_Err_Comm_DUP_GROUP_NAME_ERR_STR           = "duplicate group name"
	CC_Err_Comm_DUP_GROUP_PRIVI_ERR              = 7012
	CC_Err_Comm_DUP_GROUP_PRIVI_ERR_STR          = "duplicate group privilege"
	CC_Err_Comm_GET_USER_PRIVI_ERR               = 7013
	CC_Err_Comm_GET_USER_PRIVI_ERR_STR           = "get user privilege error"
	// object
	CC_Err_Comm_Object_Valid_Failed = 8000

	Json_Marshal_ERR     = 9000
	Json_Marshal_ERR_STR = "json marshal error"

	// property
	CC_Err_Comm_GET_PROPERTY_PRI_FAIL     = 10001
	CC_Err_Comm_GET_PROPERTY_PRI_FAIL_STR = "get property error"

	// plat
	CC_Err_Comm_GET_PLAT_FAIL         = 11001
	CC_Err_Comm_GET_PLAT_FAIL_STR     = "get plat error"
	CC_Err_Comm_DELETE_PLAT_FAIL      = 11002
	CC_Err_Comm_DELETE_PLAT_FAIL_STR  = "delete plat error"
	CC_Err_Comm_CREATE_PLAT_FAIL      = 11003
	CC_Err_Comm_CREATE_PLAT_FAIL_STR  = "create plat error"
	CC_Err_Comm_HOST_IN_PLAT_FAIL     = 11004
	CC_Err_Comm_HOST_IN_PLAT_FAIL_STR = "plat has host data, can not delete plat"
)

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

View Source
const BKAppName string = "蓝鲸"

BKAppName the default app name

View Source
const (
	// BKCacheKeyV3Prefix the prefix definition
	BKCacheKeyV3Prefix = "cc:v3:"
)
View Source
const (

	// CCSystemOperatorUserName the system user
	CCSystemOperatorUserName = "cc_system"
)
View Source
const DefaultAppFlag int = 1

DefaultAppFlag the default app flag

View Source
const DefaultAppName string = "资源池"

DefaultAppName the default app name

View Source
const DefaultResSetFlag int = 1

DefaultResSetFlat the default resource set flat

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

DefaultResSetName the inner module set

View Source
const 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)$`

PatternIP regular pattern for ip

View Source
const PatternMultipleIP = `` /* 246-byte string literal not displayed */
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

This section is empty.

Functions

func GetIdentification

func GetIdentification() string

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

type KvMap map[string]interface{}

KvMap the map definition

Jump to

Keyboard shortcuts

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