Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type Authorize
- type Callback
- type Console
- type Flavor
- type FloatingIp
- type Gateway
- type Glusterfs
- type Hyper
- type Image
- type Instance
- type Interface
- type Job
- type Key
- type Member
- type Model
- type Network
- type Openshift
- type Organization
- type Portmap
- type Quota
- type Registry
- type Resource
- type Role
- type SecurityGroup
- type SecurityRule
- type Session
- type Subnet
- type User
- type Vnc
- type Volume
- type Zone
Constants ¶
View Source
const ( HYPER_INIT = "" HYPER_CREATED = "created" HYPER_ACTIVE = "active" )
Variables ¶
View Source
var ( HyperStatusValues = map[int32]string{ 0: HYPER_CREATED, 1: HYPER_ACTIVE, } HyperStatusNames = map[string]int32{ HYPER_INIT: 0, HYPER_CREATED: 0, HYPER_ACTIVE: 1, } )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Model
Address string `gorm:"type:varchar(64)"`
Netmask string `gorm:"type:varchar(64)"`
Type string `gorm:"type:varchar(20);default:'native'"`
Allocated bool `gorm:"default:false"`
Reserved bool `gorm:"default:false"`
SubnetID int64
Subnet *Subnet `gorm:"foreignkey:SubnetID"`
Interface int64
}
type Callback ¶
type Callback struct {
gorm.Model
Status int32
Control string `gorm:"type:varchar(256)"`
Command string `gorm:"type:varchar(65536)"`
Extra int32
Job Job `gorm:"ForeignKey:JobID"`
JobID uint
}
func (*Callback) BeforeCreate ¶
type FloatingIp ¶
type FloatingIp struct {
Model
FipAddress string `gorm:"type:varchar(64)"`
IntAddress string `gorm:"type:varchar(64)"`
Type string `gorm:"type:varchar(20)"`
InstanceID int64
Instance *Instance `gorm:"foreignkey:InstanceID"`
Interface *Interface `gorm:"foreignkey:FloatingIp"`
GatewayID int64
Gateway *Gateway `gorm:"foreignkey:GatewayID"`
IPAddress string
}
type Gateway ¶
type Gateway struct {
Model
Name string `gorm:"type:varchar(32)"`
Status string `gorm:"type:varchar(32)"`
Type string `gorm:"type:varchar(32)"`
Hyper int32 `gorm:"default:-1"`
Peer int32 `gorm:"default:-1"`
VrrpVni int64
VrrpAddr string `gorm:"type:varchar(64)"`
PeerAddr string `gorm:"type:varchar(64)"`
Interfaces []*Interface `gorm:"foreignkey:Device"`
Subnets []*Subnet `gorm:"many2many:subnet_routers;"`
ZoneID int64
Zone *Zone `gorm:"foreignkey:ZoneID"`
}
type Hyper ¶
type Hyper struct {
ID int64 `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
Hostid int32 `gorm:"unique_index"`
Hostname string `gorm:"type:varchar(64)"`
Status int32
Parentid int32
Children int32
Duration int64
HostIP string
VirtType string
ZoneID int64
Zone *Zone `gorm:"foreignkey:ZoneID"`
Resource *Resource `gorm:"foreignkey:Hostid;AssociationForeignKey:Hostid"`
}
func (*Hyper) LoadCommand ¶
func (*Hyper) LoadControl ¶
func (*Hyper) LoadRequest ¶
type Image ¶
type Image struct {
Model
Name string `gorm:"type:varchar(128)"`
OSCode string `gorm:"type:varchar(128)"`
Format string `gorm:"type:varchar(128)"`
Architecture string `gorm:"type:varchar(256)"`
Status string `gorm:"type:varchar(128)"`
Href string `gorm:"type:varchar(256)"`
Checksum string `gorm:"type:varchar(36)"`
OsHashAlgo string `gorm:"type:varchar(36)"`
OsHashValue string `gorm:"type:varchar(36)"`
Holder string `gorm:"type:varchar(36)"`
Protected bool
OpenShiftLB bool `gorm:"default:false"`
Visibility string `gorm:"type:varchar(36)"`
MiniDisk int32
MiniMem int32
Size int64
OsVersion string `gorm:"type:varchar(128)"`
DiskType string `gorm:"type:varchar(128)"`
VirtType string `gorm:"type:varchar(36)"`
UserName string `gorm:"type:varchar(128)"`
}
type Instance ¶
type Instance struct {
Model
Hostname string `gorm:"type:varchar(128)"`
Domain string `gorm:"type:varchar(128)"`
Status string `gorm:"type:varchar(32)"`
Reason string `gorm:"type:text"`
FloatingIps []*FloatingIp `gorm:"PRELOAD:false"`
Volumes []*Volume `gorm:"PRELOAD:false"`
Interfaces []*Interface `gorm:"foreignkey:Instance"`
Portmaps []*Portmap `gorm:"foreignkey:instanceID"`
FlavorID int64
Flavor *Flavor `gorm:"foreignkey:FlavorID"`
ImageID int64
Image *Image `gorm:"foreignkey:ImageID"`
ClusterID int64
Cluster *Openshift `gorm:"PRELOAD:false"`
Keys []*Key `gorm:"many2many:InstanceKeys;"`
Userdata string `gorm:"type:text"`
Hyper int32 `gorm:"default:-1"`
ZoneID int64
Zone *Zone `gorm:"foreignkey:ZoneID"`
}
type Interface ¶
type Interface struct {
Model
Name string `gorm:"type:varchar(32)"`
MacAddr string `gorm:"type:varchar(32)"`
Instance int64
Device int64
Dhcp int64
FloatingIp int64
Subnet int64
ZoneID int64
Address *Address `gorm:"foreignkey:Interface"`
Hyper int32 `gorm:"default:-1"`
PrimaryIf bool `gorm:"default:false"`
Type string `gorm:"type:varchar(20)"`
Mtu int32
Secgroups []*SecurityGroup `gorm:"many2many:secgroup_ifaces;"`
AddrPairs string `gorm:"type:varchar(256)"`
}
type Job ¶
type Job struct {
gorm.Model
Status int32
Control string `gorm:"type:varchar(256)"`
Command string `gorm:"type:text"`
Extra int32
Hooks string `gorm:"type:varchar(256)"`
EchoNumber int32
}
func (*Job) BeforeCreate ¶
func (*Job) LoadRequest ¶
type Model ¶
type Model struct {
ID int64 `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
UUID string `gorm:"type:varchar(64)"`
Creater int64 `gorm:"default:1"` /* The user ID of the resource */
Owner int64 `gorm:"default:1"` /* The organization ID of the resource */
OwnerInfo *Organization `gorm:"PRELOAD:false","foreignkey:Owner"`
}
func (*Model) BeforeCreate ¶
type Openshift ¶
type Openshift struct {
Model
ClusterName string `gorm:"type:varchar(128)"`
BaseDomain string `gorm:"type:varchar(256)"`
LoadBalancer string `gorm:"type:varchar(128)"`
Version string `gorm:"type:varchar(32)"`
Status string `gorm:"type:varchar(32)"`
Haflag string
Instances []*Instance `gorm:"foreignkey:ClusterID"`
SubnetID int64
Subnet *Subnet `gorm:"foreignkey:subnetID"`
WorkerNum int32
Flavor int64
MasterFlavor int64
WorkerFlavor int64
Key int64
GlusterID int64
ZoneID int64
InfrastructureType string `gorm:"type:varchar(256)"`
StorageBackend string `gorm:"type:varchar(256)"`
AdditionalTrustBundle string `gorm:"type:varchar(256)"`
ImageContentSources string `gorm:"type:varchar(256)"`
}
type Organization ¶
type Organization struct {
Model
Name string `gorm:"size:255;unique_index" json:"name,omitempty"`
DefaultSG int64
Members []*Member `gorm:"foreignkey:OrgID"`
OwnerUser *User `gorm:"foreignkey:ID";AssociationForeignKey:Owner`
}
func (Organization) TableName ¶
func (Organization) TableName() string
type Portmap ¶
type Portmap struct {
Model
Name string `gorm:"type:varchar(32)"`
Status string `gorm:"type:varchar(32)"`
LocalPort int32
LocalAddress string `gorm:"type:varchar(64)"`
RemotePort int32
RemoteAddress string `gorm:"type:varchar(64)"`
GatewayID int64
Gateway *Gateway `gorm:"foreignkey:GatewayID"`
InstanceID int64
}
type Registry ¶
type Registry struct {
Model
Label string `gorm:"type:varchar(128)"`
OcpVersion string `gorm:"type:varchar(128)"`
VirtType string `gorm:"type:varchar(128)"`
RegistryContent string `gorm:"type:varchar(20480)"`
Initramfs string `gorm:"type:varchar(1280)"`
Kernel string `gorm:"type:varchar(1280)"`
Image string `gorm:"type:varchar(1280)"`
Installer string `gorm:"type:varchar(1280)"`
Cli string `gorm:"type:varchar(1280)"`
}
type SecurityGroup ¶
type SecurityRule ¶
type SecurityRule struct {
Model
Secgroup int64
RemoteIp string `gorm:"type:varchar(32)"`
RemoteGroup string `gorm:"type:varchar(36)"`
Direction string `gorm:"type:varchar(16)"`
IpVersion string `gorm:"type:varchar(12)"`
Protocol string `gorm:"type:varchar(20)"`
PortMin int32 `gorm:"default:-1"`
PortMax int32 `gorm:"default:-1"`
}
func GetSecurityRules ¶
func GetSecurityRules(secGroups []*SecurityGroup) (securityRules []*SecurityRule, err error)
type Session ¶
type Subnet ¶
type Subnet struct {
Model
Name string `gorm:"type:varchar(32)"`
Network string `gorm:"type:varchar(64)"`
Netmask string `gorm:"type:varchar(64)"`
Gateway string `gorm:"type:varchar(64)"`
Start string `gorm:"type:varchar(64)"`
End string `gorm:"type:varchar(64)"`
NameServer string `gorm:"type:varchar(64)"`
DomainSearch string `gorm:"type:varchar(256)"`
Dhcp string `gorm:"type:varchar(16)"`
Vlan int64
Zones []*Zone `gorm:"many2many:subnet_zones;"`
Routers []*Gateway `gorm:"many2many:subnet_routers;"`
Netlink *Network `gorm:"foreignkey:Vlan;AssociationForeignKey:Vlan"`
Type string `gorm:"type:varchar(20);default:'internal'"`
Router int64
Routes string `gorm:"type:varchar(256)"`
VSwitch string `gorm:"type:varchar(256)"`
}
type User ¶
type Volume ¶
type Volume struct {
Model
Name string `gorm:"type:varchar(128)"`
Path string `gorm:"type:varchar(128)"`
Size int32
Format string `gorm:"type:varchar(32)"`
Status string `gorm:"type:varchar(32)"`
Target string `gorm:"type:varchar(32)"`
Href string `gorm:"type:varchar(256)"`
InstanceID int64
Instance *Instance `gorm:"foreignkey:InstanceID"`
}
Click to show internal directories.
Click to hide internal directories.