service

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: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppResult

type AppResult struct {
	Result  bool        `json:"result"`
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
	Data    DataInfo    `json:"data"`
}

type DataInfo

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

type Service

type Service struct {
	*options.Config
	*backbone.Engine

	CacheDB     *redis.Client
	AuthManager *extensions.AuthManager
	EnableTxn   bool
	Logic       *logics.Logics
	// contains filtered or unexported fields
}

func (*Service) AddHost

func (s *Service) AddHost(ctx *rest.Contexts)

add host to host resource pool

func (*Service) AddHostFavourite

func (s *Service) AddHostFavourite(ctx *rest.Contexts)

func (*Service) AddHostFromAgent deprecated

func (s *Service) AddHostFromAgent(ctx *rest.Contexts)

Deprecated:

func (*Service) AddHostToResourcePool

func (s *Service) AddHostToResourcePool(ctx *rest.Contexts)

add host to resource pool, returns bk_host_id of the successfully added hosts

func (*Service) AddUserCustomQuery

func (s *Service) AddUserCustomQuery(ctx *rest.Contexts)

func (*Service) AssignHostToApp

func (s *Service) AssignHostToApp(ctx *rest.Contexts)

AssignHostToApp transfer host from resource pool to idle module

func (*Service) BKSystemInstall

func (s *Service) BKSystemInstall(ctx *rest.Contexts)

BKSystemInstall 蓝鲸组件机器安装agent,主机写入cmdb 描述: 1. 只能操作蓝鲸业务 2. 不能将主机转移到空闲机和故障机等内置模块 3. 不会删除主机已经存在的主机模块, 只会新加主机与模块。 4. 不存在的主机会新加, 规则通过内网IP和 cloud id 判断主机是否存在 4. 进程不存在不报错

func (*Service) BatchCreateOrUpdateHostApplyRule

func (s *Service) BatchCreateOrUpdateHostApplyRule(ctx *rest.Contexts)

func (*Service) CloneHostProperty

func (s *Service) CloneHostProperty(ctx *rest.Contexts)

CloneHostProperty clone host property from src host to dst host

func (*Service) CountTopoNodeHosts

func (s *Service) CountTopoNodeHosts(ctx *rest.Contexts)

func (*Service) CreateHostApplyRule

func (s *Service) CreateHostApplyRule(ctx *rest.Contexts)

func (*Service) CreatePlat

func (s *Service) CreatePlat(ctx *rest.Contexts)

CreatePlat create a plat instance available fields for body are last_time, bk_cloud_name, bk_supplier_account, bk_cloud_id, create_time {"bk_cloud_name": "云区域", "bk_supplier_account": 0}

func (*Service) CreatePlatBatch

func (s *Service) CreatePlatBatch(ctx *rest.Contexts)

CreatePlatBatch create plat instance in batch

func (*Service) DeleteHostApplyRule

func (s *Service) DeleteHostApplyRule(ctx *rest.Contexts)

func (*Service) DeleteHostBatchFromResourcePool

func (s *Service) DeleteHostBatchFromResourcePool(ctx *rest.Contexts)

delete hosts from resource pool

func (*Service) DeleteHostFavouriteByID

func (s *Service) DeleteHostFavouriteByID(ctx *rest.Contexts)

func (*Service) DeleteHostFromBusiness

func (s *Service) DeleteHostFromBusiness(ctx *rest.Contexts)

DeleteHostFromBusiness delete host from business dangerous operation

func (*Service) DeletePlat

func (s *Service) DeletePlat(ctx *rest.Contexts)

func (*Service) DeleteUserCustomQuery

func (s *Service) DeleteUserCustomQuery(ctx *rest.Contexts)

func (*Service) FindHostsByServiceTemplates

func (s *Service) FindHostsByServiceTemplates(ctx *rest.Contexts)

FindHostsByServiceTemplates find hosts by service templates

func (*Service) FindHostsBySetTemplates

func (s *Service) FindHostsBySetTemplates(ctx *rest.Contexts)

FindHostsBySetTemplates find hosts by set templates

func (*Service) FindHostsByTopo

func (s *Service) FindHostsByTopo(ctx *rest.Contexts)

FindHostsByTopo find hosts by topo node except for biz

func (*Service) FindManyCloudArea

func (s *Service) FindManyCloudArea(ctx *rest.Contexts)

FindManyCloudArea find cloud area list

func (*Service) FindModuleHost

func (s *Service) FindModuleHost(ctx *rest.Contexts)

func (*Service) FindModuleHostRelation

func (s *Service) FindModuleHostRelation(ctx *rest.Contexts)

FindModuleHostRelation find host with module by module id

func (*Service) FindSystemUserConfigBKSwitch

func (s *Service) FindSystemUserConfigBKSwitch(ctx *rest.Contexts)

func (*Service) GenerateApplyPlan

func (s *Service) GenerateApplyPlan(ctx *rest.Contexts)

func (*Service) GetAppHostTopoRelation

func (s *Service) GetAppHostTopoRelation(ctx *rest.Contexts)

GetAppHostTopoRelation query host and module relation, hostID can empty

func (*Service) GetHostApplyRule

func (s *Service) GetHostApplyRule(ctx *rest.Contexts)

func (*Service) GetHostInstanceProperties

func (s *Service) GetHostInstanceProperties(ctx *rest.Contexts)

func (*Service) GetHostModuleRelation

func (s *Service) GetHostModuleRelation(ctx *rest.Contexts)

GetHostModuleRelation query host and module relation, hostID can empty

func (*Service) GetModelDefaultCustom

func (s *Service) GetModelDefaultCustom(ctx *rest.Contexts)

GetModelDefaultCustom 获取模型在列表页面展示字段

func (*Service) GetUserCustom

func (s *Service) GetUserCustom(ctx *rest.Contexts)

func (*Service) GetUserCustomQuery

func (s *Service) GetUserCustomQuery(ctx *rest.Contexts)

func (*Service) GetUserCustomQueryDetail

func (s *Service) GetUserCustomQueryDetail(ctx *rest.Contexts)

func (*Service) GetUserCustomQueryResult

func (s *Service) GetUserCustomQueryResult(ctx *rest.Contexts)

func (*Service) Healthz

func (s *Service) Healthz(req *restful.Request, resp *restful.Response)

func (*Service) HostSnapInfo

func (s *Service) HostSnapInfo(ctx *rest.Contexts)

HostSnapInfo return host state

func (*Service) HostSnapInfoBatch

func (s *Service) HostSnapInfoBatch(ctx *rest.Contexts)

HostSnapInfoBatch get the host snapshot in batch

func (*Service) IncrHostFavouritesCount

func (s *Service) IncrHostFavouritesCount(ctx *rest.Contexts)

func (*Service) ListBizHosts

func (s *Service) ListBizHosts(ctx *rest.Contexts)

ListHosts list host under business specified by path parameter

func (*Service) ListBizHostsTopo

func (s *Service) ListBizHostsTopo(ctx *rest.Contexts)

ListBizHostsTopo list hosts under business specified by path parameter with their topology information

func (*Service) ListHostApplyRule

func (s *Service) ListHostApplyRule(ctx *rest.Contexts)

func (*Service) ListHostFavourites

func (s *Service) ListHostFavourites(ctx *rest.Contexts)

func (*Service) ListHostRelatedApplyRule

func (s *Service) ListHostRelatedApplyRule(ctx *rest.Contexts)

ListHostRelatedApplyRule 返回主机关联的规则信息(仅返回启用模块的规则)

func (*Service) ListHostsWithNoBiz

func (s *Service) ListHostsWithNoBiz(ctx *rest.Contexts)

ListHostsWithNoBiz list host for no biz case merely

func (*Service) ListResourcePoolHosts

func (s *Service) ListResourcePoolHosts(ctx *rest.Contexts)

func (*Service) LockHost

func (s *Service) LockHost(ctx *rest.Contexts)

func (*Service) MoveHost2FaultModule

func (s *Service) MoveHost2FaultModule(ctx *rest.Contexts)

func (*Service) MoveHost2IdleModule

func (s *Service) MoveHost2IdleModule(ctx *rest.Contexts)

func (*Service) MoveHost2RecycleModule

func (s *Service) MoveHost2RecycleModule(ctx *rest.Contexts)

func (*Service) MoveHostToResourcePool

func (s *Service) MoveHostToResourcePool(ctx *rest.Contexts)

func (*Service) MoveSetHost2IdleModule

func (s *Service) MoveSetHost2IdleModule(ctx *rest.Contexts)

MoveSetHost2IdleModule bk_set_id and bk_module_id cannot be empty at the same time Remove the host from the module or set. The host belongs to the current module or host only, and puts the host into the idle machine of the current service. When the host data is in multiple modules or sets. Disconnect the host from the module or set only TODO: used by v2 version, remove this api when v2 is offline.

func (*Service) NewHostSyncAppTopo

func (s *Service) NewHostSyncAppTopo(ctx *rest.Contexts)

NewHostSyncAppTopo add new hosts to the business synchronize hosts directly to a module in a business if this host does not exist. otherwise, this operation will only change host's attribute. TODO: used by framework.

func (*Service) QueryHostLock

func (s *Service) QueryHostLock(ctx *rest.Contexts)

func (*Service) RunHostApplyRule

func (s *Service) RunHostApplyRule(ctx *rest.Contexts)

func (*Service) SaveModelDefaultCustom

func (s *Service) SaveModelDefaultCustom(ctx *rest.Contexts)

SaveModelDefaultCustom 设置模型在列表页面展示字段

func (*Service) SaveUserCustom

func (s *Service) SaveUserCustom(ctx *rest.Contexts)

func (*Service) SearchHost

func (s *Service) SearchHost(ctx *rest.Contexts)

func (*Service) SearchHostWithAsstDetail

func (s *Service) SearchHostWithAsstDetail(ctx *rest.Contexts)

func (*Service) TransferHostAcrossBusiness

func (s *Service) TransferHostAcrossBusiness(ctx *rest.Contexts)

TransferHostAcrossBusiness Transfer host across business, delete old business host and module relation

func (*Service) TransferHostModule

func (s *Service) TransferHostModule(ctx *rest.Contexts)

HostModuleRelation transfer host to module specify by bk_module_id (in the same business) move a business host to a module.

func (*Service) TransferHostResourceDirectory

func (s *Service) TransferHostResourceDirectory(ctx *rest.Contexts)

func (*Service) TransferHostWithAutoClearServiceInstance

func (s *Service) TransferHostWithAutoClearServiceInstance(ctx *rest.Contexts)

TransferHostWithAutoClearServiceInstance 主机转移接口(带服务实例自动清除功能) 1. 将主机 bk_host_ids 从 remove_from_node 指定的拓扑节点移除 2. 移入到 add_to_modules 指定的模块中 3. 自动删除主机在移除模块下的服务实例 4. 自动添加主机在新模块上的服务实例 note: - 不允许 remove_from_node 和 add_to_modules 同时为空 - bk_host_ids 不允许为空 - 如果 remove_from_node 指定为业务ID,则接口行为是:覆盖更新 - 如果 remove_from_node 没有指定,仅仅是增量更新,无移除操作 - 如果 add_to_modules 没有指定,主机将仅仅从 remove_from_node 指定的模块中移除 - 如果 add_to_modules 是空先机/故障机/待回收模块中的一个,必须显式指定 remove_from_node(可指定成业务节点), 否则报主机不能属于互斥模块错误 - 如果 add_to_modules 是普通模块,主机当前数据空先机/故障机/待回收模块中的一个,必须显式指定 remove_from_node(可指定成业务节点), 否则报主机不能属于互斥模块错误 - 模块同时出现在 add_to_modules 和 remove_from_node 时,不会导致对应的服务实例被删除然后重新添加

func (*Service) TransferHostWithAutoClearServiceInstancePreview

func (s *Service) TransferHostWithAutoClearServiceInstancePreview(ctx *rest.Contexts)

TransferHostWithAutoClearServiceInstancePreview generate a preview of changes for TransferHostWithAutoClearServiceInstance operation 接口请求参数跟转移是一致的 主机从模块删除时提供了将要删除的服务实例信息 主机添加到新模块时,提供了模块对应的服务模板(如果有)

func (*Service) UnlockHost

func (s *Service) UnlockHost(ctx *rest.Contexts)

func (*Service) UpdateHostApplyRule

func (s *Service) UpdateHostApplyRule(ctx *rest.Contexts)

func (*Service) UpdateHostBatch

func (s *Service) UpdateHostBatch(ctx *rest.Contexts)

func (*Service) UpdateHostCloudAreaField

func (s *Service) UpdateHostCloudAreaField(ctx *rest.Contexts)

func (*Service) UpdateHostFavouriteByID

func (s *Service) UpdateHostFavouriteByID(ctx *rest.Contexts)

func (*Service) UpdateHostPropertyBatch

func (s *Service) UpdateHostPropertyBatch(ctx *rest.Contexts)

func (*Service) UpdateImportHosts

func (s *Service) UpdateImportHosts(ctx *rest.Contexts)

UpdateImportHosts update excel import hosts

func (*Service) UpdatePlat

func (s *Service) UpdatePlat(ctx *rest.Contexts)

func (*Service) UpdateUserCustomQuery

func (s *Service) UpdateUserCustomQuery(ctx *rest.Contexts)

func (*Service) WebService

func (s *Service) WebService() *restful.Container

Jump to

Keyboard shortcuts

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