Documentation ¶
Index ¶
- func IsNil(value interface{}) bool
- type BasePage
- type BaseResp
- type Client
- func (c *Client) CreateManyPod(bizID int64, data *CreateManyPod) (*CreatedManyOptionResult, error)
- func (c *Client) CreatePod(bizID int64, data *CreatePod) (*CreatedOneOptionResult, error)
- func (c *Client) DeletePod(bizID int64, data *DeletePod) (*DeletedOptionResult, error)
- func (c *Client) ESBGetBizLocation(username string, bizIDs []int64) (*ESBGetBizLocationResult, error)
- func (c *Client) ESBListHostsWithoutBiz(username string, req *ESBListHostsWitoutBizRequest) (*ESBListHostsWitoutBizResult, error)
- func (c *Client) ESBSearchBizInstTopo(username string, bizID int64) (*ESBSearchBizInstTopoResult, error)
- func (c *Client) ESBSearchBusiness(username string, condition map[string]interface{}) (*ESBSearchBusinessResult, error)
- func (c *Client) ESBTransferHostInBizModule(username string, bizID int64, hostIDs, moduleIDs []int64) (*ESBTransferHostModuleResult, error)
- func (c *Client) ListClusterPods(bizID int64, clusterID string) (*ListPodsResult, error)
- func (c *Client) SearchBusinessTopoWithStatistics(bizID int64) (*SearchBusinessTopoWithStatisticsResult, error)
- func (c *Client) SetCommonReq(args map[string]interface{})
- func (c *Client) SetDefaultHeader(h http.Header)
- func (c *Client) UpdatePod(bizID int64, data *UpdatePod) (*UpdatedOptionResult, error)
- type ClientInterface
- type CreateManyDataResult
- type CreateManyInfoResult
- type CreateManyPod
- type CreateOneDataResult
- type CreatePod
- type CreatedDataResult
- type CreatedManyOptionResult
- type CreatedOneOptionResult
- type DeleteOption
- type DeletePod
- type DeletedCount
- type DeletedOptionResult
- type ESBBaseResp
- type ESBBizLocation
- type ESBBusinessInfo
- type ESBBusinessInfoList
- type ESBGetBizLocationResult
- type ESBHostBsInfo
- type ESBHostInfo
- type ESBHostListInfo
- type ESBListHostsWitoutBizRequest
- type ESBListHostsWitoutBizResult
- type ESBSearchBizInstTopoResult
- type ESBSearchBusinessResult
- type ESBTopoInst
- type ESBTransferHostModuleResult
- type ExceptionResult
- type ListPods
- type ListPodsResult
- type MapStr
- func (cli MapStr) Bool(key string) (bool, error)
- func (cli MapStr) Clone() MapStr
- func (cli MapStr) Different(target MapStr) (more MapStr, less MapStr, changes MapStr)
- func (cli MapStr) Exists(key string) bool
- func (cli MapStr) Float(key string) (float64, error)
- func (cli MapStr) ForEach(callItem func(key string, val interface{}) error) error
- func (cli MapStr) Get(key string) (val interface{}, exists bool)
- func (cli MapStr) Int64(key string) (int64, error)
- func (cli MapStr) IsEmpty() bool
- func (cli MapStr) MapStr(key string) (MapStr, error)
- func (cli MapStr) MapStrArray(key string) ([]MapStr, error)
- func (cli MapStr) MarshalJSONInto(target interface{}) error
- func (cli MapStr) Merge(second MapStr)
- func (cli MapStr) Remove(key string) interface{}
- func (cli MapStr) Reset()
- func (cli MapStr) Set(key string, value interface{})
- func (cli MapStr) String(key string) (string, error)
- func (cli MapStr) Time(key string) (*time.Time, error)
- func (cli MapStr) ToJSON() ([]byte, error)
- func (cli MapStr) ToMapInterface() map[string]interface{}
- type QueryResult
- type RepeatedDataResult
- type SearchBusinessTopoWithStatisticsResult
- type TopoInst
- type TopoInstRst
- type UpdateOption
- type UpdatePod
- type UpdatedCount
- type UpdatedOptionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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
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"` }
BaseResp common result struct
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client paas cmdb client
func NewClientInterface ¶
NewClientInterface create client interface
func (*Client) CreateManyPod ¶
func (c *Client) CreateManyPod(bizID int64, data *CreateManyPod) (*CreatedManyOptionResult, error)
CreateManyPod create many pod
func (*Client) CreatePod ¶
func (c *Client) CreatePod(bizID int64, data *CreatePod) (*CreatedOneOptionResult, error)
CreatePod create pod
func (*Client) DeletePod ¶
func (c *Client) DeletePod(bizID int64, data *DeletePod) (*DeletedOptionResult, error)
DeletePod delete pod
func (*Client) ESBGetBizLocation ¶
func (c *Client) ESBGetBizLocation(username string, bizIDs []int64) (*ESBGetBizLocationResult, error)
ESBGetBizLocation get biz location
func (*Client) ESBListHostsWithoutBiz ¶
func (c *Client) ESBListHostsWithoutBiz(username string, req *ESBListHostsWitoutBizRequest) ( *ESBListHostsWitoutBizResult, error)
ESBListHostsWithoutBiz list hosts without biz
func (*Client) ESBSearchBizInstTopo ¶
func (c *Client) ESBSearchBizInstTopo(username string, bizID int64) (*ESBSearchBizInstTopoResult, error)
ESBSearchBizInstTopo search biz instance topo
func (*Client) ESBSearchBusiness ¶
func (c *Client) ESBSearchBusiness(username string, condition map[string]interface{}) ( *ESBSearchBusinessResult, error)
ESBSearchBusiness search business
func (*Client) ESBTransferHostInBizModule ¶
func (c *Client) ESBTransferHostInBizModule(username string, bizID int64, hostIDs, moduleIDs []int64) ( *ESBTransferHostModuleResult, error)
ESBTransferHostInBizModule transfer host in biz
func (*Client) ListClusterPods ¶
func (c *Client) ListClusterPods(bizID int64, clusterID string) (*ListPodsResult, error)
ListClusterPods list cluster pods
func (*Client) SearchBusinessTopoWithStatistics ¶
func (c *Client) SearchBusinessTopoWithStatistics(bizID int64) (*SearchBusinessTopoWithStatisticsResult, error)
SearchBusinessTopoWithStatistics implements client interface
func (*Client) SetCommonReq ¶
SetCommonReq set base req
func (*Client) SetDefaultHeader ¶
SetDefaultHeader set default headers
type ClientInterface ¶
type ClientInterface interface { // container server CreatePod(bizID int64, data *CreatePod) (*CreatedOneOptionResult, error) CreateManyPod(bizID int64, data *CreateManyPod) (*CreatedManyOptionResult, error) UpdatePod(bizID int64, data *UpdatePod) (*UpdatedOptionResult, error) DeletePod(bizID int64, data *DeletePod) (*DeletedOptionResult, error) ListClusterPods(bizID int64, clusterID string) (*ListPodsResult, error) // topo server SearchBusinessTopoWithStatistics(bizID int64) (*SearchBusinessTopoWithStatisticsResult, error) // interfaces through esb // 如果是通过ESB的请求,所有的参数都在post请求体中 ESBSearchBusiness(username string, condition map[string]interface{}) (*ESBSearchBusinessResult, error) ESBSearchBizInstTopo(username string, bizID int64) (*ESBSearchBizInstTopoResult, error) ESBTransferHostInBizModule(username string, bizID int64, hostIDs, moduleIDs []int64) ( *ESBTransferHostModuleResult, error) ESBListHostsWithoutBiz(username string, req *ESBListHostsWitoutBizRequest) (*ESBListHostsWitoutBizResult, error) ESBGetBizLocation(username string, bizIDs []int64) (*ESBGetBizLocationResult, error) }
ClientInterface client interface for cmdb
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 CreateManyPod ¶
type CreateManyPod struct {
PodList []MapStr `json:"pod_list" mapstructure:"pod_list"`
}
CreateManyPod request for CreateManyPod
type CreateOneDataResult ¶
type CreateOneDataResult struct {
Created CreatedDataResult `json:"created"`
}
CreateOneDataResult the data struct definition in create one function result
type CreatePod ¶
type CreatePod struct {
Pod MapStr `json:"pod" mapstructure:"pod"`
}
CreatePod request for CreatePod
type CreatedDataResult ¶
CreatedDataResult common created result definition
type CreatedManyOptionResult ¶
type CreatedManyOptionResult struct { BaseResp `json:",inline"` Data CreateManyDataResult `json:"data"` }
CreatedManyOptionResult create many api http response return this result struct
type CreatedOneOptionResult ¶
type CreatedOneOptionResult struct { BaseResp `json:",inline"` Data CreateOneDataResult `json:"data"` }
CreatedOneOptionResult create One api http response return this result struct
type DeleteOption ¶
type DeleteOption struct {
Condition MapStr `json:"condition"`
}
DeleteOption common delete condition options
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"` }
DeletedOptionResult delete api http response return result struct
type ESBBaseResp ¶
type ESBBaseResp struct { Code int64 `json:"code"` Result bool `json:"result"` Message string `json:"message"` ReqeustID string `json:"request_id,omitempty"` }
ESBBaseResp base resp from esb
type ESBBizLocation ¶
type ESBBizLocation struct { BkBizID int64 `json:"bk_biz_id"` BkLocation string `json:"bk_location"` }
ESBBizLocation struct for biz location
type ESBBusinessInfo ¶
type ESBBusinessInfo struct { BkAlarmRvcMan string `json:"bk_alarm_rvc_man"` BkAppAbbr string `json:"bk_app_abbr"` BkAppDevBak string `json:"bk_app_dev_bak"` BkAppDevteam string `json:"bk_app_devteam"` BkAppDirector string `json:"bk_app_director"` BkAppForumURL string `json:"bk_app_forum_url"` BkAppGameTypeid string `json:"bk_app_game_typeid"` BkAppImptLevel string `json:"bk_app_impt_level"` BkAppOperManual string `json:"bk_app_oper_manual"` BkAppSummary string `json:"bk_app_summary"` BkAppType string `json:"bk_app_type"` BkAppURL string `json:"bk_app_url"` BkAppUserManual string `json:"bk_app_user_manual"` BkArcDoc string `json:"bk_arc_doc"` BkBipAppName string `json:"bk_bip_app_name"` BkBipID string `json:"bk_bip_id"` BkBizDeveloper string `json:"bk_biz_developer"` BkBizID int64 `json:"bk_biz_id"` BkBizMaintainer string `json:"bk_biz_maintainer"` BkBizName string `json:"bk_biz_name"` BkBizProductor string `json:"bk_biz_productor"` BkBizTester string `json:"bk_biz_tester"` BkDbaBak string `json:"bk_dba_bak"` BkDeptNameID string `json:"bk_dept_name_id"` BkIdipID string `json:"bk_idip_id"` BkIsBip string `json:"bk_is_bip"` BkMblQqAppid string `json:"bk_mbl_qq_appid"` BkOperGrpName string `json:"bk_oper_grp_name"` BkOperGrpNameID int64 `json:"bk_oper_grp_name_id"` BkOperPlan string `json:"bk_oper_plan"` BkOperateDeptID int64 `json:"bk_operate_dept_id"` BkOperateDeptName string `json:"bk_operate_dept_name"` BkPmpCmMan string `json:"bk_pmp_cm_man"` BkPmpCmreqman string `json:"bk_pmp_cmreqman"` BkPmpComPlot string `json:"bk_pmp_com_plot"` BkPmpDbaMajor string `json:"bk_pmp_dba_major"` BkPmpGroupUser string `json:"bk_pmp_group_user"` BkPmpIdipMan string `json:"bk_pmp_idip_man"` BkPmpLogo string `json:"bk_pmp_logo"` BkPmpOpeExpert string `json:"bk_pmp_ope_expert"` BkPmpOpePm string `json:"bk_pmp_ope_pm"` BkPmpOperDevMan string `json:"bk_pmp_oper_dev_man"` BkPmpOssMan string `json:"bk_pmp_oss_man"` BkPmpPotlMan string `json:"bk_pmp_potl_man"` BkPmpQa string `json:"bk_pmp_qa"` BkPmpQc string `json:"bk_pmp_qc"` BkPmpSa string `json:"bk_pmp_sa"` BkPmpSafeMan string `json:"bk_pmp_safe_man"` BkPmpSensCol string `json:"bk_pmp_sens_col"` BkPmpSvcPm string `json:"bk_pmp_svc_pm"` BkPmpTestTm string `json:"bk_pmp_test_tm"` BkProductName string `json:"bk_product_name"` BkSourceID int64 `json:"bk_source_id"` BkSupplierAccount string `json:"bk_supplier_account"` BkTclsID string `json:"bk_tcls_id"` BkTcmID string `json:"bk_tcm_id"` BkTestResource string `json:"bk_test_resource"` BkTlogMan string `json:"bk_tlog_man"` BkVaskeyID string `json:"bk_vaskey_id"` BkVipdlID string `json:"bk_vipdl_id"` BkVisitorAppid string `json:"bk_visitor_appid"` BkWechatAppid string `json:"bk_wechat_appid"` Bs2NameID int64 `json:"bs2_name_id"` BusinessDeptID int64 `json:"business_dept_id"` BusinessDeptName string `json:"business_dept_name"` Default int64 `json:"default"` Language string `json:"language"` LastTime interface{} `json:"last_time"` LifeCycle string `json:"life_cycle"` Operator string `json:"operator"` TimeZone string `json:"time_zone"` }
ESBBusinessInfo business info struct
type ESBBusinessInfoList ¶
type ESBBusinessInfoList struct { Count int64 `json:"count"` Info []ESBBusinessInfo `json:"info"` }
ESBBusinessInfoList business info list for search business result
type ESBGetBizLocationResult ¶
type ESBGetBizLocationResult struct { ESBBaseResp `json:",inline"` Data []ESBBizLocation `json:"data"` }
ESBGetBizLocationResult result for get biz location
type ESBHostBsInfo ¶
type ESBHostBsInfo struct { Bs3Name string `json:"bs3_name"` Bs3NameID int64 `json:"bs3_name_id"` Bs1NameID int64 `json:"bs1_name_id"` Bs2NameID int64 `json:"bs2_name_id"` Bs2Name string `json:"bs2_name"` Bs1Name string `json:"bs1_name"` }
ESBHostBsInfo bk bs info for host
type ESBHostInfo ¶
type ESBHostInfo struct { BkIspName string `json:"bk_isp_name"` Domain string `json:"domain"` OuterNetworkSegment string `json:"outer_network_segment"` NetStructID int64 `json:"net_struct_id"` BkOsName string `json:"bk_os_name"` SrvOutBandManageType string `json:"srv_out_band_manage_type"` BkSvcIDArr string `json:"bk_svc_id_arr"` BkHostID int64 `json:"bk_host_id"` BkOsVersion string `json:"bk_os_version"` BkPositionName string `json:"bk_position_name"` BkHostName string `json:"bk_host_name"` BkStrVersion string `json:"bk_str_version"` IdcUnitID int64 `json:"idc_unit_id"` BkLogicZoneID string `json:"bk_logic_zone_id"` BkProduct string `json:"bk_product"` BkIdcAreaID int64 `json:"bk_idc_area_id"` SubZoneID string `json:"sub_zone_id"` BkIPOperName string `json:"bk_ip_oper_name"` BkInnerNetIdc string `json:"bk_inner_net_idc"` BkComment string `json:"bk_comment"` BkBsInfo []ESBHostBsInfo `json:"bk_bs_info"` Dbrole string `json:"dbrole"` SrvStatus string `json:"srv_status"` BkBakOperator string `json:"bk_bak_operator"` BkLogicZone string `json:"bk_logic_zone"` IdcID int64 `json:"idc_id"` BkIsVirtual string `json:"bk_is_virtual"` Operator string `json:"operator"` BkSvrDeviceClsName string `json:"bk_svr_device_cls_name"` IdcCityID int64 `json:"idc_city_id"` NetStructName string `json:"net_struct_name"` SvrInputTime time.Time `json:"svr_input_time"` ClassifyLevelName string `json:"classify_level_name"` BkHostInnerip string `json:"bk_host_innerip"` RackID string `json:"rack_id"` IFix string `json:"接入iFix"` RaidID string `json:"raid_id"` HardMemo string `json:"hard_memo"` OuterSwitchPort string `json:"outer_switch_port"` SvrFirstTime time.Time `json:"svr_first_time"` LogicDomain string `json:"logic_domain"` BkAssetID string `json:"bk_asset_id"` IdcName string `json:"idc_name"` SvrTypeName string `json:"svr_type_name"` BkCloudID int64 `json:"bk_cloud_id"` SvrID int64 `json:"svr_id"` BkSLA string `json:"bk_sla"` BkOuterEquipID string `json:"bk_outer_equip_id"` RaidName string `json:"raid_name"` BkSvrTypeID int64 `json:"bk_svr_type_id"` InnerSwitchPort string `json:"inner_switch_port"` BkHostOuterip string `json:"bk_host_outerip"` SvrDeviceTypeID int64 `json:"svr_device_type_id"` GroupName string `json:"group_name"` BkSn string `json:"bk_sn"` SvrDeviceID string `json:"svr_device_id"` LogicDomainID string `json:"logic_domain_id"` InnerNetworkSegment string `json:"inner_network_segment"` SvrDeviceClass string `json:"svr_device_class"` IdcCityName string `json:"idc_city_name"` IdcUnitName string `json:"idc_unit_name"` BkInnerSwitchIP string `json:"bk_inner_switch_ip"` SubZone string `json:"sub_zone"` Rack string `json:"rack"` NetDeviceID string `json:"net_device_id"` SrvImportantLevel string `json:"srv_important_level"` DeptName string `json:"dept_name"` BkInnerEquipID string `json:"bk_inner_equip_id"` BkServiceArr string `json:"bk_service_arr"` BkZoneName string `json:"bk_zone_name"` BkOuterSwitchIP string `json:"bk_outer_switch_ip"` BkSupplierAccount string `json:"bk_supplier_account"` SvrDeviceTypeName string `json:"svr_device_type_name"` ModuleName string `json:"module_name"` BkManageType string `json:"bk_manage_type"` IsSpecial string `json:"is_special"` BkIdcArea string `json:"bk_idc_area"` }
ESBHostInfo host info
type ESBHostListInfo ¶
type ESBHostListInfo struct { Count int64 `json:"count"` Info []ESBHostInfo `json:"info"` }
ESBHostListInfo host list info
type ESBListHostsWitoutBizRequest ¶
type ESBListHostsWitoutBizRequest struct { Page *BasePage `json:"page"` BkBizID int64 `json:"bk_biz_id"` HostPropertyFilter map[string]interface{} `json:"host_property_filter,omitempty"` }
ESBListHostsWitoutBizRequest request for list biz hosts
type ESBListHostsWitoutBizResult ¶
type ESBListHostsWitoutBizResult struct { ESBBaseResp `json:",inline"` Data *ESBHostListInfo `json:"data"` }
ESBListHostsWitoutBizResult result for list biz hosts
type ESBSearchBizInstTopoResult ¶
type ESBSearchBizInstTopoResult struct { ESBBaseResp `json:",inline"` Data *ESBTopoInst `json:"data"` }
ESBSearchBizInstTopoResult result for search business inst topo
type ESBSearchBusinessResult ¶
type ESBSearchBusinessResult struct { ESBBaseResp `json:",inline"` Data *ESBBusinessInfoList `json:"data"` }
ESBSearchBusinessResult result for search business
type ESBTopoInst ¶
type ESBTopoInst struct { HostCount int64 `json:"host_count"` Default int64 `json:"default"` BkObjName string `json:"bk_obj_name"` BkObjID string `json:"bk_obj_id"` Child []ESBTopoInst `json:"child"` BkInstID int64 `json:"bk_inst_id"` BkInstName string `json:"bk_inst_name"` }
ESBTopoInst topo instance
type ESBTransferHostModuleResult ¶
type ESBTransferHostModuleResult struct {
ESBBaseResp `json:",inline"`
}
ESBTransferHostModuleResult result for transfer host module
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 ListPods ¶
type ListPods struct { BizID int64 `json:"bk_biz_id"` SetIDs []int64 `json:"bk_set_ids"` ModuleIDs []int64 `json:"bk_module_ids"` Fields []string `json:"fields"` Page BasePage `json:"page"` }
ListPods request for ListPods
type ListPodsResult ¶
type ListPodsResult struct { BaseResp `json:",inline"` Data *QueryResult `json:"data"` }
ListPodsResult response for ListPod
type MapStr ¶
type MapStr map[string]interface{}
MapStr the common event data definition
func (MapStr) Different ¶
Different the current value is different from the content of the given data
func (MapStr) MapStrArray ¶
MapStrArray get the MapStr object array
func (MapStr) MarshalJSONInto ¶
MarshalJSONInto convert to the input value
func (MapStr) Merge ¶
Merge merge second into self,if the key is the same then the new value replaces the old value.
func (MapStr) ToMapInterface ¶
ToMapInterface convert to map[string]interface{}
type QueryResult ¶
type QueryResult struct { Count uint64 `json:"count"` Info []json.RawMessage `json:"info"` }
QueryResult common query result
type RepeatedDataResult ¶
type RepeatedDataResult struct { OriginIndex int64 `json:"origin_index"` Data MapStr `json:"data"` }
RepeatedDataResult repeated data
type SearchBusinessTopoWithStatisticsResult ¶
type SearchBusinessTopoWithStatisticsResult struct { BaseResp Data []*TopoInstRst `json:"data"` }
SearchBusinessTopoWithStatisticsResult result of SearchBusinessTopoWithStatistics
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 拓扑实例
type UpdateOption ¶
type UpdateOption struct { Data MapStr `json:"data" mapstructure:"data"` Condition MapStr `json:"condition" mapstructure:"condition"` }
UpdateOption common update options
type UpdatedCount ¶
type UpdatedCount struct {
Count uint64 `json:"updated_count"`
}
UpdatedCount created count struct
type UpdatedOptionResult ¶
type UpdatedOptionResult struct { BaseResp `json:",inline"` Data UpdatedCount `json:"data" mapstructure:"data"` }
UpdatedOptionResult common update result