Documentation ¶
Index ¶
- Constants
- type Attribute
- func (m *Attribute) CreateObjectAttribute(data types.MapStr) (int, error)
- func (m *Attribute) DeleteObjectAttribute(cond common.Condition) error
- func (m *Attribute) SearchObjectAttributes(cond common.Condition) ([]types.MapStr, error)
- func (m *Attribute) UpdateObjectAttribute(data types.MapStr, cond common.Condition) error
- type AttributeGetter
- type AttributeInterface
- type Business
- type BusinessGetter
- type BusinessInterface
- type CCV3Interface
- type Classification
- func (m *Classification) CreateClassification(data types.MapStr) (int, error)
- func (m *Classification) DeleteClassification(cond common.Condition) error
- func (m *Classification) SearchClassificationWithObjects(cond common.Condition) ([]types.MapStr, error)
- func (m *Classification) SearchClassifications(cond common.Condition) ([]types.MapStr, error)
- func (m *Classification) UpdateClassification(data types.MapStr, cond common.Condition) error
- type ClassificationGetter
- type ClassificationInterface
- type Client
- func (cli *Client) Attribute() AttributeInterface
- func (cli *Client) Business() BusinessInterface
- func (cli *Client) Classification() ClassificationInterface
- func (cli *Client) CommonInst() CommonInstInterface
- func (cli *Client) GetAddress() string
- func (cli *Client) GetSupplierAccount() string
- func (cli *Client) GetUser() string
- func (cli *Client) Group() GroupInterface
- func (cli *Client) Host() HostInterface
- func (cli *Client) Model() ModelInterface
- func (cli *Client) Module() ModuleInterface
- func (cli *Client) Set() SetInterface
- func (cli *Client) SetAddress(address string)
- func (cli *Client) SetSupplierAccount(supplierAccount string)
- func (cli *Client) SetUser(user string)
- type CommonInst
- func (m *CommonInst) CreateCommonInst(data types.MapStr) (int, error)
- func (m *CommonInst) DeleteCommonInst(cond common.Condition) error
- func (m *CommonInst) SearchInst(cond common.Condition) ([]types.MapStr, error)
- func (m *CommonInst) UpdateCommonInst(data types.MapStr, cond common.Condition) error
- type CommonInstGetter
- type CommonInstInterface
- type Group
- type GroupGetter
- type GroupInterface
- type Host
- func (h *Host) CreateHostBatch(bizID int64, moduleIDS []int64, data ...types.MapStr) ([]int, error)
- func (h *Host) DeleteHostBatch(hostID string) error
- func (h *Host) ResetBusinessHosts(bizID int64, moduleID int64, setID int64) error
- func (h *Host) SearchHost(cond common.Condition) ([]types.MapStr, error)
- func (h *Host) TransferHostFromResourcePoolsToBusinessIdleModule(bizID int64, hostIDS []int64) error
- func (h *Host) TransferHostToAnotherBusinessModules(bizID int64, moduleID int64, hostInfo []*HostInfo) error
- func (h *Host) TransferHostToBusinessFaultModule(bizID int64, hostIDS []int64) error
- func (h *Host) TransferHostToBusinessIdleModule(bizID int64, hostIDS []int64) error
- func (h *Host) TransferHostToBusinessModule(bizID int64, hostIDS []int64, newModuleIDS []int64, isIncrement bool) error
- func (h *Host) TransferHostToResourcePools(bizID int64, hostIDS []int64) error
- func (h *Host) UpdateHostBatch(data types.MapStr, hostID string) error
- type HostGetter
- type HostInfo
- type HostInterface
- type Model
- func (m *Model) CreateObject(data types.MapStr) (int, error)
- func (m *Model) DeleteObject(cond common.Condition) error
- func (m *Model) SearchObjectTopo(cond common.Condition) ([]types.MapStr, error)
- func (m *Model) SearchObjects(cond common.Condition) ([]types.MapStr, error)
- func (m *Model) UpdateObject(data types.MapStr, cond common.Condition) error
- type ModelGetter
- type ModelInterface
- type Module
- func (cli *Module) CreateModule(bizID, setID int64, data types.MapStr) (int, error)
- func (cli *Module) DeleteModule(bizID, setID, moduleID int64) error
- func (cli *Module) SearchModules(cond common.Condition) ([]types.MapStr, error)
- func (cli *Module) UpdateModule(bizID, setID, moduleID int64, data types.MapStr) error
- type ModuleGetter
- type ModuleInterface
- type Set
- type SetGetter
- type SetInterface
Constants ¶
const ( // Plat plat name Plat = "plat" // IsIncrement is increment IsIncrement = "is_increment" // HostID host id HostID = "bk_host_id" // PlatID plat id PlatID = "bk_cloud_id" // BusinessID the business id BusinessID = "bk_biz_id" // SetID the set id SetID = "bk_set_id" // ModuleID the module id ModuleID = "bk_module_id" // ObjectID the object identifier name ObjectID = "bk_obj_id" // CommonInstID the common inst id CommonInstID = "bk_inst_id" // SupplierAccount the business id SupplierAccount = "bk_supplier_account" )
const (
HostInfoField = "host_info"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
func (*Attribute) CreateObjectAttribute ¶
CreateObjectAttribute create a new model object attribute
func (*Attribute) DeleteObjectAttribute ¶
DeleteObjectAttribute delete a object attribute by condition
func (*Attribute) SearchObjectAttributes ¶
SearchObjectAttributes search some object attributes by condition
type AttributeGetter ¶
type AttributeGetter interface {
Attribute() AttributeInterface
}
type AttributeInterface ¶
type Business ¶
type Business struct {
// contains filtered or unexported fields
}
Business define
func (*Business) CreateBusiness ¶
CreateBusiness create business
func (*Business) DeleteBusiness ¶
DeleteBusiness delete business by ID
func (*Business) SearchBusiness ¶
SearchBusiness search bussiness operation
type BusinessGetter ¶
type BusinessGetter interface {
Business() BusinessInterface
}
BusinessGetter business getter interface
type BusinessInterface ¶
type BusinessInterface interface { // SearchBusiness search host by condition, SearchBusiness(cond common.Condition) ([]types.MapStr, error) // CreateBusiness create host CreateBusiness(data types.MapStr) (int, error) // update update host by bizID, bizID could be separated by a comma UpdateBusiness(data types.MapStr, bizID int) error // DeleteBusiness delete host by bizID, bizID could be separated by a comma DeleteBusiness(bizID int) error }
BusinessInterface business operation interface
type CCV3Interface ¶
type CCV3Interface interface { ModuleGetter SetGetter HostGetter ModelGetter BusinessGetter ClassificationGetter AttributeGetter CommonInstGetter GroupGetter }
type Classification ¶
type Classification struct {
// contains filtered or unexported fields
}
func (*Classification) CreateClassification ¶
func (m *Classification) CreateClassification(data types.MapStr) (int, error)
CreateClassification create a new classification
func (*Classification) DeleteClassification ¶
func (m *Classification) DeleteClassification(cond common.Condition) error
DeleteClassification delete some classification by condition
func (*Classification) SearchClassificationWithObjects ¶
func (m *Classification) SearchClassificationWithObjects(cond common.Condition) ([]types.MapStr, error)
SearchClassificationWithObjects search some classification with objects
func (*Classification) SearchClassifications ¶
SearchClassifications search some classification by condition
func (*Classification) UpdateClassification ¶
UpdateClassification update the classification by condition
type ClassificationGetter ¶
type ClassificationGetter interface {
Classification() ClassificationInterface
}
type ClassificationInterface ¶
type ClassificationInterface interface { CreateClassification(data types.MapStr) (int, error) DeleteClassification(cond common.Condition) error SearchClassifications(cond common.Condition) ([]types.MapStr, error) SearchClassificationWithObjects(cond common.Condition) ([]types.MapStr, error) UpdateClassification(data types.MapStr, cond common.Condition) error }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client the http client
func (*Client) Attribute ¶
func (cli *Client) Attribute() AttributeInterface
func (*Client) Business ¶
func (cli *Client) Business() BusinessInterface
func (*Client) Classification ¶
func (cli *Client) Classification() ClassificationInterface
func (*Client) CommonInst ¶
func (cli *Client) CommonInst() CommonInstInterface
func (*Client) GetSupplierAccount ¶
GetSupplierAccount get the supplier account
func (*Client) Group ¶
func (cli *Client) Group() GroupInterface
func (*Client) Host ¶
func (cli *Client) Host() HostInterface
func (*Client) Model ¶
func (cli *Client) Model() ModelInterface
func (*Client) Module ¶
func (cli *Client) Module() ModuleInterface
func (*Client) Set ¶
func (cli *Client) Set() SetInterface
func (*Client) SetAddress ¶
SetAddress set a new address
func (*Client) SetSupplierAccount ¶
SetSupplierAccount set a new supplieraccount
type CommonInst ¶
type CommonInst struct {
// contains filtered or unexported fields
}
CommonInst inst data
func (*CommonInst) CreateCommonInst ¶
func (m *CommonInst) CreateCommonInst(data types.MapStr) (int, error)
CreateCommonInst create a common inst instance
func (*CommonInst) DeleteCommonInst ¶
func (m *CommonInst) DeleteCommonInst(cond common.Condition) error
DeleteCommonInst delete a common inst instance
func (*CommonInst) SearchInst ¶
SearchInst search all inst by condition
func (*CommonInst) UpdateCommonInst ¶
UpdateCommonInst update a common inst instance
type CommonInstGetter ¶
type CommonInstGetter interface {
CommonInst() CommonInstInterface
}
CommonInstGetter inst getter
type CommonInstInterface ¶
type CommonInstInterface interface { CreateCommonInst(data types.MapStr) (int, error) DeleteCommonInst(cond common.Condition) error UpdateCommonInst(data types.MapStr, cond common.Condition) error SearchInst(cond common.Condition) ([]types.MapStr, error) }
CommonInstInterface inst operation interface
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group group data struct
func (*Group) CreateGroup ¶
CreateGroup create a group
func (*Group) DeleteGroup ¶
DeleteGroup delete a group by condition
func (*Group) SearchGroups ¶
SearchGroups search some group by condition
type GroupInterface ¶
type GroupInterface interface { CreateGroup(data types.MapStr) (int, error) DeleteGroup(cond common.Condition) error UpdateGroup(data types.MapStr, cond common.Condition) error SearchGroups(cond common.Condition) ([]types.MapStr, error) }
GroupInterface group interface
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host define
func (*Host) CreateHostBatch ¶
CreateHostBatch batch to create hosts
func (*Host) DeleteHostBatch ¶
DeleteHostBatch batch to delete the host
func (*Host) ResetBusinessHosts ¶
ResetBusinessHosts transfer the hosts in set or module to the idle module
func (*Host) SearchHost ¶
SearchHost search the host
func (*Host) TransferHostFromResourcePoolsToBusinessIdleModule ¶
func (h *Host) TransferHostFromResourcePoolsToBusinessIdleModule(bizID int64, hostIDS []int64) error
TransferHostFromResourcePoolsToBusinessIdleModule transfer the hosts from resource pools to another business
func (*Host) TransferHostToAnotherBusinessModules ¶
func (h *Host) TransferHostToAnotherBusinessModules(bizID int64, moduleID int64, hostInfo []*HostInfo) error
TransferHostToAnotherBusinessModules transfer host to another business modules
func (*Host) TransferHostToBusinessFaultModule ¶
TransferHostToBusinessFaultModule transfer host module to fault module
func (*Host) TransferHostToBusinessIdleModule ¶
TransferHostToBusinessIdleModule transfer host module to idle module
func (*Host) TransferHostToBusinessModule ¶
func (h *Host) TransferHostToBusinessModule(bizID int64, hostIDS []int64, newModuleIDS []int64, isIncrement bool) error
TransferHostModule transfer hosts to another modules in the same business
func (*Host) TransferHostToResourcePools ¶
TransferHostToResourcePools transfer host module to resource pools
type HostInfo ¶
type HostInfo struct { HostInnerIP string `json:"bk_host_innerip"` CloudID int64 `json:"bk_cloud_id"` }
HostInfo the host infos
type HostInterface ¶
type HostInterface interface { // SearchHost search host by condition, SearchHost(cond common.Condition) ([]types.MapStr, error) // CreateHostBatch create host CreateHostBatch(bizID int64, moduleIDS []int64, data ...types.MapStr) ([]int, error) // update update host by hostID, hostID could be separated by a comma UpdateHostBatch(data types.MapStr, hostID string) error // DeleteHost delete host by hostID, hostID could be separated by a comma DeleteHostBatch(hostID string) error // TransferHostToBusinessModule transfer host to business module TransferHostToBusinessModule(bizID int64, hostIDS []int64, newModuleIDS []int64, isIncrement bool) error // TransferHostFromResourcePoolsToBusinessIdleModule transfer host to business module TransferHostFromResourcePoolsToBusinessIdleModule(bizID int64, hostIDS []int64) error // TransferHostToBusinessFaultModule transfer host module to fault module TransferHostToBusinessFaultModule(bizID int64, hostIDS []int64) error // TransferHostToBusinessIdleModule transfer host module to idle module TransferHostToBusinessIdleModule(bizID int64, hostIDS []int64) error // TransferHostToResourcePools transfer host module to resource pools TransferHostToResourcePools(bizID int64, hostIDS []int64) error // TransferHostToAnotherBusinessModules transfer host to another modules TransferHostToAnotherBusinessModules(bizID int64, moduleID int64, hostInfo []*HostInfo) error // ResetBusinessHosts transfer the hosts in set or module to the idle module ResetBusinessHosts(bizID int64, moduleID int64, setID int64) error }
HostInterface host operation
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) CreateObject ¶
CreateObject create a new model object
func (*Model) DeleteObject ¶
DeleteObject delete a object by condition
func (*Model) SearchObjectTopo ¶
SearchObjectTopo search object topo by condition
func (*Model) SearchObjects ¶
SearchObjects search some objects by condition
type ModelGetter ¶
type ModelGetter interface {
Model() ModelInterface
}
type ModelInterface ¶
type ModelInterface interface { CreateObject(data types.MapStr) (int, error) DeleteObject(cond common.Condition) error UpdateObject(data types.MapStr, cond common.Condition) error SearchObjects(cond common.Condition) ([]types.MapStr, error) SearchObjectTopo(cond common.Condition) ([]types.MapStr, error) }
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module the module interface implement
func (*Module) CreateModule ¶
CreateModule create a new module object
func (*Module) DeleteModule ¶
DeleteModule delete a module by condition
func (*Module) SearchModules ¶
SearchModules search some modules by condition
type ModuleGetter ¶
type ModuleGetter interface {
Module() ModuleInterface
}
ModuleGetter the module getter interface
type ModuleInterface ¶
type ModuleInterface interface { CreateModule(bizID, setID int64, data types.MapStr) (int, error) DeleteModule(bizID, setID, moduleID int64) error UpdateModule(bizID, setID, moduleID int64, data types.MapStr) error SearchModules(cond common.Condition) ([]types.MapStr, error) }
ModuleInterface the module interface
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set the set interface implement
func (*Set) SearchSets ¶
SearchSets search some sets by condition
type SetInterface ¶
type SetInterface interface { CreateSet(bizID int64, data types.MapStr) (int, error) DeleteSet(cond common.Condition) error UpdateSet(bizID int64, data types.MapStr, cond common.Condition) error SearchSets(cond common.Condition) ([]types.MapStr, error) }
SetInterface the set interface