extensions

package
v0.0.0-...-be0592b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

README

auth extensions

why need it?

auth 模块提供了到iam的统一访问接口,如果直接运用auth接口对接到各个场景层或APIServer,将会嵌入非常多的代码到其中,比如生成auth接口需要的数据格式,其中最复杂的逻辑是获取资源的分层信息, 主机对应的父层级信息有模块,集群,自定义mainline层级以及业务。为了尽量降低对业务逻辑的干扰,extensions模块用于实现在auth接口层的一层封装,场景层只需要传入资源ID即可实现组装出正确的 auth数据格式并进行资源注册或者鉴权。采用extensions模块有如下有点:

  • 场景层/APIServer只需在适当位置加入对应函数调用, 无额外逻辑,保证了场景层代码主干清晰。
  • extensions模块封装了对接iam的数据转换逻辑,目前对接时,这块相对不稳定,可能需要多次调整,对于这类调整,在extension模块中只需修改对应资源类型的拼装逻辑,对变更起到了隔离作用。
  • 如上一步说描述,extensions模块可以方便的对接到其它类型的权限中心,而不用修改权限中心代码。

what is it?

extensions模块是auth模块的一个功能扩展,使得它可以方便对接到各个场景层。比如向iam注册主机的接口,只需要传入hostid信息,extensions模块即可组装出最终iam需要的数据结构。

design

extensions模块所有对接权限中心的接口均采用批量的形式,为降低问题复杂度,extension模块默认批量注册的资源属于同一个业务(全局资源的业务ID假设是0)。 extensions 被设计成一种松散的组织方式,各种资源类型之间尽量避免复用,目的是降低后期调整方案时的测试难度。

code structure

  • types.go 定义 extensions 模块用到的基本数据结构。
    • AuthManager 类为extensions模块对外接口的封装
    • BusinessSimply 以及 SetSimply 等类用于从db数据中提取extension模块必要的数据
  • 其它.go文件为对接其它各个场景的接口封装,比如 host.go 封装了对主机的注册鉴权等相关接口及实现。

special resource id design

host
Resource_id format
  • common format: business/{business}:set/{set}:module/{module}:host/{host_id}
Authorization for add host
  • resource_id: business/{business}:set/{set}:module/{module}:host
  • action: transferhost
Authorization for update/read/delete host
  • resource_id: business/{business}:set/{set}:module/{module}:host/{host_id}
  • action: update/read/delete
Deal with one host belong to multiple modules
  • respect as multiple iam resource
  • ex: host_id belong to module1 and module 2, then there will be two resource
    • resource_id: business/{business}:set/{set}:module/{module1}:host/{host_id}
    • resource_id: business/{business}:set/{set}:module/{module2}:host/{host_id}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostLayers

func GetHostLayers(ctx context.Context, coreService coreservice.CoreServiceClientInterface, requestHeader *http.Header, hostIDArr *[]int64) (
	bkBizID int64, batchLayers [][]meta.Item, err error)

GetHostLayers get resource layers id by hostID(layers is a data structure for call iam)

Types

type AuditCategorySimplify

type AuditCategorySimplify struct {
	BKAppIDField    int64  `field:"bk_biz_id"`
	BKOpTargetField string `field:"op_target"`
}

func (*AuditCategorySimplify) Parse

type AuthManager

type AuthManager struct {
	Authorize auth.Authorize

	RegisterModelAttributeEnabled bool
	RegisterModelUniqueEnabled    bool
	RegisterModuleEnabled         bool
	RegisterSetEnabled            bool
	RegisterAuditCategoryEnabled  bool
	SkipReadAuthorization         bool
	// contains filtered or unexported fields
}

func NewAuthManager

func NewAuthManager(clientSet apimachinery.ClientSetInterface, Authorize auth.Authorize) *AuthManager

func (*AuthManager) AuthorizeAuditRead

func (am *AuthManager) AuthorizeAuditRead(ctx context.Context, header http.Header, businessID int64) error

func (*AuthManager) AuthorizeByBusiness

func (am *AuthManager) AuthorizeByBusiness(ctx context.Context, header http.Header, action meta.Action, businesses ...BusinessSimplify) error

func (*AuthManager) AuthorizeByBusinessID

func (am *AuthManager) AuthorizeByBusinessID(ctx context.Context, header http.Header, action meta.Action, businessIDs ...int64) error

func (*AuthManager) AuthorizeByHosts

func (am *AuthManager) AuthorizeByHosts(ctx context.Context, header http.Header, action meta.Action, hosts ...HostSimplify) error

func (*AuthManager) AuthorizeByHostsIDs

func (am *AuthManager) AuthorizeByHostsIDs(ctx context.Context, header http.Header, action meta.Action, hostIDs ...int64) error

func (*AuthManager) AuthorizeByHostsIDsNoPermissionsResponse

func (am *AuthManager) AuthorizeByHostsIDsNoPermissionsResponse(businessID int64) metadata.BaseResp

func (*AuthManager) AuthorizeByInstanceID

func (am *AuthManager) AuthorizeByInstanceID(ctx context.Context, header http.Header, action meta.Action, objID string, ids ...int64) error

func (*AuthManager) AuthorizeByInstances

func (am *AuthManager) AuthorizeByInstances(ctx context.Context, header http.Header, action meta.Action, instances ...InstanceSimplify) error

func (*AuthManager) AuthorizeByModule

func (am *AuthManager) AuthorizeByModule(ctx context.Context, header http.Header, action meta.Action, modules ...ModuleSimplify) error

func (*AuthManager) AuthorizeByModuleID

func (am *AuthManager) AuthorizeByModuleID(ctx context.Context, header http.Header, action meta.Action, ids ...int64) error

func (*AuthManager) AuthorizeByPlat

func (am *AuthManager) AuthorizeByPlat(ctx context.Context, header http.Header, action meta.Action, plats ...PlatSimplify) error

func (*AuthManager) AuthorizeByPlatIDs

func (am *AuthManager) AuthorizeByPlatIDs(ctx context.Context, header http.Header, action meta.Action, platIDs ...int64) error

func (*AuthManager) AuthorizeByProcessID

func (am *AuthManager) AuthorizeByProcessID(ctx context.Context, header http.Header, action meta.Action, ids ...int64) error

func (*AuthManager) AuthorizeByProcesses

func (am *AuthManager) AuthorizeByProcesses(ctx context.Context, header http.Header, action meta.Action, processes ...ProcessSimplify) error

func (*AuthManager) AuthorizeBySet

func (am *AuthManager) AuthorizeBySet(ctx context.Context, header http.Header, action meta.Action, sets ...SetSimplify) error

func (*AuthManager) AuthorizeBySetID

func (am *AuthManager) AuthorizeBySetID(ctx context.Context, header http.Header, action meta.Action, ids ...int64) error

func (*AuthManager) AuthorizeCreateHost

func (am *AuthManager) AuthorizeCreateHost(ctx context.Context, header http.Header, bizID int64) error

func (*AuthManager) AuthorizeResourceCreate

func (am *AuthManager) AuthorizeResourceCreate(ctx context.Context, header http.Header, businessID int64, resourceType meta.ResourceType) error

func (*AuthManager) CollectAllBusiness

func (am *AuthManager) CollectAllBusiness(ctx context.Context, header http.Header) ([]BusinessSimplify, error)

CollectAllBusiness get all business

func (*AuthManager) CollectAuditCategoryByBusinessID

func (am *AuthManager) CollectAuditCategoryByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]AuditCategorySimplify, error)

func (*AuthManager) CollectClassificationByBusinessIDs

func (am *AuthManager) CollectClassificationByBusinessIDs(ctx context.Context, header http.Header, businessID int64) ([]metadata.Classification, error)

func (*AuthManager) CollectDynamicGroupByBusinessID

func (am *AuthManager) CollectDynamicGroupByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]DynamicGroupSimplify, error)

func (*AuthManager) CollectHostByBusinessID

func (am *AuthManager) CollectHostByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]HostSimplify, error)

func (*AuthManager) CollectInstancesByModelID

func (am *AuthManager) CollectInstancesByModelID(ctx context.Context, header http.Header, objectID string) ([]InstanceSimplify, error)

func (*AuthManager) CollectModuleByBusinessIDs

func (am *AuthManager) CollectModuleByBusinessIDs(ctx context.Context, header http.Header, businessID int64) ([]ModuleSimplify, error)

func (*AuthManager) CollectObjectsByBusinessID

func (am *AuthManager) CollectObjectsByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]metadata.Object, error)

CollectObjectsByBusinessID get models by business businessID=0 ==> get all global models

func (*AuthManager) CollectProcessesByBusinessID

func (am *AuthManager) CollectProcessesByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]ProcessSimplify, error)

func (*AuthManager) CollectSetByBusinessID

func (am *AuthManager) CollectSetByBusinessID(ctx context.Context, header http.Header, businessID int64) ([]SetSimplify, error)

func (*AuthManager) DeregisterAssociationTypeByIDs

func (am *AuthManager) DeregisterAssociationTypeByIDs(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DeregisterBusinessByRawID

func (am *AuthManager) DeregisterBusinessByRawID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DeregisterBusinesses

func (am *AuthManager) DeregisterBusinesses(ctx context.Context, header http.Header, businesses ...BusinessSimplify) error

func (*AuthManager) DeregisterBusinessesByID

func (am *AuthManager) DeregisterBusinessesByID(ctx context.Context, header http.Header, businessIDs ...int64) error

func (*AuthManager) DeregisterClassification

func (am *AuthManager) DeregisterClassification(ctx context.Context, header http.Header, classifications ...metadata.Classification) error

func (*AuthManager) DeregisterDynamicGroupByID

func (am *AuthManager) DeregisterDynamicGroupByID(ctx context.Context, header http.Header, configMeta metadata.UserConfigMeta) error

func (*AuthManager) DeregisterHosts

func (am *AuthManager) DeregisterHosts(ctx context.Context, header http.Header, hosts ...HostSimplify) error

func (*AuthManager) DeregisterHostsByID

func (am *AuthManager) DeregisterHostsByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DeregisterInstanceByRawID

func (am *AuthManager) DeregisterInstanceByRawID(ctx context.Context, header http.Header, objectID string, ids ...int64) error

func (*AuthManager) DeregisterInstances

func (am *AuthManager) DeregisterInstances(ctx context.Context, header http.Header, instances ...InstanceSimplify) error

func (*AuthManager) DeregisterMainlineModelByObjectID

func (am *AuthManager) DeregisterMainlineModelByObjectID(ctx context.Context, header http.Header, businessID int64, objectIDs ...string) error

func (*AuthManager) DeregisterModelAttribute

func (am *AuthManager) DeregisterModelAttribute(ctx context.Context, header http.Header, attributes ...metadata.Attribute) error

func (*AuthManager) DeregisterModelAttributeByID

func (am *AuthManager) DeregisterModelAttributeByID(ctx context.Context, header http.Header, attributeIDs ...int64) error

func (*AuthManager) DeregisterModelAttributeGroup

func (am *AuthManager) DeregisterModelAttributeGroup(ctx context.Context, header http.Header, attributeGroups ...metadata.Group) error

func (*AuthManager) DeregisterModelAttributeGroupByID

func (am *AuthManager) DeregisterModelAttributeGroupByID(ctx context.Context, header http.Header, groupIDs ...int64) error

func (*AuthManager) DeregisterModelUnique

func (am *AuthManager) DeregisterModelUnique(ctx context.Context, header http.Header, uniques ...ModelUniqueSimplify) error

func (*AuthManager) DeregisterModelUniqueByID

func (am *AuthManager) DeregisterModelUniqueByID(ctx context.Context, header http.Header, uniqueIDs ...int64) error

func (*AuthManager) DeregisterModule

func (am *AuthManager) DeregisterModule(ctx context.Context, header http.Header, modules ...ModuleSimplify) error

func (*AuthManager) DeregisterModuleByID

func (am *AuthManager) DeregisterModuleByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DeregisterObject

func (am *AuthManager) DeregisterObject(ctx context.Context, header http.Header, objects ...metadata.Object) error

func (*AuthManager) DeregisterPlat

func (am *AuthManager) DeregisterPlat(ctx context.Context, header http.Header, plats ...PlatSimplify) error

func (*AuthManager) DeregisterPlatByID

func (am *AuthManager) DeregisterPlatByID(ctx context.Context, header http.Header, platIDs ...int64) error

func (*AuthManager) DeregisterPlatByRawID

func (am *AuthManager) DeregisterPlatByRawID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DeregisterProcesses

func (am *AuthManager) DeregisterProcesses(ctx context.Context, header http.Header, processes ...ProcessSimplify) error

func (*AuthManager) DeregisterSet

func (am *AuthManager) DeregisterSet(ctx context.Context, header http.Header, sets ...SetSimplify) error

func (*AuthManager) DeregisterSetByID

func (am *AuthManager) DeregisterSetByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) DryRunAuthorizeByHostsIDs

func (am *AuthManager) DryRunAuthorizeByHostsIDs(ctx context.Context, header http.Header, action meta.Action, hostIDs ...int64) ([]meta.ResourceAttribute, error)

func (*AuthManager) Enabled

func (am *AuthManager) Enabled() bool

func (*AuthManager) ExtractBusinessIDFromAttributeGroup

func (am *AuthManager) ExtractBusinessIDFromAttributeGroup(attributeGroups ...metadata.Group) (int64, error)

func (*AuthManager) ExtractBusinessIDFromAuditCategories

func (am *AuthManager) ExtractBusinessIDFromAuditCategories(categories ...AuditCategorySimplify) (int64, error)

func (*AuthManager) ExtractBusinessIDFromModelAttributes

func (am *AuthManager) ExtractBusinessIDFromModelAttributes(attributes ...metadata.Attribute) (int64, error)

func (*AuthManager) ExtractBusinessIDFromObject

func (am *AuthManager) ExtractBusinessIDFromObject(object metadata.Object) (int64, error)

func (*AuthManager) ExtractBusinessIDFromObjects

func (am *AuthManager) ExtractBusinessIDFromObjects(objects ...metadata.Object) (map[int64]int64, error)

func (*AuthManager) ExtractBusinessIDFromUniques

func (am *AuthManager) ExtractBusinessIDFromUniques(uniques ...ModelUniqueSimplify) (int64, error)

func (*AuthManager) GenAuthorizeAuditReadNoPermissionsResponse

func (am *AuthManager) GenAuthorizeAuditReadNoPermissionsResponse(ctx context.Context, header http.Header, businessID int64) (*metadata.BaseResp, error)

func (*AuthManager) GenBusinessAuditNoPermissionResp

func (am *AuthManager) GenBusinessAuditNoPermissionResp(ctx context.Context, header http.Header, businessID int64) (*metadata.BaseResp, error)

func (*AuthManager) GenBusinessNoPermissionResp

func (am *AuthManager) GenBusinessNoPermissionResp(ctx context.Context, header http.Header, businessID int64) (*metadata.BaseResp, error)

func (*AuthManager) GenDeleteHostBatchNoPermissionResp

func (am *AuthManager) GenDeleteHostBatchNoPermissionResp(hostIDs []int64) *metadata.BaseResp

func (*AuthManager) GenModuleSetNoPermissionResp

func (am *AuthManager) GenModuleSetNoPermissionResp() *metadata.BaseResp

func (*AuthManager) GenMoveHostFromModuleToIdleFaultModuleResp

func (am *AuthManager) GenMoveHostFromModuleToIdleFaultModuleResp(hostIDs []int64) *metadata.BaseResp

func (*AuthManager) GenProcessNoPermissionResp

func (am *AuthManager) GenProcessNoPermissionResp(ctx context.Context, header http.Header, businessID int64) (*metadata.BaseResp, error)

func (*AuthManager) MakeAuthorizedAuditListCondition

func (am *AuthManager) MakeAuthorizedAuditListCondition(ctx context.Context, header http.Header, businessID int64) (cond []mapstr.MapStr, hasAuthorization bool, err error)

MakeAuthorizedAuditListCondition make a query condition, with which user can only search audit log under it. ==> [{"bk_biz_id":2,"op_target":{"$in":["module"]}}]

func (*AuthManager) MakeResourcesByAuditCategories

func (am *AuthManager) MakeResourcesByAuditCategories(ctx context.Context, header http.Header, action meta.Action, businessID int64, categories ...AuditCategorySimplify) ([]meta.ResourceAttribute, error)

func (*AuthManager) MakeResourcesByBusiness

func (am *AuthManager) MakeResourcesByBusiness(header http.Header, action meta.Action, businesses ...BusinessSimplify) []meta.ResourceAttribute

func (*AuthManager) MakeResourcesByClassifications

func (am *AuthManager) MakeResourcesByClassifications(header http.Header, action meta.Action, businessID int64, classifications ...metadata.Classification) []meta.ResourceAttribute

func (*AuthManager) MakeResourcesByDynamicGroups

func (am *AuthManager) MakeResourcesByDynamicGroups(header http.Header, action meta.Action, businessID int64, dynamicGroups ...DynamicGroupSimplify) []meta.ResourceAttribute

func (*AuthManager) MakeResourcesByHosts

func (am *AuthManager) MakeResourcesByHosts(ctx context.Context, header http.Header, action meta.Action, hosts ...HostSimplify) ([]meta.ResourceAttribute, error)

func (*AuthManager) MakeResourcesByInstances

func (am *AuthManager) MakeResourcesByInstances(ctx context.Context, header http.Header, action meta.Action, instances ...InstanceSimplify) ([]meta.ResourceAttribute, error)

func (*AuthManager) MakeResourcesByModule

func (am *AuthManager) MakeResourcesByModule(header http.Header, action meta.Action, businessID int64, modules ...ModuleSimplify) []meta.ResourceAttribute

func (*AuthManager) MakeResourcesByObjects

func (am *AuthManager) MakeResourcesByObjects(ctx context.Context, header http.Header, action meta.Action, objects ...metadata.Object) ([]meta.ResourceAttribute, error)

MakeResourcesByObjects make object resource with businessID and objects

func (*AuthManager) MakeResourcesByProcesses

func (am *AuthManager) MakeResourcesByProcesses(header http.Header, action meta.Action, businessID int64, processes ...ProcessSimplify) []meta.ResourceAttribute

func (*AuthManager) MakeResourcesBySet

func (am *AuthManager) MakeResourcesBySet(header http.Header, action meta.Action, businessID int64, sets ...SetSimplify) []meta.ResourceAttribute

func (*AuthManager) RegisterAssociationType

func (am *AuthManager) RegisterAssociationType(ctx context.Context, header http.Header, aks ...*metadata.AssociationKind) error

func (*AuthManager) RegisterAssociationTypeByID

func (am *AuthManager) RegisterAssociationTypeByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) RegisterAuditCategories

func (am *AuthManager) RegisterAuditCategories(ctx context.Context, header http.Header, categories ...AuditCategorySimplify) error

func (*AuthManager) RegisterBusinesses

func (am *AuthManager) RegisterBusinesses(ctx context.Context, header http.Header, businesses ...BusinessSimplify) error

func (*AuthManager) RegisterBusinessesByID

func (am *AuthManager) RegisterBusinessesByID(ctx context.Context, header http.Header, businessIDs ...int64) error

func (*AuthManager) RegisterClassification

func (am *AuthManager) RegisterClassification(ctx context.Context, header http.Header, classifications ...metadata.Classification) error

func (*AuthManager) RegisterDynamicGroupByID

func (am *AuthManager) RegisterDynamicGroupByID(ctx context.Context, header http.Header, ids ...string) error

func (*AuthManager) RegisterDynamicGroups

func (am *AuthManager) RegisterDynamicGroups(ctx context.Context, header http.Header, dynamicGroups ...DynamicGroupSimplify) error

func (*AuthManager) RegisterHosts

func (am *AuthManager) RegisterHosts(ctx context.Context, header http.Header, hosts ...HostSimplify) error

func (*AuthManager) RegisterHostsByID

func (am *AuthManager) RegisterHostsByID(ctx context.Context, header http.Header, hostIDs ...int64) error

func (*AuthManager) RegisterInstancesByID

func (am *AuthManager) RegisterInstancesByID(ctx context.Context, header http.Header, objectID string, ids ...int64) error

func (*AuthManager) RegisterMainlineObject

func (am *AuthManager) RegisterMainlineObject(ctx context.Context, header http.Header, objects ...metadata.Object) error

func (*AuthManager) RegisterModelAttribute

func (am *AuthManager) RegisterModelAttribute(ctx context.Context, header http.Header, attributes ...metadata.Attribute) error

func (*AuthManager) RegisterModelAttributeGroup

func (am *AuthManager) RegisterModelAttributeGroup(ctx context.Context, header http.Header, attributeGroups ...metadata.Group) error

func (*AuthManager) RegisterModelUnique

func (am *AuthManager) RegisterModelUnique(ctx context.Context, header http.Header, uniques ...ModelUniqueSimplify) error

func (*AuthManager) RegisterModule

func (am *AuthManager) RegisterModule(ctx context.Context, header http.Header, modules ...ModuleSimplify) error

func (*AuthManager) RegisterModuleByID

func (am *AuthManager) RegisterModuleByID(ctx context.Context, header http.Header, moduleIDs ...int64) error

func (*AuthManager) RegisterModuleUniqueByID

func (am *AuthManager) RegisterModuleUniqueByID(ctx context.Context, header http.Header, uniqueIDs ...int64) error

func (*AuthManager) RegisterObject

func (am *AuthManager) RegisterObject(ctx context.Context, header http.Header, objects ...metadata.Object) error

func (*AuthManager) RegisterPlat

func (am *AuthManager) RegisterPlat(ctx context.Context, header http.Header, plats ...PlatSimplify) error

func (*AuthManager) RegisterPlatByID

func (am *AuthManager) RegisterPlatByID(ctx context.Context, header http.Header, platIDs ...int64) error

func (*AuthManager) RegisterProcesses

func (am *AuthManager) RegisterProcesses(ctx context.Context, header http.Header, processes ...ProcessSimplify) error

func (*AuthManager) RegisterSet

func (am *AuthManager) RegisterSet(ctx context.Context, header http.Header, sets ...SetSimplify) error

func (*AuthManager) RegisterSetByID

func (am *AuthManager) RegisterSetByID(ctx context.Context, header http.Header, setIDs ...int64) error

func (*AuthManager) UpdateAssociationTypeByID

func (am *AuthManager) UpdateAssociationTypeByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredBusiness

func (am *AuthManager) UpdateRegisteredBusiness(ctx context.Context, header http.Header, businesses ...BusinessSimplify) error

func (*AuthManager) UpdateRegisteredBusinessByID

func (am *AuthManager) UpdateRegisteredBusinessByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredBusinessByRawID

func (am *AuthManager) UpdateRegisteredBusinessByRawID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredClassification

func (am *AuthManager) UpdateRegisteredClassification(ctx context.Context, header http.Header, classifications ...metadata.Classification) error

func (*AuthManager) UpdateRegisteredClassificationByID

func (am *AuthManager) UpdateRegisteredClassificationByID(ctx context.Context, header http.Header, classificationIDs ...string) error

func (*AuthManager) UpdateRegisteredClassificationByRawID

func (am *AuthManager) UpdateRegisteredClassificationByRawID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredDynamicGroupByID

func (am *AuthManager) UpdateRegisteredDynamicGroupByID(ctx context.Context, header http.Header, ids ...string) error

func (*AuthManager) UpdateRegisteredDynamicGroups

func (am *AuthManager) UpdateRegisteredDynamicGroups(ctx context.Context, header http.Header, dynamicGroups ...DynamicGroupSimplify) error

func (*AuthManager) UpdateRegisteredHosts

func (am *AuthManager) UpdateRegisteredHosts(ctx context.Context, header http.Header, hosts ...HostSimplify) error

func (*AuthManager) UpdateRegisteredHostsByID

func (am *AuthManager) UpdateRegisteredHostsByID(ctx context.Context, header http.Header, hostIDs ...int64) error

func (*AuthManager) UpdateRegisteredInstanceByID

func (am *AuthManager) UpdateRegisteredInstanceByID(ctx context.Context, header http.Header, objectID string, ids ...int64) error

func (*AuthManager) UpdateRegisteredInstanceByRawID

func (am *AuthManager) UpdateRegisteredInstanceByRawID(ctx context.Context, header http.Header, objectID string, ids ...int64) error

func (*AuthManager) UpdateRegisteredInstances

func (am *AuthManager) UpdateRegisteredInstances(ctx context.Context, header http.Header, instances ...InstanceSimplify) error

func (*AuthManager) UpdateRegisteredModelAttribute

func (am *AuthManager) UpdateRegisteredModelAttribute(ctx context.Context, header http.Header, attributes ...metadata.Attribute) error

func (*AuthManager) UpdateRegisteredModelAttributeByID

func (am *AuthManager) UpdateRegisteredModelAttributeByID(ctx context.Context, header http.Header, attributeIDs ...int64) error

func (*AuthManager) UpdateRegisteredModelAttributeGroup

func (am *AuthManager) UpdateRegisteredModelAttributeGroup(ctx context.Context, header http.Header, attributeGroups ...metadata.Group) error

func (*AuthManager) UpdateRegisteredModelAttributeGroupByID

func (am *AuthManager) UpdateRegisteredModelAttributeGroupByID(ctx context.Context, header http.Header, attributeIDs ...int64) error

func (*AuthManager) UpdateRegisteredModelUnique

func (am *AuthManager) UpdateRegisteredModelUnique(ctx context.Context, header http.Header, uniques ...ModelUniqueSimplify) error

func (*AuthManager) UpdateRegisteredModelUniqueByID

func (am *AuthManager) UpdateRegisteredModelUniqueByID(ctx context.Context, header http.Header, uniqueIDs ...int64) error

func (*AuthManager) UpdateRegisteredModule

func (am *AuthManager) UpdateRegisteredModule(ctx context.Context, header http.Header, modules ...ModuleSimplify) error

func (*AuthManager) UpdateRegisteredModuleByID

func (am *AuthManager) UpdateRegisteredModuleByID(ctx context.Context, header http.Header, moduleIDs ...int64) error

func (*AuthManager) UpdateRegisteredObjects

func (am *AuthManager) UpdateRegisteredObjects(ctx context.Context, header http.Header, businessID int64, objects ...metadata.Object) error

func (*AuthManager) UpdateRegisteredObjectsByRawIDs

func (am *AuthManager) UpdateRegisteredObjectsByRawIDs(ctx context.Context, header http.Header, businessID int64, ids ...int64) error

func (*AuthManager) UpdateRegisteredPlat

func (am *AuthManager) UpdateRegisteredPlat(ctx context.Context, header http.Header, plats ...PlatSimplify) error

func (*AuthManager) UpdateRegisteredPlatByID

func (am *AuthManager) UpdateRegisteredPlatByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredPlatByRawID

func (am *AuthManager) UpdateRegisteredPlatByRawID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredProcesses

func (am *AuthManager) UpdateRegisteredProcesses(ctx context.Context, header http.Header, processes ...ProcessSimplify) error

func (*AuthManager) UpdateRegisteredProcessesByID

func (am *AuthManager) UpdateRegisteredProcessesByID(ctx context.Context, header http.Header, ids ...int64) error

func (*AuthManager) UpdateRegisteredSet

func (am *AuthManager) UpdateRegisteredSet(ctx context.Context, header http.Header, sets ...SetSimplify) error

func (*AuthManager) UpdateRegisteredSetByID

func (am *AuthManager) UpdateRegisteredSetByID(ctx context.Context, header http.Header, setIDs ...int64) error

type BusinessSimplify

type BusinessSimplify struct {
	BKAppIDField      int64  `field:"bk_biz_id"`
	BKAppNameField    string `field:"bk_biz_name"`
	BKSupplierIDField int64  `field:"bk_supplier_id"`
	BKOwnerIDField    string `field:"bk_supplier_account"`
	IsDefault         int64  `field:"default"`
}

func (*BusinessSimplify) Parse

func (business *BusinessSimplify) Parse(data mapstr.MapStr) (*BusinessSimplify, error)

Parse load the data from mapstr attribute into ObjectUnique instance

type DynamicGroupSimplify

type DynamicGroupSimplify struct {
	BKAppIDField int64  `field:"bk_biz_id"`
	ID           string `field:"id"`
	Name         string `field:"name"`
}

func (*DynamicGroupSimplify) Parse

type HostSimplify

type HostSimplify struct {
	BKAppIDField       int64  `field:"bk_biz_id"`
	BKModuleIDField    int64  `field:"bk_module_id"`
	BKSetIDField       int64  `field:"bk_set_id"`
	BKHostIDField      int64  `field:"bk_host_id"`
	BKHostNameField    string `field:"bk_host_name"`
	BKHostInnerIPField string `field:"bk_host_innerip"`
}

func (*HostSimplify) Parse

func (is *HostSimplify) Parse(data mapstr.MapStr) (*HostSimplify, error)

type InstanceSimplify

type InstanceSimplify struct {
	InstanceID int64  `field:"bk_inst_id"`
	Name       string `field:"bk_inst_name"`
	BizID      int64  `field:"bk_biz_id"`
	ObjectID   string `field:"bk_obj_id"`
}

func (*InstanceSimplify) Parse

func (is *InstanceSimplify) Parse(data mapstr.MapStr) (*InstanceSimplify, error)

Parse load the data from mapstr attribute into ObjectUnique instance

func (*InstanceSimplify) ParseBizID

func (is *InstanceSimplify) ParseBizID(data mapstr.MapStr) (int64, error)

type ModelUniqueSimplify

type ModelUniqueSimplify struct {
	ID         uint64 `field:"id" json:"id" bson:"id"`
	ObjID      string `field:"bk_obj_id" json:"bk_obj_id" bson:"bk_obj_id"`
	Ispre      bool   `field:"ispre" json:"ispre" bson:"ispre"`
	BusinessID int64
}

func (*ModelUniqueSimplify) Parse

type ModuleSimplify

type ModuleSimplify struct {
	BKAppIDField      int64  `field:"bk_biz_id"`
	BKModuleIDField   int64  `field:"bk_module_id"`
	BKModuleNameField string `field:"bk_module_name"`
}

func (*ModuleSimplify) Parse

func (is *ModuleSimplify) Parse(data mapstr.MapStr) (*ModuleSimplify, error)

Parse load the data from mapstr attribute into ObjectUnique instance

type PlatSimplify

type PlatSimplify struct {
	BKCloudIDField   int64  `field:"bk_cloud_id"`
	BKCloudNameField string `field:"bk_cloud_name"`
}

func (*PlatSimplify) Parse

func (is *PlatSimplify) Parse(data mapstr.MapStr) (*PlatSimplify, error)

type ProcessSimplify

type ProcessSimplify struct {
	ProcessID    int64  `field:"bk_process_id"`
	ProcessName  string `field:"bk_process_name"`
	BKAppIDField int64  `field:"bk_biz_id"`
}

func (*ProcessSimplify) Parse

func (is *ProcessSimplify) Parse(data mapstr.MapStr) (*ProcessSimplify, error)

type SetSimplify

type SetSimplify struct {
	BKAppIDField   int64  `field:"bk_biz_id"`
	BKSetIDField   int64  `field:"bk_set_id"`
	BKSetNameField string `field:"bk_set_name"`
}

func (*SetSimplify) Parse

func (is *SetSimplify) Parse(data mapstr.MapStr) (*SetSimplify, error)

Parse load the data from mapstr attribute into ObjectUnique instance

Jump to

Keyboard shortcuts

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