Documentation
¶
Overview ¶
* Tencent is pleased to support the open source community by making 蓝鲸 available. * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions and * limitations under the License.
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the ",License",); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an ",AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions and * limitations under the License.
* Tencent is pleased to support the open source community by making 蓝鲸 available., * Copyright (C) 2017,-2018 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the ",License",); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an ",AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- Variables
- func BizIDFromMetadata(meta Metadata) (int64, error)
- func GetBusinessIDFromMeta(data interface{}) string
- func GetInstIDFieldByObjID(objID string) string
- func NewPublicOrBizConditionByBizID(businessID int64) mapstr.MapStr
- func ParseBizIDFromData(rawData mapstr.MapStr) (int64, error)
- func PublicAndBizCondition(meta Metadata) mapstr.MapStr
- type AddConfigQuery
- type AddDeviceResult
- type AddHistoryResult
- type AddHostFromAgentHostList
- type AddNetPropertyResult
- type AppQueryResult
- type AssignHostToAppParams
- type Association
- type AssociationDetail
- type AssociationDirection
- type AssociationKind
- type AssociationKindIDs
- type AssociationList
- type AssociationMapping
- type AssociationOnDeleteAction
- type AssociationParams
- type Attribute
- type AttributeGroup
- type AttributeWrapper
- type AuditQueryResult
- type AuthBathVerifyRequest
- type AuthBathVerifyResult
- type AuthResource
- type BasePage
- type BaseResp
- type BatchAddDevice
- type BatchAddDeviceResult
- type BatchAddNetProperty
- type BatchAddNetPropertyResult
- type BizInst
- type BkHostInfo
- type Classification
- type ClassificationWithObject
- type CloneHostPropertyParams
- type CloudHistory
- type CloudHostInfo
- type CloudHostModuleParams
- type CloudInst
- type CloudSyncRedisAlreadyStarted
- type CloudSyncRedisPendingStart
- type CloudSyncRedisPendingStop
- type CloudTaskInfo
- type CloudTaskList
- type CloudTaskSearch
- type ConditionItem
- type ConfirmMode
- type Content
- type CreateAssociationInstRequest
- type CreateAssociationInstResult
- type CreateAssociationKind
- type CreateAssociationObjectResult
- type CreateAssociationTypeResult
- type CreateInstResult
- type CreateManyAssociationKind
- type CreateManyDataResult
- type CreateManyInfoResult
- type CreateManyInstanceAssociation
- type CreateManyModelClassifiaction
- type CreateManyModelInstance
- type CreateModel
- type CreateModelAssociation
- type CreateModelAttrUnique
- type CreateModelAttributeGroup
- type CreateModelAttributes
- type CreateModelInstance
- type CreateModelResult
- type CreateObjectAttributeResult
- type CreateObjectClassificationResult
- type CreateObjectGroupResult
- type CreateObjectResult
- type CreateOneDataResult
- type CreateOneInstanceAssociation
- type CreateOneModelClassification
- type CreateResult
- type CreateUniqueRequest
- type CreateUniqueResult
- type CreatedCount
- type CreatedDataResult
- type CreatedManyOptionResult
- type CreatedOneOptionResult
- type DefaultModuleHostConfigParams
- type DeleteAssociationInstRequest
- type DeleteAssociationInstResult
- type DeleteAssociationObjectResult
- type DeleteAssociationTypeResult
- type DeleteCloudTask
- type DeleteHostBatchOpt
- type DeleteHostFromBizParameter
- type DeleteHostRequest
- type DeleteModelAttrUnique
- type DeleteModelClassificationResult
- type DeleteNetDeviceBatchOpt
- type DeleteNetPropertyBatchOpt
- type DeleteOption
- type DeleteResult
- type DeleteUniqueRequest
- type DeleteUniqueResult
- type DeletedCount
- type DeletedOptionResult
- type Dimension
- type DistInst
- type DistInstCtx
- type EsbBaseResponse
- type EsbResponse
- type EventData
- type EventInst
- type EventInstCtx
- type EventType
- type ExcelAssocation
- type ExcelAssocationOperate
- type ExceptionResult
- type FavoriteResult
- type FavouriteMeta
- type FavouriteParms
- type FilePriviewMap
- type GetAgentStatusResult
- type GetHistoryResult
- type GetHostAppByCompanyIDParams
- type GetHostFavoriteResult
- type GetHostFavoriteWithIDResult
- type GetHostModuleIDsResult
- type GetHostSnapResult
- type GetHostsResult
- type GetIPAndProxyByCompanyParams
- type GetUserConfigDetailResult
- type GetUserConfigResult
- type GetUserCustomResult
- type GitServerIpParams
- type Gprivilege
- type GraphAsst
- type Group
- type GroupPriviResult
- type GroupPrivilege
- type GseHost
- type GseProcConfigmap
- type GseProcControl
- type GseProcIdentity
- type GseProcMeta
- type GseProcMonitorPlolicy
- type GseProcRequest
- type GseProcResource
- type GseProcSpec
- type GseProcWarnReportPolicy
- type GseProcessOperateTaskResult
- type Header
- type HistoryContent
- type HistoryMeta
- type HistoryResult
- type HostCloneInputParams
- type HostCommonSearch
- type HostConfig
- type HostIdentModule
- type HostIdentProcess
- type HostIdentProcessSorter
- type HostIdentifier
- type HostInfo
- type HostInputType
- type HostInstanceProperties
- type HostInstancePropertiesResult
- type HostInstanceResult
- type HostList
- type HostLockData
- type HostLockQueryResponse
- type HostLockRequest
- type HostLockResponse
- type HostLockResultResponse
- type HostModuleFind
- type HostModuleRelationParameter
- type HostModuleRelationRequest
- type HostResponse
- type HostSearchByAppIDParams
- type HostSearchByIPParams
- type HostSearchByModuleIDParams
- type HostSearchBySetIDParams
- type HostSnap
- type HostSnapResult
- type HostSyncList
- type HostToAppModule
- type HostsModuleRelation
- type ID
- type IDResult
- type IPInfo
- type IPParam
- type InlineProcInfo
- type InnerModule
- type InnterAppTopo
- type InstAsst
- type InstDataInfo
- type InstNameAsst
- type InstResult
- type InstanceSet
- type Label
- func (label Label) Get(key string) (exist bool, value string)
- func (label Label) GetBusinessID() (int64, error)
- func (label Label) GetModelKind() (ModelKind, error)
- func (label Label) Int64(key string) (int64, error)
- func (label Label) IsTrue(key string) (bool, error)
- func (label Label) Set(key, value string)
- func (label Label) SetBusinessID(id int64)
- func (label Label) SetModelKind(kind ModelKind)
- type ListAssociationsWithAssociationKindResult
- type LoginChangeSupplierResult
- type LoginPluginInfo
- type LoginSystemUserInfo
- type LoginUserInfo
- type LoginUserInfoDetail
- type LoginUserInfoOwnerUinList
- type LoginUserInfoResult
- type LoginUserPluginInerface
- type LoginUserPluginParams
- type LogoutRequestParams
- type LogoutResult
- type LonginSystemUserListResult
- type MainLineObject
- type MainLineResult
- type MainlineObjectTopo
- type MainlineObjectTopoResult
- type MapArrayResponse
- type MatchProcInstParam
- type Metadata
- type ModelKind
- type ModifyProcInstanceDetail
- type ModuleHost
- type ModuleHostConfigParams
- type ModuleInst
- type NetCollSearchParams
- type NetcollectConfig
- type NetcollectDevice
- type NetcollectHistory
- type NetcollectProperty
- type NetcollectReport
- type NetcollectReportAssociation
- type NetcollectReportAsstCond
- type NetcollectReportAttribute
- type NetcollectReportSummary
- type Netcollector
- type NetcollectorStatus
- type ObjAttDes
- type ObjClassificationObject
- type ObjQueryInput
- type Object
- func (o *Object) GetDefaultInstPropertyName() string
- func (o *Object) GetInstIDFieldName() string
- func (o *Object) GetInstNameFieldName() string
- func (o *Object) GetObjectID() string
- func (o *Object) GetObjectType() string
- func (o *Object) IsCommon() bool
- func (o *Object) Parse(data mapstr.MapStr) (*Object, error)
- func (o *Object) ToMapStr() mapstr.MapStr
- type ObjectAttr
- type ObjectAttrBatchResult
- type ObjectAttrGroupResult
- type ObjectAttrResult
- type ObjectClsDes
- type ObjectTopo
- type ObjectUnique
- type OperaterException
- type OperationLog
- type ParamData
- type ParamNetcollectComfirm
- type ParamNetcollectDiscover
- type ParamNetcollectorSearch
- type ParamSearchNetcollectReport
- type ParamSubscriptionSearch
- type ParamSubscriptionTelnet
- type ParamSubscriptionTestCallback
- type Permission
- type PermissionGroupListResult
- type PermissionSystemResponse
- type Position
- type Privilege
- type PrivilegeUserGroup
- type ProcInfoArrResult
- type ProcInstModelResult
- type ProcInstanceDetail
- type ProcInstanceDetailResult
- type ProcInstanceDetailStatus
- type ProcInstanceModel
- type ProcModuleConfig
- type ProcModuleResult
- type ProcOpTaskStatus
- type ProcessInst
- type ProcessModule
- type ProcessOperate
- type ProcessOperateTask
- type ProcessOperateTaskDetail
- type ProcessOperateTaskResult
- type PropertyGroupCondition
- type PropertyGroupObjectAtt
- type QueryCondition
- type QueryConditionResult
- type QueryHostLockRequest
- type QueryInput
- type QueryInstResult
- type QueryModelAttributeDataResult
- type QueryModelAttributeGroupDataResult
- type QueryModelClassificationDataResult
- type QueryModelDataResult
- type QueryModelWithAttributeDataResult
- type QueryObjectAssociationResult
- type QueryObjectAttributeResult
- type QueryObjectAttributeWrapperResult
- type QueryObjectClassificationResult
- type QueryObjectClassificationWithObjectsResult
- type QueryObjectGroupResult
- type QueryObjectResult
- type QueryResult
- type QueryUniqueResult
- type ReadInstAssociationResult
- type ReadModelAssociationResult
- type ReadModelAttrResult
- type ReadModelAttributeGroupResult
- type ReadModelClassifitionResult
- type ReadModelResult
- type ReadModelUniqueResult
- type Ref
- type Region
- type RegionResponse
- type RegionSet
- type RepeatedDataResult
- type RequestImportAssociation
- type Resource
- type ResourceConfirm
- type RespError
- type ResponeImportAssociation
- type ResponeImportAssociationData
- type Response
- type ResponseDataMapStr
- type ResponseInstData
- type RoleAppResult
- type RolePriResult
- type RowMsgData
- type RspID
- type RspNetcollectConfirm
- type RspNetcollectHistory
- type RspNetcollectReport
- type RspNetcollectorSearch
- type RspSubscriptionCreate
- type RspSubscriptionSearch
- type RspSubscriptionTestCallback
- type SaveAuditLogParams
- type SearchAssociationInstRequest
- type SearchAssociationInstRequestCond
- type SearchAssociationInstResult
- type SearchAssociationObjectRequest
- type SearchAssociationObjectResult
- type SearchAssociationTypeRequest
- type SearchAssociationTypeResult
- type SearchCondition
- type SearchDataResult
- type SearchGroup
- type SearchHost
- type SearchHostIdentifierResult
- type SearchHostResult
- type SearchIdentifierParam
- type SearchInnterAppTopoResult
- type SearchInstResult
- type SearchLimit
- type SearchMainLine
- type SearchModelInfo
- type SearchModelResult
- type SearchNetDevice
- type SearchNetDeviceResult
- type SearchNetProperty
- type SearchNetPropertyResult
- type SearchParams
- type SearchSort
- type SearchSortParse
- type SearchTopoGraphicsResult
- type SearchTopoInstanceNodeResult
- type SearchTopoModelNodeResult
- type SearchUniqueRequest
- type SearchUniqueResult
- type SetAssociationKind
- type SetDataResult
- type SetHostConfigParams
- type SetInst
- type SetManyAssociationKind
- type SetManyInstanceAssociation
- type SetManyModelClassification
- type SetManyModelInstance
- type SetModel
- type SetModelAssociation
- type SetModelAttributeGroup
- type SetModelAttributes
- type SetModelInstance
- type SetOneInstanceAssociation
- type SetOneModelClassification
- type SetOptionResult
- type Statistics
- type Subscription
- type SynchronizeClearDataParameter
- type SynchronizeDataInfo
- type SynchronizeDataResult
- type SynchronizeFindInfoParameter
- type SynchronizeItem
- type SynchronizeOperateDataType
- type SynchronizeOperateType
- type SynchronizeParameter
- type SynchronizeResult
- type SysConfigStruct
- type TaskInfo
- type TemplateVersion
- type Time
- func (t Time) GetBSON() (interface{}, error)
- func (t Time) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) Scan(value interface{}) error
- func (t *Time) SetBSON(raw mgobson.Raw) error
- func (t *Time) UnmarshalBSONValue(typo bsontype.Type, raw []byte) error
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t Time) Value() (driver.Value, error)
- type TopoGraphics
- func (t *TopoGraphics) FillBlank() *TopoGraphics
- func (t *TopoGraphics) SetExt(val map[string]interface{})
- func (t *TopoGraphics) SetIcon(val string)
- func (t *TopoGraphics) SetInstID(val int)
- func (t *TopoGraphics) SetIsPre(val bool)
- func (t *TopoGraphics) SetMetaData(val Metadata)
- func (t *TopoGraphics) SetNodeName(val string)
- func (t *TopoGraphics) SetNodeType(val string)
- func (t *TopoGraphics) SetObjID(val string)
- func (t *TopoGraphics) SetPosition(val Position)
- func (t *TopoGraphics) SetScopeID(val string)
- func (t *TopoGraphics) SetScopeType(val string)
- func (t *TopoGraphics) SetSupplierAccount(val string)
- type TopoInst
- type TopoInstRst
- type TopoInstance
- type TopoInstanceNode
- type TopoItem
- type TopoModelNode
- type TransferHostAcrossBusinessParameter
- type TransferHostToInnerModule
- type TransferHostsCrossBusinessRequest
- type UniqueKey
- type UpdateAssociationObjectRequest
- type UpdateAssociationObjectResult
- type UpdateAssociationTypeRequest
- type UpdateAssociationTypeResult
- type UpdateGroupCondition
- type UpdateHostParams
- type UpdateModelAttrUnique
- type UpdateOption
- type UpdateParams
- type UpdateResult
- type UpdateTopoGraphicsInput
- type UpdateUniqueRequest
- type UpdateUniqueResult
- type UpdatedCount
- type UpdatedDataResult
- type UpdatedOptionResult
- type UserConfig
- type UserConfigMeta
- type UserConfigResult
- type UserCustomQueryDetailResult
- type UserGroup
- type UserPriviResult
- type UserPrivilege
Constants ¶
const ( // AssociationFieldObjectID the association data field definition AssociationFieldObjectID = "bk_obj_id" // AssociationFieldAsstID the association data field bk_obj_asst_id AssociationFieldAsstID = "bk_obj_asst_id" // AssociationFieldObjectAttributeID the association data field definition //AssociationFieldObjectAttributeID = "bk_object_att_id" // AssociationFieldSupplierAccount the association data field definition AssociationFieldSupplierAccount = "bk_supplier_account" // AssociationFieldAssociationForward the association data field definition // AssociationFieldAssociationForward = "bk_asst_forward" // AssociationFieldAssociationObjectID the association data field definition AssociationFieldAssociationObjectID = "bk_asst_obj_id" // AssociationFieldAssociationName the association data field definition // AssociationFieldAssociationName = "bk_asst_name" // AssociationFieldAssociationId auto incr id AssociationFieldAssociationId = "id" AssociationFieldAssociationKind = "bk_asst_id" )
const ( // this is a default action, which is do nothing when a association between object is deleted. NoAction AssociationOnDeleteAction = "none" // delete related source object instances when the association is deleted. DeleteSource AssociationOnDeleteAction = "delete_src" // delete related destination object instances when the association is deleted. DeleteDestinatioin AssociationOnDeleteAction = "delete_dest" // the source object can be related with only one destination object OneToOneMapping AssociationMapping = "1:1" // the source object can be related with multiple destination objects OneToManyMapping AssociationMapping = "1:n" // multiple source object can be related with multiple destination objects ManyToManyMapping AssociationMapping = "n:n" )
const ( AttributeFieldID = "id" AttributeFieldSupplierAccount = "bk_supplier_account" AttributeFieldObjectID = "bk_obj_id" AttributeFieldPropertyID = "bk_property_id" AttributeFieldPropertyName = "bk_property_name" AttributeFieldPropertyGroup = "bk_property_group" AttributeFieldPropertyIndex = "bk_property_index" AttributeFieldUnit = "unit" AttributeFieldPlaceHoler = "placeholder" AttributeFieldIsEditable = "editable" AttributeFieldIsPre = "ispre" AttributeFieldIsRequired = "isrequired" AttributeFieldIsReadOnly = "isreadonly" AttributeFieldIsOnly = "isonly" AttributeFieldIsSystem = "bk_issystem" AttributeFieldIsAPI = "bk_isapi" AttributeFieldPropertyType = "bk_property_type" AttributeFieldOption = "option" AttributeFieldDescription = "description" AttributeFieldCreator = "creator" AttributeFieldCreateTime = "create_time" AttributeFieldLastTime = "last_time" )
const ( ClassificationFieldID = "id" ClassFieldClassificationID = "bk_classification_id" ClassFieldClassificationName = "bk_classification_name" ClassFieldClassificationType = "bk_classification_type" ClassFieldClassificationIcon = "bk_classification_icon" ClassFieldClassificationSupplierAccount = "bk_supplier_account" )
const ( EventActionCreate = "create" EventActionUpdate = "update" EventActionDelete = "delete" )
EventAction
const ( EventTypeInstData = "instdata" EventTypeRelation = "relation" EventTypeAssociation = "association" EventTypeResourcePoolModule = "resource" )
EventType enumeration
const ( EventObjTypeProcModule = "processmodule" EventObjTypeModuleTransfer = "moduletransfer" )
Event object type
const ( GroupFieldID = "id" GroupFieldGroupID = "bk_group_id" GroupFieldGroupName = "bk_group_name" GroupFieldGroupIndex = "bk_group_index" GroupFieldObjectID = "bk_obj_id" GroupFieldSupplierAccount = "bk_supplier_account" GroupFieldIsDefault = "bk_isdefault" GroupFieldIsPre = "ispre" )
const ( // LabelTrue and LabelFalse is used to define if the label value is a bool value, // which is true or false. LabelTrue string = "true" LabelFalse string = "false" // LabelBusinessID is used to define a label key which value is the business number value. LabelBusinessID string = "bk_biz_id" // LabelModelKind is used to define a label key which describe what kind of this object is. // this label key is always used with the value of PublicModelKindValue or BusinessModelKindValue. LabelModelKind string = "object_kind" PublicModelKindValue ModelKind = "public_object" BusinessModelKindValue ModelKind = "business_object" )
const ( BKMetadata string = "metadata" BKLabel string = "label" )
const ( CollectorStatusNormal = "normal" CollectorStatusAbnormal = "abnormal" CollectorConfigStatusNormal = "normal" CollectorConfigStatusPending = "pending" CollectorConfigStatusAbnormal = "abnormal" CollectorReportStatusNormal = "normal" CollectorReportStatusAbnormal = "abnormal" )
NetcollectorStatus define
const ( ReporctActionCreate = "create" ReporctActionUpdate = "update" ReporctActionDelete = "delete" )
const ( ReporctMethodAccept = "accept" ReporctMethodIgnore = "ignore" )
const ( ModelFieldID = "id" ModelFieldObjCls = "bk_classification_id" ModelFieldObjIcon = "bk_obj_icon" ModelFieldObjectID = "bk_obj_id" ModelFieldObjectName = "bk_obj_name" ModelFieldIsPre = "ispre" ModelFieldIsPaused = "bk_ispaused" ModelFieldPosition = "position" ModelFieldOwnerID = "bk_supplier_account" ModelFieldDescription = "description" ModelFieldCreator = "creator" ModelFieldModifier = "modifier" ModelFieldCreateTime = "create_time" ModelFieldLastTime = "last_time" )
const ( PageName = "page" PageSort = "sort" PageStart = "start" DBFields = "fields" DBQueryCondition = "condition" )
const ( UniqueKeyKindProperty = "property" UniqueKeyKindAssociation = "association" )
const (
CC_time_type_parse_flag = "cc_time_type"
)
Variables ¶
var ( ConfirmmodeHttpstatus = "httpstatus" ConfirmmodeRegular = "regular" )
ConfirmMode define
var BizLabelNotExist = mapstr.MapStr{"metadata.label.bk_biz_id": mapstr.MapStr{"$exists": false}}
var DelHostInAppParams struct { AppID string `json:"appId"` HostID string `json:"hostId"` }
var (
LabelKeyNotExistError = errors.New("label key does not exist")
)
var SuccessBaseResp = BaseResp{Result: true, Code: common.CCSuccess, ErrMsg: common.CCSuccessStr}
SuccessBaseResp default result
Functions ¶
func BizIDFromMetadata ¶
func GetBusinessIDFromMeta ¶
func GetBusinessIDFromMeta(data interface{}) string
func GetInstIDFieldByObjID ¶
func NewPublicOrBizConditionByBizID ¶
NewPublicOrBizConditionByBizID new a query condition
func ParseBizIDFromData ¶
GetBizIDFromMetadata parse biz id from metadata, 0 for global case nil ==> 0, error [] ==> 0, error {} ==> 0, nil {"label": {}} ==> 0, nil {"label": []} ==> 0, error {"label": {"bk_biz_id": 1}} ==> 1, nil {"label": {"bk_biz_id": "a"}} ==> 0, error
func PublicAndBizCondition ¶
Types ¶
type AddConfigQuery ¶
type AddDeviceResult ¶
type AddDeviceResult struct {
DeviceID uint64 `json:"device_id"`
}
type AddHistoryResult ¶
type AddHostFromAgentHostList ¶
type AddHostFromAgentHostList struct {
HostInfo map[string]interface{} `json:"host_info"`
}
type AddNetPropertyResult ¶
type AddNetPropertyResult struct {
NetcollectPropertyID uint64 `json:"netcollect_property_id"`
}
type AppQueryResult ¶
type AppQueryResult struct {
BaseResp `json:",inline"`
Data InstResult `json:"data"`
}
type AssignHostToAppParams ¶
type Association ¶
type Association struct {
ID int64 `field:"id" json:"id" bson:"id"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
// the unique id belongs to this association, should be generated with rules as follows:
// "$ObjectID"_"$AsstID"_"$AsstObjID"
AssociationName string `field:"bk_obj_asst_id" json:"bk_obj_asst_id" bson:"bk_obj_asst_id"`
// the alias name of this association, which is a substitute name in the association kind $AsstKindID
AssociationAliasName string `field:"bk_obj_asst_name" json:"bk_obj_asst_name" bson:"bk_obj_asst_name"`
// describe which object this association is defined for.
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
// describe where the Object associate with.
AsstObjID string `field:"bk_asst_obj_id" json:"bk_asst_obj_id" bson:"bk_asst_obj_id"`
// the association kind used by this association.
AsstKindID string `field:"bk_asst_id" json:"bk_asst_id" bson:"bk_asst_id"`
// defined which kind of association can be used between the source object and destination object.
Mapping AssociationMapping `field:"mapping" json:"mapping" bson:"mapping"`
// describe the action when this association is deleted.
OnDelete AssociationOnDeleteAction `field:"on_delete" json:"on_delete" bson:"on_delete"`
// describe whether this association is a pre-defined association or not,
// if true, it means this association is used by cmdb itself.
IsPre *bool `field:"ispre" json:"ispre" bson:"ispre"`
ClassificationID string `field:"bk_classification_id" json:"-" bson:"-"`
ObjectIcon string `field:"bk_obj_icon" json:"-" bson:"-"`
ObjectName string `field:"bk_obj_name" json:"-" bson:"-"`
// define the metadata of assocication
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
}
Association defines the association between two objects.
func (*Association) CanUpdate ¶
func (a *Association) CanUpdate() (field string, can bool)
return field means which filed is set but is forbidden to update.
func (*Association) Parse ¶
func (cli *Association) Parse(data mapstr.MapStr) (*Association, error)
Parse load the data from mapstr attribute into attribute instance
type AssociationDetail ¶
type AssociationDetail struct {
// the ID of the association kind.
AssociationKindID string `json:"bk_asst_id"`
Associations []Association `json:"assts"`
}
type AssociationDirection ¶
type AssociationDirection string
关联类型
const ( NoneDirection AssociationDirection = "none" DestinationToSource AssociationDirection = "src_to_dest" SourceToDestination AssociationDirection = "dest_to_src" Bidirectional AssociationDirection = "bidirectional" )
type AssociationKind ¶
type AssociationKind struct {
ID int64 `field:"id" json:"id" bson:"id"`
// a unique association id created by user.
AssociationKindID string `field:"bk_asst_id" json:"bk_asst_id" bson:"bk_asst_id"`
// a memorable name for this association kind, could be a chinese name, a english name etc.
AssociationKindName string `field:"bk_asst_name" json:"bk_asst_name" bson:"bk_asst_name"`
// the owner that this association type belongs to.
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
// the describe for the relationship from source object to the target(destination) object, which will be displayed
// when the topology is constructed between objects.
SourceToDestinationNote string `field:"src_des" json:"src_des" bson:"src_des"`
// the describe for the relationship from the target(destination) object to source object, which will be displayed
// when the topology is constructed between objects.
DestinationToSourceNote string `field:"dest_des" json:"dest_des" bson:"dest_des"`
// the association direction between two objects.
Direction AssociationDirection `field:"direction" json:"direction" bson:"direction"`
// whether this is a pre-defined kind.
IsPre *bool `field:"ispre" json:"ispre" bson:"ispre"`
// define the metadata of association kind
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
}
func (*AssociationKind) Parse ¶
func (cli *AssociationKind) Parse(data mapstr.MapStr) (*AssociationKind, error)
type AssociationKindIDs ¶
type AssociationKindIDs struct {
// the association kind ids.
AsstIDs []string `json:"asst_ids"`
}
type AssociationList ¶
type AssociationList struct {
Associations []AssociationDetail `json:"associations"`
}
type AssociationMapping ¶
type AssociationMapping string
type AssociationOnDeleteAction ¶
type AssociationOnDeleteAction string
type AssociationParams ¶
type AssociationParams struct {
Page BasePage `json:"page,omitempty"`
Fields map[string][]string `json:"fields,omitempty"`
Condition map[string][]ConditionItem `json:"condition,omitempty"`
}
AssociationParams association params
type Attribute ¶
type Attribute struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
ID int64 `field:"id" json:"id" bson:"id"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
PropertyID string `field:"bk_property_id" json:"bk_property_id" bson:"bk_property_id"`
PropertyName string `field:"bk_property_name" json:"bk_property_name" bson:"bk_property_name"`
PropertyGroup string `field:"bk_property_group" json:"bk_property_group" bson:"bk_property_group"`
PropertyGroupName string `field:"bk_property_group_name,ignoretomap" json:"bk_property_group_name" bson:"-"`
PropertyIndex int64 `field:"bk_property_index" json:"bk_property_index" bson:"bk_property_index"`
Unit string `field:"unit" json:"unit" bson:"unit"`
Placeholder string `field:"placeholder" json:"placeholder" bson:"placeholder"`
IsEditable bool `field:"editable" json:"editable" bson:"editable"`
IsPre bool `field:"ispre" json:"ispre" bson:"ispre"`
IsRequired bool `field:"isrequired" json:"isrequired" bson:"isrequired"`
IsReadOnly bool `field:"isreadonly" json:"isreadonly" bson:"isreadonly"`
IsOnly bool `field:"isonly" json:"isonly" bson:"isonly"`
IsSystem bool `field:"bk_issystem" json:"bk_issystem" bson:"bk_issystem"`
IsAPI bool `field:"bk_isapi" json:"bk_isapi" bson:"bk_isapi"`
PropertyType string `field:"bk_property_type" json:"bk_property_type" bson:"bk_property_type"`
Option interface{} `field:"option" json:"option" bson:"option"`
Description string `field:"description" json:"description" bson:"description"`
Creator string `field:"creator" json:"creator" bson:"creator"`
CreateTime *Time `json:"create_time" bson:"create_time"`
LastTime *Time `json:"last_time" bson:"last_time"`
}
Attribute attribute metadata definition
type AttributeGroup ¶
type AttributeGroup struct {
ID int64 `field:"id" json:"id" bson:"id"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
IsDefault bool `field:"bk_isdefault" json:"bk_isdefault" bson:"bk_isdefault"`
IsPre bool `field:"ispre" json:"ispre" bson:"ispre"`
GroupID string `field:"bk_group_id" json:"bk_group_id" bson:"bk_group_id"`
GroupName string `field:"bk_group_name" json:"bk_group_name" bson:"bk_group_name"`
GroupIndex int64 `field:"bk_group_index" json:"bk_group_index" bson:"bk_group_index"`
}
AttributeGroup attribute metadata definition
type AttributeWrapper ¶
type AttributeWrapper struct {
Attribute `json:",inline"`
AssoType int `json:"bk_asst_type"`
AsstForward string `json:"bk_asst_forward"`
AssociationID string `json:"bk_asst_obj_id"`
PropertyGroupName string `json:"bk_property_group_name"`
}
AttributeWrapper wrapper, expansion field
type AuditQueryResult ¶
type AuditQueryResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []OperationLog `json:"info"`
} `json:"data"`
}
AuditQueryResult add single host log paramm
type AuthBathVerifyRequest ¶
type AuthBathVerifyRequest struct {
Resources []AuthResource `json:"resources"`
}
type AuthBathVerifyResult ¶
type AuthBathVerifyResult struct {
AuthResource
// the authorize decision, whether a user has been authorized or not.
Passed bool `json:"is_pass"`
// the detailed reason for this authorize.
Reason string `json:"reason"`
}
type AuthResource ¶
type AuthResource struct {
BizID int64 `json:"bk_biz_id"`
ResourceType string `json:"resource_type"`
ResourceID int64 `json:"resource_id"`
Action string `json:"action"`
ParentLayers []struct {
ResourceType string `json:"resource_type"`
ResourceID int64 `json:"resource_id"`
} `json:"parent_layers"`
}
type BasePage ¶
type BasePage struct {
Sort string `json:"sort,omitempty"`
Limit int `json:"limit,omitempty"`
Start int `json:"start,omitempty"`
}
BasePage for paging query
type BaseResp ¶
type BaseResp struct {
Result bool `json:"result"`
Code int `json:"bk_error_code"`
ErrMsg string `json:"bk_error_msg"`
Permissions []Permission `json:"permission"`
}
BaseResp common result struct
func NewNoPermissionResp ¶
func NewNoPermissionResp(permission []Permission) BaseResp
type BatchAddDevice ¶
type BatchAddDevice struct {
Data []NetcollectDevice `json:"data"`
}
type BatchAddDeviceResult ¶
type BatchAddNetProperty ¶
type BatchAddNetProperty struct {
Data []NetcollectProperty `json:"data"`
}
type BkHostInfo ¶
type Classification ¶
type Classification struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
ID int64 `field:"id" json:"id" bson:"id"`
ClassificationID string `field:"bk_classification_id" json:"bk_classification_id" bson:"bk_classification_id"`
ClassificationName string `field:"bk_classification_name" json:"bk_classification_name" bson:"bk_classification_name"`
ClassificationType string `field:"bk_classification_type" json:"bk_classification_type" bson:"bk_classification_type"`
ClassificationIcon string `field:"bk_classification_icon" json:"bk_classification_icon" bson:"bk_classification_icon"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account" `
}
Classification the classification metadata definition
func (*Classification) Parse ¶
func (cli *Classification) Parse(data mapstr.MapStr) (*Classification, error)
Parse load the data from mapstr classification into classification instance
func (*Classification) ToMapStr ¶
func (cli *Classification) ToMapStr() mapstr.MapStr
ToMapStr to mapstr
type ClassificationWithObject ¶
type ClassificationWithObject struct {
Classification `json:",inline"`
Objects []Object `json:"bk_objects"`
AsstObjects map[string][]Object `json:"bk_asst_objects"`
}
ClassificationWithObject classification with object
type CloneHostPropertyParams ¶
type CloudHistory ¶
type CloudHistory struct {
ObjID string `json:"bk_obj_id"`
Status string `json:"bk_status"`
TimeConsume string `json:"bk_time_consume"`
NewAdd int `json:"new_add"`
AttrChanged int `json:"attr_changed"`
StartTime string `json:"bk_start_time"`
TaskID int64 `json:"bk_task_id"`
HistoryID int64 `json:"bk_history_id"`
FailReason string `json:"fail_reason"`
}
type CloudHostInfo ¶
type CloudHostModuleParams ¶
type CloudHostModuleParams struct {
ApplicationID int64 `json:"bk_biz_id"`
HostInfoArr []BkHostInfo `json:"host_info"`
ModuleID int64 `json:"bk_module_id"`
}
type CloudTaskInfo ¶
type CloudTaskInfo struct {
User string `json:"bk_user" bson:"bk_user"`
TaskName string `json:"bk_task_name" bson:"bk_task_name"`
TaskID int64 `json:"bk_task_id" bson:"bk_task_id"`
AccountType string `json:"bk_account_type" bson:"bk_account_type"`
AccountAdmin string `json:"bk_account_admin" bson:"bk_account_admin"`
PeriodType string `json:"bk_period_type" bson:"bk_period_type"`
Period string `json:"bk_period" bson:"bk_period"`
LastSyncTime string `json:"bk_last_sync_time" bson:"bk_last_sync_time"`
ObjID string `json:"bk_obj_id" bson:"bk_obj_id"`
Status bool `json:"bk_status" bson:"bk_status"`
ResourceConfirm bool `json:"bk_confirm" bson:"bk_confirm"`
AttrConfirm bool `json:"bk_attr_confirm" bson:"bk_attr_confirm"`
SecretID string `json:"bk_secret_id" bson:"bk_secret_id"`
SecretKey string `json:"bk_secret_key" bson:"bk_secret_key"`
SyncStatus string `json:"bk_sync_status" bson:"bk_sync_status"`
NewAdd int64 `json:"new_add" bson:"new_add"`
AttrChanged int64 `json:"attr_changed" bson:"attr_changed"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}
type CloudTaskList ¶
type CloudTaskList struct {
User string `json:"bk_user"`
TaskName string `json:"bk_task_name"`
TaskID int64 `json:"bk_task_id"`
AccountType string `json:"bk_account_type"`
AccountAdmin string `json:"bk_account_admin"`
PeriodType string `json:"bk_period_type"`
Period string `json:"bk_period"`
LastSyncTime string `json:"bk_last_sync_time"`
ObjID string `json:"bk_obj_id"`
Status bool `json:"bk_status"`
ResourceConfirm bool `json:"bk_confirm"`
AttrConfirm bool `json:"bk_attr_confirm"`
SecretID string `json:"bk_secret_id"`
SecretKey string `json:"bk_secret_key"`
}
type CloudTaskSearch ¶
type CloudTaskSearch struct {
Count uint64 `json:"count"`
Info []CloudTaskInfo `json:"info"`
}
type ConditionItem ¶
type ConditionItem struct {
Field string `json:"field,omitempty"`
Operator string `json:"operator,omitempty"`
Value interface{} `json:"value,omitempty"`
}
ConditionItem subcondition
type ConfirmMode ¶
type ConfirmMode string
ConfirmMode define
func (*ConfirmMode) Scan ¶
func (n *ConfirmMode) Scan(value interface{}) error
Scan implement sql driver's Scan interface
type Content ¶
type Content struct {
PreData interface{} `json:"pre_data"`
CurData interface{} `json:"cur_data"`
Headers []Header `json:"header"`
}
type CreateAssociationInstRequest ¶
type CreateAssociationInstRequest struct {
ObjectAsstID string `field:"bk_obj_asst_id" json:"bk_obj_asst_id,omitempty" bson:"bk_obj_asst_id,omitempty"`
InstID int64 `field:"bk_inst_id" json:"bk_inst_id,omitempty" bson:"bk_inst_id,omitempty"`
AsstInstID int64 `field:"bk_asst_inst_id" json:"bk_asst_inst_id,omitempty" bson:"bk_asst_inst_id,omitempty"`
}
type CreateAssociationKind ¶
type CreateAssociationKind struct {
Data AssociationKind `json:"data"`
}
type CreateInstResult ¶
CreateInstResult create inst result
type CreateManyAssociationKind ¶
type CreateManyAssociationKind struct {
Datas []AssociationKind `json:"datas"`
}
type CreateManyDataResult ¶
type CreateManyDataResult struct {
CreateManyInfoResult `json:",inline"`
}
CreateManyDataResult the data struct definition in create many function result
type CreateManyInfoResult ¶
type CreateManyInfoResult struct {
Created []CreatedDataResult `json:"created"`
Repeated []RepeatedDataResult `json:"repeated"`
Exceptions []ExceptionResult `json:"exception"`
}
CreateManyInfoResult create many function return this result struct
type CreateManyInstanceAssociation ¶
type CreateManyInstanceAssociation struct {
Datas []InstAsst `json:"datas"`
}
type CreateManyModelClassifiaction ¶
type CreateManyModelClassifiaction struct {
Data []Classification `json:"datas"`
}
CreateManyModelClassifiaction create many input params
type CreateManyModelInstance ¶
type CreateModel ¶
CreateModel create model params
type CreateModelAssociation ¶
type CreateModelAssociation struct {
Spec Association `json:"spec"`
}
type CreateModelAttrUnique ¶
type CreateModelAttrUnique struct {
Data ObjectUnique `json:"data"`
}
type CreateModelAttributeGroup ¶
type CreateModelAttributeGroup struct {
Data Group `json:"data"`
}
CreateModelAttributeGroup used to create a new group for some attributes
type CreateModelAttributes ¶
type CreateModelAttributes struct {
Attributes []Attribute `json:"attributes"`
}
CreateModelAttributes create model attributes
type CreateModelInstance ¶
type CreateModelResult ¶
type CreateObjectAttributeResult ¶
CreateObjectAttributeResult create object attribute result
type CreateObjectClassificationResult ¶
CreateObjectClassificationResult create the object classification result
type CreateObjectGroupResult ¶
CreateObjectGroupResult create the object group result
type CreateObjectResult ¶
CreateObjectResult create object result
type CreateOneDataResult ¶
type CreateOneDataResult struct {
Created CreatedDataResult `json:"created"`
}
CreateOneDataResult the data struct definition in create one function result
type CreateOneInstanceAssociation ¶
type CreateOneInstanceAssociation struct {
Data InstAsst `json:"data"`
}
type CreateOneModelClassification ¶
type CreateOneModelClassification struct {
Data Classification `json:"data"`
}
CreateOneModelClassification create one model classification
type CreateResult ¶
type CreateResult struct {
BaseResp `json:",inline"`
Data []Association `json:"data"`
}
CreateResult create result
type CreateUniqueRequest ¶
type CreateUniqueResult ¶
type CreatedCount ¶
type CreatedCount struct {
Count uint64 `json:"created_count"`
}
CreatedCount created count struct
type CreatedDataResult ¶
CreatedDataResult common created result definition
type CreatedManyOptionResult ¶
type CreatedManyOptionResult struct {
BaseResp `json:",inline"`
Data CreateManyDataResult `json:"data"`
}
CreatedManyOptionResult create many api http response return this result struct
type CreatedOneOptionResult ¶
type CreatedOneOptionResult struct {
BaseResp `json:",inline"`
Data CreateOneDataResult `json:"data"`
}
CreatedOneOptionResult create One api http response return this result struct
type DeleteCloudTask ¶
type DeleteCloudTask struct {
TaskID int64 `json:"bk_task_id"`
}
type DeleteHostBatchOpt ¶
type DeleteHostBatchOpt struct {
HostID string `json:"bk_host_id"`
}
type DeleteHostFromBizParameter ¶
type DeleteHostFromBizParameter struct {
AppID int64 `json:"bk_biz_id"`
HostIDArr []int64 `json:"bk_host_ids"`
}
DeleteHostFromBizParameter delete host from business
type DeleteHostRequest ¶
type DeleteHostRequest struct {
ApplicationID int64 `json:"bk_biz_id"`
HostIDArr []int64 `json:"bk_host_ids"`
}
DeleteHostRequest delete host from application
type DeleteModelAttrUnique ¶
type DeleteModelAttrUnique struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
}
type DeleteModelClassificationResult ¶
type DeleteModelClassificationResult struct {
BaseResp `json:",inline"`
Data DeletedCount `json:"data"`
}
DeleteModelClassificationResult delete the model classification result
type DeleteNetDeviceBatchOpt ¶
type DeleteNetDeviceBatchOpt struct {
DeviceIDs []uint64 `json:"device_id"`
}
type DeleteNetPropertyBatchOpt ¶
type DeleteNetPropertyBatchOpt struct {
NetcollectPropertyIDs []uint64 `json:"netcollect_property_id"`
}
type DeleteOption ¶
DeleteOption common delete condition options
type DeleteResult ¶
type DeleteResult struct {
BaseResp `json:",inline"`
}
DeleteResult delete result
type DeleteUniqueRequest ¶
type DeleteUniqueResult ¶
type DeleteUniqueResult struct {
BaseResp
}
type DeletedCount ¶
type DeletedCount struct {
Count uint64 `json:"deleted_count"`
}
DeletedCount created count struct
type DeletedOptionResult ¶
type DeletedOptionResult struct {
BaseResp `json:",inline"`
Data DeletedCount `json:"data"`
}
DeletedCountResult delete api http response return result struct
type DistInstCtx ¶
type EsbBaseResponse ¶
type EsbResponse ¶
type EsbResponse struct {
EsbBaseResponse `json:",inline"`
Data mapstr.MapStr `json:"data"`
}
type EventData ¶
type EventData struct {
CurData interface{} `json:"cur_data"`
PreData interface{} `json:"pre_data"`
}
type EventInst ¶
type EventInst struct {
ID int64 `json:"event_id,omitempty"`
TxnID string `json:"txn_id"`
EventType string `json:"event_type"`
Action string `json:"action"`
ActionTime Time `json:"action_time"`
ObjType string `json:"obj_type"`
Data []EventData `json:"data"`
OwnerID string `json:"bk_supplier_account"`
RequestID string `json:"request_id"`
RequestTime Time `json:"request_time"`
}
func (*EventInst) MarshalBinary ¶
type EventInstCtx ¶
type ExcelAssocation ¶
type ExcelAssocation struct {
ObjectAsstID string `json:"bk_obj_asst_id"`
Operate ExcelAssocationOperate `json:"operate"`
SrcPrimary string `json:"src_primary_key"`
DstPrimary string `json:"dst_primary_key"`
}
type ExcelAssocationOperate ¶
type ExcelAssocationOperate int
const ( ExcelAssocationOperateError ExcelAssocationOperate ExcelAssocationOperateAdd //ExcelAssocationOperateUpdate ExcelAssocationOperateDelete )
type ExceptionResult ¶
type ExceptionResult struct {
Message string `json:"message"`
Code int64 `json:"code"`
Data interface{} `json:"data"`
OriginIndex int64 `json:"origin_index"`
}
ExceptionResult exception info
type FavoriteResult ¶
type FavouriteMeta ¶
type FavouriteMeta struct {
ID string `json:"id,omitempty" bson:"id,omitempty"`
Info string `json:"info,omitempty" bson:"info,omitempty"`
Name string `json:"name,omitempty" bson:"name,omitempty"`
Count int `json:"count,omitempty" bson:"count,omitempty"`
User string `json:"user,omitempty" bson:"user,omitempty"`
IsDefault int `json:"is_default,omitempty" bson:"is_default,omitempty"`
OwnerID string `json:"bk_supplier_account,omitempty" bson:"bk_supplier_account,omitempty"`
QueryParams string `json:"query_params,omitempty" bson:"query_params,omitempty"`
CreateTime time.Time `json:"create_time,omitempty" bson:"create_time,omitempty"`
UpdateTime time.Time `json:"last_time,omitempty" bson:"last_time,omitempty"`
}
type FavouriteParms ¶
type FilePriviewMap ¶
type GetAgentStatusResult ¶
type GetHistoryResult ¶
type GetHistoryResult struct {
BaseResp `json:",inline"`
Data HistoryResult `json:"data"`
}
type GetHostFavoriteResult ¶
type GetHostFavoriteResult struct {
BaseResp `json:",inline"`
Data FavoriteResult `json:"data"`
}
type GetHostFavoriteWithIDResult ¶
type GetHostFavoriteWithIDResult struct {
BaseResp `json:",inline"`
Data FavouriteMeta `json:"data"`
}
type GetHostModuleIDsResult ¶
type GetHostSnapResult ¶
type GetHostsResult ¶
type GetIPAndProxyByCompanyParams ¶
type GetIPAndProxyByCompanyParams struct {
Ips []string `json:"ips"`
AppIDStr *string `json:"bk_biz_id"`
CloudIDStr *string `json:"bk_cloud_id"`
}
GetIPAndProxyByCompanyParams get id and proxy by company
type GetUserConfigDetailResult ¶
type GetUserConfigDetailResult struct {
BaseResp `json:",inline"`
Data UserConfigMeta `json:"data"`
}
type GetUserConfigResult ¶
type GetUserConfigResult struct {
BaseResp `json:",inline"`
Data UserConfigResult `json:"data"`
}
type GetUserCustomResult ¶
type GitServerIpParams ¶
type Gprivilege ¶
type Gprivilege struct {
ModelConfig map[string]map[string][]string `json:"model_config" bson:"model_config"`
SysConfig SysConfigStruct `json:"sys_config,omitempty" bson:"sys_config"`
IsHostCrossBiz bool `json:"is_host_cross_biz" bson:"is_host_cross_biz"`
}
type GraphAsst ¶
type GraphAsst struct {
AsstType string `json:"bk_asst_type"`
NodeType string `json:"node_type"`
ObjID string `json:"bk_obj_id"`
InstID int64 `json:"bk_inst_id"`
AssociationKindInstID int64 `json:"bk_asst_inst_id"`
AsstName string `json:"bk_asst_name"`
Label map[string]string `json:"label"`
}
Asst the node association node
type Group ¶
type Group struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
ID int64 `field:"id" json:"id" bson:"id"`
GroupID string `field:"bk_group_id" json:"bk_group_id" bson:"bk_group_id"`
GroupName string `field:"bk_group_name" json:"bk_group_name" bson:"bk_group_name"`
GroupIndex int64 `field:"bk_group_index" json:"bk_group_index" bson:"bk_group_index"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
IsDefault bool `field:"bk_isdefault" json:"bk_isdefault" bson:"bk_isdefault"`
IsPre bool `field:"ispre" json:"ispre" bson:"ispre"`
}
Group group metadata definition
type GroupPriviResult ¶
type GroupPriviResult struct {
BaseResp `json:",inline"`
Data GroupPrivilege `json:"data"`
}
type GroupPrivilege ¶
type GseProcConfigmap ¶
type GseProcControl ¶
type GseProcControl struct {
StartCmd string `json:"start_cmd,omitempty"`
StopCmd string `json:"stop_cmd,omitempty"`
RestartCmd string `json:"restart_cmd,omitempty"`
ReloadCmd string `json:"reload_cmd,omitempty"`
KillCmd string `json:"kill_cmd,omitempty"`
VersionCmd string `json:"version_cmd,omitempty"`
HealthCmd string `json:"health_cmd,omitempty"`
}
type GseProcIdentity ¶
type GseProcIdentity struct {
IndexKey string `json:"index_key,omitempty"`
ProcName string `json:"proc_name,omitempty"`
SetupPath string `json:"setup_path,omitempty"`
PidPath string `json:"pid_path,omitempty"`
ConfigPath string `json:"config_path,omitempty"`
LogPath string `json:"log_path,omitempty"`
}
type GseProcMeta ¶
type GseProcMonitorPlolicy ¶
type GseProcMonitorPlolicy struct {
AutoType int `json:"auto_type,omitempty"`
StartCheckSecs int `json:"start_check_secs,omitempty"`
StopCheckSecs int `json:"stop_check_secs,omitempty"`
StartRetries int `json:"start_retries,omitempty"`
StartInterval int `json:"start_interval,omitempty"`
CrontabRule string `json:"crontab_rule,omitempty"`
}
type GseProcRequest ¶
type GseProcRequest struct {
AppID int64 `json:"bk_biz_id" bson:"bk_biz_id"`
ModuleID int64 `json:"bk_module_id" bson:"bk_module_id"`
ProcID int64 `json:"bk_process_id" bson:"bk_process_id"`
Meta GseProcMeta `json:"meta,omitempty" bson:"meta"`
Hosts []GseHost `json:"hosts,omitempty" bson:"hosts"`
OpType int `json:"op_type,omitempty" bson:"-"`
Spec GseProcSpec `json:"spec,omitempty" bson:"spec"`
}
type GseProcResource ¶
type GseProcSpec ¶
type GseProcSpec struct {
Identity GseProcIdentity `json:"identity,omitempty"`
Control GseProcControl `json:"control,omitempty"`
Resource GseProcResource `json:"resource,omitempty"`
MonitorPolicy GseProcMonitorPlolicy `json:"monitor_policy,omitempty"`
WarnReportPolicy GseProcWarnReportPolicy `json:"warn_report_policy,omitempty"`
Configmap []GseProcConfigmap `json:"configmap,omitempty"`
}
type GseProcWarnReportPolicy ¶
type GseProcWarnReportPolicy struct {
ReportId int `json:"report_id,omitempty"`
}
type GseProcessOperateTaskResult ¶
type GseProcessOperateTaskResult struct {
Data map[string]ProcessOperateTaskDetail `json:"data"`
EsbBaseResponse `json:",inline"`
}
type HistoryContent ¶
type HistoryContent struct {
Content string `json:"content"`
}
type HistoryMeta ¶
type HistoryMeta struct {
ID string `json:"id,omitempty" bson:"id,omitempty" `
User string `json:"user,omitempty" bson:"user,omitempty"`
Content string `json:"content,omitempty" bson:"content,omitempty"`
CreateTime time.Time `json:"create_time,omitempty" bson:"create_time,omitempty"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}
type HistoryResult ¶
type HistoryResult struct {
Count uint64 `json:"count"`
Info []HistoryMeta `json:"info"`
}
type HostCloneInputParams ¶
type HostCommonSearch ¶
type HostCommonSearch struct {
AppID int64 `json:"bk_biz_id,omitempty"`
Ip IPInfo `json:"ip"`
Condition []SearchCondition `json:"condition"`
Page BasePage `json:"page"`
Pattern string `json:"pattern,omitempty"`
}
type HostConfig ¶
type HostConfig struct {
BaseResp `json:",inline"`
Data []ModuleHost `json:"data"`
}
type HostIdentModule ¶
type HostIdentModule struct {
BizID int64 `json:"bk_biz_id"` // 业务ID
BizName string `json:"bk_biz_name"` // 业务名称
SetID int64 `json:"bk_set_id"` // 所属集群(bk_set_id): 数字
SetName string `json:"bk_set_name"` // 所属集群名称(bk_set_name): 字符串(最大长度25)
ModuleID int64 `json:"bk_module_id"` // 所属模块(bk_module_id): 数字
ModuleName string `json:"bk_module_name"` // 所属模块(bk_module_name): 字符串(最大长度25)
SetStatus string `json:"bk_service_status"` // 集群服务状态(bk_set_status) 数字
SetEnv string `json:"bk_set_env"` // 环境类型(bk_set_type) 数字
}
HostIdentModule HostIdentifier module define
type HostIdentProcess ¶
type HostIdentProcess struct {
ProcessID int64 `json:"bk_process_id" bson:"bk_process_id"` // 进程名称
ProcessName string `json:"bk_process_name" bson:"bk_process_name"` // 进程名称
BindIP string `json:"bind_ip" bson:"bind_ip"` // 绑定IP, 枚举: [{ID: "1", Name: "127.0.0.1"}, {ID: "2", Name: "0.0.0.0"}, {ID: "3", Name: "第一内网IP"}, {ID: "4", Name: "第一外网IP"}]
PORT string `json:"port" bson:"port"` // 端口, 单个端口:"8080", 多个连续端口:"8080-8089", 多个不连续端口:"8080-8089,8199"
PROTOCOL string `json:"protocol" bson:"protocol"` // 协议, 枚举: [{ID: "1", Name: "TCP"}, {ID: "2", Name: "UDP"}],
FuncID string `json:"bk_func_id" bson:"bk_func_id"` // 功能ID
FuncName string `json:"bk_func_name" bson:"bk_func_name"` // 功能名称
StartParamRegex string `json:"bk_start_param_regex" bson:"bk_start_param_regex"` // 启动参数匹配规则
BindModules []int64 `json:"bind_modules" bson:"bind_modules"` // 进程绑定的模块ID,数字数组
}
type HostIdentProcessSorter ¶
type HostIdentProcessSorter []HostIdentProcess
func (HostIdentProcessSorter) Len ¶
func (p HostIdentProcessSorter) Len() int
func (HostIdentProcessSorter) Less ¶
func (p HostIdentProcessSorter) Less(i, j int) bool
func (HostIdentProcessSorter) Swap ¶
func (p HostIdentProcessSorter) Swap(i, j int)
type HostIdentifier ¶
type HostIdentifier struct {
HostID int64 `json:"bk_host_id" bson:"bk_host_id"` // 主机ID(host_id) 数字
HostName string `json:"bk_host_name" bson:"bk_host_name"` // 主机名称
SupplierID int64 `json:"bk_supplier_id"` // 开发商ID(bk_supplier_id) 数字
SupplierAccount string `json:"bk_supplier_account"` // 开发商帐号(bk_supplier_account) 数字
CloudID int64 `json:"bk_cloud_id" bson:"bk_cloud_id"` // 所属云区域id(bk_cloud_id) 数字
CloudName string `json:"bk_cloud_name" bson:"bk_cloud_name"` // 所属云区域名称(bk_cloud_name) 字符串(最大长度25)
InnerIP string `json:"bk_host_innerip" bson:"bk_host_innerip"` // 内网IP
OuterIP string `json:"bk_host_outerip" bson:"bk_host_outerip"` // 外网IP
OSType string `json:"bk_os_type" bson:"bk_os_type"` // 操作系统类型
OSName string `json:"bk_os_name" bson:"bk_os_name"` // 操作系统名称
Memory int64 `json:"bk_mem" bson:"bk_mem"` // 内存容量
CPU int64 `json:"bk_cpu" bson:"bk_cpu"` // CPU逻辑核心数
Disk int64 `json:"bk_disk" bson:"bk_disk"` // 磁盘容量
HostIdentModule map[string]*HostIdentModule `json:"associations" bson:"associations"`
Process []HostIdentProcess `json:"process" bson:"process"`
}
type HostInputType ¶
type HostInputType string
const ( ExecelType HostInputType = "excel" CollectType HostInputType = "collect" )
type HostInstanceProperties ¶
type HostInstancePropertiesResult ¶
type HostInstancePropertiesResult struct {
BaseResp `json:",inline"`
Data []HostInstanceProperties `json:"data"`
}
type HostInstanceResult ¶
type HostList ¶
type HostList struct {
ApplicationID int64 `json:"bk_biz_id"`
HostInfo map[int64]map[string]interface{} `json:"host_info"`
SupplierID int64 `json:"bk_supplier_id"`
InputType HostInputType `json:"input_type"`
}
type HostLockData ¶
type HostLockQueryResponse ¶
type HostLockQueryResponse struct {
BaseResp `json:",inline"`
Data struct {
Info []HostLockData `json:"info"`
Count int64 `json:"count"`
}
}
type HostLockRequest ¶
type HostLockResponse ¶
type HostLockResultResponse ¶
type HostModuleFind ¶
type HostModuleRelationParameter ¶
type HostModuleRelationParameter struct {
AppID int64 `json:"bk_biz_id"`
HostID []int64 `json:"bk_host_id"`
}
HostModuleRelationParameter get host and module relation parameter
type HostModuleRelationRequest ¶
type HostModuleRelationRequest struct {
ApplicationID int64 `json:"bk_biz_id"`
SetIDArr []int64 `json:"bk_set_ids"`
HostIDArr []int64 `json:"bk_host_ids"`
ModuleIDArr []int64 `json:"bk_module_ids"`
}
HostModuleRelationRequest gethost module relation request parameter
func (*HostModuleRelationRequest) Empty ¶
func (h *HostModuleRelationRequest) Empty() bool
Empty empty struct
type HostResponse ¶
type HostResponse struct {
HostResponse InstanceSet `json:"Response"`
}
type HostSearchByAppIDParams ¶
type HostSearchByAppIDParams struct {
ApplicationID *int64 `json:"bk_biz_id"`
}
HostSearchByAppIDParams host search by app
type HostSearchByIPParams ¶
type HostSearchBySetIDParams ¶
type HostSnapResult ¶
type HostSyncList ¶
type HostToAppModule ¶
type HostToAppModule struct {
Ips []string `json:"ips"`
HostName []string `json:"bk_host_name"`
ModuleName string `json:"bk_module_name"`
SetName string `json:"bk_set_name"`
AppName string `json:"bk_biz_name"`
OsType string `json:"bk_os_type"`
OwnerID string `json:"bk_supplier_account"`
PlatID int64 `json:"bk_cloud_id"`
IsIncrement bool `json:"is_increment"`
}
type HostsModuleRelation ¶
type IPInfo ¶
type IPInfo struct {
Data []string `json:"data"`
Exact int64 `json:"exact"`
Flag string `json:"flag"`
}
ip search info
type InlineProcInfo ¶
type InlineProcInfo struct {
//Meta GseProcMeta
//Spec GseProcSpec
ProcInfo map[string]interface{}
ProcNum int64
AppID int64 // use gse proc namespace
FunID int64
ProcID int64
}
InlineProcInfo process info convert gse proc info
type InnerModule ¶
type InnterAppTopo ¶
type InnterAppTopo struct {
SetID int64 `json:"bk_set_id"`
SetName string `json:"bk_set_name"`
Module []InnerModule `json:"module"`
}
type InstAsst ¶
type InstAsst struct {
// sequence ID
ID int64 `field:"id" json:"id"`
// inst id associate to ObjectID
InstID int64 `field:"bk_inst_id" json:"bk_inst_id" bson:"bk_inst_id"`
// association source ObjectID
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
// inst id associate to AsstObjectID
AsstInstID int64 `field:"bk_asst_inst_id" json:"bk_asst_inst_id" bson:"bk_asst_inst_id"`
// association target ObjectID
AsstObjectID string `field:"bk_asst_obj_id" json:"bk_asst_obj_id" bson:"bk_asst_obj_id"`
// bk_supplier_account
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
// association id between two object
ObjectAsstID string `field:"bk_obj_asst_id" json:"bk_obj_asst_id" bson:"bk_obj_asst_id"`
// association kind id
AssociationKindID string `field:"bk_asst_id" json:"bk_asst_id" bson:"bk_asst_id"`
// define the metadata of assocication kind
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
}
InstAsst an association definition between instances.
type InstDataInfo ¶
InstDataInfo response instance data result Data field
type InstNameAsst ¶
type InstNameAsst struct {
ID string `json:"id"`
ObjID string `json:"bk_obj_id"`
ObjIcon string `json:"bk_obj_icon"`
InstID int64 `json:"bk_inst_id"`
ObjectName string `json:"bk_obj_name"`
InstName string `json:"bk_inst_name"`
AssoID int64 `json:"asso_id"`
// AsstName string `json:"bk_asst_name"`
// AsstID string `json:"bk_asst_id"`
InstInfo map[string]interface{} `json:"inst_info,omitempty"`
}
type InstResult ¶
InstResult inst item result
type InstanceSet ¶
type InstanceSet struct {
InstanceSet []CloudHostInfo `json:"InstanceSet"`
}
type Label ¶
Label define the Label type used to limit the scope of application of resources
func (Label) GetBusinessID ¶
func (Label) GetModelKind ¶
func (Label) Int64 ¶
int64 is used to get a int64 value from a label key. if the key does not exist, it will return with a LabelKeyNotExistError, which can be used to check it, if you do care about it.
func (Label) IsTrue ¶
isTrue is used to check if the label key is a true value or not. if the key does not exist, it will return with a LabelKeyNotExistError, which can be used to check it, if you do care about it.
func (Label) SetBusinessID ¶
func (Label) SetModelKind ¶
type ListAssociationsWithAssociationKindResult ¶
type ListAssociationsWithAssociationKindResult struct {
BaseResp `json:",inline"`
Data AssociationList `json:"data"`
}
type LoginPluginInfo ¶
type LoginPluginInfo struct {
Name string // plugin info
Version string // In what version is used
//CookieEnv string // Reserved word, not used now, When the cookie has the current key, it is used preferentially.
HandleFunc LoginUserPluginInerface
}
type LoginSystemUserInfo ¶
type LoginUserInfo ¶
type LoginUserInfo struct {
UserName string `json:"username"`
ChName string `json:"chname"`
Phone string `json:"phone"`
Email string `json:"email"`
Role string `json:"-"`
BkToken string `json:"bk_token"`
OnwerUin string `json:"current_supplier"`
OwnerUinArr []LoginUserInfoOwnerUinList `json:"supplier_list"` //user all owner uin
IsOwner bool `json:"-"` // is master
Extra map[string]interface{} `json:"extra"` //custom information
Language string `json:"-"`
AvatarUrl string `json:"avatar_url"`
SupplierID int64 `json:"supplier_id"`
MultiSupplier bool `json:"multi_supplier"`
}
type LoginUserInfoDetail ¶
type LoginUserInfoDetail struct {
UserName string `json:"username"`
ChName string `json:"chname"`
OnwerUin string `json:"current_supplier"`
OwnerUinArr []LoginUserInfoOwnerUinList `json:"supplier_list"` //user all owner uin
AvatarUrl string `json:"avatar_url"`
MultiSupplier bool `json:"multi_supplier"`
}
type LoginUserInfoResult ¶
type LoginUserInfoResult struct {
BaseResp `json:",inline"`
Data LoginUserInfoDetail `json:"data"`
}
type LoginUserPluginInerface ¶
type LoginUserPluginInerface interface {
LoginUser(c *gin.Context, config map[string]string, isMultiOwner bool) (user *LoginUserInfo, loginSucc bool)
GetUserList(c *gin.Context, config map[string]string) ([]*LoginSystemUserInfo, error)
GetLoginUrl(c *gin.Context, config map[string]string, input *LogoutRequestParams) string
}
type LoginUserPluginParams ¶
type LogoutRequestParams ¶
type LogoutRequestParams struct {
HTTPScheme string `json:"http_scheme"`
}
type LogoutResult ¶
type LonginSystemUserListResult ¶
type LonginSystemUserListResult struct {
BaseResp `json:",inline"`
Data []*LoginSystemUserInfo `json:"data"`
}
type MainLineObject ¶
MainLineObject main line object definition
type MainLineResult ¶
type MainlineObjectTopo ¶
type MainlineObjectTopo struct {
ObjID string `field:"bk_obj_id" json:"bk_obj_id"`
ObjName string `field:"bk_obj_name" json:"bk_obj_name"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account"`
NextObj string `field:"bk_next_obj" json:"bk_next_obj"`
NextName string `field:"bk_next_name" json:"bk_next_name"`
PreObjID string `field:"bk_pre_obj_id" json:"bk_pre_obj_id"`
PreObjName string `field:"bk_pre_obj_name" json:"bk_pre_obj_name"`
}
MainlineObjectTopo the mainline object topo
func (*MainlineObjectTopo) Parse ¶
func (cli *MainlineObjectTopo) Parse(data mapstr.MapStr) (*MainlineObjectTopo, error)
Parse load the data from mapstr attribute into attribute instance
func (*MainlineObjectTopo) ToMapStr ¶
func (cli *MainlineObjectTopo) ToMapStr() mapstr.MapStr
ToMapStr to mapstr
type MainlineObjectTopoResult ¶
type MainlineObjectTopoResult struct {
BaseResp `json:",inline"`
Data []MainlineObjectTopo `json:"data"`
}
type MapArrayResponse ¶
type MatchProcInstParam ¶
type MatchProcInstParam struct {
ApplicationID int64 `json:"bk_biz_id" bson:"bk_biz_id"`
SetName string `json:"bk_set_name" bson:"bk_set_name"`
ModuleName string `json:"bk_module_name" bson:"bk_module_name"`
FuncID string `json:"bk_func_id" bson:"bk_func_id"`
HostInstanceID string `json:"bk_host_instance_id" bson:"bk_host_instance_id"`
}
type Metadata ¶
type Metadata struct {
Label Label `field:"label" json:"label" bson:"label"`
}
Metadata used to define the metadata for the resources
type ModuleHost ¶
type ModuleHost struct {
AppID int64 `json:"bk_biz_id" bson:"bk_biz_id"`
HostID int64 `json:"bk_host_id" bson:"bk_host_id"`
ModuleID int64 `json:"bk_module_id" bson:"bk_module_id"`
SetID int64 `json:"bk_set_id" bson:"bk_set_id"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}
type ModuleHostConfigParams ¶
type ModuleInst ¶
type NetCollSearchParams ¶
type NetCollSearchParams struct {
Page BasePage `json:"page,omitempty"`
Fields []string `json:"fields,omitempty"`
Condition []ConditionItem `json:"condition,omitempty"`
}
type NetcollectConfig ¶
type NetcollectDevice ¶
type NetcollectDevice struct {
DeviceID uint64 `json:"device_id,omitempty" bson:"device_id,omitempty"`
DeviceName string `json:"device_name,omitempty" bson:"device_name,omitempty"`
DeviceModel string `json:"device_model,omitempty" bson:"device_model,omitempty"`
ObjectID string `json:"bk_obj_id" bson:"bk_obj_id,omitempty"`
ObjectName string `json:"bk_obj_name,omitempty" bson:"-"`
BkVendor string `json:"bk_vendor,omitempty" bson:"bk_vendor,omitempty"`
OwnerID string `json:"-" bson:"bk_supplier_account,omitempty"`
CreateTime *time.Time `field:"create_time,omitempty" json:"create_time,omitempty" bson:"create_time,omitempty"`
LastTime *time.Time `field:"last_time" json:"last_time,omitempty" bson:"last_time,omitempty"`
}
type NetcollectHistory ¶
type NetcollectHistory struct {
NetcollectReport `json:",inline" bson:",inline"`
Success bool `json:"success" bson:"success"`
}
type NetcollectProperty ¶
type NetcollectProperty struct {
NetcollectPropertyID uint64 `json:"netcollect_property_id,omitempty" bson:"netcollect_property_id,omitempty"`
PropertyID string `json:"bk_property_id" bson:"bk_property_id,omitempty"`
PropertyName string `json:"bk_property_name" bson:"-"`
DeviceID uint64 `json:"device_id" bson:"device_id,omitempty"`
DeviceName string `json:"device_name" bson:"-"`
ObjectID string `json:"bk_obj_id,omitempty" bson:"-"`
ObjectName string `json:"bk_obj_name,omitempty" bson:"-"`
OID string `json:"oid,omitempty" bson:"oid,omitempty"`
Period string `json:"period,omitempty" bson:"period,omitempty"`
Action string `json:"action,omitempty" bson:"action,omitempty"`
OwnerID string `json:"-" bson:"bk_supplier_account,omitempty"`
CreateTime *time.Time `field:"create_time,omitempty" json:"create_time,omitempty" bson:"create_time,omitempty"`
LastTime *time.Time `field:"last_time,omitempty" json:"last_time,omitempty" bson:"last_time,omitempty"`
Unit string `json:"unit,omitempty" bson:"-"`
DeviceModel string `json:"device_model,omitempty" bson:"-"`
}
type NetcollectReport ¶
type NetcollectReport struct {
Action string `json:"action" bson:"action"`
CloudID int64 `json:"bk_cloud_id" bson:"bk_cloud_id"`
CloudName string `json:"bk_cloud_name" bson:"-"`
ObjectID string `json:"bk_obj_id" bson:"bk_obj_id"`
ObjectName string `json:"bk_obj_name" bson:"-"`
InnerIP string `json:"bk_host_innerip" bson:"bk_host_innerip"`
Configuration string `json:"configuration" bson:"configuration"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
InstID int64 `json:"bk_inst_id" bson:"bk_inst_id"`
InstKey string `json:"bk_inst_key" bson:"bk_inst_key"`
LastTime Time `json:"last_time" bson:"last_time"`
Attributes []NetcollectReportAttribute `json:"attributes" bson:"attributes"`
Associations []NetcollectReportAssociation `json:"associations" bson:"associations"`
}
type NetcollectReportAssociation ¶
type NetcollectReportAssociation struct {
Action string `json:"action" bson:"-"`
AsstInstName string `json:"bk_asst_inst_name" bson:"bk_asst_inst_name"`
// AsstPropertyID string `json:"bk_asst_property_id" bson:"bk_asst_property_id"`
AsstObjectID string `json:"bk_asst_obj_id" bson:"bk_asst_obj_id"`
AsstObjectName string `json:"bk_asst_obj_name" bson:"bk_asst_obj_name"`
ObjectAsstID string `json:"bk_obj_asst_id" bson:"bk_obj_asst_id"`
Configuration string `json:"configuration" bson:"configuration"`
}
type NetcollectReportAttribute ¶
type NetcollectReportAttribute struct {
PropertyID string `json:"bk_property_id" bson:"bk_property_id"`
PropertyName string `json:"bk_property_name" bson:"-"`
IsRequired bool `json:"isrequired" bson:"-"`
CurValue interface{} `json:"value" bson:"value"`
PreValue interface{} `json:"pre_value" bson:"-"`
Method string `json:"method,omitempty" bson:"-"`
Success bool `json:"success,omitempty" bson:"-"`
Error string `json:"error,omitempty" bson:"-"`
}
type NetcollectReportSummary ¶
type Netcollector ¶
type Netcollector struct {
CloudID int64 `json:"bk_cloud_id" bson:"bk_cloud_id"`
CloudName string `json:"bk_cloud_name" bson:"-"`
BizID int64 `json:"bk_biz_id" bson:"bk_biz_id" bson:"bk_biz_id"`
InnerIP string `json:"bk_host_innerip" bson:"bk_host_innerip"`
Status NetcollectorStatus `json:"status" bson:"status"`
TaskID int64 `json:"task_id" bson:"task_id"`
DeployTime *time.Time `json:"deploy_time" bson:"deploy_time"`
Version string `json:"version" bson:"version"`
LatestVersion string `json:"latest_ersion" bson:"latest_ersion"`
ReportTotal int64 `json:"report_total" bson:"report_total"`
Config NetcollectConfig `json:"config" bson:"config"`
}
type NetcollectorStatus ¶
type ObjAttDes ¶
type ObjAttDes struct {
Attribute `json:",inline" bson:",inline"`
PropertyGroupName string `json:"bk_property_group_name"`
}
ObjAttDes 对象模型属性
type ObjClassificationObject ¶
type ObjClassificationObject struct {
Classification `bson:",inline"`
Objects []Object `json:"bk_objects"`
AsstObjects map[string][]interface{} `json:"bk_asst_objects"`
}
ObjClassificationObject define the class object class
type ObjQueryInput ¶
type ObjQueryInput struct {
Condition interface{} `json:"condition"`
Fields string `json:"fields"`
Start int `json:"start"`
Limit int `json:"limit"`
Sort string `json:"sort"`
}
func (*ObjQueryInput) ConvTime ¶
func (o *ObjQueryInput) ConvTime() error
ConvTime 将查询条件中字段包含cc_type key ,子节点变为time.Time
type Object ¶
type Object struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
ID int64 `field:"id" json:"id" bson:"id"`
ObjCls string `field:"bk_classification_id" json:"bk_classification_id" bson:"bk_classification_id"`
ObjIcon string `field:"bk_obj_icon" json:"bk_obj_icon" bson:"bk_obj_icon"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
ObjectName string `field:"bk_obj_name" json:"bk_obj_name" bson:"bk_obj_name"`
IsPre bool `field:"ispre" json:"ispre" bson:"ispre"`
IsPaused bool `field:"bk_ispaused" json:"bk_ispaused" bson:"bk_ispaused"`
Position string `field:"position" json:"position" bson:"position"`
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
Description string `field:"description" json:"description" bson:"description"`
Creator string `field:"creator" json:"creator" bson:"creator"`
Modifier string `field:"modifier" json:"modifier" bson:"modifier"`
CreateTime *Time `field:"create_time" json:"create_time" bson:"create_time"`
LastTime *Time `field:"last_time" json:"last_time" bson:"last_time"`
}
Object object metadata definition
func (*Object) GetDefaultInstPropertyName ¶
GetDefaultInstPropertyName get default inst
func (*Object) GetInstIDFieldName ¶
GetInstIDFieldName get instid filed
func (*Object) GetInstNameFieldName ¶
GetInstNameFieldName get the inst name
func (*Object) GetObjectType ¶
GetObjectType get the object type
type ObjectAttr ¶
type ObjectAttr struct {
Attr []interface{} `json:"attr"`
}
type ObjectAttrBatchResult ¶
type ObjectAttrBatchResult struct {
BaseResp `json:",inline"`
Data map[string]ObjectAttr `json:"data"`
}
type ObjectAttrGroupResult ¶
type ObjectAttrGroupResult struct {
BaseResp `json:",inline"`
Data []AttributeGroup `json:"data"`
}
type ObjectAttrResult ¶
type ObjectClsDes ¶
type ObjectClsDes struct {
ID int `json:"id" bson:"id"`
ClsID string `json:"bk_classification_id" bson:"bk_classification_id"`
ClsName string `json:"bk_classification_name" bson:"bk_classification_name"`
ClsType string `json:"bk_classification_type" bson:"bk_classification_type" `
ClsIcon string `json:"bk_classification_icon" bson:"bk_classification_icon"`
}
type ObjectTopo ¶
type ObjectTopo struct {
LabelType string `json:"label_type"`
LabelName string `json:"label_name"`
Label string `json:"label"`
From TopoItem `json:"from"`
To TopoItem `json:"to"`
Arrows string `json:"arrows"`
}
ObjectTopo define the common object topo
type ObjectUnique ¶
type ObjectUnique struct {
ID uint64 `json:"id" bson:"id"`
ObjID string `json:"bk_obj_id" bson:"bk_obj_id"`
MustCheck bool `json:"must_check" bson:"must_check"`
Keys []UniqueKey `json:"keys" bson:"keys"`
Ispre bool `json:"ispre" bson:"ispre"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
LastTime Time `json:"last_time" bson:"last_time"`
}
func (ObjectUnique) KeysHash ¶
func (u ObjectUnique) KeysHash() string
func (*ObjectUnique) Parse ¶
func (cli *ObjectUnique) Parse(data mapstr.MapStr) (*ObjectUnique, error)
Parse load the data from mapstr attribute into ObjectUnique instance
type OperaterException ¶
type OperaterException struct {
BaseResp `json:",inline"`
Data []ExceptionResult `json:"data"`
}
OperaterException result
type OperationLog ¶
type OperationLog struct {
OwnerID string `bson:"bk_supplier_account" json:"bk_supplier_account"`
ApplicationID int64 `bson:"bk_biz_id" json:"bk_biz_id"`
ExtKey string `bson:"ext_key" json:"ext_key"`
OpDesc string `bson:"op_desc" json:"op_desc"`
OpType int `bson:"op_type" json:"op_type"`
OpTarget string `bson:"op_target" json:"op_target"`
Content interface{} `bson:"content" json:"content"`
User string `bson:"operator" json:"operator"`
OpFrom string `bson:"op_from" json:"op_from"`
ExtInfo string `bson:"ext_info" json:"ext_info"`
CreateTime time.Time `bson:"op_time" json:"op_time"`
InstID int64 `bson:"inst_id" json:"inst_id"`
}
OperationLog opeartion log item definition
func (OperationLog) TableName ¶
func (OperationLog) TableName() string
TableName return the table name
type ParamNetcollectComfirm ¶
type ParamNetcollectComfirm struct {
Reports []NetcollectReport `json:"reports"`
}
type ParamNetcollectDiscover ¶
type ParamNetcollectDiscover struct {
Collectors []Netcollector `json:"collectors"`
}
type ParamNetcollectorSearch ¶
type ParamSearchNetcollectReport ¶
type ParamSearchNetcollectReport struct {
Action string `json:"action"`
ObjectID string `json:"bk_object_id"`
Query string `json:"query"`
CloudName string `json:"bk_cloud_name"`
CloudID int64 `json:"bk_cloud_id"`
InnerIP string `json:"bk_host_innerip"`
LastTime []Time `json:"last_time"`
Page BasePage `json:"page"`
}
type ParamSubscriptionSearch ¶
type ParamSubscriptionTelnet ¶
type ParamSubscriptionTelnet struct {
CallbackUrl string `json:"callback_url"`
}
type ParamSubscriptionTestCallback ¶
type ParamSubscriptionTestCallback struct {
ParamSubscriptionTelnet `json:",inline"`
Data string `json:"data"`
}
type Permission ¶
type Permission struct {
SystemID string `json:"system_id"`
SystemName string `json:"system_name"`
ScopeType string `json:"scope_type"`
ScopeTypeName string `json:"scope_type_name"`
ScopeID string `json:"scope_id"`
ScopeName string `json:"scope_name"`
ActionID string `json:"action_id"`
ActionName string `json:"action_name"`
Resources [][]Resource `json:"resources"`
}
Permission describes all the authorities that a user is need, when he attempts to operate a resource. Permission is used only when a user do not have the authority to access a resources with a action.
type Privilege ¶
type Privilege struct {
ModelConfig map[string]map[string][]string `json:"model_config,omitempty" bson:"model_config"`
SysConfig *SysConfigStruct `json:"sys_config,omitempty" bson:"sys_config"`
}
type PrivilegeUserGroup ¶
type PrivilegeUserGroup struct {
SupplierAccount string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
GroupID string `field:"group_id" json:"group_id" bson:"bk_supplier_account"`
ModelConfig mapstr.MapStr `field:"model_config" json:"model_config" bson:"model_config"`
SystemConfig mapstr.MapStr `field:"sys_config" json:"sys_config" bson:"sys_config"`
}
PrivilegeUserGroup the user group permission configure
func (*PrivilegeUserGroup) Parse ¶
func (p *PrivilegeUserGroup) Parse(data mapstr.MapStr) (*PrivilegeUserGroup, error)
Parse load the data from mapstr object into object instance
func (*PrivilegeUserGroup) ToMapStr ¶
func (p *PrivilegeUserGroup) ToMapStr() mapstr.MapStr
ToMapStr to mapstr
type ProcInfoArrResult ¶
type ProcInstModelResult ¶
type ProcInstModelResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []ProcInstanceModel `json:"info"`
} `json:"data"`
}
type ProcInstanceDetail ¶
type ProcInstanceDetail struct {
GseProcRequest `json:",inline" bson:",inline"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
HostID int64 `json:"bk_host_id" bson:"bk_host_id"`
Status ProcInstanceDetailStatus `json:"status" bson:"status"` //1 register gse sucess, 2 register error need retry 3 unregister error need retry
}
type ProcInstanceDetailResult ¶
type ProcInstanceDetailResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []ProcInstanceDetail `json:"info"`
} `json:"data"`
}
type ProcInstanceDetailStatus ¶
type ProcInstanceDetailStatus int64
var ( ProcInstanceDetailStatusRegisterSucc ProcInstanceDetailStatus = 1 ProcInstanceDetailStatusRegisterFailed ProcInstanceDetailStatus = 2 ProcInstanceDetailStatusUnRegisterFailed ProcInstanceDetailStatus = 10 )
type ProcInstanceModel ¶
type ProcInstanceModel struct {
ApplicationID int64 `json:"bk_biz_id" bson:"bk_biz_id"`
SetID int64 `json:"bk_set_id" bson:"bk_set_id,omitempty"`
ModuleID int64 `json:"bk_module_id" bson:"bk_module_id,omitempty"`
ProcID int64 `json:"bk_process_id" bson:"bk_process_id"`
FuncID int64 `json:"bk_func_id" bson:"bk_func_id"`
ProcInstanceID uint64 `json:"proc_instance_id" bson:"proc_instance_id"`
HostID int64 `json:"bk_host_id" bson:"bk_host_id"`
HostInstanID uint64 `json:"bk_host_instance_id" bson:"bk_host_instance_id"`
HostProcID uint64 `json:"host_proc_id" bson:"host_proc_id"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}
type ProcModuleConfig ¶
type ProcModuleResult ¶
type ProcModuleResult struct {
BaseResp `json:",inline"`
Data []ProcModuleConfig `json:"data"`
}
type ProcOpTaskStatus ¶
type ProcOpTaskStatus int64
var ( ProcOpTaskStatusWaitOP ProcOpTaskStatus = 1 ProcOpTaskStatusExecuteing ProcOpTaskStatus = 115 ProcOpTaskStatusErr ProcOpTaskStatus = 2 ProcOpTaskStatusSucc ProcOpTaskStatus = 3 ProcOpTaskStatusHTTPErr ProcOpTaskStatus = 1101 ProcOpTaskStatusNotTaskIDErr ProcOpTaskStatus = 1112 )
type ProcessInst ¶
type ProcessInst struct {
ProcessID int64 `json:"bk_process_id" bson:"bk_process_id"` // 进程名称
ProcessName string `json:"bk_process_name" bson:"bk_process_name"` // 进程名称
BindIP string `json:"bind_ip" bson:"bind_ip"` // 绑定IP, 枚举: [{ID: "1", Name: "127.0.0.1"}, {ID: "2", Name: "0.0.0.0"}, {ID: "3", Name: "第一内网IP"}, {ID: "4", Name: "第一外网IP"}]
PORT string `json:"port" bson:"port"` // 端口, 单个端口:"8080", 多个连续端口:"8080-8089", 多个不连续端口:"8080-8089,8199"
PROTOCOL string `json:"protocol" bson:"protocol"` // 协议, 枚举: [{ID: "1", Name: "TCP"}, {ID: "2", Name: "UDP"}],
FuncID string `json:"bk_func_id" bson:"bk_func_id"` // 功能ID
FuncName string `json:"bk_func_name" bson:"bk_func_name"` // 功能名称
StartParamRegex string `json:"bk_start_param_regex" bson:"bk_start_param_regex"` // 启动参数匹配规则
}
type ProcessModule ¶
type ProcessOperate ¶
type ProcessOperate struct {
MatchProcInstParam `json:",inline"`
OpType int `json:"bk_proc_optype"`
}
type ProcessOperateTask ¶
type ProcessOperateTask struct {
OperateInfo *ProcessOperate `json:"operate_info" bson:"operate_info"`
TaskID string `json:"task_id" bson:"task_id"`
GseTaskID string `json:"gse_task_id" bson:"gse_task_id"`
Namespace string `json:"namespace" bson:"namespace"`
Status ProcOpTaskStatus `json:"status" bson:"status"`
CreateTime time.Time `json:"create_time" bson:"create_time"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
User string `json:"user,omitempty" bson:"user,omitempty"`
Detail map[string]ProcessOperateTaskDetail `json:"detail" bson:"detail"`
Host []GseHost `json:"host_info" bson:"host_info"`
ProcName string `json:"bk_process_name" bson:"bk_process_name"`
HTTPHeader http.Header `json:"http_header" bson:"http_header"`
}
type ProcessOperateTaskResult ¶
type ProcessOperateTaskResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []ProcessOperateTask `json:"info"`
} `json:"data"`
}
type PropertyGroupCondition ¶
type PropertyGroupCondition struct {
Condition map[string]interface{} `json:"condition"`
Data map[string]interface{} `json:"data"`
}
PropertyGroupCondition used to reflect the property group json
type PropertyGroupObjectAtt ¶
type PropertyGroupObjectAtt struct {
Condition struct {
OwnerID string `field:"bk_supplier_account" json:"bk_supplier_account"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id"`
PropertyID string `field:"bk_property_id" json:"bk_property_id"`
} `json:"condition"`
Data struct {
PropertyGroupID string `field:"bk_property_group" json:"bk_property_group"`
PropertyIndex int `field:"bk_property_index" json:"bk_property_index"`
} `json:"data"`
}
PropertyGroupObjectAtt uset to update or delete the property group object attribute
type QueryCondition ¶
type QueryCondition struct {
Fields []string `json:"fields"`
Limit SearchLimit `json:"limit"`
SortArr []SearchSort `json:"sort"`
Condition mapstr.MapStr `json:"condition"`
}
QueryCondition the common query condition definition
type QueryConditionResult ¶
type QueryConditionResult ResponseInstData
type QueryHostLockRequest ¶
type QueryInput ¶
type QueryInstResult ¶
type QueryInstResult struct {
BaseResp `json:",inline"`
Data InstResult `json:"data"`
}
QueryInstResult query inst result
type QueryModelAttributeDataResult ¶
type QueryModelAttributeDataResult struct {
Count int64 `json:"count"`
Info []Attribute `json:"info"`
}
QueryModelAttributeDataResult search model attr data result
type QueryModelAttributeGroupDataResult ¶
type QueryModelAttributeGroupDataResult struct {
Count int64 `json:"count"`
Info []Group `json:"info"`
}
QueryModelAttributeGroupDataResult query model attribute group result definition
type QueryModelClassificationDataResult ¶
type QueryModelClassificationDataResult struct {
Count int64 `json:"count"`
Info []Classification `json:"info"`
}
QueryModelClassificationDataResult query model classification result definition
type QueryModelDataResult ¶
QueryModelDataResult used to define the model query
type QueryModelWithAttributeDataResult ¶
type QueryModelWithAttributeDataResult struct {
Count int64 `json:"count"`
Info []SearchModelInfo `json:"info"`
}
QueryModelWithAttributeDataResult used to define the model with attribute query
type QueryObjectAssociationResult ¶
type QueryObjectAssociationResult struct {
BaseResp `json:",inline"`
Data []Association `json:"data"`
}
QueryObjectAssociationResult query object association result
type QueryObjectAttributeResult ¶
QueryObjectAttributeResult query object attribute result
type QueryObjectAttributeWrapperResult ¶
type QueryObjectAttributeWrapperResult struct {
BaseResp `json:",inline"`
Data []AttributeWrapper `json:"data"`
}
QueryObjectAttributeWrapperResult query object attribute with association info result
type QueryObjectClassificationResult ¶
type QueryObjectClassificationResult struct {
BaseResp `json:",inline"`
Data []Classification `json:"data"`
}
QueryObjectClassificationResult query the object classification result
type QueryObjectClassificationWithObjectsResult ¶
type QueryObjectClassificationWithObjectsResult struct {
BaseResp `json:",inline"`
Data []ClassificationWithObject `json:"data"`
}
QueryObjectClassificationWithObjectsResult query the object classification with objects result
type QueryObjectGroupResult ¶
QueryObjectGroupResult query the object group result
type QueryObjectResult ¶
QueryObjectResult query object result
type QueryResult ¶
QueryResult common query result
type QueryUniqueResult ¶
type QueryUniqueResult struct {
Count uint64 `json:"count"`
Info []ObjectUnique `json:"info"`
}
type ReadModelAssociationResult ¶
type ReadModelAssociationResult struct {
BaseResp
Data struct {
Count uint64 `json:"count"`
Info []Association `json:"info"`
}
}
type ReadModelAttrResult ¶
type ReadModelAttrResult struct {
BaseResp `json:",inline"`
Data QueryModelAttributeDataResult `json:"data"`
}
ReadModelAttrResult read model attribute api http response return result struct
type ReadModelAttributeGroupResult ¶
type ReadModelAttributeGroupResult struct {
BaseResp `json:",inline"`
Data QueryModelAttributeGroupDataResult `json:"data"`
}
type ReadModelClassifitionResult ¶
type ReadModelClassifitionResult struct {
BaseResp `json:",inline"`
Data QueryModelClassificationDataResult `json:"data"`
}
ReadModelClassifitionResult read model classifition api http response return result struct
type ReadModelResult ¶
type ReadModelResult struct {
BaseResp `json:",inline"`
Data QueryModelWithAttributeDataResult `json:"data"`
}
ReadModelResult read model classifition api http response return result struct
type ReadModelUniqueResult ¶
type ReadModelUniqueResult struct {
BaseResp `json:",inline"`
Data QueryUniqueResult `json:"data"`
}
type RegionResponse ¶
type RegionResponse struct {
Response RegionSet `json:"Response"`
}
type RepeatedDataResult ¶
type RepeatedDataResult struct {
OriginIndex int64 `json:"origin_index"`
Data mapstr.MapStr `json:"data"`
}
RepeatedDataResult repeated data
type RequestImportAssociation ¶
type RequestImportAssociation struct {
AssociationInfoMap map[int]ExcelAssocation `json:"association_info"`
}
ResponeImportAssociation import association result
type ResourceConfirm ¶
type ResourceConfirm struct {
ObjID string `json:"bk_obj_id"`
ResourceName []mapstr.MapStr `json:"bk_resource_name"`
SourceType string `json:"bk_source_type"`
SourceName string `json:"bk_source_name"`
CreateTime string `json:"bk_create_time"`
TaskID string `json:"bk_task_id"`
ResourceID int64 `json:"bk_resource_id"`
ConfirmType string `json:"bk_confirm_type"`
Incharge string `json:"bk_in_charge"`
}
type ResponeImportAssociation ¶
type ResponeImportAssociation struct {
BaseResp `json:",inline"`
Data ResponeImportAssociationData `json:"data"`
}
ResponeImportAssociation import association result
type ResponeImportAssociationData ¶
type ResponeImportAssociationData struct {
ErrMsgMap []RowMsgData `json:"err_msg"`
}
type Response ¶
type Response struct {
BaseResp `json:",inline"`
Data interface{} `json:"data"`
}
func NewSuccessResp ¶
func NewSuccessResp(data interface{}) *Response
data is the data you want to return to client.
type ResponseDataMapStr ¶
type ResponseInstData ¶
type ResponseInstData struct {
BaseResp `json:",inline"`
Data InstDataInfo `json:"data"`
}
ResponseInstData
type RoleAppResult ¶
type RolePriResult ¶
type RowMsgData ¶
type RspNetcollectConfirm ¶
type RspNetcollectConfirm struct {
ChangeAttributeSuccess int `json:"change_attribute_success"`
ChangeAttributeFailure int `json:"change_attribute_failure"`
ChangeAssociationsSuccess int `json:"change_associations_success"`
ChangeAssociationsFailure int `json:"change_associations_failure"`
Errors []string `json:"errors"`
}
type RspNetcollectHistory ¶
type RspNetcollectHistory struct {
Count uint64 `json:"count"`
Info []NetcollectHistory `json:"info"`
}
type RspNetcollectReport ¶
type RspNetcollectReport struct {
Count uint64 `json:"count"`
Info []NetcollectReport `json:"info"`
}
type RspNetcollectorSearch ¶
type RspNetcollectorSearch struct {
Count int64 `json:"count"`
Info []Netcollector `json:"info"`
}
type RspSubscriptionCreate ¶
type RspSubscriptionSearch ¶
type RspSubscriptionSearch struct {
Count uint64 `json:"count"`
Info []Subscription `json:"info"`
}
type SaveAuditLogParams ¶
type SaveAuditLogParams struct {
ID int64 `json:"inst_id"`
Model string `json:"op_target"`
Content interface{} `json:"content"`
ExtKey string `json:"ext"`
OpDesc string `json:"op_desc"`
OpType auditoplog.AuditOpType `json:"op_type"`
BizID int64 `json:"biz_id"`
}
type SearchAssociationInstRequestCond ¶
type SearchAssociationInstRequestCond struct {
ObjectAsstID string `field:"bk_obj_asst_id" json:"bk_obj_asst_id,omitempty" bson:"bk_obj_asst_id,omitempty"`
AsstID string `field:"bk_asst_id" json:"bk_asst_id,omitempty" bson:"bk_asst_id,omitempty"`
ObjectID string `field:"bk_obj_id" json:"bk_obj_id,omitempty" bson:"bk_obj_id,omitempty"`
AsstObjID string `field:"bk_asst_obj_id" json:"bk_asst_obj_id,omitempty" bson:"bk_asst_obj_id,omitempty"`
InstID []int64 `field:"bk_inst_id" json:"bk_inst_id,omitempty" bson:"bk_inst_id,omitempty"`
AsstInstID []int64 `field:"bk_asst_inst_id" json:"bk_asst_inst_id,omitempty" bson:"bk_asst_inst_id,omitempty"`
BothObjectID string `field:"both_obj_id" json:"both_obj_id" bson:"both_obj_id"`
BothInstID []int64 `field:"both_inst_id" json:"both_inst_id" bson:"both_inst_id"`
}
type SearchAssociationObjectResult ¶
type SearchAssociationObjectResult struct {
BaseResp `json:",inline"`
Data []*Association `json:"data"`
}
type SearchAssociationTypeResult ¶
type SearchAssociationTypeResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []*AssociationKind `json:"info"`
} `json:"data"`
}
type SearchCondition ¶
type SearchCondition struct {
Fields []string `json:"fields"`
Condition []ConditionItem `json:"condition"`
ObjectID string `json:"bk_obj_id"`
}
search condition
type SearchDataResult ¶
SearchDataResult common search data result
type SearchGroup ¶
type SearchHost ¶
func (SearchHost) ExtractHostIDs ¶
func (sh SearchHost) ExtractHostIDs() *[]int64
type SearchHostIdentifierResult ¶
type SearchHostIdentifierResult struct {
BaseResp `json:",inline"`
Data struct {
Count int `json:"count"`
Info []HostIdentifier `json:"info"`
} `json:"data"`
}
type SearchHostResult ¶
type SearchHostResult struct {
BaseResp `json:",inline"`
Data SearchHost `json:"data"`
}
type SearchIdentifierParam ¶
SearchIdentifierParam defines the param
type SearchInnterAppTopoResult ¶
type SearchInnterAppTopoResult struct {
BaseResp `json:",inline"`
Data InnterAppTopo
}
type SearchInstResult ¶
type SearchInstResult struct {
BaseResp `json:",inline"`
Data InstResult `json:"data"`
}
type SearchLimit ¶
SearchLimit sub condition
type SearchMainLine ¶
type SearchModelInfo ¶
type SearchModelInfo struct {
Spec Object `json:"spec"`
Attributes []Attribute `json:"attributes"`
}
SearchModelInfo search model params
type SearchModelResult ¶
type SearchNetDevice ¶
type SearchNetDevice struct {
Count uint64 `json:"count"`
Info []NetcollectDevice `json:"info"`
}
type SearchNetDeviceResult ¶
type SearchNetDeviceResult struct {
BaseResp `json:",inline"`
Data SearchNetDevice `json:"data"`
}
type SearchNetProperty ¶
type SearchNetProperty struct {
Count uint64 `json:"count"`
Info []NetcollectProperty `json:"info"`
}
type SearchNetPropertyResult ¶
type SearchNetPropertyResult struct {
BaseResp `json:",inline"`
Data SearchNetProperty `json:"data"`
}
type SearchParams ¶
type SearchParams struct {
Condition map[string]interface{} `json:"condition"`
Page map[string]interface{} `json:"page,omitempty"`
Fields []string `json:"fields,omitempty"`
Native int `json:"native,omitempty"`
}
common search struct
type SearchSort ¶
SearchSort sub condition
type SearchSortParse ¶
type SearchSortParse interface {
String(sort string) SearchSortParse
Field(field string, isDesc bool) SearchSortParse
Set(ssArr []SearchSort) SearchSortParse
ToMongo() string
ToSearchSortArr() []SearchSort
}
SearchSortParse SearchSort parse interface
func NewSearchSortParse ¶
func NewSearchSortParse() SearchSortParse
type SearchTopoGraphicsResult ¶
type SearchTopoGraphicsResult struct {
BaseResp `json:",inline"`
Data []TopoGraphics `json:"data"`
}
type SearchTopoInstanceNodeResult ¶
type SearchTopoInstanceNodeResult struct {
BaseResp `json:",inline"`
Data TopoInstanceNode `json:"data"`
}
type SearchTopoModelNodeResult ¶
type SearchTopoModelNodeResult struct {
BaseResp `json:",inline"`
Data TopoModelNode `json:"data"`
}
type SearchUniqueRequest ¶
type SearchUniqueRequest struct {
ObjID string `json:"bk_obj_id"`
}
type SearchUniqueResult ¶
type SearchUniqueResult struct {
BaseResp
Data []ObjectUnique `json:"data"`
}
type SetAssociationKind ¶
type SetAssociationKind CreateAssociationKind
type SetDataResult ¶
type SetDataResult struct {
UpdatedCount `json:",inline"`
CreatedCount `json:",inline"`
Created []CreatedDataResult `json:"created"`
Updated []UpdatedDataResult `json:"updated"`
Exceptions []ExceptionResult `json:"exception"`
}
SetDataResult common set result definition
type SetHostConfigParams ¶
type SetManyAssociationKind ¶
type SetManyAssociationKind CreateManyAssociationKind
type SetManyInstanceAssociation ¶
type SetManyInstanceAssociation CreateManyInstanceAssociation
type SetManyModelClassification ¶
type SetManyModelClassification CreateManyModelClassifiaction
SetManyModelClassification set many input params
type SetManyModelInstance ¶
type SetManyModelInstance CreateManyModelInstance
type SetModelAssociation ¶
type SetModelAssociation CreateModelAssociation
type SetModelAttributeGroup ¶
type SetModelAttributeGroup CreateModelAttributeGroup
SetModelAttributeGroup used to create a new group for some attributes, if it is exists, then update it
type SetModelAttributes ¶
type SetModelAttributes CreateModelAttributes
type SetModelInstance ¶
type SetModelInstance CreateModelInstance
type SetOneInstanceAssociation ¶
type SetOneInstanceAssociation CreateOneInstanceAssociation
type SetOneModelClassification ¶
type SetOneModelClassification CreateOneModelClassification
SetOneModelClassification set one input params
type SetOptionResult ¶
type SetOptionResult struct {
BaseResp `json:",inline"`
Data SetDataResult `json:"data"`
}
SetOptionResult set api http response return this result struct
type Statistics ¶
Report define sending statistic
type Subscription ¶
type Subscription struct {
SubscriptionID int64 `bson:"subscription_id" json:"subscription_id"`
SubscriptionName string `bson:"subscription_name" json:"subscription_name"`
SystemName string `bson:"system_name" json:"system_name"`
CallbackURL string `bson:"callback_url" json:"callback_url"`
ConfirmMode string `bson:"confirm_mode" json:"confirm_mode"`
ConfirmPattern string `bson:"confirm_pattern" json:"confirm_pattern"`
TimeOut int64 `bson:"time_out" json:"time_out"` // second
SubscriptionForm string `bson:"subscription_form" json:"subscription_form"` // json format
Operator string `bson:"operator" json:"operator"`
OwnerID string `bson:"bk_supplier_account" json:"bk_supplier_account"`
LastTime Time `bson:"last_time" json:"last_time"`
Statistics *Statistics `bson:"-" json:"statistics"`
}
Subscription define
func (Subscription) GetCacheKey ¶
func (s Subscription) GetCacheKey() string
func (Subscription) GetTimeout ¶
func (s Subscription) GetTimeout() time.Duration
func (Subscription) TableName ¶
func (Subscription) TableName() string
type SynchronizeClearDataParameter ¶
type SynchronizeClearDataParameter struct {
Tamestamp int64 `json:"tamestamp"`
Sign string `json:"sign"`
Version int64 `json:"version"`
SynchronizeFlag string `json:"synchronizeFlag"`
}
SynchronizeClearDataParameter synchronize data clear data http request parameter
func (*SynchronizeClearDataParameter) GenerateSign ¶
func (s *SynchronizeClearDataParameter) GenerateSign(key string)
GenerateSign generate sign
func (*SynchronizeClearDataParameter) Legality ¶
func (s *SynchronizeClearDataParameter) Legality(key string) bool
Legality sign is legal
type SynchronizeDataInfo ¶
type SynchronizeDataInfo struct {
OperateDataType SynchronizeOperateDataType `json:"operate_data_type"`
// OperateDataType = SynchronizeOperateDataTypeInstance,
// DataClassify = object_id, eg:host,plat,module,proc etc.
// OperateDataType = SynchronizeOperateDataTypeModel,
// DataClassify = common.SynchronizeModelDescTypeGroupInfo,common.SynchronizeModelDescTypeModuleAttribute etc
// OperateDataType = SynchronizeOperateDataTypeAssociation
// DataClassify = common.SynchronizeAssociationTypeModelHost etc.
DataClassify string `json:"data_classify"`
InfoArray []mapstr.MapStr `json:"instance_info_array"`
// OffSet current data offset start location
Offset int64 `json:"offset"`
// Count total data count
Count int64 `json:"count"`
Version int64 `json:"version"`
SynchronizeFlag string `json:"synchronize_flag"`
}
SynchronizeDataInfo synchronize instance data http request parameter
type SynchronizeDataResult ¶
type SynchronizeDataResult struct {
//Created []CreatedDataResult `json:"created"`
//Updated []UpdatedDataResult `json:"updated"`
Exceptions []ExceptionResult `json:"exception"`
}
SynchronizeDataResult common Synchronize result definition
type SynchronizeFindInfoParameter ¶
type SynchronizeFindInfoParameter struct {
DataType SynchronizeOperateDataType `json:"data_type"`
DataClassify string `json:"data_classify"`
Condition mapstr.MapStr `json:"condition"`
Start uint64 `json:"start"`
Limit uint64 `json:"limit"`
}
SynchronizeFindInfoParameter synchronize data fetch data http request parameter
type SynchronizeItem ¶
SynchronizeItem synchronize data information
type SynchronizeOperateDataType ¶
type SynchronizeOperateDataType int64
SynchronizeOperateDataType synchronize data operate type
const ( // SynchronizeOperateDataTypeInstance synchronize data is instance SynchronizeOperateDataTypeInstance SynchronizeOperateDataType = iota + 1 // SynchronizeOperateDataTypeModel synchronize data is model SynchronizeOperateDataTypeModel //SynchronizeOperateDataTypeAssociation synchronize data is association SynchronizeOperateDataTypeAssociation )
type SynchronizeOperateType ¶
type SynchronizeOperateType int64
SynchronizeOperateType synchronize data operate type
const ( // SynchronizeOperateTypeAdd synchronize data add SynchronizeOperateTypeAdd SynchronizeOperateType = iota + 1 // SynchronizeOperateTypeUpdate synchronize data update SynchronizeOperateTypeUpdate // SynchronizeOperateTypeRepalce synchronize data add or update SynchronizeOperateTypeRepalce // SynchronizeOperateTypeDelete synchronize data delete SynchronizeOperateTypeDelete )
type SynchronizeParameter ¶
type SynchronizeParameter struct {
OperateType SynchronizeOperateType `json:"op_type"`
// synchronize data type
OperateDataType SynchronizeOperateDataType `json:"operate_data_type"`
// OperateDataType = SynchronizeOperateDataTypeInstance,
// DataClassify = object_id, eg:host,plat,module,proc etc.
// OperateDataType = SynchronizeOperateDataTypeModel,
// DataClassify = common.SynchronizeModelDescTypeGroupInfo,common.SynchronizeModelDescTypeModuleAttribute etc
// OperateDataType = SynchronizeOperateDataTypeAssociation
// DataClassify = common.SynchronizeAssociationTypeModelHost etc.
DataClassify string `json:"data_classify"`
InfoArray []*SynchronizeItem `json:"instance_info_array"`
Version int64 `json:"version"`
SynchronizeFlag string `json:"synchronize_flag"`
}
SynchronizeParameter synchronize instance data http request parameter
type SynchronizeResult ¶
type SynchronizeResult struct {
BaseResp `json:",inline"`
Data SetDataResult `json:"data"`
}
SynchronizeResult synchronize result
type SysConfigStruct ¶
type TaskInfo ¶
type TaskInfo struct {
Args CloudTaskInfo
Method string
NextTrigger int64
}
type TemplateVersion ¶
type Time ¶
func (Time) MarshalBSONValue ¶
MarshalBSONValue implements bson.MarshalBSON interface
func (Time) MarshalJSON ¶
func (*Time) UnmarshalBSONValue ¶
UnmarshalBSONValue implements bson.UnmarshalBSONValue interface
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in RFC 3339 format.
type TopoGraphics ¶
type TopoGraphics struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
ScopeType string `json:"scope_type,omitempty" bson:"scope_type,omitempty"` // biz,user,global,classification
ScopeID string `json:"scope_id,omitempty" bson:"scope_id,omitempty"` // ID for ScopeType
NodeType string `json:"node_type" bson:"node_type"` // obj inst
ObjID string `json:"bk_obj_id" bson:"bk_obj_id"`
IsPre bool `json:"ispre" bson:"ispre"`
InstID int `json:"bk_inst_id" bson:"bk_inst_id"`
NodeName string `json:"node_name,omitempty" bson:"node_name,omitempty"`
Position Position `json:"position" bson:"position"`
Ext map[string]interface{} `json:"ext,omitempty" bson:"ext,omitempty"`
Icon string `json:"bk_obj_icon,omitempty" bson:"bk_obj_icon,omitempty"`
// BizID int `json:"bk_biz_id,omitempty" bson:"bk_biz_id,omitempty"`
SupplierAccount string `json:"bk_supplier_account,omitempty" bson:"bk_supplier_account,omitempty"` // bk_supplier_account
Assts []GraphAsst `json:"assts,omitempty"`
}
func (*TopoGraphics) FillBlank ¶
func (t *TopoGraphics) FillBlank() *TopoGraphics
func (*TopoGraphics) SetExt ¶
func (t *TopoGraphics) SetExt(val map[string]interface{})
func (*TopoGraphics) SetIcon ¶
func (t *TopoGraphics) SetIcon(val string)
func (*TopoGraphics) SetInstID ¶
func (t *TopoGraphics) SetInstID(val int)
func (*TopoGraphics) SetIsPre ¶
func (t *TopoGraphics) SetIsPre(val bool)
func (*TopoGraphics) SetMetaData ¶
func (t *TopoGraphics) SetMetaData(val Metadata)
func (*TopoGraphics) SetNodeName ¶
func (t *TopoGraphics) SetNodeName(val string)
func (*TopoGraphics) SetNodeType ¶
func (t *TopoGraphics) SetNodeType(val string)
func (*TopoGraphics) SetObjID ¶
func (t *TopoGraphics) SetObjID(val string)
func (*TopoGraphics) SetPosition ¶
func (t *TopoGraphics) SetPosition(val Position)
func (*TopoGraphics) SetScopeID ¶
func (t *TopoGraphics) SetScopeID(val string)
func (*TopoGraphics) SetScopeType ¶
func (t *TopoGraphics) SetScopeType(val string)
func (*TopoGraphics) SetSupplierAccount ¶
func (t *TopoGraphics) SetSupplierAccount(val string)
type TopoInst ¶
type TopoInst struct {
InstID int64 `json:"bk_inst_id"`
InstName string `json:"bk_inst_name"`
ObjID string `json:"bk_obj_id"`
ObjName string `json:"bk_obj_name"`
Default int `json:"default"`
}
TopoInst 实例拓扑结构
type TopoInstRst ¶
type TopoInstRst struct {
TopoInst `json:",inline"`
Child []*TopoInstRst `json:"child"`
}
TopoInstRst 拓扑实例
type TopoInstance ¶
type TopoInstance struct {
ObjectID string
InstanceID int64
ParentInstanceID int64
Detail map[string]interface{}
Default int64
}
func (*TopoInstance) Key ¶
func (ti *TopoInstance) Key() string
Key generate a unique key for instance(as instances's of different object type maybe conflict)
type TopoInstanceNode ¶
type TopoInstanceNode struct {
Children []*TopoInstanceNode
ObjectID string
InstanceID int64
Detail map[string]interface{}
}
func (*TopoInstanceNode) Name ¶
func (node *TopoInstanceNode) Name() string
func (*TopoInstanceNode) TraversalFindModule ¶
func (node *TopoInstanceNode) TraversalFindModule(targetID int64) []*TopoInstanceNode
func (*TopoInstanceNode) TraversalFindNode ¶
func (node *TopoInstanceNode) TraversalFindNode(objectType string, targetID int64) []*TopoInstanceNode
type TopoItem ¶
type TopoItem struct {
ClassificationID string `json:"bk_classification_id"`
Position string `json:"position"`
ObjID string `json:"bk_obj_id"`
OwnerID string `json:"bk_supplier_account"`
ObjName string `json:"bk_obj_name"`
}
TopoItem define topo item
type TopoModelNode ¶
type TopoModelNode struct {
Children []*TopoModelNode
ObjectID string
}
func (*TopoModelNode) LeftestObjectIDList ¶
func (tn *TopoModelNode) LeftestObjectIDList() []string
LeftestObjectIDList extrac leftest node's id of each level, arrange as a list it's useful in model mainline topo case, as bk_mainline relationship degenerate to a list.
type TransferHostAcrossBusinessParameter ¶
type TransferHostAcrossBusinessParameter struct {
SrcAppID int64 `json:"src_bk_biz_id"`
DstAppID int64 `json:"dst_bk_biz_id"`
HostID int64 `json:"bk_host_id"`
DstModuleIDArr []int64 `json:"bk_module_ids"`
}
TransferHostAcrossBusinessParameter Transfer host across business request parameter
type TransferHostToInnerModule ¶
type TransferHostToInnerModule struct {
ApplicationID int64 `json:"bk_biz_id"`
ModuleID int64 `json:"bk_module_id"`
HostID []int64 `json:"bk_host_id"`
}
TransferHostToInnerModule transfer host to inner module eg:idle module ,fault module
type TransferHostsCrossBusinessRequest ¶
type TransferHostsCrossBusinessRequest struct {
SrcApplicationID int64 `json:"src_bk_biz_id"`
DstApplicationID int64 `json:"dst_bk_biz_id"`
HostIDArr []int64 `json:"bk_host_id"`
DstModuleIDArr []int64 `json:"bk_module_ids"`
}
TransferHostsCrossBusinessRequest Transfer host across business request parameter
type UpdateAssociationObjectRequest ¶
type UpdateAssociationObjectRequest struct {
AsstName string `field:"bk_asst_name" json:"bk_asst_name" bson:"bk_asst_name"`
}
type UpdateAssociationTypeRequest ¶
type UpdateAssociationTypeRequest struct {
AsstName string `field:"bk_asst_name" json:"bk_asst_name" bson:"bk_asst_name"`
SrcDes string `field:"src_des" json:"src_des" bson:"src_des"`
DestDes string `field:"dest_des" json:"dest_des" bson:"dest_des"`
Direction string `field:"direction" json:"direction" bson:"direction"`
}
type UpdateGroupCondition ¶
type UpdateGroupCondition struct {
Condition struct {
ID int64 `field:"id" json:"id,omitempty"`
GroupID string `field:"bk_group_id" json:"bk_group_id,omitempty"`
ObjID string `field:"bk_obj_id" json:"bk_obj_id,omitempty"`
} `json:"condition"`
Data struct {
Name string `field:"bk_group_name" json:"bk_group_name,omitempty"`
Index int64 `field:"bk_group_index" json:"bk_group_index"`
} `json:"data"`
}
UpdateGroupCondition update group condition struct
type UpdateHostParams ¶
type UpdateHostParams struct {
ProxyList []interface{} `json:"bk_proxy_list"`
CloudID int64 `json:"bk_cloud_id"`
}
type UpdateModelAttrUnique ¶
type UpdateModelAttrUnique struct {
Data UpdateUniqueRequest `json:"data"`
}
type UpdateOption ¶
type UpdateOption struct {
Data mapstr.MapStr `json:"data"`
Condition mapstr.MapStr `json:"condition"`
}
UpdateOption common update options
type UpdateParams ¶
type UpdateResult ¶
type UpdateResult struct {
BaseResp `json:",inline"`
}
UpdateResult update result
type UpdateTopoGraphicsInput ¶
type UpdateTopoGraphicsInput struct {
Metadata `field:"metadata" json:"metadata" bson:"metadata"`
Origin []TopoGraphics `field:"origin" json:"origin" bson:"origin"`
}
type UpdateUniqueRequest ¶
type UpdateUniqueResult ¶
type UpdateUniqueResult struct {
BaseResp
}
type UpdatedCount ¶
type UpdatedCount struct {
Count uint64 `json:"updated_count"`
}
UpdatedCount created count struct
type UpdatedDataResult ¶
UpdatedDataResult common update operation result
type UpdatedOptionResult ¶
type UpdatedOptionResult struct {
BaseResp `json:",inline"`
Data UpdatedCount `json:"data"`
}
UpdatedOptionResult common update result
type UserConfig ¶
type UserConfig struct {
Info string `json:"info" bson:"info"`
Name string `json:"name" bson:"name"`
ID string `json:"id" bson:"id"`
CreateTime time.Time `json:"create_time" bson:"create_time"`
UpdateTime time.Time `json:"last_time" bson:"last_time"`
AppID int64 `json:"bk_biz_id" bson:"bk_biz_id"`
CreateUser string `json:"create_user" bson:"create_user"`
ModifyUser string `json:"modify_user" bson:"modify_user"`
}
type UserConfigMeta ¶
type UserConfigMeta struct {
AppID int64 `json:"bk_biz_id,omitempty" bson:"bk_biz_id,omitempty"`
Info string `json:"info,omitempty" bson:"info,omitempty"`
Name string `json:"name,omitempty" bson:"name,omitempty"`
ID string `json:"id,omitempty" bson:"id,omitempty"`
CreateTime time.Time `json:"create_time" bson:"create_time,omitempty"`
CreateUser string `json:"create_user" bson:"create_user,omitempty"`
ModifyUser string `json:"modify_user" bson:"modify_user,omitempty"`
UpdateTime time.Time `json:"last_time" bson:"last_time,omitempty"`
OwnerID string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}
type UserConfigResult ¶
type UserConfigResult struct {
Count uint64 `json:"count"`
Info []interface{} `json:"info"`
}
type UserGroup ¶
type UserGroup struct {
GroupName string `field:"group_name" json:"group_name" bson:"group_name"`
UserList string `field:"user_list" json:"user_list" bson:"user_list"`
SupplierAccount string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
GroupID string `field:"group_id" json:"group_id" bson:"group_id"`
}
UserGroup the privilege user group definition
type UserPriviResult ¶
type UserPriviResult struct {
Result bool `json:"result"`
Code int `json:"code"`
Message interface{} `json:"message"`
Data UserPrivilege `json:"data"`
}
type UserPrivilege ¶
type UserPrivilege struct {
GroupID string `json:"bk_group_id" bson:"bk_group_id"`
ModelConfig map[string]map[string][]string `json:"model_config" bson:"model_config"`
SysConfig SysConfigStruct `json:"sys_config" bson:"sys_config"`
}
Source Files
¶
- apiserver.go
- association.go
- attribute.go
- audit.go
- auth.go
- classification.go
- common.go
- core_service.go
- core_service_synchronize.go
- create.go
- datacollection.go
- delete.go
- eventserver.go
- graphic.go
- group.go
- hostcontroller.go
- hostlock.go
- hostserver.go
- inst.go
- log.go
- metadata.go
- netdevice.go
- object.go
- object_controller.go
- page.go
- phpapi.go
- privilege.go
- procserver.go
- query.go
- querycondition.go
- result.go
- set.go
- time.go
- toposerver.go
- unique.go
- update.go
- webserver.go