metadata

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

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

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

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.

* 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.

* 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.

* 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

View Source
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"
)
View Source
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"
)
View Source
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"
	AttributeFieldPlaceHolder     = "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"
)
View Source
const (
	ClassificationFieldID        = "id"
	ClassFieldClassificationID   = "bk_classification_id"
	ClassFieldClassificationName = "bk_classification_name"
)
View Source
const (
	AWS          string = "1"
	TencentCloud string = "2"
)

云厂商 和属性表中的bk_cloud_vendor值相对应

View Source
const (
	CloudSyncSuccess    string = "cloud_sync_success"
	CloudSyncFail       string = "cloud_sync_fail"
	CloudSyncInProgress string = "cloud_sync_in_progress"
)

云同步任务同步状态

View Source
const (
	EventActionCreate = "create"
	EventActionUpdate = "update"
	EventActionDelete = "delete"
)

EventAction

View Source
const (
	// 实例CRUD事件,实例类型通过event中的objType字段区分
	EventTypeInstData = "instdata"
	// 实例间的绑定关系发生变化,目前主要用于主机转移
	EventTypeRelation           = "relation"
	EventTypeAssociation        = "association"
	EventTypeResourcePoolModule = "resource"
)

EventType enumeration

View Source
const (
	EventObjTypeProcModule     = "processmodule"
	EventObjTypeModuleTransfer = "moduletransfer"
)

Event object type common instance's Event object type are model object id below are object type for relations

View Source
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"
)
View Source
const (
	TopoNodeKeyword = "keyword"
	// 主机更新时是否剔除绑定了主机属性自动应用的字段
	HostUpdateWithoutHostApplyFiled = true
)
View Source
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"
)
View Source
const (
	BKMetadata string = "metadata"
	BKLabel    string = "label"
)
View Source
const (
	CollectorStatusNormal   = "normal"
	CollectorStatusAbnormal = "abnormal"

	CollectorConfigStatusNormal   = "normal"
	CollectorConfigStatusPending  = "pending"
	CollectorConfigStatusAbnormal = "abnormal"

	CollectorReportStatusNormal   = "normal"
	CollectorReportStatusAbnormal = "abnormal"
)

NetcollectorStatus define

View Source
const (
	ReporctActionCreate = "create"
	ReporctActionUpdate = "update"
	ReporctActionDelete = "delete"
)
View Source
const (
	ReporctMethodAccept = "accept"
	ReporctMethodIgnore = "ignore"
)
View Source
const (
	ModelFieldID          = "id"
	ModelFieldObjCls      = "bk_classification_id"
	ModelFieldObjIcon     = "bk_obj_icon"
	ModelFieldObjectID    = "bk_obj_id"
	ModelFieldObjectName  = "bk_obj_name"
	ModelFieldIsHidden    = "bk_ishidden"
	ModelFieldIsPre       = "ispre"
	ModelFieldIsPaused    = "bk_ispaused"
	ModelFieldPosition    = "position"
	ModelFieldOwnerID     = "bk_supplier_account"
	ModelFieldDescription = "description"
	ModelFieldCreator     = "creator"
	ModelFieldModifier    = "modifier"
	ModelFieldCreateTime  = "create_time"
	ModelFieldLastTime    = "last_time"
)
View Source
const (
	PageName         = "page"
	PageSort         = "sort"
	PageStart        = "start"
	DBFields         = "fields"
	DBQueryCondition = "condition"
)
View Source
const (
	UniqueKeyKindProperty    = "property"
	UniqueKeyKindAssociation = "association"
)
View Source
const CCSystemUserConfigSwitch = "user_config_switch"
View Source
const (
	CC_time_type_parse_flag = "cc_time_type"
)

Variables

View Source
var (
	ConfirmModeHTTPStatus = "httpstatus"
	ConfirmModeRegular    = "regular"
)

ConfirmMode define

View Source
var (
	BizModuleHostChart = ChartConfig{
		ReportType: common.BizModuleHostChart,
	}

	HostOsChart = ChartConfig{
		ReportType: common.HostOSChart,
		Name:       "按操作系统类型统计",
		ObjID:      "host",
		Width:      "50",
		ChartType:  "pie",
		Field:      "bk_os_type",
		XAxisCount: 10,
	}

	HostBizChart = ChartConfig{
		ReportType: common.HostBizChart,
		Name:       "按业务统计",
		ObjID:      "host",
		Width:      "50",
		ChartType:  "bar",
		XAxisCount: 10,
	}

	HostCloudChart = ChartConfig{
		ReportType: common.HostCloudChart,
		Name:       "按云区域统计",
		Width:      "100",
		ObjID:      "host",
		ChartType:  "bar",
		Field:      common.BKCloudIDField,
		XAxisCount: 20,
	}

	HostChangeBizChart = ChartConfig{
		ReportType: common.HostChangeBizChart,
		Name:       "主机数量变化趋势",
		Width:      "100",
		XAxisCount: 20,
	}

	ModelAndInstCountChart = ChartConfig{
		ReportType: common.ModelAndInstCount,
	}

	ModelInstChart = ChartConfig{
		ReportType: common.ModelInstChart,
		Name:       "实例数量统计",
		Width:      "50",
		ChartType:  "bar",
		XAxisCount: 10,
	}

	ModelInstChangeChart = ChartConfig{
		ReportType: common.ModelInstChangeChart,
		Name:       "实例变更统计",
		Width:      "50",
		ChartType:  "bar",
		XAxisCount: 10,
	}

	InnerChartsMap = map[string]ChartConfig{
		common.BizModuleHostChart:   BizModuleHostChart,
		common.ModelAndInstCount:    ModelAndInstCountChart,
		common.HostOSChart:          HostOsChart,
		common.HostBizChart:         HostBizChart,
		common.HostCloudChart:       HostCloudChart,
		common.HostChangeBizChart:   HostChangeBizChart,
		common.ModelInstChart:       ModelInstChart,
		common.ModelInstChangeChart: ModelInstChangeChart,
	}

	InnerChartsArr = []string{
		common.BizModuleHostChart,
		common.ModelAndInstCount,
		common.HostOSChart,
		common.HostBizChart,
		common.HostCloudChart,
		common.HostChangeBizChart,
		common.ModelInstChart,
		common.ModelInstChangeChart,
	}
)
View Source
var (
	SyncStatusWaiting  = SyncStatus("waiting")  // 等待同步
	SyncStatusSyncing  = SyncStatus("syncing")  // 同步中
	SyncStatusFinished = SyncStatus("finished") // 同步完成
	SyncStatusFailure  = SyncStatus("failure")  // 同步失败
)
View Source
var (
	ModuleDiffAdd       = "add"
	ModuleDiffRemove    = "remove"
	ModuleDiffChanged   = "changed"
	ModuleDiffUnchanged = "unchanged"
)
View Source
var BizLabelNotExist = mapstr.MapStr{"metadata.label.bk_biz_id": mapstr.MapStr{"$exists": false}}
View Source
var (
	LabelKeyNotExistError = errors.New("label key does not exist")
)
View Source
var MetadataBizField = "metadata.label.bk_biz_id"
View Source
var (
	ProcessPortFormat = regexp.MustCompile(`^(((([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5]))-(([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))|((([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5]))))(,(((([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))|((([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5]))-(([1-9][0-9]{0,3})|([1-5][0-9]{4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))))*$`)
)
View Source
var SuccessBaseResp = BaseResp{Result: true, Code: common.CCSuccess, ErrMsg: common.CCSuccessStr}

SuccessBaseResp default result

View Source
var SupportedCloudVendors = []string{AWS, TencentCloud}

支持的云厂商 实现了相应的云厂商插件

Functions

func BizIDFromMetadata

func BizIDFromMetadata(meta Metadata) (int64, error)

func CheckAllowHostApplyOnField

func CheckAllowHostApplyOnField(field string) bool

CheckAllowHostApplyOnField 检查字段是否能用于主机属性自动应用

func ConvertHostSpecialStringToArray

func ConvertHostSpecialStringToArray(host map[string]interface{}) map[string]interface{}

convert host ip and operator fields value from string to array

func FilterValidFields

func FilterValidFields(fields []string) []string

func GetAllProcessPropertyFields

func GetAllProcessPropertyFields() []string

func GetAuditDict

func GetAuditDict() []resourceTypeInfo

func GetBusinessIDFromMeta

func GetBusinessIDFromMeta(data interface{}) string

func GetInstIDFieldByObjID

func GetInstIDFieldByObjID(objID string) string

func GetInstNameFieldName

func GetInstNameFieldName(objID string) string

func GetSetTemplateSyncIndex

func GetSetTemplateSyncIndex(setID int64) string

GetSetTemplateSyncIndex 返回task_server中任务的检索值(flag)

func IsAsDefaultValue

func IsAsDefaultValue(asDefaultValue *bool) bool

func NewPublicOrBizConditionByBizID

func NewPublicOrBizConditionByBizID(businessID int64) mapstr.MapStr

NewPublicOrBizConditionByBizID new a query condition

func ParseBizIDFromData

func ParseBizIDFromData(rawData mapstr.MapStr) (int64, error)

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 ParseCursorTypeFromEventType

func ParseCursorTypeFromEventType(eventType string) watch.CursorType

ParseCursorTypeFromEventType returns target cursor type type base on event type.

func ParseTime

func ParseTime(data interface{}) (time.Time, error)

func PublicAndBizCondition

func PublicAndBizCondition(meta Metadata) mapstr.MapStr

func Register

func Register(propertyBindInfo ProcPropertyExtraBindInfoInterface, procBindInfo ProcExtraBindInfoInterface)

Register 实现, 替换已有的进程,进程模板中进程绑定信息实际结构的处理对象

func StringToTimeDurationHookFunc

func StringToTimeDurationHookFunc() mapstructure.DecodeHookFunc

Types

type APISubTaskDetail

type APISubTaskDetail struct {
	SubTaskID string        `json:"sub_task_id" bson:"sub_task_id"`
	Data      interface{}   `json:"data" bson:"data"`
	Status    APITaskStatus `json:"status" bson:"status"`
	Response  *Response     `json:"response" bson:"response"`
}

APISubTaskDetail task data and execute detail

type APITaskDetail

type APITaskDetail struct {
	// task id
	TaskID string `json:"task_id" bson:"task_id"`
	// task name. 表示所在的任务队列
	Name string `json:"name" bson:"name"`
	// flag task 任务标识,留给业务方做识别任务
	Flag string `json:"flag" bson:"flag"`
	// task create user
	User string `json:"user" bson:"user"`
	//  http header
	Header http.Header `json:"header" bson:"header"`
	// task status
	Status APITaskStatus `json:"status" bson:"status"`
	// sub task detail
	Detail []APISubTaskDetail `json:"detail" bson:"detail"`

	CreateTime time.Time `json:"create_time" bson:"create_time"`
	LastTime   time.Time `json:"last_time" bson:"last_time"`
}

APITaskDetail task info detaill

type APITaskStatus

type APITaskStatus int64

APITaskStatus task status type

const (
	// APITaskStatusNew new task ,waiting execute
	APITaskStatusNew APITaskStatus = 0
	// APITaskStatusWaitExecute 正在执行的任务中断了。 补偿后。确定需要重新执行
	APITaskStatusWaitExecute APITaskStatus = 1

	// APITaskStatuExecute task executing
	APITaskStatuExecute APITaskStatus = 100

	// APITaskStatusSuccess task execute success
	APITaskStatusSuccess APITaskStatus = 200

	// APITAskStatusFail task execute failure
	APITAskStatusFail APITaskStatus = 500
)

func (APITaskStatus) IsFailure

func (s APITaskStatus) IsFailure() bool

func (APITaskStatus) IsFinished

func (s APITaskStatus) IsFinished() bool

func (APITaskStatus) IsSuccessful

func (s APITaskStatus) IsSuccessful() bool

type AccountValidityInfo

type AccountValidityInfo struct {
	AccountID int64  `json:"bk_account_id" bson:"bk_account_id"`
	ErrMsg    string `json:"err_msg" bson:"err_msg"`
}

type ActionType

type ActionType string

ActionType defines all the user's operation type

const (
	// create a resource
	AuditCreate ActionType = "create"
	// update a resource
	AuditUpdate ActionType = "update"
	// delete a resource
	AuditDelete ActionType = "delete"
	// transfer a host from resource pool to biz
	AuditAssignHost ActionType = "assign_host"
	// transfer a host from biz to resource pool
	AuditUnassignHost ActionType = "unassign_host"
	// transfer host to another module
	AuditTransferHostModule ActionType = "transfer_host_module"
	// archive a resource
	AuditArchive ActionType = "archive"
	// recover a resource
	AuditRecover ActionType = "recover"
	// pause an object
	AuditPause ActionType = "stop"
	// resume using an object
	AuditResume ActionType = "resume"
)

type AddConfigQuery

type AddConfigQuery struct {
	AppID      int64  `json:"bk_biz_id,omitempty"`
	Info       string `json:"info,omitempty"`
	Name       string `json:"name,omitempty"`
	CreateUser string `json:"create_user,omitempty"`
}

type AddDeviceResult

type AddDeviceResult struct {
	DeviceID uint64 `json:"device_id"`
}

type AddHistoryResult

type AddHistoryResult struct {
	BaseResp `json:",inline"`
	Data     ID `json:"data"`
}

type AddHostFromAgentHostList

type AddHostFromAgentHostList struct {
	HostInfo map[string]interface{} `json:"host_info"`
}

type AddHostToResourcePoolHostList

type AddHostToResourcePoolHostList struct {
	HostInfo  []map[string]interface{} `json:"host_info"`
	Directory int64                    `json:"directory"`
}

type AddHostToResourcePoolResult

type AddHostToResourcePoolResult struct {
	Success []AddOneHostToResourcePoolResult `json:"success,omitempty"`
	Error   []AddOneHostToResourcePoolResult `json:"error,omitempty"`
}

type AddNetPropertyResult

type AddNetPropertyResult struct {
	NetcollectPropertyID uint64 `json:"netcollect_property_id"`
}

type AddOneHostToResourcePoolResult

type AddOneHostToResourcePoolResult struct {
	Index    int    `json:"index"`
	HostID   int64  `json:"bk_host_id,omitempty"`
	ErrorMsg string `json:"error_message,omitempty"`
}

type AddToModuleInfo

type AddToModuleInfo struct {
	ModuleID        int64                  `field:"bk_module_id" json:"bk_module_id"`
	ServiceTemplate *ServiceTemplateDetail `field:"service_template" json:"service_template"`
}

type AggregateIntResponse

type AggregateIntResponse struct {
	BaseResp `json:",inline"`
	Data     []IntIDCount `json:"data"`
}

type AggregateStringResponse

type AggregateStringResponse struct {
	BaseResp `json:",inline"`
	Data     []StringIDCount `json:"data"`
}

type Ancestor

type Ancestor struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type AppBasicInfoResult

type AppBasicInfoResult struct {
	BaseResp
	Data BizBasicInfo `json:"data"`
}

type AppQueryResult

type AppQueryResult struct {
	BaseResp `json:",inline"`
	Data     InstResult `json:"data"`
}

type AssignHostToAppParams

type AssignHostToAppParams struct {
	ApplicationID      int64   `json:"bk_biz_id"`
	HostID             []int64 `json:"bk_host_id"`
	ModuleID           int64   `json:"bk_module_id"`
	OwnerApplicationID int64   `json:"bk_owner_biz_id"`
	OwnerModuleID      int64   `json:"bk_owner_module_id"`
}

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:"-"`
}

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

func (*Association) ToMapStr

func (cli *Association) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

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 AssociationIdItem

type AssociationIdItem struct {
	BaseCfgItem `json:",inline"`
}

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"`
}

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 AssociationOpDetail

type AssociationOpDetail struct {
	// AssociationID association id between two object
	AssociationID string `json:"asst_id" bson:"asst_id"`
	// AssociationKind association kind id
	AssociationKind string `json:"asst_kind" bson:"asst_kind"`
}

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 {
	BizID             int64       `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	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

func (*Attribute) Parse

func (attribute *Attribute) Parse(data mapstr.MapStr) (*Attribute, error)

Parse load the data from mapstr attribute into attribute instance

func (Attribute) PrettyValue

func (attribute Attribute) PrettyValue(ctx context.Context, val interface{}) (string, error)

func (*Attribute) ToMapStr

func (attribute *Attribute) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

func (*Attribute) Validate

func (attribute *Attribute) Validate(ctx context.Context, data interface{}, key string) (rawError errors.RawErrorInfo)

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 AttributesOption

type AttributesOption struct {
	ID        string `json:"id" bson:"id"`
	Name      string `json:"name" bson:"name"`
	Type      string `json:"type" bson:"type"`
	IsDefault bool   `json:"is_default" bson:"is_default"`
}

type AttributesOptions

type AttributesOptions []AttributesOption

type AuditLog

type AuditLog struct {
	ID int64 `json:"id" bson:"id"`
	// AuditType is a high level abstract of the resource managed by this cmdb.
	// Each kind of concept, resource must belongs to one of the resource type.
	AuditType AuditType `json:"audit_type" bson:"audit_type"`
	// the supplier account that this resource belongs to.
	SupplierAccount string `json:"bk_supplier_account" bson:"bk_supplier_account"`
	// name of the one who triggered this operation.
	User string `json:"user" bson:"user"`
	// the operated resource by the user
	ResourceType ResourceType `json:"resource_type" bson:"resource_type"`
	// ActionType represent the user's operation type, like CUD etc.
	Action ActionType `json:"action" bson:"action"`
	// OperateFrom describe which form does this audit come from.
	OperateFrom OperateFromType `json:"operate_from" bson:"operate_from"`
	// OperationDetail describe the details information by a user.
	// Note: when the ResourceType relevant to Business, then the business id field must
	// be bk_biz_id, otherwise the user can not search this operation log with business id.
	OperationDetail DetailFactory `json:"operation_detail" bson:"operation_detail"`
	// OperationTime is the time that user do the operation.
	OperationTime Time `json:"operation_time" bson:"operation_time"`
	// the business id of the resource if it belongs to a business.
	BusinessID int64 `json:"bk_biz_id,omitempty" bson:"bk_biz_id,omitempty"`
	// ResourceID is the id of the resource instance. which is a unique id, dynamic grouping id is string type.
	ResourceID interface{} `json:"resource_id" bson:"resource_id"`
	// ResourceName is the name of the resource, such as a switch model has a name "switch"
	ResourceName string `json:"resource_name" bson:"resource_name"`
}

func (AuditLog) MarshalBSON

func (auditLog AuditLog) MarshalBSON() ([]byte, error)

func (*AuditLog) UnmarshalBSON

func (auditLog *AuditLog) UnmarshalBSON(data []byte) error

func (*AuditLog) UnmarshalJSON

func (auditLog *AuditLog) UnmarshalJSON(data []byte) error

type AuditQueryCondition

type AuditQueryCondition struct {
	AuditType    AuditType       `json:"audit_type"`
	User         string          `json:"user"`
	ResourceType ResourceType    `json:"resource_type" `
	Action       []ActionType    `json:"action"`
	OperateFrom  OperateFromType `json:"operate_from"`
	BizID        int64           `json:"bk_biz_id"`
	ResourceID   interface{}     `json:"resource_id"`
	// ResourceName filters audit logs by resource name, such as instance name, host ip etc., support fuzzy query
	ResourceName string `json:"resource_name"`
	// OperationTime is an array of start time and end time, filters audit logs between them
	OperationTime OperationTimeCondition `json:"operation_time"`
	// Category is used by front end, filters audit logs as business(business resource related to business), resource(instance resource not related to business), host or other category
	Category string `json:"category"`
	// ObjID is used for instance audit log filter like host deletion history
	ObjID string `json:"bk_obj_id"`
}

type AuditQueryInput

type AuditQueryInput struct {
	Condition AuditQueryCondition `json:"condition"`
	Page      BasePage            `json:"page,omitempty"`
}

func (*AuditQueryInput) Validate

func (input *AuditQueryInput) Validate() errors.RawErrorInfo

Validate validates the input param

type AuditQueryResult

type AuditQueryResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		Count int64      `json:"count"`
		Info  []AuditLog `json:"info"`
	} `json:"data"`
}

type AuditType

type AuditType string
const (
	// BusinessKind represent business itself's operation audit. such as you change a business maintainer, it's
	// audit belongs to this kind.
	BusinessType AuditType = "business"

	// Business resource include resources as follows:
	// - service template
	// - set template
	// - service category
	// - dynamic group
	// - main line instance, such as user-defined topology level, set, module etc.
	// - service instance.
	// - others.
	//
	// Note: host does not belong to business resource, it's a independent resource kind.
	BusinessResourceType AuditType = "business_resource"

	// HostType represent all the host related resource's operation audit.
	HostType AuditType = "host"

	// ModelType represent all the operation audit related with model in the system
	ModelType AuditType = "model"

	// ModelInstanceType represent all the operation audit related with model instance in the system,
	// and the instance association is included.
	ModelInstanceType AuditType = "model_instance"

	// AssociationKindType represent all the association kind operation audit.
	AssociationKindType AuditType = "association_kind"

	// EventType represent all the event related operation audit.
	EventPushType AuditType = "event"

	// CloudResource represent all the operation audit related with cloud, such as:
	// - cloud area
	// - cloud account
	// - cloud synchronize job
	// - others
	CloudResourceType AuditType = "cloud_resource"
)

func GetAuditTypeByObjID

func GetAuditTypeByObjID(objID string, isMainline bool) AuditType

func GetAuditTypesByCategory

func GetAuditTypesByCategory(category string) []AuditType

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"`
}

type AuthResource

type AuthResource struct {
	BizID        int64  `json:"bk_biz_id"`
	ResourceType string `json:"resource_type"`
	ResourceID   int64  `json:"resource_id"`
	ResourceIDEx string `json:"resource_id_ex"`
	Action       string `json:"action"`
	ParentLayers []struct {
		ResourceType string `json:"resource_type"`
		ResourceID   int64  `json:"resource_id"`
		ResourceIDEx string `json:"resource_id_ex"`
	} `json:"parent_layers"`
}

type BKResponse

type BKResponse struct {
	BkBaseResp `json:",inline"`
	Data       interface{} `json:"data"`
}

type BackendCfg

type BackendCfg struct {
	SnapshotBizName string `json:"snapshotBizName"`
	MaxBizTopoLevel int64  `json:"maxBizTopoLevel"`
}

BackendCfg used to admin backend Config

func (BackendCfg) Validate

func (b BackendCfg) Validate() error

Validate validate the fields of BackendCfg

type BaseCfgItem

type BaseCfgItem struct {
	Value       string `json:"value"`
	Description string `json:"description"`
	I18N        I18N   `json:"i18n"`
}

BaseCfgItem the common base config item

func (*BaseCfgItem) IsEmpty

func (b *BaseCfgItem) IsEmpty() bool

IsEmpty judge whether the value is empty

func (*BaseCfgItem) IsExceedMaxLength

func (b *BaseCfgItem) IsExceedMaxLength() bool

IsExceedMaxLength judge whether the the length of value exceed the max value

func (*BaseCfgItem) ValidateRegex

func (b *BaseCfgItem) ValidateRegex() error

ValidateRegex validate regex

func (*BaseCfgItem) ValidateValueFormat

func (b *BaseCfgItem) ValidateValueFormat() error

ValidateValueFormat validate the value format

type BasePage

type BasePage struct {
	Sort  string `json:"sort,omitempty" mapstructure:"sort"`
	Limit int    `json:"limit,omitempty" mapstructure:"limit"`
	Start int    `json:"start" mapstructure:"start"`
}

BasePage for paging query

func ParsePage

func ParsePage(origin interface{}) BasePage

func (BasePage) IsIllegal

func (page BasePage) IsIllegal() bool

IsIllegal limit is illegal

func (BasePage) ToSearchSort

func (page BasePage) ToSearchSort() []SearchSort

func (BasePage) Validate

func (page BasePage) Validate(allowNoLimit bool) (string, error)

type BaseResp

type BaseResp struct {
	Result      bool           `json:"result" mapstructure:"result"`
	Code        int            `json:"bk_error_code" mapstructure:"bk_error_code"`
	ErrMsg      string         `json:"bk_error_msg" mapstructure:"bk_error_msg"`
	Permissions *IamPermission `json:"permission" mapstructure:"permission"`
}

BaseResp common result struct

func NewNoPermissionResp

func NewNoPermissionResp(permission *IamPermission) BaseResp

func (*BaseResp) CCError

func (br *BaseResp) CCError() errors.CCErrorCoder

CCError 根据response返回的信息产生错误

func (*BaseResp) Error

func (br *BaseResp) Error() error

New 根据response返回的信息产生错误

func (*BaseResp) ToString

func (br *BaseResp) ToString() string

type BasicContent

type BasicContent struct {
	// PreData the previous data before the deletion or updating operation
	PreData map[string]interface{} `json:"pre_data" bson:"pre_data"`
	// CurData the current date after the creation operation
	CurData map[string]interface{} `json:"cur_data" bson:"cur_data"`
	// UpdateFields the data that user uses to update the pre data, might not be the actual changed data
	UpdateFields map[string]interface{} `json:"update_fields" bson:"update_fields"`
}

Content contains the details information with in a user's operation. Generally, works for business, model, model instance etc.

type BasicOpDetail

type BasicOpDetail struct {
	// Details contains all the details information about a user's operation
	Details *BasicContent `json:"details" bson:"details"`
}

func (*BasicOpDetail) WithName

func (op *BasicOpDetail) WithName() string

type BatchAddDevice

type BatchAddDevice struct {
	Data []NetcollectDevice `json:"data"`
}

type BatchAddDeviceResult

type BatchAddDeviceResult struct {
	Result   bool   `json:"result"`
	ErrMsg   string `json:"error_msg"`
	DeviceID uint64 `json:"device_id"`
}

type BatchAddNetProperty

type BatchAddNetProperty struct {
	Data []NetcollectProperty `json:"data"`
}

type BatchAddNetPropertyResult

type BatchAddNetPropertyResult struct {
	Result               bool   `json:"result"`
	ErrMsg               string `json:"error_msg"`
	NetcollectPropertyID uint64 `json:"netcollect_property_id"`
}

type BatchCheckSetInstUpdateToDateStatusOption

type BatchCheckSetInstUpdateToDateStatusOption struct {
	SetTemplateIDs []int64 `field:"set_template_ids" json:"set_template_ids" bson:"set_template_ids" mapstructure:"set_template_ids"`
}

type BatchCreateOrUpdateApplyRuleOption

type BatchCreateOrUpdateApplyRuleOption struct {
	Rules []CreateOrUpdateApplyRuleOption `field:"host_apply_rules" json:"host_apply_rules" bson:"host_apply_rules" mapstructure:"host_apply_rules"`
}

type BatchCreateOrUpdateHostApplyRuleResult

type BatchCreateOrUpdateHostApplyRuleResult struct {
	Items []CreateOrUpdateHostApplyRuleResult `json:"items" mapstructure:"items"`
}

type BizBasicInfo

type BizBasicInfo struct {
	BizID   int64  `bson:"bk_biz_id" json:"bk_biz_id" field:"bk_biz_id" mapstructure:"bk_biz_id"`
	BizName string `bson:"bk_biz_name" json:"bk_biz_name" field:"bk_biz_name" mapstructure:"bk_biz_name"`
}

type BizInst

type BizInst struct {
	BizID           int64  `bson:"bk_biz_id" mapstructure:"bk_biz_id"`
	BizName         string `bson:"bk_biz_name" mapstructure:"bk_biz_name"`
	SupplierAccount string `bson:"bk_supplier_account" mapstructure:"bk_supplier_account"`
}

type BkBaseResp

type BkBaseResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

BkBaseResp base response defined in blueking api protocol

type BkHostInfo

type BkHostInfo struct {
	IP      string `json:"bk_host_innerip"`
	CloudID int    `json:"bk_cloud_id"`
}

type BkSystemInstallRequest

type BkSystemInstallRequest struct {
	SetName    string                            `json:"bk_set_name"`
	ModuleName string                            `json:"bk_module_name"`
	InnerIP    string                            `json:"bk_host_innerip"`
	CloudID    int64                             `json:"bk_cloud_id"`
	HostInfo   map[string]interface{}            `json:"host_info"`
	ProcInfo   map[string]map[string]interface{} `json:"proc_info"`
}

type BoolResponse

type BoolResponse struct {
	BaseResp `json:",inline"`
	Data     bool `json:"data"`
}

type BusinessDefaultSetModuleInfo

type BusinessDefaultSetModuleInfo struct {
	IdleSetID       int64 `json:"idle_set_id"`
	IdleModuleID    int64 `json:"idle_module_id"`
	FaultModuleID   int64 `json:"fault_module_id"`
	RecycleModuleID int64 `json:"recycle_module_id"`
}

func (BusinessDefaultSetModuleInfo) IsInternalModule

func (b BusinessDefaultSetModuleInfo) IsInternalModule(moduleID int64) bool

type BusinessDefaultSetModuleInfoResult

type BusinessDefaultSetModuleInfoResult struct {
	BaseResp `json:",inline"`
	Data     BusinessDefaultSetModuleInfo `json:"data"`
}

type BusinessTopoInstNamesItem

type BusinessTopoInstNamesItem struct {
	BaseCfgItem `json:",inline"`
}

type ChartClassification

type ChartClassification struct {
	Host []ChartConfig `json:"host"`
	Inst []ChartConfig `json:"inst"`
	Nav  []ChartConfig `json:"nav"`
}

type ChartConfig

type ChartConfig struct {
	ConfigID   uint64 `json:"config_id" bson:"config_id"`
	ReportType string `json:"report_type" bson:"report_type"`
	Name       string `json:"name" bson:"name"`
	CreateTime Time   `json:"create_time" bson:"create_time"`
	OwnerID    string `json:"bk_supplier_account" bson:"bk_supplier_account"`
	ObjID      string `json:"bk_obj_id" bson:"bk_obj_id"`
	Width      string `json:"width" bson:"width"`
	ChartType  string `json:"chart_type" bson:"chart_type"`
	Field      string `json:"field" bson:"field"`
	XAxisCount int64  `json:"x_axis_count" bson:"x_axis_count"`
}

type ChartData

type ChartData struct {
	ReportType string      `json:"report_type" bson:"report_type"`
	Data       interface{} `json:"data" data:"data"`
	OwnerID    string      `json:"bk_supplier_account" bson:"bk_supplier_account"`
	LastTime   time.Time   `json:"last_time" bson:"last_time"`
}

type ChartPosition

type ChartPosition struct {
	BizID    int64        `json:"bk_biz_id" bson:"bk_biz_id"`
	Position PositionInfo `json:"position" bson:"position"`
	OwnerID  string       `json:"bk_supplier_account" bson:"bk_supplier_account"`
}

type Classification

type Classification struct {
	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"`
}

ClassificationWithObject classification with object

type ClassifyIdItem

type ClassifyIdItem struct {
	BaseCfgItem `json:",inline"`
}

type CloneHostPropertyParams

type CloneHostPropertyParams struct {
	AppID   int64  `json:"bk_biz_id"`
	OrgIP   string `json:"bk_org_ip"`
	DstIP   string `json:"bk_dst_ip"`
	CloudID int64  `json:"bk_cloud_id"`
}

type CloudAccount

type CloudAccount struct {
	AccountName string    `json:"bk_account_name" bson:"bk_account_name"`
	CloudVendor string    `json:"bk_cloud_vendor" bson:"bk_cloud_vendor"`
	AccountID   int64     `json:"bk_account_id" bson:"bk_account_id"`
	SecretID    string    `json:"bk_secret_id" bson:"bk_secret_id"`
	SecretKey   string    `json:"bk_secret_key" bson:"bk_secret_key"`
	Description string    `json:"bk_description" bson:"bk_description"`
	OwnerID     string    `json:"bk_supplier_account" bson:"bk_supplier_account"`
	Creator     string    `json:"bk_creator" bson:"bk_creator"`
	LastEditor  string    `json:"bk_last_editor" bson:"bk_last_editor"`
	CreateTime  time.Time `json:"create_time" bson:"create_time"`
	LastTime    time.Time `json:"last_time" bson:"last_time"`
}

云账户

func (*CloudAccount) ToMapStr

func (c *CloudAccount) ToMapStr() mapstr.MapStr

func (*CloudAccount) Validate

func (c *CloudAccount) Validate() (rawError errors.RawErrorInfo)

type CloudAccountConf

type CloudAccountConf struct {
	AccountID  int64  `json:"bk_account_id" bson:"bk_account_id"`
	VendorName string `json:"bk_cloud_vendor" bson:"bk_cloud_vendor"`
	SecretID   string `json:"bk_secret_id" bson:"bk_secret_id"`
	SecretKey  string `json:"bk_secret_key" bson:"bk_secret_key"`
}

云厂商账户配置

type CloudAccountResult

type CloudAccountResult struct {
	BaseResp `json:",inline"`
	Data     CloudAccount `json:"data"`
}

type CloudAccountVerify

type CloudAccountVerify struct {
	SecretID    string `json:"bk_secret_id"`
	SecretKey   string `json:"bk_secret_key"`
	CloudVendor string `json:"bk_cloud_vendor"`
}

type CloudAccountWithExtraInfo

type CloudAccountWithExtraInfo struct {
	CloudAccount `json:",inline"`
	// 是否能删除账户,只有该账户下不存在同步任务了,才能删除,此时才能为true,否则为false
	CanDeleteAccount bool `json:"bk_can_delete_account" bson:"bk_can_delete_account"`
}

带有额外信息的云账户

type CloudArea

type CloudArea struct {
	CloudID     int64     `json:"bk_cloud_id" bson:"bk_cloud_id"`
	CloudName   string    `json:"bk_cloud_name" bson:"bk_cloud_name"`
	Status      int       `json:"bk_status" bson:"bk_status"`
	CloudVendor string    `json:"bk_cloud_vendor" bson:"bk_cloud_vendor"`
	OwnerID     string    `json:"bk_supplier_account" bson:"bk_supplier_account"`
	VpcID       string    `json:"bk_vpc_id" bson:"bk_vpc_id"`
	VpcName     string    `json:"bk_vpc_name" bson:"bk_vpc_name"`
	Region      string    `json:"bk_region" bson:"bk_region"`
	AccountID   int64     `json:"bk_account_id" bson:"bk_account_id"`
	Creator     string    `json:"bk_creator" bson:"bk_creator"`
	LastEditor  string    `json:"bk_last_editor" bson:"bk_last_editor"`
	CreateTime  time.Time `json:"create_time" bson:"create_time"`
	LastTime    time.Time `json:"last_time" bson:"last_time"`
}

云区域

type CloudAreaSearchParam

type CloudAreaSearchParam struct {
	SearchCloudOption `json:",inline"`
	HostCount         bool `json:"host_count"`
	SyncTaskIDs       bool `json:"sync_task_ids"`
}

CloudAreaParameter search cloud area parameter

type CloudHost

type CloudHost struct {
	Instance   `json:",inline"`
	CloudID    int64  `json:"bk_cloud_id" bson:"bk_cloud_id"`
	SyncDir    int64  `json:"bk_sync_dir,omitempty" bson:"bk_sync_dir,omitempty"`
	HostID     int64  `json:"bk_host_id" bson:"bk_host_id"`
	VendorName string `json:"bk_cloud_vendor" bson:"bk_cloud_vendor"`
}

type CloudHostModuleParams

type CloudHostModuleParams struct {
	ApplicationID int64        `json:"bk_biz_id"`
	HostInfoArr   []BkHostInfo `json:"host_info"`
	ModuleID      int64        `json:"bk_module_id"`
}

type CloudHostResource

type CloudHostResource struct {
	HostResource  []*VpcInstances
	DestroyedVpcs []*VpcSyncInfo
	TaskID        int64             `json:"bk_task_id" bson:"bk_task_id"`
	AccountConf   *CloudAccountConf `json:"account_conf" bson:"account_conf"`
}

云主机同步时的资源数据

type CloudInst

type CloudInst struct {
	CloudID   int64  `bson:"bk_cloud_id" json:"bk_cloud_id"`
	CloudName string `bson:"bk_cloud_name" json:"bk_cloud_name"`
}

type CloudMapping

type CloudMapping struct {
	CreateTime Time   `json:"create_time" bson:"create_time"`
	LastTime   Time   `json:"last_time" bson:"lsat_time"`
	CloudName  string `json:"bk_cloud_name" bson:"bk_cloud_name"`
	OwnerID    string `json:"bk_supplier_account" bson:"bk_supplier_account"`
	CloudID    int64  `json:"bk_cloud_id" bson:"bk_cloud_id"`
}

type CloudSyncTask

type CloudSyncTask struct {
	TaskID            int64          `json:"bk_task_id" bson:"bk_task_id"`
	TaskName          string         `json:"bk_task_name" bson:"bk_task_name"`
	ResourceType      string         `json:"bk_resource_type" bson:"bk_resource_type"`
	AccountID         int64          `json:"bk_account_id" bson:"bk_account_id"`
	CloudVendor       string         `json:"bk_cloud_vendor" bson:"bk_cloud_vendor"`
	SyncStatus        string         `json:"bk_sync_status" bson:"bk_sync_status"`
	OwnerID           string         `json:"bk_supplier_account" bson:"bk_supplier_account"`
	StatusDescription SyncStatusDesc `json:"bk_status_description" bson:"bk_status_description"`
	LastSyncTime      *time.Time     `json:"bk_last_sync_time" bson:"bk_last_sync_time"`
	SyncAll           bool           `json:"bk_sync_all" bson:"bk_sync_all"`
	SyncAllDir        int64          `json:"bk_sync_all_dir" bson:"bk_sync_all_dir"`
	SyncVpcs          []VpcSyncInfo  `json:"bk_sync_vpcs" bson:"bk_sync_vpcs"`
	Creator           string         `json:"bk_creator" bson:"bk_creator"`
	LastEditor        string         `json:"bk_last_editor" bson:"bk_last_editor"`
	CreateTime        time.Time      `json:"create_time" bson:"create_time"`
	LastTime          time.Time      `json:"last_time" bson:"last_time"`
}

云同步任务

func (*CloudSyncTask) ToMapStr

func (c *CloudSyncTask) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

type CntInfoString

type CntInfoString struct {
	Count int64 `json:"count"`
	// info is a json array string field.
	Info string `json:"info"`
}

type CommonInstTopo

type CommonInstTopo struct {
	InstNameAsst
	Count    int            `json:"count"`
	Children []InstNameAsst `json:"children"`
}

type CommonInstTopoV2

type CommonInstTopoV2 struct {
	Prev []*CommonInstTopo `json:"prev"`
	Next []*CommonInstTopo `json:"next"`
	Curr interface{}       `json:"curr"`
}

type CommonSearchChart

type CommonSearchChart struct {
	Count uint64      `json:"count"`
	Info  ChartConfig `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 ConfigAdmin

type ConfigAdmin struct {
	Backend         BackendCfg         `json:"backend"`
	Site            SiteCfg            `json:"site"`
	ValidationRules ValidationRulesCfg `json:"validationRules"`
}

ConfigAdmin used to admin the cmdb config

func (*ConfigAdmin) DecodeWithBase64

func (c *ConfigAdmin) DecodeWithBase64() error

DecodeWithBase64 decode the base64 value of ValidationRules

func (*ConfigAdmin) EncodeWithBase64

func (c *ConfigAdmin) EncodeWithBase64() error

EncodeWithBase64 encode the value of ValidationRules to base64

func (*ConfigAdmin) Validate

func (c *ConfigAdmin) Validate() error

Validate validate the fields of ConfigAdmin

type ConfigAdminParmams

type ConfigAdminParmams struct {
	Config ConfigAdmin `json:"config"`
}

ConfigAdminParams used to admin the cmdb config

type ConfigAdminResult

type ConfigAdminResult struct {
	BaseResp `json:",inline"`
	Data     ConfigAdmin `json:"data"`
}

ConfigAdminResult the result with config admin

type ConfirmMode

type ConfirmMode string

ConfirmMode define

func (*ConfirmMode) Scan

func (n *ConfirmMode) Scan(value interface{}) error

Scan implement sql driver's Scan interface

func (ConfirmMode) Value

func (n ConfirmMode) Value() (driver.Value, error)

Value implement sql driver's Value interface

type CoreDeleteServiceInstanceOption

type CoreDeleteServiceInstanceOption struct {
	BizID              int64   `json:"bk_biz_id"`
	ServiceInstanceIDs []int64 `json:"service_instance_ids" field:"service_instance_ids" bson:"service_instance_ids"`
}

type CoreUint64Response

type CoreUint64Response struct {
	BaseResp `json:",inline"`
	Data     uint64 `json:"data"`
}

type CountSetTplInstItem

type CountSetTplInstItem struct {
	SetTemplateID    int64 `json:"set_template_id" bson:"_id"`
	SetInstanceCount int64 `json:"set_instances_count" bson:"set_instances_count"`
}

type CountSetTplInstOption

type CountSetTplInstOption struct {
	SetTemplateIDs []int64 `field:"set_template_ids" json:"set_template_ids" bson:"set_template_ids"`
}

type CountTopoNodeHostsOption

type CountTopoNodeHostsOption struct {
	Nodes []TopoNode `json:"topo_nodes" mapstructure:"topo_nodes"`
}

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 CreateAssociationInstResult

type CreateAssociationInstResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

type CreateAssociationKind

type CreateAssociationKind struct {
	Data AssociationKind `json:"data"`
}

type CreateAssociationObjectResult

type CreateAssociationObjectResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

type CreateAssociationTypeResult

type CreateAssociationTypeResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

type CreateAuditLogParam

type CreateAuditLogParam struct {
	Data []AuditLog `json:"data"`
}

type CreateHostApplyRuleOption

type CreateHostApplyRuleOption struct {
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	ModuleID      int64       `field:"bk_module_id" json:"bk_module_id" bson:"bk_module_id" mapstructure:"bk_module_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" bson:"bk_property_value" mapstructure:"bk_property_value"`
}

type CreateInstResult

type CreateInstResult struct {
	BaseResp `json:",inline"`
	Data     mapstr.MapStr `json:"data"`
}

CreateInstResult create inst result

type CreateManyAssociationKind

type CreateManyAssociationKind struct {
	Datas []AssociationKind `json:"datas"`
}

type CreateManyCloudAreaElem

type CreateManyCloudAreaElem struct {
	CloudID int64  `json:"bk_cloud_id"`
	ErrMsg  string `json:"err_msg"`
}

type CreateManyCloudAreaResult

type CreateManyCloudAreaResult struct {
	BaseResp `json:",inline"`
	Data     []CreateManyCloudAreaElem `json:"data"`
}

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 CreateManyModelInstance struct {
	Datas []mapstr.MapStr `json:"datas"`
}

type CreateModel

type CreateModel struct {
	Spec       Object      `json:"spec"`
	Attributes []Attribute `json:"attributes"`
}

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 CreateModelInstance struct {
	Data mapstr.MapStr `json:"data"`
}

type CreateModelResult

type CreateModelResult struct {
	BaseResp `json:",inline"`
	Data     Object `json:"data"`
}

type CreateObjectAttributeResult

type CreateObjectAttributeResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

CreateObjectAttributeResult create object attribute result

type CreateObjectClassificationResult

type CreateObjectClassificationResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

CreateObjectClassificationResult create the object classification result

type CreateObjectGroupResult

type CreateObjectGroupResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

CreateObjectGroupResult create the object group result

type CreateObjectResult

type CreateObjectResult struct {
	BaseResp `json:",inline"`
	Data     RspID `json:"data"`
}

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 CreateOrUpdateApplyRuleOption

type CreateOrUpdateApplyRuleOption struct {
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	ModuleID      int64       `field:"bk_module_id" json:"bk_module_id" bson:"bk_module_id" mapstructure:"bk_module_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" bson:"bk_property_value" mapstructure:"bk_property_value"`
}

type CreateOrUpdateHostApplyRuleResult

type CreateOrUpdateHostApplyRuleResult struct {
	ErrorContainer `json:",inline"`
	Index          int           `json:"index" mapstructure:"index"`
	Rule           HostApplyRule `json:"rule" mapstructure:"rule"`
}

type CreateProcessTemplateBatchInput

type CreateProcessTemplateBatchInput struct {
	BizID             int64           `json:"bk_biz_id"`
	ServiceTemplateID int64           `json:"service_template_id"`
	Processes         []ProcessDetail `json:"processes"`
}

type CreateRawProcessInstanceInput

type CreateRawProcessInstanceInput struct {
	BizID             int64                   `json:"bk_biz_id"`
	ServiceInstanceID int64                   `json:"service_instance_Id"`
	Processes         []ProcessInstanceDetail `json:"processes"`
}

type CreateResult

type CreateResult struct {
	BaseResp `json:",inline"`
	Data     []Association `json:"data"`
}

CreateResult create result

type CreateServiceCategoryOption

type CreateServiceCategoryOption struct {
	BizID    int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	Name     string `field:"name" json:"name,omitempty" bson:"name"`
	ParentID int64  `field:"bk_parent_id" json:"bk_parent_id,omitempty" bson:"bk_parent_id"`
}

type CreateServiceInstanceDetail

type CreateServiceInstanceDetail struct {
	HostID int64 `json:"bk_host_id"`
	// Processes parameter usable only when create instance with raw
	Processes []ProcessInstanceDetail `json:"processes"`
}

type CreateServiceInstanceForServiceTemplateInput

type CreateServiceInstanceForServiceTemplateInput struct {
	BizID                      int64                         `json:"bk_biz_id"`
	Name                       string                        `json:"name"`
	ModuleID                   int64                         `json:"bk_module_id"`
	Instances                  []CreateServiceInstanceDetail `json:"instances"`
	HostApplyConflictResolvers []HostApplyConflictResolver   `json:"host_apply_conflict_resolvers"`
}

type CreateServiceInstanceOption

type CreateServiceInstanceOption struct {
	ModuleID int64 `json:"bk_module_id"`
	HostID   int64 `json:"bk_host_id"`
	// Processes parameter usable only when create instance with raw
	Processes []ProcessCreateOrUpdateInfo `json:"processes"`
}

type CreateServiceInstancePreviewInput

type CreateServiceInstancePreviewInput struct {
	BizID    int64   `json:"bk_biz_id"`
	ModuleID int64   `json:"bk_module_id"`
	HostIDs  []int64 `json:"bk_host_ids"`
}

type CreateServiceTemplateOption

type CreateServiceTemplateOption struct {
	BizID             int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	Name              string `field:"name" json:"name,omitempty" bson:"name"`
	ServiceCategoryID int64  `field:"service_category_id" json:"service_category_id,omitempty" bson:"service_category_id"`
}

type CreateSetTemplateOption

type CreateSetTemplateOption struct {
	Name               string  `field:"name" json:"name" bson:"name" mapstructure:"name"`
	ServiceTemplateIDs []int64 `field:"service_template_ids" json:"service_template_ids" bson:"service_template_ids" mapstructure:"service_template_ids"`
}

type CreateSyncHistoryesult

type CreateSyncHistoryesult struct {
	BaseResp `json:",inline"`
	Data     SyncHistory `json:"data"`
}

type CreateSyncTaskResult

type CreateSyncTaskResult struct {
	BaseResp `json:",inline"`
	Data     CloudSyncTask `json:"data"`
}

type CreateTaskRequest

type CreateTaskRequest struct {
	// task name
	Name string `json:"name"`

	// flag task 任务标识,留给业务方做识别任务
	Flag string `json:"flag"`

	Data []interface{} `json:"data"`
}

CreateTaskRequest create task request parameters

type CreateTaskResponse

type CreateTaskResponse struct {
	BaseResp
	Data APITaskDetail `json:"data"`
}

type CreateUniqueRequest

type CreateUniqueRequest struct {
	ObjID     string      `json:"bk_obj_id" bson:"bk_obj_id"`
	MustCheck bool        `json:"must_check" bson:"must_check"`
	Keys      []UniqueKey `json:"keys" bson:"keys"`
}

type CreateUniqueResult

type CreateUniqueResult struct {
	BaseResp
	Data RspID `json:"data"`
}

type CreatedCount

type CreatedCount struct {
	Count uint64 `json:"created_count"`
}

CreatedCount created count struct

type CreatedDataResult

type CreatedDataResult struct {
	OriginIndex int64  `json:"origin_index"`
	ID          uint64 `json:"id"`
}

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 DefaultModuleHostConfigParams

type DefaultModuleHostConfigParams struct {
	ApplicationID int64   `json:"bk_biz_id"`
	HostIDs       []int64 `json:"bk_host_id"`
}

type DeleteArchive

type DeleteArchive struct {
	Oid    string      `json:"oid" bson:"oid"`
	Detail interface{} `json:"detail" bson:"detail"`
}

type DeleteAssociationInstRequest

type DeleteAssociationInstRequest struct {
	Condition mapstr.MapStr `json:"condition"`
}

type DeleteAssociationInstResult

type DeleteAssociationInstResult struct {
	BaseResp `json:",inline"`
	Data     string `json:"data"`
}

type DeleteAssociationObjectResult

type DeleteAssociationObjectResult struct {
	BaseResp `json:",inline"`
	Data     string `json:"data"`
}

type DeleteAssociationTypeResult

type DeleteAssociationTypeResult struct {
	BaseResp `json:",inline"`
	Data     string `json:"data"`
}

type DeleteCategoryInput

type DeleteCategoryInput struct {
	ID int64 `json:"id"`
}

type DeleteDestroyedHostRelatedOption

type DeleteDestroyedHostRelatedOption struct {
	HostIDs []int64 `json:"host_ids" bson:"host_ids"`
}

type DeleteHostApplyRuleOption

type DeleteHostApplyRuleOption struct {
	RuleIDs []int64 `field:"host_apply_rule_ids" json:"host_apply_rule_ids" bson:"host_apply_rule_ids" mapstructure:"host_apply_rule_ids"`
}

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 {
	BizID int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
}

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

type DeleteOption struct {
	Condition mapstr.MapStr `json:"condition"`
}

DeleteOption common delete condition options

type DeleteProcessInstanceInServiceInstanceInput

type DeleteProcessInstanceInServiceInstanceInput struct {
	BizID              int64   `json:"bk_biz_id"`
	ProcessInstanceIDs []int64 `json:"process_instance_ids"`
}

type DeleteProcessInstanceRelationOption

type DeleteProcessInstanceRelationOption struct {
	BusinessID         *int64  `json:"bk_biz_id"`
	ProcessIDs         []int64 `json:"bk_process_id,omitempty"`
	ServiceInstanceIDs []int64 `json:"service_instance_id,omitempty"`
	ProcessTemplateIDs []int64 `json:"process_template_id,omitempty"`
	HostIDs            []int64 `json:"bk_host_id,omitempty"`
	ModuleIDs          []int64 `json:"bk_module_id,omitempty"`
}

type DeleteProcessTemplateBatchInput

type DeleteProcessTemplateBatchInput struct {
	BizID            int64   `json:"bk_biz_id"`
	ProcessTemplates []int64 `json:"process_templates"`
}

type DeleteResult

type DeleteResult struct {
	BaseResp `json:",inline"`
}

DeleteResult delete result

type DeleteServiceInstanceOption

type DeleteServiceInstanceOption struct {
	BizID              int64   `json:"bk_biz_id"`
	ServiceInstanceIDs []int64 `json:"service_instance_ids" field:"service_instance_ids" bson:"service_instance_ids"`
}

type DeleteServiceTemplatesInput

type DeleteServiceTemplatesInput struct {
	BizID             int64 `json:"bk_biz_id"`
	ServiceTemplateID int64 `json:"service_template_id"`
}

type DeleteSetTemplateOption

type DeleteSetTemplateOption struct {
	SetTemplateIDs []int64 `field:"set_template_ids" json:"set_template_ids" bson:"set_template_ids" mapstructure:"set_template_ids"`
}

type DeleteSetTemplateSyncStatusOption

type DeleteSetTemplateSyncStatusOption struct {
	SetIDs []int64 `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
	BizID  int64   `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id" mapstructure:"bk_biz_id"`
}

type DeleteUniqueRequest

type DeleteUniqueRequest struct {
	ID    uint64 `json:"id"`
	ObjID string `json:"bk_obj_id"`
}

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 DepartmentData

type DepartmentData struct {
	Count   int64            `json:"count"`
	Results []DepartmentItem `json:"results"`
}

type DepartmentItem

type DepartmentItem struct {
	ID          int64      `json:"id"`
	Parent      int64      `json:"parent"`
	Name        string     `json:"name"`
	FullName    string     `json:"full_name"`
	Level       int        `json:"level"`
	HasChildren bool       `json:"has_children"`
	Ancestors   []Ancestor `json:"ancestors"`
}

type DepartmentProfileData

type DepartmentProfileData struct {
	Count   int64                   `json:"count"`
	Results []DepartmentProfileItem `json:"results"`
}

type DepartmentProfileItem

type DepartmentProfileItem struct {
	ID   int64  `json:"id"`
	Name string `json:"username"`
}

type DepartmentProfileResult

type DepartmentProfileResult struct {
	BaseResp `json:",inline"`
	Data     *DepartmentProfileData `json:"data"`
}

type DepartmentResult

type DepartmentResult struct {
	BaseResp `json:",inline"`
	Data     *DepartmentData `json:"data"`
}

type DetailFactory

type DetailFactory interface {
	WithName() string
}

type DiffModuleWithTemplateOption

type DiffModuleWithTemplateOption struct {
	BizID     int64   `json:"bk_biz_id"`
	ModuleIDs []int64 `json:"bk_module_ids"`
}

type DiffOneModuleWithTemplateOption

type DiffOneModuleWithTemplateOption struct {
	BizID    int64 `json:"bk_biz_id"`
	ModuleID int64 `json:"bk_module_id"`
}

type DiffSetTplWithInstOption

type DiffSetTplWithInstOption struct {
	SetIDs []int64 `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
}

type DifferenceDetail

type DifferenceDetail struct {
	Unchanged []ProcessDifferenceDetail `json:"unchanged"`
	Changed   []ProcessDifferenceDetail `json:"changed"`
	Added     []ProcessDifferenceDetail `json:"added"`
	Removed   []ProcessDifferenceDetail `json:"removed"`
}

type Dimension

type Dimension struct {
	AppID int64 `json:"bk_biz_id"`
}

type DistInst

type DistInst struct {
	EventInst
	DstbID         int64 `json:"distribution_id"`
	SubscriptionID int64 `json:"subscription_id"`
}

type DistInstCtx

type DistInstCtx struct {
	DistInst
	Raw string
}

type DistinctHostIDByTopoRelationRequest

type DistinctHostIDByTopoRelationRequest struct {
	ApplicationIDArr []int64 `json:"bk_biz_ids" bson:"bk_biz_ids" field:"bk_biz_ids" mapstructure:"bk_biz_ids"`
	SetIDArr         []int64 `json:"bk_set_ids" bson:"bk_set_ids" field:"bk_set_ids" mapstructure:"bk_set_ids"`
	HostIDArr        []int64 `json:"bk_host_ids" bson:"bk_host_ids" field:"bk_host_ids" mapstructure:"bk_host_ids"`
	ModuleIDArr      []int64 `json:"bk_module_ids" bson:"bk_module_ids" field:"bk_module_ids" mapstructure:"bk_module_ids"`
}

DistinctHostIDByTopoRelationRequest distinct host id by topology request

func (*DistinctHostIDByTopoRelationRequest) Empty

Empty empty struct

type DistinctID

type DistinctID struct {
	IDArr []int64 `json:"id_arr"`
}

type DistinctIDResponse

type DistinctIDResponse struct {
	BaseResp `json:",inline"`
	Data     DistinctID `json:"data"`
}

type EnumIdItem

type EnumIdItem struct {
	BaseCfgItem `json:",inline"`
}

type EnumNameItem

type EnumNameItem struct {
	BaseCfgItem `json:",inline"`
}

type EnumOption

type EnumOption []EnumVal

EnumOption enum option

func ParseEnumOption

func ParseEnumOption(ctx context.Context, val interface{}) (EnumOption, error)

ParseEnumOption convert val to []EnumVal

func (EnumOption) GetDefault

func (opt EnumOption) GetDefault() *EnumVal

GetDefault returns EnumOption's default value

type EnumVal

type EnumVal struct {
	ID        string `bson:"id"           json:"id"`
	Name      string `bson:"name"         json:"name"`
	Type      string `bson:"type"         json:"type"`
	IsDefault bool   `bson:"is_default"   json:"is_default"`
}

EnumVal enum option val

type ErrorContainer

type ErrorContainer struct {
	ErrCode int    `json:"error_code" json:"error_code" bson:"error_code" mapstructure:"error_code"`
	ErrMsg  string `json:"error_message" json:"error_message" bson:"error_message" mapstructure:"error_message"`
}

func (*ErrorContainer) GetError

func (container *ErrorContainer) GetError() errors.CCErrorCoder

func (*ErrorContainer) SetError

func (container *ErrorContainer) SetError(err errors.CCErrorCoder)

type EsbBaseResponse

type EsbBaseResponse struct {
	Result       bool   `json:"result"`
	Code         int    `json:"code"`
	Message      string `json:"message"`
	EsbRequestID string `json:"request_id"`
}

type EsbDepartmentProfileResponse

type EsbDepartmentProfileResponse struct {
	EsbBaseResponse `json:",inline"`
	Data            DepartmentProfileData `json:"data"`
}

type EsbDepartmentResponse

type EsbDepartmentResponse struct {
	EsbBaseResponse `json:",inline"`
	Data            DepartmentData `json:"data"`
}

type EsbListUserResponse

type EsbListUserResponse struct {
	EsbBaseResponse `json:",inline"`
	Data            []ListUserItem `json:"data"`
}

type EsbResponse

type EsbResponse struct {
	EsbBaseResponse `json:",inline"`
	Data            mapstr.MapStr `json:"data"`
}

type EsbUserListResponse

type EsbUserListResponse struct {
	EsbBaseResponse `json:",inline"`
	Data            []UserInfo `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"`
	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"`
	Cursor        string      `json:"cursor"`
	UpdateFields  []string    `json:"update_fields"`
	DeletedFields []string    `json:"deleted_fields"`
}

func (*EventInst) GetType

func (e *EventInst) GetType() string

func (*EventInst) MarshalBinary

func (e *EventInst) MarshalBinary() (data []byte, err error)

type EventInstCtx

type EventInstCtx struct {
	EventInst
	Raw string
}

type EventType

type EventType string

EventType define

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 FavoriteResult struct {
	Count uint64                   `json:"count"`
	Info  []map[string]interface{} `json:"info"`
}

type FavouriteMeta

type FavouriteMeta struct {
	BizID       int64     `json:"bk_biz_id" bson:"bk_biz_id"`
	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"`
	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 FavouriteParms struct {
	ID          string `json:"id,omitempty"`
	Info        string `json:"info,omitempty"`
	QueryParams string `json:"query_params,omitempty"`
	Name        string `json:"name,omitempty"`
	IsDefault   int    `json:"is_default,omitempty"`
	Count       int    `json:"count,omitempty"`
	BizID       int64  `json:"bk_biz_id"`
}

type FieldIdItem

type FieldIdItem struct {
	BaseCfgItem `json:",inline"`
}

type FilePriviewMap

type FilePriviewMap struct {
	Content string `json:"content"`
	Inst    string `json:"inst"`
}

type FindHostsBySetTplOpt

type FindHostsBySetTplOpt struct {
	SetTemplateIDs []int64  `json:"bk_set_template_ids"`
	SetIDs         []int64  `json:"bk_set_ids"`
	Fields         []string `json:"fields"`
	Page           BasePage `json:"page"`
}

func (*FindHostsBySetTplOpt) Validate

func (o *FindHostsBySetTplOpt) Validate() (rawError errors.RawErrorInfo)

type FindHostsBySrvTplOpt

type FindHostsBySrvTplOpt struct {
	ServiceTemplateIDs []int64  `json:"bk_service_template_ids"`
	ModuleIDs          []int64  `json:"bk_module_ids"`
	Fields             []string `json:"fields"`
	Page               BasePage `json:"page"`
}

func (*FindHostsBySrvTplOpt) Validate

func (o *FindHostsBySrvTplOpt) Validate() (rawError errors.RawErrorInfo)

type FindHostsByTopoOpt

type FindHostsByTopoOpt struct {
	ObjID  string   `json:"bk_obj_id"`
	InstID int64    `json:"bk_inst_id"`
	Fields []string `json:"fields"`
	Page   BasePage `json:"page"`
}

func (*FindHostsByTopoOpt) Validate

func (o *FindHostsByTopoOpt) Validate() (rawError errors.RawErrorInfo)

type FindModuleHostRelationParameter

type FindModuleHostRelationParameter struct {
	ModuleIDS    []int64  `json:"bk_module_ids"`
	ModuleFields []string `json:"module_fields"`
	HostFields   []string `json:"host_fields"`
	Page         BasePage `json:"page"`
}

func (FindModuleHostRelationParameter) Validate

type FindModuleHostRelationResp

type FindModuleHostRelationResp struct {
	BaseResp `json:",inline"`
	Data     FindModuleHostRelationResult `json:"data"`
}

type FindModuleHostRelationResult

type FindModuleHostRelationResult struct {
	Count    int                  `json:"count"`
	Relation []ModuleHostRelation `json:"relation"`
}

type FindServiceAndProcessInstanceOption

type FindServiceAndProcessInstanceOption struct {
	BizID             int64 `json:"bk_biz_id" field:"bk_biz_id" bson:"bk_biz_id"`
	ModuleID          int64 `json:"bk_module_id" field:"bk_module_id" bson:"bk_module_id"`
	ServiceTemplateID int64 `json:"service_template_id" field:"service_template_id" bson:"service_template_id"`
}

type FindTopoPathRequest

type FindTopoPathRequest struct {
	Nodes []TopoNode `json:"topo_nodes" mapstructure:"topo_nodes"`
}

type FloatItem

type FloatItem struct {
	BaseCfgItem `json:",inline"`
}

type FloatOption

type FloatOption struct {
	Min string `bson:"min" json:"min"`
	Max string `bson:"max" json:"max"`
}

FloatOption float option

func ParseFloatOption

func ParseFloatOption(ctx context.Context, val interface{}) FloatOption

parseFloatOption parse float data in option

type FooterItem

type FooterItem struct {
	Links []LinksItem `json:"links"`
}

func (FooterItem) Validate

func (s FooterItem) Validate() error

Validate validate the fields of FooterItem

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 GetHostModuleIDsResult struct {
	BaseResp `json:",inline"`
	Data     []int64 `json:"data"`
}

type GetHostSnapBatchResult

type GetHostSnapBatchResult struct {
	BaseResp `json:",inline"`
	Data     map[int64]string `json:"data"`
}

type GetHostSnapResult

type GetHostSnapResult struct {
	BaseResp `json:",inline"`
	Data     HostSnap `json:"data"`
}

type GetHostsResult

type GetHostsResult struct {
	BaseResp `json:",inline"`
	Data     HostInfo `json:"data"`
}

type GetProc2ModuleOption

type GetProc2ModuleOption struct {
	ProcessID int64 `json:"bk_process_id"`
	BizID     int64 `json:"bk_biz_id"`
}

type GetProc2ModuleResult

type GetProc2ModuleResult struct {
	BaseResp `json:",inline"`
	Data     []Proc2Module `json:"data"`
}

type GetServiceInstanceInModuleInput

type GetServiceInstanceInModuleInput struct {
	BizID     int64              `json:"bk_biz_id"`
	ModuleID  int64              `json:"bk_module_id"`
	HostIDs   []int64            `json:"bk_host_ids"`
	Page      BasePage           `json:"page"`
	SearchKey *string            `json:"search_key"`
	Selectors selector.Selectors `json:"selectors"`
}

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 GetUserCustomResult struct {
	BaseResp `json:",inline"`
	Data     map[string]interface{} `json:"data"`
}

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 {
	BizID      int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	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"`
	IsCollapse bool   `field:"is_collapse" json:"is_collapse" bson:"is_collapse"`
}

Group group metadata definition

func (*Group) Parse

func (cli *Group) Parse(data mapstr.MapStr) (*Group, error)

Parse load the data from mapstr group into group instance

func (*Group) ToMapStr

func (cli *Group) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

type GseHost

type GseHost struct {
	HostID    int64  `json:"bk_host_id,omitempty"`
	Ip        string `json:"ip,omitempty"`
	BkCloudId int64  `json:"bk_cloud_id"`
}

type GseProcConfigmap

type GseProcConfigmap struct {
	Path string `json:"path,omitempty"`
	Md5  string `json:"md5,omitempty"`
}

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 GseProcMeta struct {
	Namespace string            `json:"namespace,omitempty"`
	Name      string            `json:"name,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
}

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 GseProcResource struct {
	Cpu  float64 `json:"cpu,omitempty"`
	Mem  float64 `json:"mem,omitempty"`
	Fd   int     `json:"fd,omitempty"`
	Disk int     `json:"disk,omitempty"`
	Net  int     `json:"net,omitempty"`
}

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 Host2Modules

type Host2Modules struct {
	HostID    int64   `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id" mapstructure:"bk_host_id"`
	ModuleIDs []int64 `field:"bk_module_ids" json:"bk_module_ids" bson:"bk_module_ids" mapstructure:"bk_module_ids"`
}

type HostApplyConflictField

type HostApplyConflictField struct {
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	PropertyID    string      `field:"bk_property_id" json:"bk_property_id" mapstructure:"bk_property_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" mapstructure:"bk_property_value"`

	Rules []HostApplyRule `field:"host_apply_rules" json:"host_apply_rules" bson:"host_apply_rules" mapstructure:"host_apply_rules"`
	// UnresolvedConflictExist show whether conflict still exist after use possible conflict resolver
	// if there is a conflict, but has a resolver for it, ConflictedStillExist will be false
	UnresolvedConflictExist bool `field:"unresolved_conflict_exist" json:"unresolved_conflict_exist" mapstructure:"unresolved_conflict_exist"`
}

type HostApplyConflictResolver

type HostApplyConflictResolver struct {
	HostID        int64       `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id" mapstructure:"bk_host_id"`
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" bson:"bk_property_value" mapstructure:"bk_property_value"`
}

ConflictResolver 定义单个冲突的解决办法

type HostApplyPlanOption

type HostApplyPlanOption struct {
	Rules             []HostApplyRule             `field:"host_apply_rules" json:"host_apply_rules" bson:"host_apply_rules" mapstructure:"host_apply_rules"`
	HostModules       []Host2Modules              `field:"host_modules" json:"host_modules" bson:"host_modules" mapstructure:"host_modules"`
	ConflictResolvers []HostApplyConflictResolver `field:"conflict_resolvers" json:"conflict_resolvers" bson:"conflict_resolvers" mapstructure:"conflict_resolvers"`
}

主机属性自动应用执行计划生成逻辑核心数据结构 设计背景:该数据结构需要支持如下三种场景 1. 应用模块配置到主机属性 2. 编辑模块配置(可能未保存), 预览应用效果(查看是否有冲突) 3. 将主机转移到模块下前预览应用效果(查看是否有冲突) 字段说明 - Rules: 主机属性应用规则,由于上述case2的存在,其中 ID 可能为0 - HostModules: 主机所有模块信息,case3的存在,导致不能直接从db中查询主机所属模块 - ConflictResolvers: 可选参数,用于表示主机属性应用出现冲突时,如何设置应用值,如果未设置则冲突的字段不会被更新

type HostApplyPlanRequest

type HostApplyPlanRequest struct {
	RemoveRuleIDs     []int64                     `field:"remove_rule_ids" json:"remove_rule_ids" bson:"remove_rule_ids" mapstructure:"remove_rule_ids"`
	IgnoreRuleIDs     []int64                     `field:"ignore_rule_ids" json:"ignore_rule_ids" bson:"ignore_rule_ids" mapstructure:"ignore_rule_ids"`
	AdditionalRules   []CreateHostApplyRuleOption `field:"additional_rules" json:"additional_rules" bson:"additional_rules" mapstructure:"additional_rules"`
	ConflictResolvers []HostApplyConflictResolver `field:"conflict_resolvers" json:"conflict_resolvers" bson:"conflict_resolvers" mapstructure:"conflict_resolvers"`
	ModuleIDs         []int64                     `field:"bk_module_ids" json:"bk_module_ids" bson:"bk_module_ids" mapstructure:"bk_module_ids"`
	// optional, if set, only hostID in HostIDs will be used
	HostIDs []int64 `field:"bk_host_ids" json:"bk_host_ids" bson:"bk_host_ids" mapstructure:"bk_host_ids"`
}

type HostApplyPlanResult

type HostApplyPlanResult struct {
	Plans []OneHostApplyPlan `field:"plans" json:"plans" bson:"plans" mapstructure:"plans"`
	// 未解决的冲突主机数
	UnresolvedConflictCount int64           `field:"unresolved_conflict_count" json:"unresolved_conflict_count" mapstructure:"unresolved_conflict_count"`
	HostAttributes          []Attribute     `field:"host_attributes" json:"host_attributes" bson:"host_attributes" mapstructure:"host_attributes"`
	Count                   int             `field:"count" json:"count" bson:"count" mapstructure:"count"`
	Rules                   []HostApplyRule `field:"final_rules" json:"final_rules" mapstructure:"final_rules"`
}

type HostApplyResult

type HostApplyResult struct {
	ErrorContainer `json:",inline"`
	HostID         int64 `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id" mapstructure:"bk_host_id"`
}

type HostApplyRule

type HostApplyRule struct {
	ID       int64 `field:"id" json:"id" bson:"id" mapstructure:"id"`
	BizID    int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id" mapstructure:"bk_biz_id"`
	ModuleID int64 `field:"bk_module_id" json:"bk_module_id" bson:"bk_module_id" mapstructure:"bk_module_id"`
	// `id` field of table: `cc_AsstDes`, not the same with bk_property_id
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" bson:"bk_property_value" mapstructure:"bk_property_value"`

	// 通用字段
	Creator         string    `field:"creator" json:"creator" bson:"creator" mapstructure:"creator"`
	Modifier        string    `field:"modifier" json:"modifier" bson:"modifier" mapstructure:"modifier"`
	CreateTime      time.Time `field:"create_time" json:"create_time" bson:"create_time" mapstructure:"create_time"`
	LastTime        time.Time `field:"last_time" json:"last_time" bson:"last_time" mapstructure:"last_time"`
	SupplierAccount string    `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account" mapstructure:"bk_supplier_account"`
}

HostApplyRule represent one rule of host property auto apply

func (*HostApplyRule) Validate

func (h *HostApplyRule) Validate() (string, error)

type HostApplyUpdateField

type HostApplyUpdateField struct {
	AttributeID   int64       `field:"bk_attribute_id" json:"bk_attribute_id" bson:"bk_attribute_id" mapstructure:"bk_attribute_id"`
	PropertyID    string      `field:"bk_property_id" json:"bk_property_id" mapstructure:"bk_property_id"`
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" mapstructure:"bk_property_value"`
}

type HostBizTopo

type HostBizTopo struct {
	BizID   int64  `json:"bk_biz_id" bson:"bk_biz_id"`
	BizName string `json:"bk_biz_name" bson:"bk_biz_name"`
	Set     []Topo `json:"set" bson:"set"`
}

type HostChangeChartData

type HostChangeChartData struct {
	ReportType string          `json:"report_type" bson:"report_type"`
	Data       []StringIDCount `json:"data" bson:"data"`
	OwnerID    string          `json:"bk_supplier_account" bson:"bk_supplier_account"`
	CreateTime string          `json:"create_time" bson:"create_time"`
}

type HostCloneInputParams

type HostCloneInputParams struct {
	OrgIP  string `json:"bk_org_ip"`
	DstIP  string `json:"bk_dst_ip"`
	AppID  int64  `json:"bk_biz_id"`
	PlatID int64  `json:"bk_cloud_id"`
}

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     HostConfigData `json:"data"`
}

type HostConfigData

type HostConfigData struct {
	Count int64        `json:"count"`
	Info  []ModuleHost `json:"data"`
	Page  BasePage     `json:"page"`
}

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)					数字
	Layer      *Layer `json:"layer"`             // 自定义层级
}

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"` // 进程名称
	// deprecated  后续的版本会被废弃掉
	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"}]
	// deprecated  后续的版本会被废弃掉
	Port string `json:"port" bson:"port"` // 端口, 单个端口:"8080", 多个连续端口:"8080-8089", 多个不连续端口:"8080-8089,8199"
	// deprecated  后续的版本会被废弃掉
	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,数字数组
	// deprecated  后续的版本会被废弃掉
	PortEnable bool `field:"bk_enable_port" json:"bk_enable_port" bson:"bk_enable_port"`
	// BindInfo 进程绑定信息
	BindInfo []ProcBindInfo `field:"bind_info" json:"bind_info" bson:"bind_info"`
}

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"`       // 主机名称
	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         StringArrayToString         `json:"bk_host_innerip" bson:"bk_host_innerip"` // 内网IP
	OuterIP         StringArrayToString         `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"`
}

func (*HostIdentifier) MarshalBinary

func (identifier *HostIdentifier) MarshalBinary() (data []byte, err error)

type HostInfo

type HostInfo struct {
	Count int             `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

type HostInputType

type HostInputType string
const (
	ExcelType   HostInputType = "excel"
	CollectType HostInputType = "collect"
)

type HostInstanceProperties

type HostInstanceProperties struct {
	PropertyID    string      `json:"bk_property_id"`
	PropertyName  string      `json:"bk_property_name"`
	PropertyValue interface{} `json:"bk_property_value"`
}

type HostInstancePropertiesResult

type HostInstancePropertiesResult struct {
	BaseResp `json:",inline"`
	Data     []HostInstanceProperties `json:"data"`
}

type HostInstanceResult

type HostInstanceResult struct {
	BaseResp `json:",inline"`
	Data     map[string]interface{} `json:"data"`
}

type HostList

type HostList struct {
	ApplicationID int64                            `json:"bk_biz_id"`
	HostInfo      map[int64]map[string]interface{} `json:"host_info"`
	InputType     HostInputType                    `json:"input_type"`
}

type HostLockData

type HostLockData struct {
	User       string    `json:"bk_user" bson:"bk_user"`
	ID         int64     `json:"bk_host_id" bson:"bk_host_id"`
	CreateTime time.Time `json:"create_time" bson:"create_time"`
	OwnerID    string    `json:"-" bson:"bk_supplier_account"`
}

type HostLockQueryResponse

type HostLockQueryResponse struct {
	BaseResp `json:",inline"`
	Data     struct {
		Info  []HostLockData `json:"info"`
		Count int64          `json:"count"`
	}
}

type HostLockRequest

type HostLockRequest struct {
	IDS []int64 `json:"id_list"`
}

type HostLockResponse

type HostLockResponse struct {
	BaseResp `json:",inline"`
	Data     mapstr.MapStr `json:"data"`
}

type HostLockResultResponse

type HostLockResultResponse struct {
	BaseResp `json:",inline"`
	Data     map[int64]bool `json:"data"`
}

type HostMapStr

type HostMapStr map[string]interface{}

host map with string type ip and operator, can only get host from db with this map

func (*HostMapStr) UnmarshalBSON

func (h *HostMapStr) UnmarshalBSON(b []byte) error

type HostModuleConfig

type HostModuleConfig struct {
	ApplicationID 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"`
}

type HostModuleFind

type HostModuleFind struct {
	ModuleIDS []int64  `json:"bk_module_ids"`
	AppID     int64    `json:"bk_biz_id"`
	Fields    []string `json:"fields"`
	Page      BasePage `json:"page"`
}

type HostModuleRelationParameter

type HostModuleRelationParameter struct {
	AppID  int64   `json:"bk_biz_id"`
	HostID []int64 `json:"bk_host_id"`
}

HostModuleRelationParameter get host and module relation parameter

func (*HostModuleRelationParameter) Validate

func (h *HostModuleRelationParameter) Validate() (rawError errors.RawErrorInfo)

type HostModuleRelationRequest

type HostModuleRelationRequest struct {
	ApplicationID int64    `json:"bk_biz_id" bson:"bk_biz_id" field:"bk_biz_id" mapstructure:"bk_biz_id"`
	SetIDArr      []int64  `json:"bk_set_ids" bson:"bk_set_ids" field:"bk_set_ids" mapstructure:"bk_set_ids"`
	HostIDArr     []int64  `json:"bk_host_ids" bson:"bk_host_ids" field:"bk_host_ids" mapstructure:"bk_host_ids"`
	ModuleIDArr   []int64  `json:"bk_module_ids" bson:"bk_module_ids" field:"bk_module_ids" mapstructure:"bk_module_ids"`
	Page          BasePage `json:"page" bson:"page" field:"page" mapstructure:"page"`
	Fields        []string `json:"field" bson:"field"  field:"field" mapstructure:"field"`
}

HostModuleRelationRequest gethost module relation request parameter

func (*HostModuleRelationRequest) Empty

func (h *HostModuleRelationRequest) Empty() bool

Empty empty struct

type HostObjAttDes

type HostObjAttDes struct {
	ObjAttDes        `json:",inline" bson:",inline"`
	HostApplyEnabled bool `json:"host_apply_enabled"`
}

type HostProcessInstance

type HostProcessInstance struct {
	HostID    int64        `json:"bk_host_id"`
	ProcessID int64        `json:"bk_process_id"`
	BindIP    string       `json:"bind_ip"`
	Port      string       `json:"port"`
	Protocol  ProtocolType `json:"protocol"`
}

type HostProcessRelation

type HostProcessRelation struct {
	HostID    int64 `json:"bk_host_id" bson:"bk_host_id"`
	ProcessID int64 `json:"bk_process_id" bson:"bk_process_id"`
}

type HostSnap

type HostSnap struct {
	Data string `json:"data"`
}

type HostSnapBatchInput

type HostSnapBatchInput struct {
	HostIDs []int64 `json:"host_ids"`
}

type HostSnapBatchOption

type HostSnapBatchOption struct {
	IDs    []int64  `json:"bk_ids"`
	Fields []string `json:"fields"`
}

func (*HostSnapBatchOption) Validate

func (h *HostSnapBatchOption) Validate() (rawError errors.RawErrorInfo)

type HostSnapBatchResult

type HostSnapBatchResult struct {
	BaseResp `json:",inline"`
	Data     []map[string]interface{} `json:"data"`
}

type HostSnapResult

type HostSnapResult struct {
	BaseResp `json:",inline"`
	Data     map[string]interface{} `json:"data"`
}

type HostSyncInfo

type HostSyncInfo struct {
	HostID        int64     `json:"bk_host_id" bson:"bk_host_id"`
	CloudID       int64     `json:"bk_cloud_id" bson:"bk_cloud_id"`
	InstanceId    string    `json:"bk_cloud_inst_id" bson:"bk_cloud_inst_id"`
	PrivateIp     string    `json:"bk_host_innerip" bson:"bk_host_innerip"`
	PublicIp      string    `json:"bk_host_outerip" bson:"bk_host_outerip"`
	InstanceState string    `json:"bk_cloud_host_status" bson:"bk_cloud_host_status"`
	OwnerID       string    `json:"bk_supplier_account" bson:"bk_supplier_account"`
	CreateTime    time.Time `json:"create_time" bson:"create_time"`
	LastTime      time.Time `json:"last_time" bson:"last_time"`
}

type HostSyncList

type HostSyncList struct {
	ApplicationID int64                            `json:"bk_biz_id"`
	HostInfo      map[int64]map[string]interface{} `json:"host_info"`
	ModuleID      []int64                          `json:"bk_module_id"`
	InputType     HostInputType                    `json:"input_type"`
}

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 HostTopo

type HostTopo struct {
	Host map[string]interface{} `json:"host"`
	Topo []Topo                 `json:"topo"`
}

type HostTopoResult

type HostTopoResult struct {
	Count int        `json:"count"`
	Info  []HostTopo `json:"info"`
}

type HostTransferOpDetail

type HostTransferOpDetail struct {
	// PreData the previous biz topology of the host before transfer
	PreData HostBizTopo `json:"pre_data" bson:"pre_data"`
	// CurData the current biz topology of the host before transfer
	CurData HostBizTopo `json:"cur_data" bson:"cur_data"`
}

func (*HostTransferOpDetail) WithName

func (op *HostTransferOpDetail) WithName() string

type HostTransferPlan

type HostTransferPlan struct {
	HostID                  int64            `field:"bk_host_id" json:"bk_host_id"`
	FinalModules            []int64          `field:"final_modules" json:"final_modules"`
	ToRemoveFromModules     []int64          `field:"to_remove_from_modules" json:"to_remove_from_modules"`
	ToAddToModules          []int64          `field:"to_add_to_modules" json:"to_add_to_modules"`
	IsTransferToInnerModule bool             `field:"is_transfer_to_inner_module" json:"is_transfer_to_inner_module"`
	HostApplyPlan           OneHostApplyPlan `field:"host_apply_plan" json:"host_apply_plan" mapstructure:"host_apply_plan"`
}

type HostTransferPreview

type HostTransferPreview struct {
	HostID              int64                  `field:"bk_host_id" json:"bk_host_id"`
	FinalModules        []int64                `field:"final_modules" json:"final_modules"`
	ToRemoveFromModules []RemoveFromModuleInfo `field:"to_remove_from_modules" json:"to_remove_from_modules"`
	ToAddToModules      []AddToModuleInfo      `field:"to_add_to_modules" json:"to_add_to_modules"`
	HostApplyPlan       OneHostApplyPlan       `field:"host_apply_plan" json:"host_apply_plan"`
}

type HostsModuleRelation

type HostsModuleRelation struct {
	ApplicationID int64   `json:"bk_biz_id"`
	HostID        []int64 `json:"bk_host_id"`
	ModuleID      []int64 `json:"bk_module_id"`
	IsIncrement   bool    `json:"is_increment"`
}

type I18N

type I18N struct {
	CN string `json:"cn"`
	EN string `json:"en"`
}

type ID

type ID struct {
	ID string `json:"id"`
}

type IDResult

type IDResult struct {
	BaseResp `json:",inline"`
	Data     ID `json:"data"`
}

type IPInfo

type IPInfo struct {
	Data  []string `json:"data"`
	Exact int64    `json:"exact"`
	Flag  string   `json:"flag"`
}

ip search info

type IPParam

type IPParam struct {
	Data    []string `json:"data"`
	CloudID *int64   `json:"bk_cloud_id"`
}

type IamAction

type IamAction struct {
	ID                   string            `json:"id"`
	RelatedResourceTypes []IamResourceType `json:"related_resource_types"`
}

type IamCreatorActionPolicy

type IamCreatorActionPolicy struct {
	Action struct {
		ID string `json:"id"`
	} `json:"action"`
	PolicyID int64 `json:"policy_id"`
}

type IamInstance

type IamInstance struct {
	ID        string                `json:"id"`
	Name      string                `json:"name"`
	Ancestors []IamInstanceAncestor `json:"ancestors,omitempty"`
}

type IamInstanceAncestor

type IamInstanceAncestor struct {
	System string `json:"system"`
	Type   string `json:"type"`
	ID     string `json:"id"`
}

type IamInstanceWithCreator

type IamInstanceWithCreator struct {
	System    string                `json:"system"`
	Type      string                `json:"type"`
	ID        string                `json:"id"`
	Name      string                `json:"name"`
	Creator   string                `json:"creator"`
	Ancestors []IamInstanceAncestor `json:"ancestors,omitempty"`
}

type IamInstancesWithCreator

type IamInstancesWithCreator struct {
	System    string        `json:"system"`
	Type      string        `json:"type"`
	Creator   string        `json:"creator"`
	Instances []IamInstance `json:"instances"`
}

type IamPermission

type IamPermission struct {
	SystemID string      `json:"system_id"`
	Actions  []IamAction `json:"actions"`
}

type IamResourceAttribute

type IamResourceAttribute struct {
	ID     string                      `json:"id"`
	Values []IamResourceAttributeValue `json:"values"`
}

type IamResourceAttributeValue

type IamResourceAttributeValue struct {
	ID string `json:"id"`
}

type IamResourceInstance

type IamResourceInstance struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type IamResourceType

type IamResourceType struct {
	SystemID   string                  `json:"system_id"`
	Type       string                  `json:"type"`
	Instances  [][]IamResourceInstance `json:"instances,omitempty"`
	Attributes []IamResourceAttribute  `json:"attributes,omitempty"`
}

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 InnerModule struct {
	ModuleID         int64  `field:"bk_module_id" json:"bk_module_id" bson:"bk_module_id" mapstructure:"bk_module_id"`
	ModuleName       string `field:"bk_module_name" bson:"bk_module_name" json:"bk_module_name" mapstructure:"bk_module_name"`
	Default          int64  `field:"default" bson:"default" json:"default" mapstructure:"default"`
	HostApplyEnabled bool   `field:"host_apply_enabled" bson:"host_apply_enabled" json:"host_apply_enabled" mapstructure:"host_apply_enabled"`
}

type InnterAppTopo

type InnterAppTopo struct {
	SetID   int64         `json:"bk_set_id" field:"bk_set_id"`
	SetName string        `json:"bk_set_name" field:"bk_set_name"`
	Module  []InnerModule `json:"module" field:"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"`

	// BizID the business ID
	BizID int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
}

InstAsst an association definition between instances.

func (InstAsst) GetInstID

func (asst InstAsst) GetInstID(objID string) (instID int64, ok bool)

func (*InstAsst) Parse

func (cli *InstAsst) Parse(data mapstr.MapStr) (*InstAsst, error)

Parse load the data from mapstr attribute into attribute instance

func (*InstAsst) ToMapStr

func (cli *InstAsst) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

type InstBaseInfo

type InstBaseInfo struct {
	ID   int64  `json:"bk_inst_id"`
	Name string `json:"bk_inst_name"`
}

InstBaseInfo instance base info

type InstChangeCount

type InstChangeCount struct {
	Create int64 `json:"create" bson:"create"`
	Update int64 `json:"update" bson:"update"`
	Delete int64 `json:"delete" bson:"delete"`
}

type InstDataInfo

type InstDataInfo struct {
	Count int             `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

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

type InstResult struct {
	Count int             `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

InstResult inst item result

type Instance

type Instance struct {
	InstanceId    string `json:"bk_cloud_inst_id" bson:"bk_cloud_inst_id"`
	PrivateIp     string `json:"bk_host_innerip" bson:"bk_host_innerip"`
	PublicIp      string `json:"bk_host_outerip" bson:"bk_host_outerip"`
	InstanceState string `json:"bk_cloud_host_status" bson:"bk_cloud_host_status"`
	VpcId         string `json:"bk_vpc_id" bson:"bk_vpc_id"`
}

type InstanceAssociationOpDetail

type InstanceAssociationOpDetail struct {
	AssociationOpDetail `bson:",inline"`
	// SourceModelID the source instance's object ID
	SourceModelID string `json:"src_obj_id" bson:"src_obj_id"`
	// TargetModelID the target instance's object ID
	TargetModelID string `json:"dest_obj_id" bson:"dest_obj_id"`
	// TargetInstanceID the target instance ID
	TargetInstanceID int64 `json:"dest_inst_id" bson:"dest_inst_id"`
	// TargetInstanceID the target instance name
	TargetInstanceName string `json:"dest_inst_name" bson:"dest_inst_name"`
}

func (*InstanceAssociationOpDetail) WithName

func (ao *InstanceAssociationOpDetail) WithName() string

type InstanceOpDetail

type InstanceOpDetail struct {
	BasicOpDetail `bson:",inline"`
	// BkObjID the object ID of the instance's model
	ModelID string `json:"bk_obj_id" bson:"bk_obj_id"`
}

func (*InstanceOpDetail) WithName

func (op *InstanceOpDetail) WithName() string

type InstanceTagKeyItem

type InstanceTagKeyItem struct {
	BaseCfgItem `json:",inline"`
}

type InstanceTagValueItem

type InstanceTagValueItem struct {
	BaseCfgItem `json:",inline"`
}

type InstancesInfo

type InstancesInfo struct {
	Count       int64       `json:"count" bson:"count"`
	InstanceSet []*Instance `json:"instance_set" bson:"instance_set"`
}

type IntIDArrayCount

type IntIDArrayCount struct {
	ID    int64   `json:"id" bson:"_id"`
	Count []int64 `json:"count" bson:"count"`
}

IntIDArrayCount int类型字段做mongoDB聚合,且结果为数组时使用

type IntIDCount

type IntIDCount struct {
	ID    int64 `json:"id" bson:"_id"`
	Count int64 `json:"count" bson:"count"`
}

IntIDCount int类型字段做mongoDB聚合时使用

type IntOption

type IntOption struct {
	Min string `bson:"min" json:"min"`
	Max string `bson:"max" json:"max"`
}

IntOption integer option

func ParseIntOption

func ParseIntOption(ctx context.Context, val interface{}) IntOption

parseIntOption parse int data in option

type JsonCntInfoResp

type JsonCntInfoResp struct {
	BaseResp
	Data CntInfoString `json:"data"`
}

JsonCntInfoResp defines a response that do not parse the data's count and info fields to a struct but decode it to a json string if possible

type JsonStringResp

type JsonStringResp struct {
	BaseResp
	Data string
}

JsonStringResp defines a response that do not parse the data field to a struct but decode it to a json string if possible

type Label

type Label map[string]string

Label define the Label type used to limit the scope of application of resources

func (Label) Get

func (label Label) Get(key string) (exist bool, value string)

func (Label) GetBusinessID

func (label Label) GetBusinessID() (int64, error)

func (Label) GetModelKind

func (label Label) GetModelKind() (ModelKind, error)

func (Label) Int64

func (label Label) Int64(key string) (int64, error)

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

func (label Label) IsTrue(key string) (bool, error)

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) Set

func (label Label) Set(key, value string)

func (Label) SetBusinessID

func (label Label) SetBusinessID(id int64)

func (Label) SetModelKind

func (label Label) SetModelKind(kind ModelKind)

func (Label) ToMapStr

func (label Label) ToMapStr() mapstr.MapStr

type LabelAggregationOption

type LabelAggregationOption struct {
	BizID    int64  `json:"bk_biz_id"`
	ModuleID *int64 `json:"bk_module_id" bson:"bk_module_id" field:"bk_module_id"`
}

type Layer

type Layer struct {
	InstID   int64  `json:"bk_inst_id"`
	InstName string `json:"bk_inst_name"`
	ObjID    string `json:"bk_obj_id"`
	Child    *Layer `json:"child"`
}

type LimiterRule

type LimiterRule struct {
	RuleName string `json:"rulename"`
	AppCode  string `json:"appcode"`
	User     string `json:"user"`
	IP       string `json:"ip"`
	Method   string `json:"method"`
	Url      string `json:"url"`
	Limit    int64  `json:"limit"`
	TTL      int64  `json:"ttl"`
	DenyAll  bool   `json:"denyall"`
}

LimiterRule is a rule for api limiter

func (LimiterRule) Verify

func (r LimiterRule) Verify() error

Verify to check the fields of LimiterRule

type LinksItem

type LinksItem struct {
	BaseCfgItem `json:",inline"`
	Enabled     bool `json:"enabled"`
}

type ListAPITaskData

type ListAPITaskData struct {
	Info  []APITaskDetail `json:"info"`
	Count int64           `json:"count"`
	Page  BasePage        `json:"page"`
}

type ListAPITaskRequest

type ListAPITaskRequest struct {
	Condition mapstr.MapStr `json:"condition"`
	Page      BasePage      `json:"page"`
}

type ListAPITaskResponse

type ListAPITaskResponse struct {
	BaseResp
	Data ListAPITaskData `json:"data"`
}

type ListAssociationsWithAssociationKindResult

type ListAssociationsWithAssociationKindResult struct {
	BaseResp `json:",inline"`
	Data     AssociationList `json:"data"`
}

type ListHostApplyRuleOption

type ListHostApplyRuleOption struct {
	ModuleIDs    []int64  `field:"bk_module_ids" json:"bk_module_ids" bson:"bk_module_ids" mapstructure:"bk_module_ids"`
	AttributeIDs []int64  `field:"bk_attribute_ids" json:"bk_attribute_ids" bson:"bk_attribute_ids" mapstructure:"bk_attribute_ids"`
	Page         BasePage `field:"page" json:"page" bson:"page" mapstructure:"page"`
}

type ListHostRelatedApplyRuleOption

type ListHostRelatedApplyRuleOption struct {
	HostIDs []int64  `field:"bk_host_ids" json:"bk_host_ids" bson:"bk_host_ids" mapstructure:"bk_host_ids"`
	Page    BasePage `json:"page" mapstructure:"page"`
}

type ListHostResult

type ListHostResult struct {
	Count int                      `json:"count"`
	Info  []map[string]interface{} `json:"info"`
}

type ListHostWithPage

type ListHostWithPage struct {
	// length range is [1,1000]
	HostIDs []int64 `json:"bk_host_ids"`
	// only return these fields in hosts.
	Fields []string `json:"fields"`
	// sort field is not used.
	// max page limit is 1000
	Page BasePage `json:"page"`
}

list hosts with page in cache, which page info is in redis cache. store in a zset.

type ListHostWithoutAppResponse

type ListHostWithoutAppResponse struct {
	BaseResp `json:",inline"`
	Data     ListHostResult `json:"data"`
}

type ListHosts

type ListHosts struct {
	BizID              int64                     `json:"bk_biz_id,omitempty"`
	SetIDs             []int64                   `json:"bk_set_ids"`
	ModuleIDs          []int64                   `json:"bk_module_ids"`
	HostPropertyFilter *querybuilder.QueryFilter `json:"host_property_filter"`
	Fields             []string                  `json:"fields"`
	Page               BasePage                  `json:"page"`
}

func (ListHosts) GetHostPropertyFilter

func (option ListHosts) GetHostPropertyFilter(ctx context.Context) (map[string]interface{}, error)

func (ListHosts) Validate

func (option ListHosts) Validate() (errKey string, err error)

Validate whether ListHosts is valid errKey: invalid key er: detail reason why errKey in invalid

type ListHostsParameter

type ListHostsParameter struct {
	SetIDs             []int64                   `json:"bk_set_ids"`
	SetCond            []ConditionItem           `json:"set_cond"`
	ModuleIDs          []int64                   `json:"bk_module_ids"`
	HostPropertyFilter *querybuilder.QueryFilter `json:"host_property_filter"`
	Fields             []string                  `json:"fields"`
	Page               BasePage                  `json:"page"`
}

func (ListHostsParameter) Validate

func (option ListHostsParameter) Validate() (string, error)

type ListHostsWithNoBizParameter

type ListHostsWithNoBizParameter struct {
	HostPropertyFilter *querybuilder.QueryFilter `json:"host_property_filter"`
	Fields             []string                  `json:"fields"`
	Page               BasePage                  `json:"page"`
}

func (ListHostsWithNoBizParameter) Validate

func (option ListHostsWithNoBizParameter) Validate() (string, error)

type ListProcessInstanceRelationOption

type ListProcessInstanceRelationOption struct {
	BusinessID         int64    `json:"bk_biz_id"`
	ProcessIDs         []int64  `json:"process_ids,omitempty"`
	ServiceInstanceIDs []int64  `json:"service_instance_id,omitempty"`
	ProcessTemplateID  int64    `json:"process_template_id,omitempty"`
	HostID             int64    `json:"host_id,omitempty"`
	Page               BasePage `json:"page" field:"page"`
}

type ListProcessInstancesDetailsByIDsOption

type ListProcessInstancesDetailsByIDsOption struct {
	BizID      int64    `json:"bk_biz_id"`
	ProcessIDs []int64  `json:"process_ids"`
	Page       BasePage `json:"page"`
}

func (*ListProcessInstancesDetailsByIDsOption) Validate

func (o *ListProcessInstancesDetailsByIDsOption) Validate() (rawError cErr.RawErrorInfo)

Validate validates the input param

type ListProcessInstancesNameIDsOption

type ListProcessInstancesNameIDsOption struct {
	BizID       int64    `json:"bk_biz_id"`
	ModuleID    int64    `json:"bk_module_id"`
	ProcessName string   `json:"process_name"`
	Page        BasePage `json:"page"`
}

func (*ListProcessInstancesNameIDsOption) Validate

func (o *ListProcessInstancesNameIDsOption) Validate() (rawError cErr.RawErrorInfo)

Validate validates the input param

type ListProcessInstancesOption

type ListProcessInstancesOption struct {
	BizID             int64 `json:"bk_biz_id"`
	ServiceInstanceID int64 `json:"service_instance_id"`
}

type ListProcessInstancesWithHostOption

type ListProcessInstancesWithHostOption struct {
	BizID   int64    `json:"bk_biz_id"`
	HostIDs []int64  `json:"bk_host_ids"`
	Page    BasePage `json:"page"`
}

type ListProcessTemplateWithServiceTemplateInput

type ListProcessTemplateWithServiceTemplateInput struct {
	BizID               int64    `json:"bk_biz_id"`
	ProcessTemplatesIDs []int64  `json:"process_template_ids"`
	ServiceTemplateID   int64    `json:"service_template_id"`
	Page                BasePage `json:"page" field:"page" bson:"page"`
}

type ListProcessTemplatesOption

type ListProcessTemplatesOption struct {
	BusinessID         int64    `json:"bk_biz_id" bson:"bk_biz_id"`
	ProcessTemplateIDs []int64  `json:"process_template_ids,omitempty" bson:"process_template_ids"`
	ServiceTemplateIDs []int64  `json:"service_template_ids,omitempty" bson:"service_template_ids"`
	Page               BasePage `json:"page" field:"page" bson:"page"`
}

type ListServiceCategoriesOption

type ListServiceCategoriesOption struct {
	BusinessID         int64   `json:"bk_biz_id" bson:"bk_biz_id"`
	ServiceCategoryIDs []int64 `json:"service_category_ids,omitempty" bson:"service_category_ids"`
	WithStatistics     bool    `json:"with_statistics" bson:"with_statistics"`
}

type ListServiceInstanceDetailOption

type ListServiceInstanceDetailOption struct {
	BusinessID         int64              `json:"bk_biz_id"`
	SetID              int64              `json:"bk_set_id"`
	ModuleID           int64              `json:"bk_module_id"`
	HostID             int64              `json:"bk_host_id"`
	ServiceInstanceIDs []int64            `json:"service_instance_ids"`
	Selectors          selector.Selectors `json:"selectors,omitempty"`
	Page               BasePage           `json:"page,omitempty"`
}

type ListServiceInstanceDetailRequest

type ListServiceInstanceDetailRequest struct {
	BizID              int64              `json:"bk_biz_id"`
	SetID              int64              `json:"bk_set_id"`
	ModuleID           int64              `json:"bk_module_id"`
	HostID             int64              `json:"bk_host_id"`
	ServiceInstanceIDs []int64            `json:"service_instance_ids"`
	Page               BasePage           `json:"page"`
	Selectors          selector.Selectors `json:"selectors"`
}

type ListServiceInstanceOption

type ListServiceInstanceOption struct {
	BusinessID         int64              `json:"bk_biz_id"`
	ServiceTemplateID  int64              `json:"service_template_id"`
	HostIDs            []int64            `json:"bk_host_ids"`
	ModuleIDs          []int64            `json:"bk_module_ids"`
	SearchKey          *string            `json:"search_key"`
	ServiceInstanceIDs []int64            `json:"service_instance_ids"`
	Selectors          selector.Selectors `json:"selectors"`
	Page               BasePage           `json:"page"`
}

type ListServiceInstancesWithHostInput

type ListServiceInstancesWithHostInput struct {
	BizID     int64              `json:"bk_biz_id"`
	HostID    int64              `json:"bk_host_id"`
	SearchKey *string            `json:"search_key"`
	Selectors selector.Selectors `json:"selectors"`
	Page      BasePage           `json:"page"`
}

type ListServiceTemplateInput

type ListServiceTemplateInput struct {
	BizID int64 `json:"bk_biz_id"`
	// this field can be empty, it a optional condition.
	ServiceCategoryID int64    `json:"service_category_id"`
	Page              BasePage `json:"page"`
	Search            string   `json:"search"`
}

type ListServiceTemplateOption

type ListServiceTemplateOption struct {
	BusinessID         int64    `json:"bk_biz_id"`
	ServiceCategoryID  *int64   `json:"service_category_id"`
	ServiceTemplateIDs []int64  `json:"service_template_ids"`
	Page               BasePage `json:"page,omitempty"`
	Search             string   `json:"search"`
}

type ListServiceTemplateWithDetailResult

type ListServiceTemplateWithDetailResult struct {
	ServiceTemplate      ServiceTemplate `json:"service_template"`
	ProcessTemplateCount int64           `json:"process_template_count"`
	ServiceInstanceCount int64           `json:"service_instance_count"`
	ModuleCount          int64           `json:"module_count"`
}

type ListSetByTemplateOption

type ListSetByTemplateOption struct {
	Page   BasePage `json:"page"`
	SetIDs []int64  `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
}

type ListSetTemplateOption

type ListSetTemplateOption struct {
	SetTemplateIDs []int64  `field:"set_template_ids" json:"set_template_ids" bson:"set_template_ids"`
	Page           BasePage `json:"page"`
}

type ListSetTemplateResult

type ListSetTemplateResult struct {
	BaseResp
	Data MultipleSetTemplateResult `json:"data"`
}

type ListSetTemplateSyncStatusOption

type ListSetTemplateSyncStatusOption struct {
	BizID         int64      `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id" mapstructure:"bk_biz_id"`
	SetIDs        []int64    `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
	TaskIDs       []string   `field:"task_ids" json:"task_ids" bson:"task_ids" mapstructure:"task_ids"`
	SearchKey     string     `field:"search" json:"search" bson:"search" mapstructure:"search"`
	SetTemplateID int64      `field:"set_template_id" json:"set_template_id" bson:"set_template_id" mapstructure:"set_template_id"`
	Creator       string     `field:"creator" json:"creator,omitempty" bson:"creator" mapstructure:"creator"`
	StartTime     *Time      `field:"start_time" json:"start_time,omitempty" bson:"create_time" mapstructure:"start_time"`
	EndTime       *Time      `field:"end_time" json:"end_time,omitempty" bson:"end_time" mapstructure:"end_time"`
	Status        SyncStatus `field:"status" json:"status" bson:"status" mapstructure:"status"`
	Page          BasePage   `field:"page" json:"page" bson:"page" mapstructure:"page"`
}

func (ListSetTemplateSyncStatusOption) ToFilter

func (option ListSetTemplateSyncStatusOption) ToFilter() map[string]interface{}

type ListUserItem

type ListUserItem struct {
	ID          int64  `json:"id"`
	Username    string `json:"username"`
	DisplayName string `json:"display_name"`
}

type ListWithIDOption

type ListWithIDOption struct {
	// length range is [1,500]
	IDs []int64 `json:"ids"`
	// only return these fields in hosts.
	Fields []string `json:"fields"`
}

type LoginChangeSupplierResult

type LoginChangeSupplierResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		ID string `json:"bk_supplier_account"`
	} `json:"data"`
}

type LoginPluginInfo

type LoginPluginInfo struct {
	Name       string // plugin info
	Version    string // In what version is used
	HandleFunc LoginUserPluginInerface
}

type LoginSystemUserInfo

type LoginSystemUserInfo struct {
	CnName string `json:"chinese_name"`
	EnName string `json:"english_name"`
}

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"`
	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 LoginUserInfoOwnerUinList

type LoginUserInfoOwnerUinList struct {
	OwnerID   string `json:"id"`
	OwnerName string `json:"name"`
	Role      int64  `json:"role"`
}

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)
	GetLoginUrl(c *gin.Context, config map[string]string, input *LogoutRequestParams) string
	GetUserList(c *gin.Context, config map[string]string) ([]*LoginSystemUserInfo, *errors.RawErrorInfo)
}

type LoginUserPluginParams

type LoginUserPluginParams struct {
	Url          string
	IsMultiOwner bool
	Cookie       []*http.Cookie // Reserved word, not used now
	Header       http.Header    // Reserved word, not used now
}

type LogoutRequestParams

type LogoutRequestParams struct {
	HTTPScheme string `json:"http_scheme"`
}

type LogoutResult

type LogoutResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		LogoutURL string `json:"url"`
	} `json:"data"`
}

type LongcharItem

type LongcharItem struct {
	BaseCfgItem `json:",inline"`
}

type LonginSystemUserListResult

type LonginSystemUserListResult struct {
	BaseResp `json:",inline"`
	Data     []*LoginSystemUserInfo `json:"data"`
}

type MainLineObject

type MainLineObject struct {
	Object        `json:",inline"`
	AssociationID string `json:"bk_asst_obj_id"`
}

MainLineObject main line object definition

type MainLineResult

type MainLineResult struct {
	BaseResp `json:",inline"`
	Data     []map[string]interface{} `json:"data"`
}

type MainlineInstInfo

type MainlineInstInfo struct {
	InstID   int64  `json:"bk_inst_id" bson:"bk_inst_id"`
	InstName string `json:"bk_inst_name" bson:"bk_inst_name"`
	ObjID    string `json:"bk_obj_id" bson:"bk_obj_id"`
	ParentID int64  `json:"bk_parent_id" bson:"bk_parent_id"`
}

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

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 MapArrayResponse struct {
	BaseResp `json:",inline"`
	Data     []mapstr.MapStr `json:"data"`
}

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

func NewMetaDataFromBusinessID

func NewMetaDataFromBusinessID(value string) Metadata

func NewMetadata

func NewMetadata(bizID int64) Metadata

func (*Metadata) ParseBizID

func (md *Metadata) ParseBizID() (int64, error)

func (*Metadata) ToMapStr

func (md *Metadata) ToMapStr() mapstr.MapStr

type MetadataWrapper

type MetadataWrapper struct {
	Metadata Metadata `json:"metadata"`
}

type ModelAssociationOpDetail

type ModelAssociationOpDetail struct {
	AssociationOpDetail `bson:",inline"`
	// AssociationName the alias name of the association
	AssociationName string `json:"asst_name" bson:"asst_name"`
	// Mapping the association mapping, defines which kind of association can be used
	Mapping AssociationMapping `json:"mapping" bson:"mapping"`
	// OnDelete the association on delete action
	OnDelete AssociationOnDeleteAction `json:"on_delete" bson:"on_delete"`
	// IsPre describe whether this association is a pre-defined association or not
	IsPre *bool `json:"is_pre" bson:"is_pre"`
	// TargetModelID the target object ID
	TargetModelID string `json:"dest_obj_id" bson:"dest_obj_id"`
	// TargetModelID the target object name
	TargetModelName int64 `json:"dest_obj_name" bson:"dest_obj_name"`
}

func (*ModelAssociationOpDetail) WithName

func (ao *ModelAssociationOpDetail) WithName() string

type ModelAttrOpDetail

type ModelAttrOpDetail struct {
	BasicOpDetail `bson:",inline"`
	// BkObjID the attribute object ID
	BkObjID string `json:"bk_obj_id" bson:"bk_obj_id"`
	// BkObjName the attribute object name
	BkObjName string `json:"bk_obj_name" bson:"bk_obj_name"`
}

func (*ModelAttrOpDetail) WithName

func (op *ModelAttrOpDetail) WithName() string

type ModelIdItem

type ModelIdItem struct {
	BaseCfgItem `json:",inline"`
}

type ModelInstChange

type ModelInstChange map[string]*InstChangeCount

type ModelInstChartData

type ModelInstChartData struct {
	ReportType string          `json:"report_type" bson:"report_type"`
	Data       []StringIDCount `json:"data" data:"data"`
	OwnerID    string          `json:"bk_supplier_account" bson:"bk_supplier_account"`
	LastTime   time.Time       `json:"last_time" bson:"last_time"`
}

type ModelKind

type ModelKind string

type ModifyProcInstanceDetail

type ModifyProcInstanceDetail struct {
	Conds map[string]interface{} `json:"condition"`
	Data  map[string]interface{} `json:"data"`
}

type Module

type Module struct {
	ModuleID   int64  `json:"bk_module_id" bson:"bk_module_id" mapstructure:"bk_module_id"`
	ModuleName string `json:"bk_module_name" bson:"bk_module_name" mapstructure:"bk_module_name"`
}

type ModuleChangedAttribute

type ModuleChangedAttribute struct {
	ID                    int64       `json:"id"`
	PropertyID            string      `json:"property_id"`
	PropertyName          string      `json:"property_name"`
	PropertyValue         interface{} `json:"property_value"`
	TemplatePropertyValue interface{} `json:"template_property_value"`
}

type ModuleDiffWithTemplateDetail

type ModuleDiffWithTemplateDetail struct {
	ModuleID          int64                       `json:"bk_module_id"`
	Unchanged         []ServiceInstanceDifference `json:"unchanged"`
	Changed           []ServiceInstanceDifference `json:"changed"`
	Added             []ServiceInstanceDifference `json:"added"`
	Removed           []ServiceInstanceDifference `json:"removed"`
	ChangedAttributes []ModuleChangedAttribute    `json:"changed_attributes"`
	HasDifference     bool                        `json:"has_difference"`
}

ModuleDiffWithTemplateDetail 模块与服务模板间的差异

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 ModuleHostConfigParams struct {
	ApplicationID int64   `json:"bk_biz_id"`
	HostID        int64   `json:"bk_host_id"`
	ModuleID      []int64 `json:"bk_module_id"`
	OwnerID       string  `json:"bk_supplier_account" bson:"bk_supplier_account"`
}

type ModuleHostRelation

type ModuleHostRelation struct {
	Host    map[string]interface{}   `json:"host"`
	Modules []map[string]interface{} `json:"modules"`
}

type ModuleInst

type ModuleInst struct {
	BizID             int64  `bson:"bk_biz_id" json:"bk_biz_id" field:"bk_biz_id" mapstructure:"bk_biz_id"`
	ModuleID          int64  `bson:"bk_module_id" json:"bk_module_id" field:"bk_module_id" mapstructure:"bk_module_id"`
	ModuleName        string `bson:"bk_module_name" json:"bk_module_name" field:"bk_module_name" mapstructure:"bk_module_name"`
	SupplierAccount   string `bson:"bk_supplier_account" json:"bk_supplier_account" field:"bk_supplier_account" mapstructure:"bk_supplier_account"`
	ServiceCategoryID int64  `bson:"service_category_id" json:"service_category_id" field:"service_category_id" mapstructure:"service_category_id"`
	ServiceTemplateID int64  `bson:"service_template_id" json:"service_template_id" field:"service_template_id" mapstructure:"service_template_id"`
	ParentID          int64  `bson:"bk_parent_id" json:"bk_parent_id" field:"bk_parent_id" mapstructure:"bk_parent_id"`
	SetTemplateID     int64  `bson:"set_template_id" json:"set_template_id" field:"set_template_id" mapstructure:"set_template_id"`
	Default           int64  `bson:"default" json:"default" field:"default" mapstructure:"default"`
	HostApplyEnabled  bool   `bson:"host_apply_enabled" json:"host_apply_enabled" field:"host_apply_enabled" mapstructure:"host_apply_enabled"`
}

ModuleInst contains partial fields of a real module

type MultipleCloudAccount

type MultipleCloudAccount struct {
	Count int64                       `json:"count"`
	Info  []CloudAccountWithExtraInfo `json:"info"`
}

type MultipleCloudAccountConf

type MultipleCloudAccountConf struct {
	Count int64              `json:"count"`
	Info  []CloudAccountConf `json:"info"`
}

type MultipleCloudAccountConfResult

type MultipleCloudAccountConfResult struct {
	BaseResp `json:",inline"`
	Data     MultipleCloudAccountConf `json:"data"`
}

type MultipleCloudAccountResult

type MultipleCloudAccountResult struct {
	BaseResp `json:",inline"`
	Data     MultipleCloudAccount `json:"data"`
}

type MultipleCloudSyncTask

type MultipleCloudSyncTask struct {
	Count int64           `json:"count"`
	Info  []CloudSyncTask `json:"info"`
}

type MultipleCloudSyncTaskResult

type MultipleCloudSyncTaskResult struct {
	BaseResp `json:",inline"`
	Data     MultipleCloudSyncTask `json:"data"`
}

type MultipleHostApplyResult

type MultipleHostApplyResult struct {
	ErrorContainer `json:",inline"`
	HostResults    []HostApplyResult `field:"host_results" json:"host_results" bson:"host_results" mapstructure:"host_results"`
}

type MultipleHostApplyRuleResult

type MultipleHostApplyRuleResult struct {
	Count int64           `json:"count" mapstructure:"count"`
	Info  []HostApplyRule `json:"info" mapstructure:"info"`
}

type MultipleHostProcessRelation

type MultipleHostProcessRelation struct {
	Count uint64                `json:"count"`
	Info  []HostProcessRelation `json:"info"`
}

type MultipleHostProcessRelationResult

type MultipleHostProcessRelationResult struct {
	BaseResp `json:",inline"`
	Data     MultipleHostProcessRelation `json:"data"`
}

type MultipleMap

type MultipleMap struct {
	Count uint64                   `json:"count"`
	Info  []map[string]interface{} `json:"info"`
}

type MultipleProcessInstanceRelation

type MultipleProcessInstanceRelation struct {
	Count uint64                    `json:"count"`
	Info  []ProcessInstanceRelation `json:"info"`
}

type MultipleProcessInstanceRelationResult

type MultipleProcessInstanceRelationResult struct {
	BaseResp `json:",inline"`
	Data     MultipleProcessInstanceRelation `json:"data"`
}

type MultipleProcessTemplate

type MultipleProcessTemplate struct {
	Count uint64            `json:"count"`
	Info  []ProcessTemplate `json:"info"`
}

type MultipleProcessTemplateResult

type MultipleProcessTemplateResult struct {
	BaseResp `json:",inline"`
	Data     MultipleProcessTemplate `json:"data"`
}

type MultipleServiceCategory

type MultipleServiceCategory struct {
	Count int64             `json:"count"`
	Info  []ServiceCategory `json:"info"`
}

type MultipleServiceCategoryResult

type MultipleServiceCategoryResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceCategory `json:"data"`
}

type MultipleServiceCategoryWithStatistics

type MultipleServiceCategoryWithStatistics struct {
	Count int64                           `json:"count"`
	Info  []ServiceCategoryWithStatistics `json:"info"`
}

type MultipleServiceCategoryWithStatisticsResult

type MultipleServiceCategoryWithStatisticsResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceCategoryWithStatistics `json:"data"`
}

type MultipleServiceInstance

type MultipleServiceInstance struct {
	Count uint64            `json:"count"`
	Info  []ServiceInstance `json:"info"`
}

type MultipleServiceInstanceDetail

type MultipleServiceInstanceDetail struct {
	Count uint64                  `json:"count"`
	Info  []ServiceInstanceDetail `json:"info"`
}

type MultipleServiceInstanceDetailResult

type MultipleServiceInstanceDetailResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceInstanceDetail `json:"data"`
}

type MultipleServiceInstanceResult

type MultipleServiceInstanceResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceInstance `json:"data"`
}

type MultipleServiceTemplate

type MultipleServiceTemplate struct {
	Count uint64            `json:"count"`
	Info  []ServiceTemplate `json:"info"`
}

type MultipleServiceTemplateDetail

type MultipleServiceTemplateDetail struct {
	Count uint64                  `json:"count"`
	Info  []ServiceTemplateDetail `json:"info"`
}

type MultipleServiceTemplateDetailResult

type MultipleServiceTemplateDetailResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceTemplateDetail `json:"data"`
}

type MultipleServiceTemplateResult

type MultipleServiceTemplateResult struct {
	BaseResp `json:",inline"`
	Data     MultipleServiceTemplate `json:"data"`
}

type MultipleSetTemplateResult

type MultipleSetTemplateResult struct {
	Count int64         `json:"count"`
	Info  []SetTemplate `json:"info"`
}

type MultipleSetTemplateSyncStatus

type MultipleSetTemplateSyncStatus struct {
	Count int64                   `json:"count"`
	Info  []SetTemplateSyncStatus `field:"info" json:"info" bson:"info" mapstructure:"info"`
}

type MultipleSetTemplateWithStatisticsResult

type MultipleSetTemplateWithStatisticsResult struct {
	Count int64                       `json:"count"`
	Info  []SetTemplateWithStatistics `json:"info"`
}

type MultipleSyncHistory

type MultipleSyncHistory struct {
	Count int64         `json:"count"`
	Info  []SyncHistory `json:"info"`
}

type MultipleSyncHistoryResult

type MultipleSyncHistoryResult struct {
	BaseResp `json:",inline"`
	Data     MultipleSyncHistory `json:"data"`
}

type MultipleSyncRegionResult

type MultipleSyncRegionResult struct {
	BaseResp `json:",inline"`
	Data     []*Region `json:"data"`
}

type NamedCharacterItem

type NamedCharacterItem struct {
	BaseCfgItem `json:",inline"`
}

type NetCollSearchParams

type NetCollSearchParams struct {
	Page      BasePage        `json:"page,omitempty"`
	Fields    []string        `json:"fields,omitempty"`
	Condition []ConditionItem `json:"condition,omitempty"`
}

type NetcollectConfig

type NetcollectConfig struct {
	ScanRange []string `json:"scan_range" bson:"scan_range"`
	Period    string   `json:"period" bson:"period"`
	Community string   `json:"community" bson:"community"`
}

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 NetcollectReportAsstCond

type NetcollectReportAsstCond struct {
	PropertyID   string      `json:"bk_property_id" bson:"bk_property_id"`
	PropertyName string      `json:"bk_property_name" bson:"bk_property_name"`
	Value        interface{} `json:"value" bson:"value"`
}

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 NetcollectReportSummary struct {
	CloudID    int64          `json:"bk_cloud_id"`
	CloudName  string         `json:"bk_cloud_name"`
	LastTime   Time           `json:"last_time"`
	Statistics map[string]int `json:"operation"`
}

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 NetcollectorStatus struct {
	CollectorStatus string `json:"collector_status" bson:"collector_status"`
	ConfigStatus    string `json:"config_status" bson:"config_status"`
	ReportStatus    string `json:"report_status" bson:"report_status"`
}

type NodeTopoPath

type NodeTopoPath struct {
	BizID int64                       `json:"bk_biz_id" mapstructure:"bk_biz_id"`
	Node  TopoNode                    `json:"topo_node" mapstructure:"topo_node"`
	Path  []*TopoInstanceNodeSimplify `json:"topo_path" mapstructure:"topo_path"`
}

type NumberItem

type NumberItem struct {
	BaseCfgItem `json:",inline"`
}

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 {
	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"`

	// IsHidden front-end don't display the object if IsHidden is true
	IsHidden bool `field:"bk_ishidden" json:"bk_ishidden" bson:"bk_ishidden"`

	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

func (o *Object) GetDefaultInstPropertyName() string

GetDefaultInstPropertyName get default inst

func (*Object) GetInstIDFieldName

func (o *Object) GetInstIDFieldName() string

GetInstIDFieldName get instid filed

func (*Object) GetInstNameFieldName

func (o *Object) GetInstNameFieldName() string

GetInstNameFieldName get the inst name

func (*Object) GetObjectID

func (o *Object) GetObjectID() string

GetObjectID get the object type

func (*Object) GetObjectType

func (o *Object) GetObjectType() string

GetObjectType get the object type

func (*Object) IsCommon

func (o *Object) IsCommon() bool

IsCommon is common object

func (*Object) Parse

func (o *Object) Parse(data mapstr.MapStr) (*Object, error)

Parse load the data from mapstr object into object instance

func (*Object) ToMapStr

func (o *Object) ToMapStr() mapstr.MapStr

ToMapStr to mapstr

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 ObjectAttrResult struct {
	BaseResp `json:",inline"`
	Data     []Attribute `json:"data"`
}

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 ObjectIDName

type ObjectIDName struct {
	ObjectID   string `json:"bk_object_id"`
	ObjectName string `json:"bk_object_name"`
}

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"`
	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 OneHostApplyPlan

type OneHostApplyPlan struct {
	ErrorContainer `json:",inline"`
	HostID         int64     `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id" mapstructure:"bk_host_id"`
	CloudInfo      CloudInst `field:"cloud_area" json:"cloud_area" bson:"cloud_area" mapstructure:"cloud_area"`
	ModuleIDs      []int64   `field:"bk_module_ids" json:"bk_module_ids" bson:"bk_module_ids" mapstructure:"bk_module_ids"`
	// 预计执行后端主机信息
	ExpectHost     map[string]interface{}   `field:"expect_host" json:"expect_host" bson:"expect_host" mapstructure:"expect_host"`
	UpdateFields   []HostApplyUpdateField   `field:"update_fields" json:"update_fields" bson:"update_fields" mapstructure:"update_fields"`
	ConflictFields []HostApplyConflictField `field:"conflicts" json:"conflicts" bson:"conflicts" mapstructure:"conflicts"`
	// 未解决的冲突字段数
	UnresolvedConflictCount int64 `field:"unresolved_conflict_count" json:"unresolved_conflict_count" mapstructure:"unresolved_conflict_count"`
}

func (OneHostApplyPlan) GetUpdateData

func (plan OneHostApplyPlan) GetUpdateData() map[string]interface{}

func (OneHostApplyPlan) GetUpdateDataStr

func (plan OneHostApplyPlan) GetUpdateDataStr() string

type OneProcessInstanceRelationResult

type OneProcessInstanceRelationResult struct {
	BaseResp `json:",inline"`
	Data     ProcessInstanceRelation `json:"data"`
}

type OneProcessTemplateResult

type OneProcessTemplateResult struct {
	BaseResp `json:",inline"`
	Data     ProcessTemplate `json:"data"`
}

type OneServiceCategoryResult

type OneServiceCategoryResult struct {
	BaseResp `json:",inline"`
	Data     ServiceCategory `json:"data"`
}

type OneServiceCategoryWithStatisticsResult

type OneServiceCategoryWithStatisticsResult struct {
	BaseResp `json:",inline"`
	Data     ServiceCategoryWithStatistics `json:"data"`
}

type OneServiceInstanceResult

type OneServiceInstanceResult struct {
	BaseResp `json:",inline"`
	Data     ServiceInstance `json:"data"`
}

type OneServiceTemplateResult

type OneServiceTemplateResult struct {
	BaseResp `json:",inline"`
	Data     ServiceTemplate `json:"data"`
}

type OneServiceTemplateWithStatisticsResult

type OneServiceTemplateWithStatisticsResult struct {
	BaseResp `json:",inline"`
	Data     ServiceTemplateWithStatistics `json:"data"`
}

type OperateFromType

type OperateFromType string
const (
	// FromCCSystem means this audit come from cc system operation, such as upgrader.
	FromCCSystem OperateFromType = "cc_system"
	// FromUser means this audit come from a user's operation, such as web.
	FromUser OperateFromType = "user"
	// FromDataCollection means this audit is created by data collection.
	FromDataCollection OperateFromType = "data_collection"
	// FromSynchronizer means this audit is created by the data synchronizer.
	FromSynchronizer OperateFromType = "synchronizer"
	// FromCloudSync means this audit is created by cloud sync.
	FromCloudSync OperateFromType = "cloud_sync"
)

type OperaterException

type OperaterException struct {
	BaseResp `json:",inline"`
	Data     []ExceptionResult `json:"data"`
}

OperaterException result

type OperationTimeCondition

type OperationTimeCondition struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type ParamData

type ParamData struct {
	ApplicationID       int64   `json:"bk_biz_id"`
	HostID              []int64 `json:"bk_host_id"`
	OwnerModuleID       int64   `json:"bk_owner_module_id"`
	OwnerAppplicationID int64   `json:"bk_owner_biz_id"`
}

type ParamNetcollectComfirm

type ParamNetcollectComfirm struct {
	Reports []NetcollectReport `json:"reports"`
}

type ParamNetcollectDiscover

type ParamNetcollectDiscover struct {
	Collectors []Netcollector `json:"collectors"`
}

type ParamNetcollectorSearch

type ParamNetcollectorSearch struct {
	Query string   `json:"query"`
	Page  BasePage `json:"page"`
}

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 ParamSubscriptionSearch struct {
	Fields    []string               `json:"fields"`
	Condition map[string]interface{} `json:"condition"`
	Page      BasePage               `json:"page"`
}

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"`
	// newly added two field.
	ResourceTypeName string `json:"resource_type_name"`
	ResourceType     string `json:"resource_type"`

	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 Position

type Position struct {
	X *int64 `json:"x" bson:"x"`
	Y *int64 `json:"y" bson:"y"`
}

Position the node position in graph

type PositionInfo

type PositionInfo struct {
	Host []uint64 `json:"host" bson:"host"`
	Inst []uint64 `json:"inst" bson:"inst"`
}

type Proc2Module

type Proc2Module struct {
	BizID           int64  `json:"bk_biz_id"`
	ModuleName      string `json:"bk_module_name"`
	ProcessID       int64  `json:"bk_process_id"`
	SupplierAccount string `json:"bk_supplier_account"`
}

type ProcBindInfo

type ProcBindInfo struct {
	// 标准属性
	Std *stdProcBindInfo
	// contains filtered or unexported fields
}

ProcBindInfo 给服务模板使用的,来存储,校验服务实例中进程绑定的信息

func (ProcBindInfo) MarshalBSON

func (pbi ProcBindInfo) MarshalBSON() ([]byte, error)

func (ProcBindInfo) MarshalJSON

func (pbi ProcBindInfo) MarshalJSON() ([]byte, error)

func (ProcBindInfo) SetExtraItem

func (pbi ProcBindInfo) SetExtraItem(key string, value interface{}) error

SetExtraItem 设置额外配置项,不可为标准属性赋值

func (*ProcBindInfo) UnmarshalBSON

func (pbi *ProcBindInfo) UnmarshalBSON(data []byte) error

func (*ProcBindInfo) UnmarshalJSON

func (pbi *ProcBindInfo) UnmarshalJSON(data []byte) error

func (ProcBindInfo) Value

func (pbi ProcBindInfo) Value() map[string]interface{}

type ProcExtraBindInfoInterface

type ProcExtraBindInfoInterface interface {
	UJSON(data []byte, bindInfo *ProcBindInfo) error
	UBSON(data []byte, bindInfo *ProcBindInfo) error
}

ProcExtraBindInfoInterface 用来处理进程中bind info 数据的序反序列化, 序列号使用默认的方法,目前只支持json, bson, 如果需要其他请新加

type ProcInfoArrResult

type ProcInfoArrResult struct {
	BaseResp `json:",inline"`
	Data     []mapstr.MapStr `json:"data"`
}

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 ProcModuleConfig struct {
	ApplicationID int64  `json:"bk_biz_id"`
	ModuleName    string `json:"bk_module_name"`
	ProcessID     int64  `json:"bk_process_id"`
}

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 ProcPropertyBindInfo

type ProcPropertyBindInfo struct {
	// 通过Unmarshal 方法实现不同的数据类型
	Value []ProcPropertyBindInfoValue `field:"value" json:"value" bson:"value"`
	// 给前端做兼容
	AsDefaultValue *bool `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

ProcPropertyBindInfo 给服务模板使用的,来存储,校验服务模板中进程绑定的信息

func (*ProcPropertyBindInfo) DiffWithProcessTemplate

func (pbi *ProcPropertyBindInfo) DiffWithProcessTemplate(procBindInfoArr []ProcBindInfo, host map[string]interface{}) (newBindInfoArr []ProcBindInfo, change bool)

Compare 对比模板和实例数据,发现数据是否变化

func (*ProcPropertyBindInfo) ExtractChangeInfoBindInfo

func (pbi *ProcPropertyBindInfo) ExtractChangeInfoBindInfo(i *Process, host map[string]interface{}) ([]ProcBindInfo, bool, bool)

func (*ProcPropertyBindInfo) ExtractInstanceUpdateData

func (pbi *ProcPropertyBindInfo) ExtractInstanceUpdateData(input *Process, host map[string]interface{}) []ProcBindInfo

func (ProcPropertyBindInfo) NewProcBindInfo

func (pbi ProcPropertyBindInfo) NewProcBindInfo(host map[string]interface{}) []ProcBindInfo

NewProcBindInfo 通过模板生成进程的时候使用

func (*ProcPropertyBindInfo) Update

func (pbi *ProcPropertyBindInfo) Update(input ProcessProperty, rawProperty map[string]interface{})

Update bind info 每次更新采用的是全量更新

func (*ProcPropertyBindInfo) Validate

func (pbi *ProcPropertyBindInfo) Validate() (string, error)

type ProcPropertyBindInfoValue

type ProcPropertyBindInfoValue struct {
	// 标准属性
	Std *stdProcPropertyBindInfoValue
	// contains filtered or unexported fields
}

ProcPropertyBindInfoValue 给服务模板使用的,来存储,校验服务模板中进程绑定的信息, 用来做管理的

func (ProcPropertyBindInfoValue) MarshalBSON

func (pbi ProcPropertyBindInfoValue) MarshalBSON() ([]byte, error)

func (ProcPropertyBindInfoValue) MarshalJSON

func (pbi ProcPropertyBindInfoValue) MarshalJSON() ([]byte, error)

func (ProcPropertyBindInfoValue) SetExtraItem

func (pbi ProcPropertyBindInfoValue) SetExtraItem(key string, value interface{}) error

SetExtraItem 新加一项数据

func (*ProcPropertyBindInfoValue) UnmarshalBSON

func (pbi *ProcPropertyBindInfoValue) UnmarshalBSON(data []byte) error

func (*ProcPropertyBindInfoValue) UnmarshalJSON

func (pbi *ProcPropertyBindInfoValue) UnmarshalJSON(data []byte) error

func (*ProcPropertyBindInfoValue) Validate

func (pbi *ProcPropertyBindInfoValue) Validate() (string, error)

type ProcPropertyExtraBindInfoInterface

type ProcPropertyExtraBindInfoInterface interface {
	UJSON(data []byte, bindInfo *ProcPropertyBindInfoValue) error
	UBSON(data []byte, bindInfo *ProcPropertyBindInfoValue) error
}

ProcPropertyExtraBindInfoInterface 用来处理进程模板中bind info 数据的反序列化, 序列号使用默认的方法,目前只支持json, bson, 如果需要其他请新加

type Process

type Process struct {
	ProcNum      *int64  `field:"proc_num" json:"proc_num" bson:"proc_num" structs:"proc_num" mapstructure:"proc_num"`
	StopCmd      *string `field:"stop_cmd" json:"stop_cmd" bson:"stop_cmd" structs:"stop_cmd" mapstructure:"stop_cmd"`
	RestartCmd   *string `field:"restart_cmd" json:"restart_cmd" bson:"restart_cmd" structs:"restart_cmd" mapstructure:"restart_cmd"`
	ForceStopCmd *string `field:"face_stop_cmd" json:"face_stop_cmd" bson:"face_stop_cmd" structs:"face_stop_cmd" mapstructure:"face_stop_cmd"`
	ProcessID    int64   `field:"bk_process_id" json:"bk_process_id" bson:"bk_process_id" structs:"bk_process_id" mapstructure:"bk_process_id"`
	FuncName     *string `field:"bk_func_name" json:"bk_func_name" bson:"bk_func_name" structs:"bk_func_name" mapstructure:"bk_func_name"`
	WorkPath     *string `field:"work_path" json:"work_path" bson:"work_path" structs:"work_path" mapstructure:"work_path"`
	//BindIP          *string       `field:"bind_ip" json:"bind_ip" bson:"bind_ip" structs:"bind_ip" mapstructure:"bind_ip"`
	Priority    *int64  `field:"priority" json:"priority" bson:"priority" structs:"priority" mapstructure:"priority"`
	ReloadCmd   *string `field:"reload_cmd" json:"reload_cmd" bson:"reload_cmd" structs:"reload_cmd" mapstructure:"reload_cmd"`
	ProcessName *string `` /* 126-byte string literal not displayed */
	//Port           *string   `field:"port" json:"port" bson:"port" structs:"port" mapstructure:"port"`
	PidFile        *string   `field:"pid_file" json:"pid_file" bson:"pid_file" structs:"pid_file" mapstructure:"pid_file"`
	AutoStart      *bool     `field:"auto_start" json:"auto_start" bson:"auto_start" structs:"auto_start" mapstructure:"auto_start"`
	AutoTimeGap    *int64    `field:"auto_time_gap" json:"auto_time_gap" bson:"auto_time_gap" structs:"auto_time_gap" mapstructure:"auto_time_gap"`
	LastTime       time.Time `field:"last_time" json:"last_time" bson:"last_time" structs:"last_time" mapstructure:"last_time"`
	CreateTime     time.Time `field:"create_time" json:"create_time" bson:"create_time" structs:"create_time" mapstructure:"create_time"`
	BusinessID     int64     `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id" structs:"bk_biz_id" mapstructure:"bk_biz_id"`
	StartCmd       *string   `field:"start_cmd" json:"start_cmd" bson:"start_cmd" structs:"start_cmd" mapstructure:"start_cmd"`
	FuncID         *string   `field:"bk_func_id" json:"bk_func_id" bson:"bk_func_id" structs:"bk_func_id" mapstructure:"bk_func_id"`
	User           *string   `field:"user" json:"user" bson:"user" structs:"user" mapstructure:"user"`
	TimeoutSeconds *int64    `field:"timeout" json:"timeout" bson:"timeout" structs:"timeout" mapstructure:"timeout"`
	//Protocol        *ProtocolType `field:"protocol" json:"protocol" bson:"protocol" structs:"protocol" mapstructure:"protocol"`
	Description     *string `field:"description" json:"description" bson:"description" structs:"description" mapstructure:"description"`
	SupplierAccount string  `` /* 146-byte string literal not displayed */
	StartParamRegex *string `` /* 151-byte string literal not displayed */

	BindInfo []ProcBindInfo `field:"bind_info" json:"bind_info" bson:"bind_info" structs:"bind_info" mapstructure:"bind_info"`
}

func (*Process) Map

func (p *Process) Map() map[string]interface{}

type ProcessChangedAttribute

type ProcessChangedAttribute struct {
	ID                    int64       `json:"id"`
	PropertyID            string      `json:"property_id"`
	PropertyName          string      `json:"property_name"`
	PropertyValue         interface{} `json:"property_value"`
	TemplatePropertyValue interface{} `json:"template_property_value"`
}

type ProcessCreateOrUpdateInfo

type ProcessCreateOrUpdateInfo struct {
	// ProcessTemplateID indicate which process to update if service instance bound with a template
	ProcessTemplateID int64                  `json:"process_template_id"`
	ProcessInfo       map[string]interface{} `json:"process_info"`
}

type ProcessDetail

type ProcessDetail struct {
	Spec *ProcessProperty `json:"spec"`
}

type ProcessDifferenceDetail

type ProcessDifferenceDetail struct {
	ProcessTemplateID int64                     `json:"process_template_id"`
	ProcessInstance   Process                   `json:"process_instance"`
	ChangedAttributes []ProcessChangedAttribute `json:"changed_attributes"`
}

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 ProcessInstance

type ProcessInstance struct {
	Property mapstr.MapStr           `json:"property"`
	Relation ProcessInstanceRelation `json:"relation"`
}

type ProcessInstanceDetail

type ProcessInstanceDetail struct {
	// ProcessTemplateID indicate which process to update if service instance bound with a template
	ProcessTemplateID int64                  `json:"process_template_id"`
	ProcessData       map[string]interface{} `json:"process_info"`
}

type ProcessInstanceDetailByID

type ProcessInstanceDetailByID struct {
	ProcessID           int64                   `json:"process_id"`
	ServiceInstanceName string                  `json:"service_instance_name"`
	Property            mapstr.MapStr           `json:"property"`
	Relation            ProcessInstanceRelation `json:"relation"`
}

type ProcessInstanceNG

type ProcessInstanceNG struct {
	Process  Process                 `json:"process"`
	Relation ProcessInstanceRelation `json:"relation"`
}

type ProcessInstanceNameIDs

type ProcessInstanceNameIDs struct {
	ProcessName string  `json:"bk_process_name"`
	ProcessIDs  []int64 `json:"process_ids"`
}

type ProcessInstanceRelation

type ProcessInstanceRelation struct {
	BizID int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`

	// unique field, 1:1 mapping with ProcessInstance.
	ProcessID         int64 `field:"bk_process_id" json:"bk_process_id" bson:"bk_process_id"`
	ServiceInstanceID int64 `field:"service_instance_id" json:"service_instance_id" bson:"service_instance_id"`

	// ProcessTemplateID indicate which template are current process instantiate from.
	ProcessTemplateID int64 `field:"process_template_id" json:"process_template_id" bson:"process_template_id"`

	// redundant field for accelerating processes by HostID
	HostID          int64  `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id"`
	SupplierAccount string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

ProcessInstanceRelation record which service instance and process template are current process binding, process identified by ProcessID

func (*ProcessInstanceRelation) Validate

func (pir *ProcessInstanceRelation) Validate() (field string, err error)

type ProcessModule

type ProcessModule struct {
	AppID      int64  `json:"bk_biz_id" bson:"bk_biz_id"`
	ModuleName string `json:"bk_module_name" bson:"bk_module_name"`
	ProcessID  int64  `json:"bk_process_id" bson:"bk_process_id"`
	OwnerID    string `json:"bk_supplier_account" bson:"bk_supplier_account"`
}

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 ProcessOperateTaskDetail

type ProcessOperateTaskDetail struct {
	Errcode int    `json:"errcode" bson:"error_code"`
	ErrMsg  string `json:"errmsg" bson:"error_msg"`
}

type ProcessOperateTaskResult

type ProcessOperateTaskResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		Count int                  `json:"count"`
		Info  []ProcessOperateTask `json:"info"`
	} `json:"data"`
}

type ProcessProperty

type ProcessProperty struct {
	ProcNum      PropertyInt64  `field:"proc_num" json:"proc_num" bson:"proc_num" validate:"max=10000,min=1"`
	StopCmd      PropertyString `field:"stop_cmd" json:"stop_cmd" bson:"stop_cmd"`
	RestartCmd   PropertyString `field:"restart_cmd" json:"restart_cmd" bson:"restart_cmd"`
	ForceStopCmd PropertyString `field:"face_stop_cmd" json:"face_stop_cmd" bson:"face_stop_cmd"`
	FuncName     PropertyString `field:"bk_func_name" json:"bk_func_name" bson:"bk_func_name" validate:"required"`
	WorkPath     PropertyString `field:"work_path" json:"work_path" bson:"work_path"`
	//BindIP             PropertyBindIP   `field:"bind_ip" json:"bind_ip" bson:"bind_ip"`
	Priority    PropertyInt64  `field:"priority" json:"priority" bson:"priority" validate:"max=10000,min=1"`
	ReloadCmd   PropertyString `field:"reload_cmd" json:"reload_cmd" bson:"reload_cmd"`
	ProcessName PropertyString `field:"bk_process_name" json:"bk_process_name" bson:"bk_process_name" validate:"required"`
	//Port               PropertyPort     `field:"port" json:"port" bson:"port"`
	PidFile            PropertyString `field:"pid_file" json:"pid_file" bson:"pid_file"`
	AutoStart          PropertyBool   `field:"auto_start" json:"auto_start" bson:"auto_start"`
	AutoTimeGapSeconds PropertyInt64  `field:"auto_time_gap" json:"auto_time_gap" bson:"auto_time_gap" validate:"max=10000,min=1"`
	StartCmd           PropertyString `field:"start_cmd" json:"start_cmd" bson:"start_cmd"`
	FuncID             PropertyString `field:"bk_func_id" json:"bk_func_id" bson:"bk_func_id"`
	User               PropertyString `field:"user" json:"user" bson:"user"`
	TimeoutSeconds     PropertyInt64  `field:"timeout" json:"timeout" bson:"timeout" validate:"max=10000,min=1"`
	//Protocol           PropertyProtocol `field:"protocol" json:"protocol" bson:"protocol"`
	Description     PropertyString `field:"description" json:"description" bson:"description"`
	StartParamRegex PropertyString `field:"bk_start_param_regex" json:"bk_start_param_regex" bson:"bk_start_param_regex"`

	BindInfo ProcPropertyBindInfo `field:"bind_info" json:"bind_info" bson:"bind_info" structs:"bind_info" mapstructure:"bind_info"`
}

func (*ProcessProperty) Update

func (pt *ProcessProperty) Update(input ProcessProperty, rawProperty map[string]interface{})

Update all not nil field from input to pt rawProperty allows us set property field to nil

参数rawProperty,input 数据是一样的,只不过一个是map,一个struct。 因为struct 是有默认行为的。 rawProperty为了获取用户是否输入

func (*ProcessProperty) Validate

func (pt *ProcessProperty) Validate() (field string, err error)

type ProcessPropertyInterface

type ProcessPropertyInterface interface {
	Validate() error
}

type ProcessTemplate

type ProcessTemplate struct {
	ID          int64  `field:"id" json:"id" bson:"id"`
	ProcessName string `field:"bk_process_name" json:"bk_process_name" bson:"bk_process_name"`
	BizID       int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	// the service template's, which this process template belongs to.
	ServiceTemplateID int64 `field:"service_template_id" json:"service_template_id" bson:"service_template_id"`

	// stores a process instance's data includes all the process's
	// properties's value.
	Property *ProcessProperty `field:"property" json:"property" bson:"property"`

	Creator         string    `field:"creator" json:"creator" bson:"creator"`
	Modifier        string    `field:"modifier" json:"modifier" bson:"modifier"`
	CreateTime      time.Time `field:"create_time" json:"create_time" bson:"create_time"`
	LastTime        time.Time `field:"last_time" json:"last_time" bson:"last_time"`
	SupplierAccount string    `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

this works for the process instance which is used for a template.

func (*ProcessTemplate) ExtractChangeInfo

func (pt *ProcessTemplate) ExtractChangeInfo(i *Process, host map[string]interface{}) (mapstr.MapStr, bool, bool)

ExtractChangeInfo get changes that will be applied to process instance

func (*ProcessTemplate) ExtractEditableFields

func (pt *ProcessTemplate) ExtractEditableFields() []string

func (*ProcessTemplate) ExtractInstanceUpdateData

func (pt *ProcessTemplate) ExtractInstanceUpdateData(input *Process, host map[string]interface{}) map[string]interface{}

InstanceUpdate is used for update instance's value

func (*ProcessTemplate) GetEditableFields

func (pt *ProcessTemplate) GetEditableFields(fields []string) []string

FilterEditableFields only return editable fields

func (*ProcessTemplate) NewProcess

func (pt *ProcessTemplate) NewProcess(bizID int64, supplierAccount string, host map[string]interface{}) *Process

func (*ProcessTemplate) Validate

func (pt *ProcessTemplate) Validate() (field string, err error)

type PropertyBindIP

type PropertyBindIP struct {
	Value          *SocketBindType `field:"value" json:"value" bson:"value"`
	AsDefaultValue *bool           `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyBindIP) Validate

func (ti *PropertyBindIP) Validate() error

type PropertyBool

type PropertyBool struct {
	Value          *bool `field:"value" json:"value" bson:"value"`
	AsDefaultValue *bool `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyBool) Validate

func (ti *PropertyBool) Validate() error

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 PropertyInt64

type PropertyInt64 struct {
	Value *int64 `field:"value" json:"value" bson:"value"`

	// AsDefaultValue records the relations between process instance's property and
	// whether it's used as a default value, the empty value can also be a default value.
	// If the property's value is used as a default value, then this property
	// can not be changed in all the process instance's created by this process
	// template. or, it can only be changed to this default value.
	AsDefaultValue *bool `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyInt64) Validate

func (ti *PropertyInt64) Validate() error

type PropertyInt64String

type PropertyInt64String struct {
	Value *string `field:"value" json:"value" bson:"value"`

	// AsDefaultValue records the relations between process instance's property and
	// whether it's used as a default value, the empty value can also be a default value.
	// If the property's value is used as a default value, then this property
	// can not be changed in all the process instance's created by this process
	// template. or, it can only be changed to this default value.
	AsDefaultValue *bool `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

PropertyInt64String is a string field that parse into int64

func (*PropertyInt64String) Validate

func (ti *PropertyInt64String) Validate() error

type PropertyPort

type PropertyPort struct {
	Value          *string `field:"value" json:"value" bson:"value"`
	AsDefaultValue *bool   `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyPort) Validate

func (ti *PropertyPort) Validate() error

type PropertyProtocol

type PropertyProtocol struct {
	Value          *ProtocolType `field:"value" json:"value" bson:"value"`
	AsDefaultValue *bool         `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyProtocol) Validate

func (ti *PropertyProtocol) Validate() error

type PropertyString

type PropertyString struct {
	Value          *string `field:"value" json:"value" bson:"value"`
	AsDefaultValue *bool   `field:"as_default_value" json:"as_default_value" bson:"as_default_value"`
}

func (*PropertyString) Validate

func (ti *PropertyString) Validate() error

type ProtocolType

type ProtocolType string
const (
	ProtocolTypeTCP ProtocolType = "1"
	ProtocolTypeUDP ProtocolType = "2"
)

func (ProtocolType) String

func (p ProtocolType) String() string

func (ProtocolType) Validate

func (p ProtocolType) Validate() error

type PullResourceParam

type PullResourceParam struct {
	Collection string                 `json:"collection"`
	Condition  map[string]interface{} `json:"condition"`
	Fields     []string               `json:"fields"`
	Limit      int64                  `json:"limit"`
	Offset     int64                  `json:"offset"`
}

type PullResourceResponse

type PullResourceResponse struct {
	BaseResp `json:",inline"`
	Data     PullResourceResult `json:"data"`
}

type PullResourceResult

type PullResourceResult struct {
	Count int64                    `json:"count"`
	Info  []map[string]interface{} `json:"info"`
}

type QueryBusinessRequest

type QueryBusinessRequest struct {
	Fields    []string      `json:"fields"`
	Page      BasePage      `json:"page"`
	Condition mapstr.MapStr `json:"condition"`
}

type QueryCondition

type QueryCondition struct {
	Fields    []string      `json:"fields"`
	Page      BasePage      `json:"page"`
	Condition mapstr.MapStr `json:"condition"`
}

QueryCondition the common query condition definition

func (*QueryCondition) IsIllegal

func (qc *QueryCondition) IsIllegal() bool

IsIllegal limit is illegal, if limit = 0; change to default page size

type QueryConditionResult

type QueryConditionResult ResponseInstData

type QueryHostLockRequest

type QueryHostLockRequest struct {
	IDS []int64 `json:"id_list"`
}

type QueryInput

type QueryInput struct {
	Condition map[string]interface{} `json:"condition"`
	Fields    string                 `json:"fields,omitempty"`
	Start     int                    `json:"start,omitempty"`
	Limit     int                    `json:"limit,omitempty"`
	Sort      string                 `json:"sort,omitempty"`
}

func (*QueryInput) ConvTime

func (o *QueryInput) ConvTime() error

ConvTime cc_type key

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

type QueryModelDataResult struct {
	Count int64    `json:"count"`
	Info  []Object `json:"info"`
}

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

type QueryObjectAttributeResult struct {
	BaseResp `json:",inline"`
	Data     []Attribute `json:"data"`
}

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

type QueryObjectGroupResult struct {
	BaseResp `json:",inline"`
	Data     []Group `json:"data"`
}

QueryObjectGroupResult query the object group result

type QueryObjectResult

type QueryObjectResult struct {
	BaseResp `json:",inline"`
	Data     []Object `json:"data"`
}

QueryObjectResult query object result

type QueryResult

type QueryResult struct {
	Count uint64          `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

QueryResult common query result

type QueryUniqueResult

type QueryUniqueResult struct {
	Count uint64         `json:"count"`
	Info  []ObjectUnique `json:"info"`
}

type ReadInstAssociationResult

type ReadInstAssociationResult struct {
	BaseResp
	Data struct {
		Count uint64     `json:"count"`
		Info  []InstAsst `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 Region

type Region struct {
	RegionId    string `json:"bk_region" bson:"bk_region"`
	RegionName  string `json:"bk_region_name" bson:"bk_region_name"`
	RegionState string `json:"bk_region_state" bson:"bk_region_state"`
}

type RegionVpc

type RegionVpc struct {
	Region string `json:"bk_region"`
	VpcID  string `json:"bk_vpc_id"`
}

type RemoveFromModuleHost

type RemoveFromModuleHost struct {
	MoveToIdle        bool    `field:"move_to_idle" json:"move_to_idle"`
	HostID            int64   `field:"bk_host_id" json:"bk_host_id"`
	RemoveFromModules []int64 `field:"bk_module_ids" json:"bk_module_ids"`
	FinalModules      []int64 `field:"final_module_ids" json:"final_module_ids"`
}

type RemoveFromModuleInfo

type RemoveFromModuleInfo struct {
	ModuleID         int64             `field:"bk_module_id" json:"bk_module_id"`
	ServiceInstances []ServiceInstance `field:"service_instances" json:"service_instances"`
}

type RemoveHostsFromModuleOption

type RemoveHostsFromModuleOption struct {
	ApplicationID int64 `json:"bk_biz_id"`
	HostID        int64 `json:"bk_host_id"`
	ModuleID      int64 `json:"bk_module_id"`
}

type RemoveTemplateBindingOnModuleOption

type RemoveTemplateBindingOnModuleOption struct {
	BizID    int64 `json:"bk_biz_id"`
	ModuleID int64 `json:"bk_module_id"`
}

type RemoveTemplateBoundOnModuleResult

type RemoveTemplateBoundOnModuleResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		ServiceTemplateID int64 `json:"service_template_id" bson:"service_template_id" field:"service_template_id"`
	} `json:"data"`
}

type RepeatedDataResult

type RepeatedDataResult struct {
	OriginIndex int64         `json:"origin_index"`
	Data        mapstr.MapStr `json:"data"`
}

RepeatedDataResult repeated data

type ReponseSysUserConfig

type ReponseSysUserConfig struct {
	BaseResp `json:",inline"`
	Data     ResponseSysUserConfigData `json:"data"`
}

type RequestImportAssociation

type RequestImportAssociation struct {
	AssociationInfoMap map[int]ExcelAssocation `json:"association_info"`
}

ResponeImportAssociation import association result

type RequestInstAssociationObjectID

type RequestInstAssociationObjectID struct {
	Condition RequestInstAssociationObjectIDCondition `json:"condition"`
	Page      BasePage                                `json:"page"`
}

RequestInstAssociationObjectID 要求根据实例信息(实例的模型ID,实例ID)和模型ID(关联关系中的源,目的模型ID), 返回关联关系的请求参数

type RequestInstAssociationObjectIDCondition

type RequestInstAssociationObjectIDCondition struct {
	// 实例得模型ID
	ObjectID string `json:"bk_obj_id"`
	// 实例ID
	InstID int64 `json:"bk_inst_id"`
	// ObjectID是否为目标模型, 默认false, 关联关系中的源模型,否则是目标模型
	IsTargetObject bool `json:"is_target_object"`

	// 关联对象的模型ID
	AssociationObjectID string `json:"association_obj_id"`
}

RequestInstAssociationObjectIDCondition query condition

type Resource

type Resource struct {
	ResourceTypeName string `json:"resource_type_name"`
	ResourceType     string `json:"resource_type"`
	ResourceName     string `json:"resource_name"`
	ResourceID       string `json:"resource_id"`
}

type ResourceType

type ResourceType string
const (
	// business related operation type
	BusinessRes             ResourceType = "business"
	ServiceTemplateRes      ResourceType = "service_template"
	SetTemplateRes          ResourceType = "set_template"
	ServiceCategoryRes      ResourceType = "service_category"
	DynamicGroupRes         ResourceType = "dynamic_group"
	ServiceInstanceRes      ResourceType = "service_instance"
	ServiceInstanceLabelRes ResourceType = "service_instance_label"
	SetRes                  ResourceType = "set"
	ModuleRes               ResourceType = "module"
	ProcessRes              ResourceType = "process"
	HostApplyRes            ResourceType = "host_apply"
	CustomFieldRes          ResourceType = "custom_field"

	// model related operation type
	ModelRes               ResourceType = "model"
	ModelInstanceRes       ResourceType = "model_instance"
	MainlineInstanceRes    ResourceType = "mainline_instance"
	ModelAssociationRes    ResourceType = "model_association"
	ModelAttributeRes      ResourceType = "model_attribute"
	ModelAttributeGroupRes ResourceType = "model_attribute_group"
	ModelClassificationRes ResourceType = "model_classification"
	InstanceAssociationRes ResourceType = "instance_association"
	ModelGroupRes          ResourceType = "model_group"
	ModelUniqueRes         ResourceType = "model_unique"
	ResourceDirectoryRes   ResourceType = "resource_directory"

	AssociationKindRes ResourceType = "association_kind"
	EventPushRes       ResourceType = "event"
	CloudAreaRes       ResourceType = "cloud_area"
	CloudAccountRes    ResourceType = "cloud_account"
	CloudSyncTaskRes   ResourceType = "cloud_sync_task"

	// host related operation type
	HostRes ResourceType = "host"

	ResourceDirRes ResourceType = "resource_directory"
)

func GetResourceTypeByObjID

func GetResourceTypeByObjID(objID string, isMainline bool) ResourceType

type RespError

type RespError struct {
	// error message
	Msg error
	// error code
	ErrCode int
	Data    interface{}
}

RespError

func (*RespError) Error

func (r *RespError) Error() string

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" mapstructure:"data"`
}

func NewSuccessResp

func NewSuccessResp(data interface{}) *Response

data is the data you want to return to client.

type ResponseDataMapStr

type ResponseDataMapStr struct {
	BaseResp `json:",inline"`
	Data     mapstr.MapStr `json:"data"`
}

type ResponseInstData

type ResponseInstData struct {
	BaseResp `json:",inline"`
	Data     InstDataInfo `json:"data"`
}

ResponseInstData

type ResponseSysUserConfigData

type ResponseSysUserConfigData struct {
	RowType        string            `json:"type"`
	BluekingModify SysUserConfigItem `json:"blueking_modify"`
}

type RoleAppResult

type RoleAppResult struct {
	BaseResp `json:",inline"`
	Data     []map[string]interface{} `json:"data"`
}

type RolePriResult

type RolePriResult struct {
	BaseResp `json:",inline"`
	Data     []string `json:"data"`
}

type RowMsgData

type RowMsgData struct {
	Row int    `json:"row"`
	Msg string `json:"message"`
}

type RspID

type RspID struct {
	ID int64 `json:"id"`
}

RspID response id

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 RspSubscriptionCreate struct {
	BaseResp `json:",inline"`
	Data     struct {
		SubscriptionID int64 `json:"subscription_id"`
	} `json:"data"`
}

type RspSubscriptionSearch

type RspSubscriptionSearch struct {
	Count uint64         `json:"count"`
	Info  []Subscription `json:"info"`
}

type RspSubscriptionTestCallback

type RspSubscriptionTestCallback struct {
	HttpStatus   int    `json:"http_status"`
	ResponseBody string `json:"response_body"`
}

type SearchAccountValidityOption

type SearchAccountValidityOption struct {
	AccountIDs []int64 `json:"account_ids" bson:"account_ids"`
}

func (*SearchAccountValidityOption) Validate

func (s *SearchAccountValidityOption) Validate() (rawError errors.RawErrorInfo)

type SearchAssociationInstRequest

type SearchAssociationInstRequest struct {
	Condition mapstr.MapStr `json:"condition"` // construct condition mapstr by condition.Condition
}

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 SearchAssociationInstResult

type SearchAssociationInstResult struct {
	BaseResp `json:",inline"`
	Data     []*InstAsst `json:"data"`
}

type SearchAssociationKindResult

type SearchAssociationKindResult struct {
	Count uint64            `json:"count"`
	Info  []AssociationKind `json:"info"`
}

SearchAssociationKindResult search association kind result definition

type SearchAssociationObjectRequest

type SearchAssociationObjectRequest struct {
	Condition mapstr.MapStr `json:"condition"`
}

type SearchAssociationObjectResult

type SearchAssociationObjectResult struct {
	BaseResp `json:",inline"`
	Data     []*Association `json:"data"`
}

type SearchAssociationTopoResult

type SearchAssociationTopoResult struct {
	BaseResp `json:",inline"`
	Data     []CommonInstTopoV2 `json:"data"`
}

type SearchAssociationTypeRequest

type SearchAssociationTypeRequest struct {
	BasePage  `json:"page"`
	Condition map[string]interface{} `json:"condition"`
}

type SearchAssociationTypeResult

type SearchAssociationTypeResult struct {
	BaseResp `json:",inline"`
	Data     struct {
		Count int                `json:"count"`
		Info  []*AssociationKind `json:"info"`
	} `json:"data"`
}

type SearchChartCommon

type SearchChartCommon struct {
	BaseResp `json:",inline"`
	Data     CommonSearchChart `json:"data"`
}

type SearchChartConfig

type SearchChartConfig struct {
	Count uint64                   `json:"count"`
	Info  map[string][]ChartConfig `json:"info"`
}

type SearchChartResponse

type SearchChartResponse struct {
	BaseResp `json:",inline"`
	Data     SearchChartConfig `json:"data"`
}

type SearchCloudOption

type SearchCloudOption struct {
	Condition mapstr.MapStr `json:"condition" bson:"condition" field:"condition"`
	Page      BasePage      `json:"page" bson:"page" field:"page"`
	Fields    []string      `json:"fields,omitempty" bson:"fields,omitempty"`
	// 对于condition里的属性值是否精确匹配,默认为false,即使用模糊匹配和忽略大小写
	Exact bool `json:"exact" bson:"exact"`
}

type SearchCondition

type SearchCondition struct {
	Fields    []string        `json:"fields"`
	Condition []ConditionItem `json:"condition"`
	ObjectID  string          `json:"bk_obj_id"`
}

search condition

type SearchDataResult

type SearchDataResult struct {
	Count int64           `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

SearchDataResult common search data result

type SearchHost

type SearchHost struct {
	Count int             `json:"count"`
	Info  []mapstr.MapStr `json:"info"`
}

func (SearchHost) ExtractHostIDs

func (sh SearchHost) ExtractHostIDs() *[]int64

type SearchHostIdentifierData

type SearchHostIdentifierData struct {
	Count int              `json:"count"`
	Info  []HostIdentifier `json:"info"`
}

SearchHostIdentifierData host identifier detail

type SearchHostIdentifierParam

type SearchHostIdentifierParam struct {
	HostIDs []int64 `json:"host_ids"`
}

SearchHostIdentifierParam 查询主机身份的条件

type SearchHostIdentifierResult

type SearchHostIdentifierResult struct {
	BaseResp `json:",inline"`
	Data     SearchHostIdentifierData `json:"data"`
}

type SearchHostResult

type SearchHostResult struct {
	BaseResp `json:",inline"`
	Data     *SearchHost `json:"data"`
}

type SearchHostWithIDOption

type SearchHostWithIDOption struct {
	HostID int64 `json:"bk_host_id"`
	// only return these fields in hosts.
	Fields []string `json:"fields"`
}

type SearchHostWithInnerIPOption

type SearchHostWithInnerIPOption struct {
	InnerIP string `json:"bk_host_innerip"`
	CloudID int64  `json:"bk_cloud_id"`
	// only return these fields in hosts.
	Fields []string `json:"fields"`
}

type SearchIdentifierParam

type SearchIdentifierParam struct {
	IP   IPParam `json:"ip"`
	Page BasePage
}

SearchIdentifierParam defines the param

type SearchInnterAppTopoResult

type SearchInnterAppTopoResult struct {
	BaseResp `json:",inline"`
	Data     InnterAppTopo
}

type SearchInstBatchOption

type SearchInstBatchOption struct {
	IDs    []int64  `json:"bk_ids"`
	Fields []string `json:"fields"`
}

func (*SearchInstBatchOption) Validate

func (s *SearchInstBatchOption) Validate() (rawError errors.RawErrorInfo)

type SearchInstResult

type SearchInstResult struct {
	BaseResp `json:",inline"`
	Data     InstResult `json:"data"`
}

type SearchLimit deprecated

type SearchLimit struct {
	Offset int64 `json:"start" field:"start"`
	Limit  int64 `json:"limit" field:"limit"`
}

Deprecated: SearchLimit sub condition

func (SearchLimit) IsIllegal

func (page SearchLimit) IsIllegal() bool

IsIllegal limit is illegal

type SearchModelInfo

type SearchModelInfo struct {
	Spec       Object      `json:"spec"`
	Attributes []Attribute `json:"attributes"`
}

SearchModelInfo search model params

type SearchModelResult

type SearchModelResult struct {
	BaseResp `json:",inline"`
	Data     []Object `json:"data"`
}

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"`
}

common search struct

type SearchResourceDirParams

type SearchResourceDirParams struct {
	Fields    []string      `json:"fields"`
	Page      BasePage      `json:"page"`
	Condition mapstr.MapStr `json:"condition"`
	Exact     bool          `json:"exact"`
}

type SearchResourceDirResult

type SearchResourceDirResult struct {
	BizID      int64  `json:"bk_biz_id"`
	ModuleID   int64  `json:"bk_module_id"`
	ModuleName string `json:"bk_module_name"`
	SetID      int64  `json:"bk_set_id"`
	HostCount  int64  `json:"host_count"`
}

type SearchResp

type SearchResp struct {
	BaseResp `json:",inline"`
	Data     SearchDataResult `json:"data"`
}

SearchResp common search response

type SearchRuleRelatedModulesOption

type SearchRuleRelatedModulesOption struct {
	Keyword     string                    `json:"keyword" field:"keyword" mapstructure:"keyword"`
	QueryFilter *querybuilder.QueryFilter `json:"query_filter" field:"query_filter" mapstructure:"query_filter"`
}

type SearchSort

type SearchSort struct {
	IsDsc bool   `json:"is_dsc"`
	Field string `json:"field"`
}

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 SearchSyncHistoryOption

type SearchSyncHistoryOption struct {
	SearchCloudOption `json:",inline"`
	TaskID            int64  `json:"bk_task_id" bson:"bk_task_id"`
	StarTime          string `json:"start_time" bson:"start_time"`
	EndTime           string `json:"end_time" bson:"end_time"`
}

type SearchSyncRegionOption

type SearchSyncRegionOption struct {
	AccountID int64 `json:"bk_account_id" bson:"bk_account_id"`
	// 是否返回地域下的主机数,返回主机数会导致请求更耗时,默认为false
	WithHostCount bool `json:"with_host_count" bson:"with_host_count"`
}

type SearchSyncTaskOption

type SearchSyncTaskOption struct {
	SearchCloudOption `json:",inline"`
	// 是否实时获取云厂商vpc下最新的主机数
	LastestHostCount bool `json:"latest_hostcount" bson:"latest_host_count"`
}

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 SearchTopoResult

type SearchTopoResult struct {
	BaseResp `json:",inline"`
	Data     []*CommonInstTopo `json:"data"`
}

type SearchUniqueRequest

type SearchUniqueRequest struct {
	ObjID string `json:"bk_obj_id"`
}

type SearchUniqueResult

type SearchUniqueResult struct {
	BaseResp
	Data []ObjectUnique `json:"data"`
}

type SearchVpcHostCntOption

type SearchVpcHostCntOption struct {
	RegionVpcs []RegionVpc
}

type SearchVpcOption

type SearchVpcOption struct {
	Region string `json:"bk_region"`
}

type SearchVpcResult

type SearchVpcResult struct {
	Count string            `json:"count"`
	Info  []VpcInstancesCnt `json:"info"`
}

type SecretContent

type SecretContent struct {
	SecretKey string `json:"secret_key"`
}

type SecretKeyInfo

type SecretKeyInfo struct {
	Content SecretContent `json:"content"`
}

type SecretKeyResult

type SecretKeyResult struct {
	Code    int           `json:"code"`
	Message string        `json:"message"`
	Result  bool          `json:"result"`
	Data    SecretKeyInfo `json:"data"`
}

type ServiceCategory

type ServiceCategory struct {
	BizID int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`

	ID   int64  `field:"id" json:"id" bson:"id"`
	Name string `field:"name" json:"name" bson:"name"`

	RootID          int64  `field:"bk_root_id" json:"bk_root_id" bson:"bk_root_id"`
	ParentID        int64  `field:"bk_parent_id" json:"bk_parent_id" bson:"bk_parent_id"`
	SupplierAccount string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`

	// IsBuiltIn indicates internal system service category, which shouldn't be modified.
	IsBuiltIn bool `field:"is_built_in" json:"is_built_in" bson:"is_built_in"`
}

func (*ServiceCategory) Validate

func (sc *ServiceCategory) Validate() (field string, err error)

type ServiceCategoryWithStatistics

type ServiceCategoryWithStatistics struct {
	ServiceCategory ServiceCategory `field:"category" json:"category" bson:"category"`
	UsageAmount     int64           `field:"usage_amount" json:"usage_amount" bson:"usage_amount"`
}

type ServiceDifferenceDetails

type ServiceDifferenceDetails struct {
	ServiceInstance   ServiceInstance           `json:"service_instance"`
	Process           *Process                  `json:"process"`
	ChangedAttributes []ProcessChangedAttribute `json:"changed_attributes"`
}

ServiceDifferenceDetails 服务实例与模板差异信息

type ServiceInstance

type ServiceInstance struct {
	BizID  int64           `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	ID     int64           `field:"id" json:"id" bson:"id"`
	Name   string          `field:"name" json:"name" bson:"name"`
	Labels selector.Labels `field:"labels" json:"labels" bson:"labels"`

	// the template id can not be updated, once the service is created.
	// it can be 0 when the service is not created with a service template.
	ServiceTemplateID int64 `field:"service_template_id" json:"service_template_id" bson:"service_template_id"`
	HostID            int64 `field:"bk_host_id" json:"bk_host_id" bson:"bk_host_id"`

	// the module that this service belongs to.
	ModuleID int64 `field:"bk_module_id" json:"bk_module_id" bson:"bk_module_id"`

	Creator         string    `field:"creator" json:"creator" bson:"creator"`
	Modifier        string    `field:"modifier" json:"modifier" bson:"modifier"`
	CreateTime      time.Time `field:"create_time" json:"create_time" bson:"create_time"`
	LastTime        time.Time `field:"last_time" json:"last_time" bson:"last_time"`
	SupplierAccount string    `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

ServiceInstance is a service, which created when a host binding with a service template.

func (*ServiceInstance) Validate

func (si *ServiceInstance) Validate() (field string, err error)

type ServiceInstanceDeletePreview

type ServiceInstanceDeletePreview struct {
	ToMoveModuleHosts []RemoveFromModuleHost `field:"to_move_module_hosts" json:"to_move_module_hosts"`
	HostApplyPlan     HostApplyPlanResult    `field:"host_apply_plan" json:"host_apply_plan"`
}

type ServiceInstanceDetail

type ServiceInstanceDetail struct {
	ServiceInstance
	ServiceCategoryID int64               `field:"service_category_id" json:"service_category_id" bson:"service_category_id"`
	ProcessInstances  []ProcessInstanceNG `field:"process_instances" json:"process_instances" bson:"process_instances"`
}

type ServiceInstanceDifference

type ServiceInstanceDifference struct {
	ProcessTemplateID    int64                      `json:"process_template_id"`
	ProcessTemplateName  string                     `json:"process_template_name"`
	ServiceInstanceCount int                        `json:"service_instance_count"`
	ServiceInstances     []ServiceDifferenceDetails `json:"service_instances"`
}

ServiceInstanceDifference 服务实例内的进程信息与进程模板ID不一致的服务实例列表

type ServiceInstanceWithTopoPath

type ServiceInstanceWithTopoPath struct {
	ServiceInstance
	TopoPath []TopoInstanceNodeSimplify `field:"topo_path" json:"topo_path" bson:"topo_path"`
}

type ServiceProcessInstanceDifference

type ServiceProcessInstanceDifference struct {
	ServiceInstanceID   int64             `json:"service_instance_id" field:"service_instance_id" bson:"service_instance_id"`
	ServiceInstanceName string            `json:"service_instance_name" field:"service_instance_name" bson:"service_instance_name"`
	BizID               int64             `json:"bk_biz_id" field:"bk_biz_id" bson:"bk_biz_id"`
	HostID              int64             `json:"bk_host_id" field:"bk_host_id" bson:"bk_host_id"`
	Differences         *DifferenceDetail `json:"differences" field:"differences" bson:"differences"`
}

to describe the differences between service instance and it's service template's process template's attribute.

type ServiceTemplate

type ServiceTemplate struct {
	BizID int64 `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`

	ID int64 `field:"id" json:"id" bson:"id"`
	// name of this service, can not be empty
	Name string `field:"name" json:"name" bson:"name"`

	// the class of this service, each field means a class label.
	// now, the class must have two labels.
	ServiceCategoryID int64 `field:"service_category_id" json:"service_category_id" bson:"service_category_id"`

	Creator         string    `field:"creator" json:"creator" bson:"creator"`
	Modifier        string    `field:"modifier" json:"modifier" bson:"modifier"`
	CreateTime      time.Time `field:"create_time" json:"create_time" bson:"create_time"`
	LastTime        time.Time `field:"last_time" json:"last_time" bson:"last_time"`
	SupplierAccount string    `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

func (*ServiceTemplate) Validate

func (st *ServiceTemplate) Validate() (field string, err error)

type ServiceTemplateDetail

type ServiceTemplateDetail struct {
	ServiceTemplate  ServiceTemplate   `field:"service_template" json:"service_template" bson:"service_template" mapstructure:"service_template"`
	ProcessTemplates []ProcessTemplate `field:"process_templates" json:"process_templates" bson:"process_templates" mapstructure:"process_templates"`
}

type ServiceTemplateWithStatistics

type ServiceTemplateWithStatistics struct {
	Template             ServiceTemplate `field:"template" json:"template" bson:"template"`
	ServiceInstanceCount int64           `field:"service_instance_count" json:"service_instance_count" bson:"service_instance_count"`
	ProcessInstanceCount int64           `field:"process_instance_count" json:"process_instance_count" bson:"process_instance_count"`
}

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 SetDiff

type SetDiff struct {
	ModuleDiffs []SetModuleDiff            `json:"module_diffs"`
	SetID       int64                      `json:"bk_set_id"`
	SetDetail   SetInst                    `json:"set_detail"`
	TopoPath    []TopoInstanceNodeSimplify `json:"topo_path"`
	NeedSync    bool                       `json:"need_sync"`

	SetTemplateVersion int64 `json:"set_template_version"`
}

func (*SetDiff) UpdateNeedSyncField

func (sd *SetDiff) UpdateNeedSyncField()

type SetHostConfigParams

type SetHostConfigParams struct {
	ApplicationID int64 `json:"bk_biz_id"`
	SetID         int64 `json:"bk_set_id"`
	ModuleID      int64 `json:"bk_module_id"`
}

type SetIdenifierFlag

type SetIdenifierFlag struct {
	DataType SynchronizeOperateDataType `json:"data_type"`
	// DataType = SynchronizeOperateDataTypeInstance,
	// DataType = object_id,  eg:host,plat,module,proc etc.
	// DataType = SynchronizeOperateDataTypeModel,
	// DataClassify = common.SynchronizeModelDescTypeGroupInfo,common.SynchronizeModelDescTypeModuleAttribute etc
	DataClassify string `json:"data_classify"`

	IdentifierID []int64 `json:"identifier_id"`

	// 需要同步到第三方系统的身份标志
	Flag string `json:"flag"`
	// 1:新增,在原有的基础新加同步标志。
	// 2:覆盖,删除 原有的同步标志
	// 3:删除, 删除同步标志
	OperateType SynchronizeOperateType `json:"op_type"`
}

SetIdenifierFlag update idenifier flag data

type SetInst

type SetInst struct {
	BizID         int64  `bson:"bk_biz_id" json:"bk_biz_id" mapstructure:"bk_biz_id"`
	SetID         int64  `bson:"bk_set_id" json:"bk_set_id" mapstructure:"bk_set_id"`
	SetName       string `bson:"bk_set_name" json:"bk_set_name" mapstructure:"bk_set_name"`
	SetStatus     string `bson:"bk_service_status" json:"bk_service_status" mapstructure:"bk_service_status"`
	SetEnv        string `bson:"bk_set_env" json:"bk_set_env" mapstructure:"bk_set_env"`
	SetTemplateID int64  `bson:"set_template_id" json:"set_template_id" mapstructure:"set_template_id"`
	ParentID      int64  `bson:"bk_parent_id" json:"bk_parent_id" mapstructure:"bk_parent_id"`

	Creator         string `field:"creator" json:"creator,omitempty" bson:"creator" mapstructure:"creator"`
	CreateTime      Time   `field:"create_time" json:"create_time,omitempty" bson:"create_time" mapstructure:"create_time"`
	LastTime        Time   `field:"last_time" json:"last_time,omitempty" bson:"last_time" mapstructure:"last_time"`
	SupplierAccount string `` /* 126-byte string literal not displayed */

	SetTemplateVersion int64 `bson:"set_template_version" json:"set_template_version" mapstructure:"set_template_version"`
}

SetInst contains partial fields of a real set

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 SetModel

type SetModel CreateModel

SetModel define SetMode method input params

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 SetModuleDiff

type SetModuleDiff struct {
	ModuleID            int64  `json:"bk_module_id" mapstructure:"bk_module_id"`
	ModuleName          string `json:"bk_module_name" mapstructure:"bk_module_name"`
	ServiceTemplateID   int64  `json:"service_template_id" mapstructure:"service_template_id"`
	ServiceTemplateName string `json:"service_template_name" mapstructure:"service_template_name"`
	DiffType            string `json:"diff_type" mapstructure:"diff_type"`
}

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 SetServiceTemplateRelation

type SetServiceTemplateRelation struct {
	BizID             int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	SetTemplateID     int64  `field:"set_template_id" json:"set_template_id" bson:"set_template_id"`
	ServiceTemplateID int64  `field:"service_template_id" json:"service_template_id" bson:"service_template_id"`
	SupplierAccount   string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

拓扑模板与服务模板多对多关系, 记录拓扑模板的构成

type SetSyncStatusOption

type SetSyncStatusOption struct {
	SetIDs []int64 `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
}

type SetTemplate

type SetTemplate struct {
	ID    int64  `field:"id" json:"id" bson:"id"`
	Name  string `field:"name" json:"name" bson:"name"`
	BizID int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`

	Version int64 `field:"version" json:"version" bson:"version" mapstructure:"version"`

	// 通用字段
	Creator         string    `field:"creator" json:"creator" bson:"creator"`
	Modifier        string    `field:"modifier" json:"modifier" bson:"modifier"`
	CreateTime      time.Time `field:"create_time" json:"create_time" bson:"create_time"`
	LastTime        time.Time `field:"last_time" json:"last_time" bson:"last_time"`
	SupplierAccount string    `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account"`
}

SetTemplate 集群模板

func (SetTemplate) Validate

func (st SetTemplate) Validate() (key string, err error)

type SetTemplateResult

type SetTemplateResult struct {
	BaseResp
	Data SetTemplate `field:"data" json:"data" bson:"data"`
}

type SetTemplateSyncStatus

type SetTemplateSyncStatus struct {
	SetID         int64  `field:"bk_set_id" json:"bk_set_id" bson:"bk_set_id" mapstructure:"bk_set_id"`
	Name          string `field:"bk_set_name" json:"bk_set_name" bson:"bk_set_name" mapstructure:"bk_set_name"`
	BizID         int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id" mapstructure:"bk_biz_id"`
	SetTemplateID int64  `field:"set_template_id" json:"set_template_id" bson:"set_template_id" mapstructure:"set_template_id"`

	Creator         string `field:"creator" json:"creator" bson:"creator" mapstructure:"creator"`
	CreateTime      Time   `field:"create_time" json:"create_time" bson:"create_time" mapstructure:"create_time"`
	LastTime        Time   `field:"last_time" json:"last_time" bson:"last_time" mapstructure:"last_time"`
	SupplierAccount string `field:"bk_supplier_account" json:"bk_supplier_account" bson:"bk_supplier_account" mapstructure:"bk_supplier_account"`

	Status SyncStatus `field:"status" json:"status" bson:"status" mapstructure:"status"`
	TaskID string     `field:"task_id" json:"task_id" bson:"task_id" mapstructure:"task_id"`
}

type SetTemplateUpdateToDateStatus

type SetTemplateUpdateToDateStatus struct {
	Sets               []SetUpdateToDateStatus `json:"sets"`
	SetTemplateVersion int64                   `json:"set_template_version"`
	SetTemplateID      int64                   `json:"set_template_id"`
	NeedSync           bool                    `json:"need_sync"`
}

type SetTemplateWithStatistics

type SetTemplateWithStatistics struct {
	SetInstanceCount int64       `json:"set_instance_count"`
	SetTemplate      SetTemplate `json:"set_template"`
}

type SetTplDiffResult

type SetTplDiffResult struct {
	Difference      []SetDiff       `json:"difference"`
	ModuleHostCount map[int64]int64 `json:"module_host_count"`
}

type SetUpdateToDateStatus

type SetUpdateToDateStatus struct {
	SetID              int64 `json:"bk_set_id"`
	SetTemplateVersion int64 `json:"set_template_version"`
	NeedSync           bool  `json:"need_sync"`
}

type SinglecharItem

type SinglecharItem struct {
	BaseCfgItem `json:",inline"`
}

type SiteCfg

type SiteCfg struct {
	Title  TitleItem  `json:"title"`
	Footer FooterItem `json:"footer"`
}

SiteCfg used to admin Site Config

func (SiteCfg) Validate

func (s SiteCfg) Validate() error

Validate validate the fields of SiteCfg

type SocketBindType

type SocketBindType string
const (
	BindLocalHost SocketBindType = "1"
	BindAll       SocketBindType = "2"
	BindInnerIP   SocketBindType = "3"
	BindOuterIP   SocketBindType = "4"
)

func (*SocketBindType) IP

func (p *SocketBindType) IP(host map[string]interface{}) string

func (*SocketBindType) NeedIPFromHost

func (p *SocketBindType) NeedIPFromHost() bool

func (*SocketBindType) String

func (p *SocketBindType) String() string

func (SocketBindType) Validate

func (p SocketBindType) Validate() error

type StatisticInstOperation

type StatisticInstOperation struct {
	Create []StringIDCount   `json:"create"`
	Delete []StringIDCount   `json:"delete"`
	Update []UpdateInstCount `json:"update"`
}

type Statistics

type Statistics struct {
	Total   int64 `json:"total"`
	Failure int64 `json:"failure"`
}

Report define sending statistic

type StringArrayToString

type StringArrayToString string

special field whose string array value is parsed into string value from db

func (*StringArrayToString) UnmarshalBSONValue

func (s *StringArrayToString) UnmarshalBSONValue(typo bsontype.Type, raw []byte) error

type StringIDCount

type StringIDCount struct {
	ID    string `json:"id" bson:"_id"`
	Count int64  `json:"count" bson:"count"`
}

StringIDCount string类型字段做mongoDB聚合时使用

type SubAttribute

type SubAttribute struct {
	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"`
	Placeholder   string      `field:"placeholder" json:"placeholder" bson:"placeholder"`
	IsEditable    bool        `field:"editable" json:"editable" bson:"editable"`
	IsRequired    bool        `field:"isrequired" json:"isrequired" bson:"isrequired"`
	IsReadOnly    bool        `field:"isreadonly" json:"isreadonly" bson:"isreadonly"`
	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"`
	PropertyGroup string      `field:"bk_property_group" json:"bk_property_group" bson:"bk_property_group"`
}

SubAttribute sub attribute metadata definition

func (*SubAttribute) Validate

func (sa *SubAttribute) Validate(ctx context.Context, data interface{}, key string) (rawError errors.RawErrorInfo)

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"`
	TimeOutSeconds   int64  `bson:"time_out" json:"time_out"` // second
	// SubscriptionForm is a list of event types split by comma
	SubscriptionForm string      `bson:"subscription_form" json:"subscription_form"`
	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 SuccessResponse

type SuccessResponse struct {
	BaseResp `json:",inline"`
	Data     interface{} `json:"data"`
}

func NewSuccessResponse

func NewSuccessResponse(data interface{}) *SuccessResponse

type SyncDetail

type SyncDetail struct {
	NewAdd SyncSuccessInfo `json:"new_add" bson:"new_add"`
	Update SyncSuccessInfo `json:"update" bson:"update"`
}

type SyncFailInfo

type SyncFailInfo struct {
	Count   int64             `json:"count" bson:"count"`
	IPError map[string]string `json:"ip_error" bson:"ip_error"`
}

type SyncHistory

type SyncHistory struct {
	HistoryID         int64          `json:"bk_history_id" bson:"bk_history_id"`
	TaskID            int64          `json:"bk_task_id" bson:"bk_task_id"`
	SyncStatus        string         `json:"bk_sync_status" bson:"bk_sync_status"`
	OwnerID           string         `json:"bk_supplier_account" bson:"bk_supplier_account"`
	StatusDescription SyncStatusDesc `json:"bk_status_description" bson:"bk_status_description"`
	Detail            SyncDetail     `json:"bk_detail" bson:"bk_detail"`
	CreateTime        time.Time      `json:"create_time" bson:"create_time"`
}

同步历史记录

type SyncModuleServiceInstanceByTemplateOption

type SyncModuleServiceInstanceByTemplateOption struct {
	BizID    int64 `json:"bk_biz_id"`
	ModuleID int64 `json:"bk_module_id"`
}

用于同步单个模块的服务实例

type SyncModuleTask

type SyncModuleTask struct {
	Set         SetInst                    `json:"set"`
	SetTopoPath []TopoInstanceNodeSimplify `json:"set_topo_path"`
	ModuleDiff  SetModuleDiff              `json:"module_diff"`

	SetTemplateVersion int64 `json:"set_template_version"`
}

type SyncRegion

type SyncRegion struct {
	RegionId    string `json:"bk_region" bson:"bk_region"`
	RegionName  string `json:"bk_region_name" bson:"bk_region_name"`
	RegionState string `json:"bk_region_state" bson:"bk_region_state"`
	HostCount   int64  `json:"bk_host_count" bson:"bk_host_count"`
}

type SyncResult

type SyncResult struct {
	SuccessInfo       SyncSuccessInfo `json:"success_info" bson:"success_info"`
	FailInfo          SyncFailInfo    `json:"fail_info" bson:"fail_info"`
	Detail            SyncDetail      `json:"detail" bson:"detail"`
	SyncStatus        string          `json:"bk_sync_status" bson:"bk_sync_status"`
	StatusDescription SyncStatusDesc  `json:"bk_status_description" bson:"bk_status_description"`
}

type SyncServiceInstanceByTemplateOption

type SyncServiceInstanceByTemplateOption struct {
	BizID     int64   `json:"bk_biz_id"`
	ModuleIDs []int64 `json:"bk_module_ids"`
}

type SyncSetTplToInstOption

type SyncSetTplToInstOption struct {
	SetIDs []int64 `field:"bk_set_ids" json:"bk_set_ids" bson:"bk_set_ids" mapstructure:"bk_set_ids"`
}

type SyncStatus

type SyncStatus string

func (SyncStatus) IsFinished

func (ss SyncStatus) IsFinished() bool

type SyncStatusDesc

type SyncStatusDesc struct {
	CostTime  float64 `json:"cost_time" bson:"cost_time"`
	ErrorInfo string  `json:"error_info" bson:"error_info"`
}

type SyncSuccessInfo

type SyncSuccessInfo struct {
	Count int64    `json:"count" bson:"count"`
	IPs   []string `json:"ips" bson:"ips"`
}

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

type SynchronizeItem struct {
	Info mapstr.MapStr `json:"info"`
	ID   int64         `json:"id"`
}

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 SysUserConfigItem

type SysUserConfigItem struct {
	Flag     bool  `json:"flag" bson:"flag"`
	ExpireAt int64 `json:"expire_at" bson:"expire_at"`
}

SysUserConfigItem 用户在cc_System表中的用户自定义配置

type TaskDetailResponse

type TaskDetailResponse struct {
	BaseResp
	Data struct {
		Info APITaskDetail `json:"info"`
	} `json:"data"`
}

type TemplateVersion

type TemplateVersion struct {
	Content     string `json:"content" field:"content"`
	Status      string `json:"status" field:"status"`
	Description string `json:"description" field:"description"`
}

type Time

type Time struct {
	time.Time `bson:",inline" json:",inline"`
}

func Now

func Now() Time

Now retruns now

func ParseTimeInUnixTS

func ParseTimeInUnixTS(sec, nsec int64) Time

ParseTimeInUnixTS return Time object base on unix timestamp.

func (Time) MarshalBSONValue

func (t Time) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue implements bson.MarshalBSON interface

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) Scan

func (t *Time) Scan(value interface{}) error

Scan implement sql driver's Scan interface

func (*Time) UnmarshalBSONValue

func (t *Time) UnmarshalBSONValue(typo bsontype.Type, raw []byte) error

UnmarshalBSONValue implements bson.UnmarshalBSONValue interface

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in RFC 3339 format.

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value implement sql driver's Value interface

type TimeRange

type TimeRange struct {
	Start *time.Time
	End   *time.Time
}

type TitleItem

type TitleItem struct {
	BaseCfgItem `json:",inline"`
}

type Topo

type Topo struct {
	SetID   int64    `json:"bk_set_id" bson:"bk_set_id"`
	SetName string   `json:"bk_set_name" bson:"bk_set_name"`
	Module  []Module `json:"module" bson:"module"`
}

type TopoGraphics

type TopoGraphics struct {
	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"`
	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) 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"`
	HostCount            int64  `json:"host_count"`
	ServiceInstanceCount int64  `json:"service_instance_count,omitempty"`
	ServiceTemplateID    int64  `json:"service_template_id,omitempty"`
	SetTemplateID        int64  `json:"set_template_id,omitempty"`
	HostApplyEnabled     *bool  `json:"host_apply_enabled,omitempty"`
	HostApplyRuleCount   *int64 `json:"host_apply_rule_count,omitempty"`
}

TopoInst 实例拓扑结构

type TopoInstRst

type TopoInstRst struct {
	TopoInst `json:",inline"`
	Child    []*TopoInstRst `json:"child"`
}

TopoInstRst 拓扑实例

func (*TopoInstRst) DeepFirstTraverse

func (tir *TopoInstRst) DeepFirstTraverse(visitor TopoInstRstVisitor)

type TopoInstRstVisitor

type TopoInstRstVisitor func(tir *TopoInstRst)

type TopoInstance

type TopoInstance struct {
	ObjectID         string
	InstanceID       int64
	InstanceName     string
	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
	InstanceName string
	Detail       map[string]interface{}
}

func (*TopoInstanceNode) DeepFirstTraversal

func (node *TopoInstanceNode) DeepFirstTraversal(f func(node *TopoInstanceNode))

func (*TopoInstanceNode) Name

func (node *TopoInstanceNode) Name() string

func (*TopoInstanceNode) ToSimplify

func (node *TopoInstanceNode) ToSimplify() *TopoInstanceNodeSimplify

func (*TopoInstanceNode) TraversalFindModule

func (node *TopoInstanceNode) TraversalFindModule(targetID int64) []*TopoInstanceNode

func (*TopoInstanceNode) TraversalFindNode

func (node *TopoInstanceNode) TraversalFindNode(objectType string, targetID int64) []*TopoInstanceNode

common.BKInnerObjIDObject used for matching custom level node

type TopoInstanceNodeSimplify

type TopoInstanceNodeSimplify struct {
	ObjectID     string `json:"bk_obj_id" field:"bk_obj_id" mapstructure:"bk_obj_id"`
	InstanceID   int64  `json:"bk_inst_id" field:"bk_inst_id" mapstructure:"bk_inst_id"`
	InstanceName string `json:"bk_inst_name" field:"bk_inst_name" mapstructure:"bk_inst_name"`
}

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 extract 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 TopoNode

type TopoNode struct {
	ObjectID   string `field:"bk_obj_id" json:"bk_obj_id" mapstructure:"bk_obj_id"`
	InstanceID int64  `field:"bk_inst_id" json:"bk_inst_id" mapstructure:"bk_inst_id"`
}

func (TopoNode) Key

func (node TopoNode) Key() string

func (TopoNode) String

func (node TopoNode) String() string

type TopoNodeHostCount

type TopoNodeHostCount struct {
	Node      TopoNode `field:"topo_node" json:"topo_node" mapstructure:"topo_node"`
	HostCount int      `field:"host_count" json:"host_count" mapstructure:"host_count"`
}

type TopoPathResult

type TopoPathResult struct {
	Nodes []NodeTopoPath `json:"nodes" mapstructure:"nodes"`
}

type TransferException

type TransferException struct {
	HostID []int64 `json:"bk_host_id"`
	ErrMsg string  `json:"bk_error_msg"`
}

type TransferExceptionResult

type TransferExceptionResult struct {
	BaseResp `json:",inline"`
	Data     TransferException `json:"data"`
}

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 TransferHostResourceDirectory

type TransferHostResourceDirectory struct {
	ModuleID int64   `json:"bk_module_id"`
	HostID   []int64 `json:"bk_host_id"`
}

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 TransferHostWithAutoClearServiceInstanceOption

type TransferHostWithAutoClearServiceInstanceOption struct {
	HostIDs []int64 `field:"bk_host_ids" json:"bk_host_ids"`

	RemoveFromNode *TopoNode `field:"remove_from_node" json:"remove_from_node"`
	AddToModules   []int64   `field:"add_to_modules" json:"add_to_modules"`
	// 主机从 RemoveFromNode 移除后如果不再属于其它模块, 默认转移到空闲机模块
	// DefaultInternalModule 支持调整这种模型行为,可设置成待回收模块或者故障机模块
	DefaultInternalModule int64 `field:"default_internal_module" json:"default_internal_module"`

	Options TransferOptions `field:"options" json:"options"`
}

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 TransferOptions

type TransferOptions struct {
	ServiceInstanceOptions     []CreateServiceInstanceOption `field:"service_instance_options" json:"service_instance_options"`
	HostApplyConflictResolvers []HostApplyConflictResolver   `` /* 156-byte string literal not displayed */
}

type TxnCapable

type TxnCapable struct {
	Timeout   time.Duration `json:"timeout"`
	SessionID string        `json:"session_id"`
}

type TxnOption

type TxnOption struct {
	// transaction timeout time
	// min value: 5 * time.Second
	// default: 5min
	Timeout time.Duration
}

type Uint64DataResponse

type Uint64DataResponse struct {
	BaseResp `json:",inline"`
	Data     uint64 `json:"data"`
}

type Uint64Response

type Uint64Response struct {
	BaseResp `json:",inline"`
	Count    uint64 `json:"count"`
}

type UniqueKey

type UniqueKey struct {
	Kind string `json:"key_kind" bson:"key_kind"`
	ID   uint64 `json:"key_id" bson:"key_id"`
}

type UpdateAssociationObjectRequest

type UpdateAssociationObjectRequest struct {
	AsstName string `field:"bk_asst_name" json:"bk_asst_name" bson:"bk_asst_name"`
}

type UpdateAssociationObjectResult

type UpdateAssociationObjectResult struct {
	BaseResp `json:",inline"`
	Data     string `json:"data"`
}

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 UpdateAssociationTypeResult

type UpdateAssociationTypeResult struct {
	BaseResp `json:",inline"`
	Data     string `json:"data"`
}

type UpdateAttrIndexData

type UpdateAttrIndexData struct {
	Info  []*UpdateAttributeIndex `json:"info"`
	Count uint64                  `json:"count"`
}

type UpdateAttributeIndex

type UpdateAttributeIndex struct {
	Id    int64 `json:"id"`
	Index int64 `json:"index"`
}

UpdateAttributeIndex created bk_property_index info struct

type UpdateBusinessStatusOption

type UpdateBusinessStatusOption struct {
	BizName string `json:"bk_biz_name" mapstructure:"bk_biz_name"`
}

type UpdateGroupCondition

type UpdateGroupCondition struct {
	ModelBizID int64 `json:"bk_biz_id"`
	Condition  struct {
		ID int64 `field:"id" json:"id,omitempty"`
	} `json:"condition"`

	Data struct {
		IsCollapse *bool   `field:"is_collapse" json:"is_collapse,omitempty"`
		Name       *string `field:"bk_group_name" json:"bk_group_name,omitempty"`
		Index      *int64  `field:"bk_group_index" json:"bk_group_index,omitempty"`
	} `json:"data"`
}

UpdateGroupCondition update group condition struct

type UpdateHostApplyRuleOption

type UpdateHostApplyRuleOption struct {
	PropertyValue interface{} `field:"bk_property_value" json:"bk_property_value" bson:"bk_property_value" mapstructure:"bk_property_value"`
}

type UpdateHostByHostApplyRuleOption

type UpdateHostByHostApplyRuleOption struct {
	HostIDs []int64 `field:"bk_host_ids" json:"bk_host_ids" bson:"bk_host_ids" mapstructure:"bk_host_ids"`
}

type UpdateHostCloudAreaFieldOption

type UpdateHostCloudAreaFieldOption struct {
	BizID   int64   `field:"bk_biz_id" json:"bk_biz_id" mapstructure:"bk_biz_id"`
	HostIDs []int64 `field:"bk_host_ids" json:"bk_host_ids" mapstructure:"bk_host_ids"`
	CloudID int64   `field:"bk_cloud_id" json:"bk_cloud_id" mapstructure:"bk_cloud_id"`
}

type UpdateHostPropertyBatchParameter

type UpdateHostPropertyBatchParameter struct {
	Update []updateHostProperty `json:"update"`
}

UpdateHostPropertyBatchParameter batch update host property parameter

type UpdateID

type UpdateID struct {
	ObjID  string `json:"bk_obj_id" bson:"bk_obj_id"`
	InstID int64  `json:"bk_inst_id" bson:"bk_inst_id"`
}

type UpdateInstCount

type UpdateInstCount struct {
	ID    UpdateID `json:"id" bson:"_id"`
	Count int64    `json:"count" bson:"count"`
}

type UpdateModelAttrUnique

type UpdateModelAttrUnique struct {
	Data UpdateUniqueRequest `json:"data"`
}

type UpdateModuleHostApplyEnableStatusOption

type UpdateModuleHostApplyEnableStatusOption struct {
	Enable     bool `json:"enable" mapstructure:"enable"`
	ClearRules bool `json:"clear_rules" mapstructure:"clear_rules"`
}

type UpdateOption

type UpdateOption struct {
	Data      mapstr.MapStr `json:"data" mapstructure:"data"`
	Condition mapstr.MapStr `json:"condition" mapstructure:"condition"`
	// can edit all fields, including not editable properties, used by collectors
	CanEditAll bool `json:"can_edit_all" mapstructure:"can_edit_all"`
}

UpdateOption common update options

type UpdateParams

type UpdateParams struct {
	Condition map[string]interface{} `json:"condition"`
	Data      map[string]interface{} `json:"data"`
}

type UpdateProcessByIDsInput

type UpdateProcessByIDsInput struct {
	BizID      int64                  `json:"bk_biz_id"`
	ProcessIDs []int64                `json:"process_ids"`
	UpdateData map[string]interface{} `json:"update_data"`
}

func (*UpdateProcessByIDsInput) Validate

func (o *UpdateProcessByIDsInput) Validate() (rawError cErr.RawErrorInfo)

Validate validates the input param

type UpdateProcessTemplateInput

type UpdateProcessTemplateInput struct {
	BizID             int64                  `json:"bk_biz_id"`
	ProcessTemplateID int64                  `json:"process_template_id"`
	Property          map[string]interface{} `json:"process_property"`
}

type UpdateRawProcessInstanceInput

type UpdateRawProcessInstanceInput struct {
	BizID     int64                    `json:"bk_biz_id"`
	Processes []Process                `json:"-"`
	Raw       []map[string]interface{} `json:"processes"`
}

type UpdateResult

type UpdateResult struct {
	BaseResp `json:",inline"`
}

UpdateResult update result

type UpdateServiceTemplateOption

type UpdateServiceTemplateOption struct {
	BizID             int64  `field:"bk_biz_id" json:"bk_biz_id" bson:"bk_biz_id"`
	ID                int64  `field:"id" json:"id,omitempty" bson:"id"`
	Name              string `field:"name" json:"name,omitempty" bson:"name"`
	ServiceCategoryID int64  `field:"service_category_id" json:"service_category_id,omitempty" bson:"service_category_id"`
}

type UpdateSetTemplateOption

type UpdateSetTemplateOption struct {
	Name               string  `field:"name" json:"name" bson:"name"`
	ServiceTemplateIDs []int64 `field:"service_template_ids" json:"service_template_ids" bson:"service_template_ids"`
}

func (UpdateSetTemplateOption) Validate

func (option UpdateSetTemplateOption) Validate() (string, error)

type UpdateTopoGraphicsInput

type UpdateTopoGraphicsInput struct {
	Origin []TopoGraphics `field:"origin" json:"origin" bson:"origin"`
}

type UpdateUniqueRequest

type UpdateUniqueRequest struct {
	MustCheck bool        `json:"must_check" bson:"must_check"`
	Keys      []UniqueKey `json:"keys" bson:"keys"`
	LastTime  Time        `json:"last_time" bson:"last_time"`
}

type UpdateUniqueResult

type UpdateUniqueResult struct {
	BaseResp
}

type UpdatedAttrIndexResult

type UpdatedAttrIndexResult struct {
	BaseResp `json:",inline"`
	Data     *UpdateAttrIndexData `json:"data"`
}

UpdatedAttrIndexResult update attributes index result

type UpdatedCount

type UpdatedCount struct {
	Count uint64 `json:"updated_count"`
}

UpdatedCount created count struct

type UpdatedDataResult

type UpdatedDataResult struct {
	OriginIndex int64  `json:"origin_index"`
	ID          uint64 `json:"id"`
}

UpdatedDataResult common update operation result

type UpdatedOptionResult

type UpdatedOptionResult struct {
	BaseResp `json:",inline"`
	Data     UpdatedCount `json:"data" mapstructure:"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 UserCustomQueryDetailResult

type UserCustomQueryDetailResult struct {
	BaseResp `json:",inline"`
	Data     map[string]interface{} `json:"data"`
}

type UserInfo

type UserInfo struct {
	Qq          string `json:"qq"`
	Status      string `json:"status"`
	WxUserid    string `json:"wx_userid"`
	DisplayName string `json:"display_name"`
	Language    string `json:"language"`
	StaffStatus string `json:"staff_status"`
	BkUsername  string `json:"bk_username"`
	Telephone   string `json:"telephone"`
	BkRole      int    `json:"bk_role"`
	TimeZone    string `json:"time_zone"`
	Email       string `json:"email"`
}

type ValidationRulesCfg

type ValidationRulesCfg struct {
	Number                NumberItem                `json:"number"`
	Float                 FloatItem                 `json:"float"`
	Singlechar            SinglecharItem            `json:"singlechar"`
	Longchar              LongcharItem              `json:"longchar"`
	AssociationId         AssociationIdItem         `json:"associationId"`
	ClassifyId            ClassifyIdItem            `json:"classifyId"`
	ModelId               ModelIdItem               `json:"modelId"`
	EnumId                EnumIdItem                `json:"enumId"`
	EnumName              EnumNameItem              `json:"enumName"`
	FieldId               FieldIdItem               `json:"fieldId"`
	NamedCharacter        NamedCharacterItem        `json:"namedCharacter"`
	InstanceTagKey        InstanceTagKeyItem        `json:"instanceTagKey"`
	InstanceTagValue      InstanceTagValueItem      `json:"instanceTagValue"`
	BusinessTopoInstNames BusinessTopoInstNamesItem `json:"businessTopoInstNames"`
}

ValidationRulesCfg used to admin valiedation rules Config

func (ValidationRulesCfg) Validate

func (v ValidationRulesCfg) Validate() error

Validate validate the fields of ValidationRulesCfg

type Vpc

type Vpc struct {
	VpcId   string `json:"bk_vpc_id" bson:"bk_vpc_id"`
	VpcName string `json:"bk_vpc_name" bson:"bk_vpc_name"`
}

type VpcHostCntResult

type VpcHostCntResult struct {
	Count int64         `json:"count"`
	Info  []VpcSyncInfo `json:"info"`
}

type VpcInfo

type VpcInfo struct {
	VpcName string `json:"bk_vpc_name"`
	VpcID   string `json:"bk_vpc_id"`
	Region  string `json:"bk_region"`
}

type VpcInstances

type VpcInstances struct {
	Vpc       *VpcSyncInfo
	CloudID   int64 `json:"bk_cloud_id" bson:"bk_cloud_id"`
	Instances []*Instance
}

type VpcInstancesCnt

type VpcInstancesCnt struct {
	VpcId     string `json:"bk_vpc_id"`
	VpcName   string `json:"bk_vpc_name"`
	Region    string `json:"bk_region"`
	HostCount int64  `json:"bk_host_count"`
}

type VpcSyncInfo

type VpcSyncInfo struct {
	VpcID        string `json:"bk_vpc_id" bson:"bk_vpc_id"`
	VpcName      string `json:"bk_vpc_name" bson:"bk_vpc_name"`
	Region       string `json:"bk_region" bson:"bk_region"`
	VpcHostCount int64  `json:"bk_host_count" bson:"bk_host_count"`
	SyncDir      int64  `json:"bk_sync_dir,omitempty" bson:"bk_sync_dir,omitempty"`
	CloudID      int64  `json:"bk_cloud_id" bson:"bk_cloud_id"`
	// 该vpc在云端是否被销毁
	Destroyed bool `json:"destroyed" bson:"destroyed"`
}

type VpcsInfo

type VpcsInfo struct {
	Count  int64  `json:"count" bson:"count"`
	VpcSet []*Vpc `json:"vpc_set" bson:"vpc_set"`
}

Jump to

Keyboard shortcuts

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