cmdb

package
v0.0.0-...-1dfee00 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AliYun  string = "aliyun"
	Tencent string = "tencent"
	HuaWei  string = "huawei"
	AWS     string = "aws"
)
View Source
const (
	CloudSyncSuccess    string = "cloud_sync_success"
	CloudSyncFail       string = "cloud_sync_fail"
	CloudSyncInProgress string = "cloud_sync_in_progress"
)

云同步任务同步状态

Variables

View Source
var SupportedCloudVendors = []string{AliYun, Tencent, HuaWei, AWS}

SupportedCloudVendors 实现了相应的云厂商插件

Functions

This section is empty.

Types

type CloudPlatform

type CloudPlatform struct {
	ID        int              `json:"id" gorm:"column:id;AUTO_INCREMENT;comment:主键"`
	Name      string           `json:"name"`
	Type      string           `json:"type"`
	AccessKey string           `json:"access_key"`
	SecretKey string           `json:"secret_key"`
	Region    string           `json:"region"`
	Remark    string           `json:"remark"`
	Status    int              `json:"status"`
	Msg       string           `json:"msg"`
	Enable    bool             `json:"enable"`
	CreatedAt models.LocalTime `json:"created_at"`
	DeletedAt gorm.DeletedAt   `json:"-"`
	UpdatedAt models.LocalTime `json:"updated_at"`
	SyncTime  *time.Time       `json:"sync_time"`
}

func (CloudPlatform) TableName

func (c CloudPlatform) TableName() string

type Region

type Region struct {
	RegionId   string `json:"region"`
	RegionName string `json:"region_name"`
	Type       string `json:"type"`
	Enable     bool   `json:"enable"`
}

Region 云资产地域信息

type SSHGlobalConfig

type SSHGlobalConfig struct {
	ID         int              `json:"id" gorm:"column:id;AUTO_INCREMENT;comment:主键"`
	UserName   string           `gorm:"comment:'用户';column:username" json:"-"`
	Password   string           `gorm:"comment:'密码'" json:"-"`
	Port       string           `gorm:"comment:'端口';default:22" json:"-"`
	PrivateKey string           `json:"private_key"`
	Enable     bool             `json:"enable"`
	CreatedAt  models.LocalTime `json:"created_at"`
	DeletedAt  gorm.DeletedAt   `json:"-"`
	UpdatedAt  models.LocalTime `json:"updated_at"`
}

func (SSHGlobalConfig) TableName

func (v SSHGlobalConfig) TableName() string

type SSHRecord

type SSHRecord struct {
	gorm.Model
	ConnectID   string           `gorm:"comment:'连接标识';size:64" json:"connect_id"`
	UserName    string           `gorm:"comment:'系统用户名';size:128" json:"user_name"`
	HostName    string           `gorm:"comment:'主机名';size:128" json:"host_name"`
	ConnectTime models.LocalTime `gorm:"index;comment:'接入时间'" json:"connect_time"`
	LogoutTime  models.LocalTime `gorm:"index;comment:'注销时间'" json:"logout_time"`
	Records     []byte           `json:"records" gorm:"type:longblob;comment:'操作记录(二进制存储)';size:128"`
	HostId      uint             `gorm:"comment:'主机Id外键'" json:"host_id"`
	Host        VirtualMachine   `gorm:"foreignkey:HostId" json:"host"`
}

func (SSHRecord) TableName

func (s SSHRecord) TableName() string

type TreeData

type TreeData struct {
	Key      string      `json:"key"`
	Value    string      `json:"value"`
	Title    string      `json:"title"`
	Name     string      `json:"name"`
	Children interface{} `json:"children"`
}

type TreeMenu

type TreeMenu struct {
	ID              int               `gorm:"not null;primary_key; AUTO_INCREMENT" json:"id"`
	Name            string            `gorm:"type:varchar(32); not null" json:"name"`
	ParentId        int64             `gorm:"default:0" json:"parent_id"`
	Hide            int               `gorm:"default:0" json:"hide"`
	SortId          int               `json:"sort_id"`
	VirtualMachines []*VirtualMachine `gorm:"many2many:hosts_group_virtual_machines" json:"cloud_virtual_machine"`
}

func (TreeMenu) TableName

func (t TreeMenu) TableName() string

type VirtualMachine

type VirtualMachine struct {
	ID int `json:"id" gorm:"not null;primary_key"`
	//Platform      CloudPlatform    `gorm:"-" json:"platform"`
	Groups        []*TreeMenu      `gorm:"many2many:hosts_group_virtual_machines" json:"groups"`
	UUID          string           `json:"uuid"`
	UserName      string           `gorm:"comment:'用户';column:username" json:"-"`
	Password      string           `gorm:"comment:'密码'" json:"-"`
	Port          string           `gorm:"comment:'端口';default:22" json:"-"`
	HostName      string           `gorm:"comment:'主机名';column:hostname" json:"hostname"`
	CPU           int              `gorm:"comment:'CPU'" json:"cpu"`
	Mem           int              `gorm:"comment:'内存'" json:"memory"` // MB
	OS            string           `gorm:"comment:'操作系统'" json:"os"`
	OSType        string           `gorm:"comment:'系统类型'" json:"os_type"`
	MacAddr       string           `gorm:"comment:'物理地址'" json:"mac_addr"`
	PrivateAddr   string           `gorm:"comment:'私网地址'" json:"private_addr"`
	PublicAddr    string           `gorm:"comment:'公网地址'" json:"public_addr"`
	SN            string           `gorm:"comment:'SN序列号'" json:"sn"`
	BandWidth     int              `gorm:"comment:'带宽';column:bandwidth" json:"bandwidth"` // MB
	Status        string           `json:"status"`
	Region        string           `gorm:"comment:'机房'" json:"region"`
	Source        string           `json:"source"`
	VmCreatedTime string           `json:"vm_created_time"`
	VmExpiredTime string           `json:"vm_expired_time"`
	CreatedAt     models.LocalTime `json:"created_at"`
	DeletedAt     gorm.DeletedAt   `json:"-"`
	UpdatedAt     models.LocalTime `json:"updated_at"`
}

func (VirtualMachine) TableName

func (v VirtualMachine) TableName() string

Jump to

Keyboard shortcuts

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