models

package
v0.0.0-...-2b29b9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WhiteListMap = make(map[string]bool)

Functions

func InitActionLog

func InitActionLog()

func InitActionWhiteList

func InitActionWhiteList()

func InitBaremetalEvent

func InitBaremetalEvent()

func InitDB

func InitDB() error

func IsInActionWhiteList

func IsInActionWhiteList(key string) bool

Types

type SActionlog

type SActionlog struct {
	db.SOpsLog
	db.SRecordChecksumResourceBase

	// 开始时间
	StartTime time.Time `nullable:"true" list:"user" create:"optional"`
	// 结果
	Success bool `list:"user" create:"required"`
	// 服务类别
	Service string `width:"32" charset:"utf8" nullable:"true" list:"user" create:"optional"`
	// 系统账号
	IsSystemAccount tristate.TriState `default:"false" list:"user" create:"optional"`

	// 用户IP
	Ip string `width:"17" charset:"ascii" nullable:"true" list:"user" create:"optional"`
	// 风险级别 0 紧急(Emergency) 1 警报(Alert) 2 关键(Critical) 3 错误(Error) 4 警告(Warning) 5 通知(Notice) 6 信息(informational) 7 调试(debug)
	Severity api.TEventSeverity `width:"32" charset:"ascii" nullable:"false" default:"INFO" list:"user" create:"optional"`
	// 行为类别,0 一般行为(normal) 1 异常行为(abnormal) 2 违规行为(illegal)
	Kind api.TEventKind `width:"16" charset:"ascii" nullable:"false" default:"NORMAL" list:"user" create:"optional"`
}

func (*SActionlog) CustomizeCreate

func (action *SActionlog) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SActionlog) GetI18N

func (action *SActionlog) GetI18N(ctx context.Context) *jsonutils.JSONDict

func (*SActionlog) GetModelManager

func (action *SActionlog) GetModelManager() db.IModelManager

func (*SActionlog) PostCreate

type SActionlogManager

type SActionlogManager struct {
	db.SOpsLogManager
	db.SRecordChecksumResourceBaseManager
	// contains filtered or unexported fields
}
var ActionLog *SActionlogManager
var AdminActionLog *SActionlogManager

func (*SActionlogManager) GetI18N

func (man *SActionlogManager) GetI18N(ctx context.Context, idstr string, resObj jsonutils.JSONObject) *jsonutils.JSONDict

func (*SActionlogManager) GetImmutableInstance

func (manager *SActionlogManager) GetImmutableInstance(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) db.IModelManager

func (*SActionlogManager) GetMutableInstance

func (manager *SActionlogManager) GetMutableInstance(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) db.IModelManager

func (*SActionlogManager) GetPropertyDistinctField

func (manager *SActionlogManager) GetPropertyDistinctField(ctx context.Context, userCred mcclient.TokenCredential, input apis.DistinctFieldInput) (jsonutils.JSONObject, error)

func (*SActionlogManager) InitializeData

func (manager *SActionlogManager) InitializeData() error

func (*SActionlogManager) ListItemFilter

func (manager *SActionlogManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input api.ActionLogListInput,
) (*sqlchemy.SQuery, error)

操作日志列表

type SBaremetalEvent

type SBaremetalEvent struct {
	db.SModelBase

	Id       int64     `primary:"true" auto_increment:"true" list:"user" clickhouse_partition_by:"toInt64(id/100000000000)"`
	HostId   string    `width:"128" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
	HostName string    `width:"64" charset:"utf8" nullable:"false" list:"user" create:"required"`
	IpmiIp   string    `width:"16" charset:"ascii" nullable:"true" list:"user" create:"optional"`
	Created  time.Time `nullable:"false" create:"required" list:"user"`
	EventId  string    `width:"32" nullable:"true" create:"optional" list:"user"`
	Type     string    `width:"10" nullable:"true" create:"optional" list:"user"`

	Message  string `nullable:"false" create:"required" list:"user"`
	Severity string `width:"16" charset:"ascii" nullable:"true" list:"user" create:"optional"`
}

func (*SBaremetalEvent) BeforeInsert

func (event *SBaremetalEvent) BeforeInsert()

func (*SBaremetalEvent) GetId

func (event *SBaremetalEvent) GetId() string

func (*SBaremetalEvent) GetModelManager

func (event *SBaremetalEvent) GetModelManager() db.IModelManager

func (*SBaremetalEvent) GetName

func (event *SBaremetalEvent) GetName() string

type SBaremetalEventManager

type SBaremetalEventManager struct {
	db.SModelBaseManager
}
var BaremetalEventManager *SBaremetalEventManager

func (*SBaremetalEventManager) CreateByInsertOrUpdate

func (manager *SBaremetalEventManager) CreateByInsertOrUpdate() bool

func (*SBaremetalEventManager) GetPagingConfig

func (manager *SBaremetalEventManager) GetPagingConfig() *db.SPagingConfig

func (*SBaremetalEventManager) ListItemFilter

物理机日志列表

func (*SBaremetalEventManager) ResourceScope

func (manager *SBaremetalEventManager) ResourceScope() rbacscope.TRbacScope

Jump to

Keyboard shortcuts

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