models

package
v2.0.31+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHED_IMAGE_REFRESH_SECONDS                  = 900   // 15 minutes
	CACHED_IMAGE_REFERENCE_SESSION_EXPIRE_SECONDS = 86400 // 1 day
)
View Source
const (
	CLOUD_PROVIDER_INIT         = "init"
	CLOUD_PROVIDER_CONNECTED    = "connected"
	CLOUD_PROVIDER_DISCONNECTED = "disconnected"
	CLOUD_PROVIDER_START_SYNC   = "start_sync"
	CLOUD_PROVIDER_SYNCING      = "syncing"

	CLOUD_PROVIDER_VMWARE = "VMware"
	CLOUD_PROVIDER_ALIYUN = "Aliyun"
)
View Source
const (
	CLOUD_REGION_STATUS_INSERVER     = "inservice"
	CLOUD_REGION_STATUS_OUTOFSERVICE = "outofservice"
)
View Source
const (
	DISK_INIT           = "init"
	DISK_REBUILD        = "rebuild"
	DISK_ALLOC_FAILED   = "alloc_failed"
	DISK_STARTALLOC     = "start_alloc"
	DISK_ALLOCATING     = "allocating"
	DISK_READY          = "ready"
	DISK_DEALLOC        = "deallocating"
	DISK_DEALLOC_FAILED = "dealloc_failed"
	DISK_UNKNOWN        = "unknown"

	DISK_START_SAVE = "start_save"
	DISK_SAVING     = "saving"

	DISK_START_RESIZE = "start_resize"
	DISK_RESIZING     = "resizing"

	DISK_START_MIGRATE = "start_migrate"
	DISK_POST_MIGRATE  = "post_migrate"
	DISK_MIGRATING     = "migrating"

	DISK_TYPE_SYS  = "sys"
	DISK_TYPE_SWAP = "swap"
	DISK_TYPE_DATA = "data"

	DISK_BACKING_IMAGE = "image"
)
View Source
const (
	REDIS_TYPE = "REDIS"
	RDS_TYPE   = "RDS"
)
View Source
const (
	VM_INIT            = "init"
	VM_UNKNOWN         = "unknown"
	VM_SCHEDULE        = "schedule"
	VM_SCHEDULE_FAILED = "sched_fail"
	VM_CREATE_NETWORK  = "network"
	VM_NETWORK_FAILED  = "net_fail"
	VM_DEVICE_FAILED   = "dev_fail"
	VM_CREATE_FAILED   = "create_fail"
	VM_CREATE_DISK     = "disk"
	VM_DISK_FAILED     = "disk_fail"
	VM_START_DEPLOY    = "start_deploy"
	VM_DEPLOYING       = "deploying"
	VM_DEPLOY_FAILED   = "deploy_fail"
	VM_READY           = "ready"
	VM_START_START     = "start_start"
	VM_STARTING        = "starting"
	VM_START_FAILED    = "start_fail" // # = ready
	VM_RUNNING         = "running"
	VM_START_STOP      = "start_stop"
	VM_STOPPING        = "stopping"
	VM_STOP_FAILED     = "stop_fail" // # = running

	VM_START_SUSPEND  = "start_suspend"
	VM_SUSPENDING     = "suspending"
	VM_SUSPEND        = "suspend"
	VM_SUSPEND_FAILED = "suspend_failed"

	VM_START_DELETE = "start_delete"
	VM_DELETE_FAIL  = "delete_fail"
	VM_DELETING     = "deleting"

	VM_START_MIGRATE  = "start_migrate"
	VM_MIGRATING      = "migrating"
	VM_MIGRATE_FAILED = "migrate_failed"

	VM_CHANGE_FLAVOR     = "change_flavor"
	VM_REBUILD_ROOT      = "rebuild_root"
	VM_REBUILD_ROOT_FAIL = "rebld_root_fail"

	VM_START_SNAPSHOT  = "snapshot_start"
	VM_SNAPSHOT        = "snapshot"
	VM_SNAPSHOT_STREAM = "block_stream"
	VM_SNAPSHOT_SUCC   = "snapshot_succ"
	VM_SNAPSHOT_FAILED = "snapshot_failed"

	VM_SYNCING_STATUS = "syncing"
	VM_SYNC_CONFIG    = "sync_config"
	VM_SYNC_FAIL      = "sync_fail"

	VM_RESIZE_DISK      = "resize_disk"
	VM_START_SAVE_DISK  = "start_save_disk"
	VM_SAVE_DISK        = "save_disk"
	VM_SAVE_DISK_FAILED = "save_disk_failed"

	VM_RESTORING_SNAPSHOT = "restoring_snapshot"
	VM_RESTORE_DISK       = "restore_disk"
	VM_RESTORE_STATE      = "restore_state"
	VM_RESTORE_FAILED     = "restore_failed"

	VM_REMOVE_STATEFILE = "remove_state"

	VM_ADMIN = "admin"

	SHUTDOWN_STOP      = "stop"
	SHUTDOWN_TERMINATE = "terminate"

	HYPERVISOR_KVM       = "kvm"
	HYPERVISOR_CONTAINER = "container"
	HYPERVISOR_BAREMETAL = "baremetal"
	HYPERVISOR_ESXI      = "esxi"
	HYPERVISOR_HYPERV    = "hyperv"
	HYPERVISOR_ALIYUN    = "aliyun"

	//	HYPERVISOR_DEFAULT = HYPERVISOR_KVM
	HYPERVISOR_DEFAULT = HYPERVISOR_ALIYUN
)
View Source
const (
	HOST_TYPE_BAREMETAL  = "baremetal"
	HOST_TYPE_HYPERVISOR = "hypervisor" // KVM
	HOST_TYPE_ESXI       = "esxi"       // # VMWare vSphere ESXi
	HOST_TYPE_KUBELET    = "kubelet"    // # Kubernetes Kubelet
	HOST_TYPE_HYPERV     = "hyperv"     // # Microsoft Hyper-V
	HOST_TYPE_XEN        = "xen"        // # XenServer
	HOST_TYPE_ALIYUN     = "aliyun"

	HOST_TYPE_DEFAULT = HOST_TYPE_HYPERVISOR

	// # possible status
	HOST_ONLINE   = "online"
	HOST_ENABLED  = "online"
	HOST_OFFLINE  = "offline"
	HOST_DISABLED = "offline"

	NIC_TYPE_IPMI  = "ipmi"
	NIC_TYPE_ADMIN = "admin"

	HOST_STATUS_INIT           = "init"
	HOST_STATUS_PREPARE        = "prepare"
	HOST_STATUS_PREPARE_FAIL   = "prepare_fail"
	HOST_STATUS_READY          = "ready"
	HOST_STATUS_RUNNING        = "running"
	HOST_STATUS_MAINTAINING    = "maintaining"
	HOST_STATUS_START_MAINTAIN = "start_maintain"
	HOST_STATUS_DELETING       = "deleting"
	HOST_STATUS_DELETE         = "delete"
	HOST_STATUS_DELETE_FAIL    = "delete_fail"
	HOST_STATUS_UNKNOWN        = "unknown"
	HOST_STATUS_SYNCING_STATUS = "syncing_status"
	HOST_STATUS_SYNC           = "sync"
	HOST_STATUS_SYNC_FAIL      = "sync_fail"
	HOST_STATUS_START_CONVERT  = "start_convert"
	HOST_STATUS_CONVERTING     = "converting"
)
View Source
const (
	IMAGE_STATUS_ACTIVE  = "active"
	IMAGE_STATUS_QUEUED  = "queued"
	IMAGE_STATUS_KILLED  = "killed"
	IMAGE_STATUS_DELETED = "deleted"
)
View Source
const (
	DIRECT_PCI_TYPE = "PCI"
	GPU_HPC_TYPE    = "GPU-HPC" // # for compute
	GPU_VGA_TYPE    = "GPU-VGA" // # for display
	USB_TYPE        = "USB"
	NIC_TYPE        = "NIC"

	NVIDIA_VENDOR_ID = "10de"
	AMD_VENDOR_ID    = "1002"
)
View Source
const (
	// # DEFAULT_BANDWIDTH = options.default_bandwidth
	MAX_BANDWIDTH = 100000

	SERVER_TYPE_GUEST     = "guest"
	SERVER_TYPE_BAREMETAL = "baremetal"
	SERVER_TYPE_CONTAINER = "container"

	STATIC_ALLOC = "static"

	MAX_NETWORK_NAME_LEN = 11

	EXTRA_DNS_UPDATE_TARGETS = "__extra_dns_update_targets"

	NETWORK_STATUS_INIT          = "init"
	NETWORK_STATUS_PENDING       = "pending"
	NETWORK_STATUS_AVAILABLE     = "available"
	NETWORK_STATUS_FAILED        = "failed"
	NETWORK_STATUS_UNKNOWN       = "unknown"
	NETWORK_STATUS_START_DELETE  = "start_delete"
	NETWORK_STATUS_DELETING      = "deleting"
	NETWORK_STATUS_DELETED       = "deleted"
	NETWORK_STATUS_DELETE_FAILED = "delete_failed"
)
View Source
const (
	STRATEGY_REQUIRE = "require"
	STRATEGY_EXCLUDE = "exclude"
	STRATEGY_PREFER  = "prefer"
	STRATEGY_AVOID   = "avoid"

	// # container used aggregate
	CONTAINER_AGGREGATE = "container"
)
View Source
const (
	CACHED_IMAGE_STATUS_INIT         = "init"
	CACHED_IMAGE_STATUS_SAVING       = "saving"
	CACHED_IMAGE_STATUS_CACHING      = "caching"
	CACHED_IMAGE_STATUS_READY        = "ready"
	CACHED_IMAGE_STATUS_DELETING     = "deleting"
	CACHED_IMAGE_STATUS_CACHE_FAILED = "cache_fail"

	DOWNLOAD_SESSION_LENGTH = 3600 * 3 // 3 hour
)
View Source
const (
	STORAGE_LOCAL        = "local"
	STORAGE_BAREMETAL    = "baremetal"
	STORAGE_SHEEPDOG     = "sheepdog"
	STORAGE_RBD          = "rbd"
	STORAGE_DOCKER       = "docker"
	STORAGE_NAS          = "nas"
	STORAGE_VSAN         = "vsan"
	STORAGE_PUBLIC_CLOUD = "cloud"

	STORAGE_ENABLED  = "enabled"
	STORAGE_DISABLED = "disabled"
	STORAGE_OFFLINE  = "offline"
	STORAGE_ONLINE   = "offline"

	DISK_TYPE_ROTATE = "rotate"
	DISK_TYPE_SSD    = "ssd"
	DISK_TYPE_HYBRID = "hybrid"
)
View Source
const (
	VPC_STATUS_PENDING       = "pending"
	VPC_STATUS_AVAILABLE     = "available"
	VPC_STATUS_FAILED        = "failed"
	VPC_STATUS_START_DELETE  = "start_delete"
	VPC_STATUS_DELETING      = "deleting"
	VPC_STATUS_DELETE_FAILED = "delete_failed"
	VPC_STATUS_DELETED       = "deleted"
	VPC_STATUS_UNKNOWN       = "unknown"

	MAX_VPC_PER_REGION = 3
)
View Source
const (
	ZONE_ENABLE  = "enable"
	ZONE_DISABLE = "disable"
	ZONE_SOLDOUT = "soldout"
	ZONE_LACK    = "lack"
)
View Source
const (
	DNS_RECORDS_SEPARATOR = ","
)
View Source
const (
	MAX_IFNAME_SIZE = 13
)
View Source
const MAX_TRIES = 10
View Source
const (
	SECURITY_GROUP_SEPARATOR = ";"
)

Variables

View Source
var (
	ErrOutOfCPU            = errors.New("out of CPU quota")
	ErrOutOfMemory         = errors.New("out of memory quota")
	ErrOutOfStorage        = errors.New("out of storage quota")
	ErrOutOfPort           = errors.New("out of internal port quota")
	ErrOutOfEip            = errors.New("out of eip quota")
	ErrOutOfEport          = errors.New("out of external port quota")
	ErrOutOfBw             = errors.New("out of internal bandwidth quota")
	ErrOutOfEbw            = errors.New("out of external bandwidth quota")
	ErrOutOfKeypair        = errors.New("out of keypair quota")
	ErrOutOfImage          = errors.New("out of image quota")
	ErrOutOfGroup          = errors.New("out of group quota")
	ErrOutOfSecgroup       = errors.New("out of secgroup quota")
	ErrOutOfIsolatedDevice = errors.New("out of isolated device quota")
)
View Source
var HOSTTYPE_HYPERVISOR = map[string]string{
	HOST_TYPE_HYPERVISOR: HYPERVISOR_KVM,
	HOST_TYPE_BAREMETAL:  HYPERVISOR_BAREMETAL,
	HOST_TYPE_ESXI:       HYPERVISOR_ESXI,
	HOST_TYPE_KUBELET:    HYPERVISOR_CONTAINER,
	HOST_TYPE_ALIYUN:     HYPERVISOR_ALIYUN,
}
View Source
var ID_VENDOR_MAP = map[string]string{
	NVIDIA_VENDOR_ID: "NVIDIA",
	AMD_VENDOR_ID:    "AMD",
}
View Source
var QuotaManager *quotas.SQuotaManager
View Source
var VALID_GPU_TYPES = []string{GPU_HPC_TYPE, GPU_VGA_TYPE}
View Source
var VENDOR_ID_MAP = map[string]string{
	"NVIDIA": NVIDIA_VENDOR_ID,
	"AMD":    AMD_VENDOR_ID,
}

Functions

func AttachUsageQuery

func AttachUsageQuery(
	q *sqlchemy.SQuery,
	hosts *sqlchemy.SSubQuery,
	hostIdField sqlchemy.IQueryField,
	hostTypes []string,
	rangeObj db.IStandaloneModel,
) *sqlchemy.SQuery

func GetIPTenantIdPairs

func GetIPTenantIdPairs()

func InitDB

func InitDB() error

func RegisterGuestDriver

func RegisterGuestDriver(driver IGuestDriver)

Types

type DNSUpdateKeySecret

type DNSUpdateKeySecret struct {
	Key    string
	Secret string
}

type DnsIp

type DnsIp struct {
	Ttl  int
	Addr string
}

type GuestnicsCount

type GuestnicsCount struct {
	InternalNicCount        int
	InternalVirtualNicCount int
	ExternalNicCount        int
	ExternalVirtualNicCount int
	InternalBandwidth       int
	ExternalBandwidth       int
}

type HostStat

type HostStat struct {
	MemSize     int
	MemReserved int
	MemCmtbound float32
	CpuCount    int8
	CpuReserved int8
	CpuCmtbound float32
	StorageSize int
}

type HostsCountStat

type HostsCountStat struct {
	StorageSize   int64
	Count         int64
	Memory        int64
	MemoryVirtual float64
	CPU           int64
	CPUVirtual    float64
}

type IGuestDriver

type IGuestDriver interface {
	GetHypervisor() string

	GetMaxVCpuCount() int
	GetMaxVMemSizeGB() int

	GetJsonDescAtHost(ctx context.Context, guest *SGuest, host *SHost) jsonutils.JSONObject

	ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

	ValidateCreateHostData(ctx context.Context, userCred mcclient.TokenCredential, bmName string, host *SHost, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

	PrepareDiskRaidConfig(host *SHost, params *jsonutils.JSONDict) error

	GetNamedNetworkConfiguration(guest *SGuest, userCred mcclient.TokenCredential, host *SHost, netConfig *SNetworkConfig) (*SNetwork, string, int8, IPAddlocationDirection)

	Attach2RandomNetwork(guest *SGuest, ctx context.Context, userCred mcclient.TokenCredential, host *SHost, netConfig *SNetworkConfig, pendingUsage quotas.IQuota) error

	ChooseHostStorage(host *SHost, backend string) *SStorage

	StartGuestCreateTask(guest *SGuest, ctx context.Context, userCred mcclient.TokenCredential, params *jsonutils.JSONDict, pendingUsage quotas.IQuota, parentTaskId string) error

	RequestGuestCreateAllDisks(ctx context.Context, guest *SGuest, task taskman.ITask) error

	OnGuestCreateTaskComplete(ctx context.Context, guest *SGuest, task taskman.ITask) error

	RequestGuestCreateInsertIso(ctx context.Context, imageId string, guest *SGuest, task taskman.ITask) error

	StartGuestStopTask(guest *SGuest, ctx context.Context, userCred mcclient.TokenCredential, params *jsonutils.JSONDict, parentTaskId string) error

	RequestDeployGuestOnHost(ctx context.Context, guest *SGuest, host *SHost, task taskman.ITask) error

	OnGuestDeployTaskDataReceived(ctx context.Context, guest *SGuest, task taskman.ITask, data jsonutils.JSONObject) error

	OnGuestDeployTaskComplete(ctx context.Context, guest *SGuest, task taskman.ITask) error

	StartGuestSyncstatusTask(guest *SGuest, ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error

	RequestSyncstatusOnHost(ctx context.Context, guest *SGuest, host *SHost, userCred mcclient.TokenCredential) (jsonutils.JSONObject, error)

	RequestStartOnHost(guest *SGuest, host *SHost, userCred mcclient.TokenCredential, task taskman.ITask) (jsonutils.JSONObject, error)

	RequestStopOnHost(ctx context.Context, guest *SGuest, host *SHost, task taskman.ITask) error

	StartDeleteGuestTask(guest *SGuest, ctx context.Context, userCred mcclient.TokenCredential, params *jsonutils.JSONDict, parentTaskId string) error

	RequestStopGuestForDelete(ctx context.Context, guest *SGuest, task taskman.ITask) error

	RequestDetachDisksFromGuestForDelete(ctx context.Context, guest *SGuest, task taskman.ITask) error

	RequestUndeployGuestOnHost(ctx context.Context, guest *SGuest, host *SHost, task taskman.ITask) error

	OnDeleteGuestFinalCleanup(ctx context.Context, guest *SGuest, userCred mcclient.TokenCredential) error

	PerformStart(ctx context.Context, userCred mcclient.TokenCredential, guest *SGuest, data *jsonutils.JSONDict) error

	CheckDiskTemplateOnStorage(ctx context.Context, userCred mcclient.TokenCredential, imageId string, storageId string, task taskman.ITask) error

	GetGuestVncInfo(userCred mcclient.TokenCredential, guest *SGuest, host *SHost) (*jsonutils.JSONDict, error)
}

func GetDriver

func GetDriver(hypervisor string) IGuestDriver

type IPAddlocationDirection

type IPAddlocationDirection string
const (
	IPAllocationStepdown IPAddlocationDirection = "stepdown"
	IPAllocationStepup   IPAddlocationDirection = "stepup"
	IPAllocationRadnom   IPAddlocationDirection = "random"
	IPAllocationNone     IPAddlocationDirection = "none"
	IPAllocationDefault                         = ""
)

type IsolatedDeviceCountStat

type IsolatedDeviceCountStat struct {
	Devices int
	Gpus    int
}

type NetworkPortStat

type NetworkPortStat struct {
	Count    int
	CountExt int
}

type SCachedimage

type SCachedimage struct {
	db.SStandaloneResourceBase
	SInfrastructure

	Size int64 `nullable:"false" list:"admin" update:"admin" create:"admin_required"` // = Column(BigInteger, nullable=False) # in Byte
	// virtual_size = Column(BigInteger, nullable=False) # in Byte
	Info     jsonutils.JSONObject `nullable:"true" get:"admin" update:"admin" create:"admin_required"` // Column(JSONEncodedDict, nullable=True)
	LastSync time.Time            `list:"admin"`                                                       // = Column(DateTime)
	LastRef  time.Time            `list:"admin"`                                                       // = Column(DateTime)
	RefCount int                  `default:"0" list:"admin"`                                           // = Column(Integer, default=0, server_default='0')
}

func (*SCachedimage) AllowPerformRefresh

func (self *SCachedimage) AllowPerformRefresh(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SCachedimage) GetCustomizeColumns

func (self *SCachedimage) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SCachedimage) PerformRefresh

func (*SCachedimage) ValidateDeleteCondition

func (self *SCachedimage) ValidateDeleteCondition(ctx context.Context) error

type SCachedimageManager

type SCachedimageManager struct {
	db.SStandaloneResourceBaseManager
	SInfrastructureManager
}
var CachedimageManager *SCachedimageManager

func (*SCachedimageManager) ImageAddRefCount

func (manager *SCachedimageManager) ImageAddRefCount(imageId string)

type SCloudprovider

type SCloudprovider struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure

	AccessUrl string `width:"64" charset:"ascii" nullable:"true" list:"admin" update:"admin" create:"admin_optional"`
	// Hostname string `width:"64" charset:"ascii" nullable:"true"` // Column(VARCHAR(64, charset='ascii'), nullable=False)
	// port = Column(Integer, nullable=False)
	Account string `width:"64" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"`  // Column(VARCHAR(64, charset='ascii'), nullable=False)
	Secret  string `width:"256" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"` // Column(VARCHAR(256, charset='ascii'), nullable=False)

	LastSync time.Time `get:"admin" list:"admin"` // = Column(DateTime, nullable=True)

	Version string `width:"32" charset:"ascii" nullable:"true" list:"admin"` // Column(VARCHAR(32, charset='ascii'), nullable=True)

	Sysinfo jsonutils.JSONObject `get:"admin"` // Column(JSONEncodedDict, nullable=True)

	Provider string `width:"64" charset:"ascii" list:"admin" create:"admin_required"`
}

func (*SCloudprovider) AllowPerformSync

func (self *SCloudprovider) AllowPerformSync(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SCloudprovider) AllowPerformUpdateCredential

func (self *SCloudprovider) AllowPerformUpdateCredential(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SCloudprovider) CanSync

func (self *SCloudprovider) CanSync() bool

func (*SCloudprovider) GetCustomizeColumns

func (self *SCloudprovider) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SCloudprovider) GetDriver

func (self *SCloudprovider) GetDriver() (cloudprovider.ICloudProvider, error)

func (*SCloudprovider) GetExtraDetails

func (self *SCloudprovider) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SCloudprovider) GetHostCount

func (self *SCloudprovider) GetHostCount() int

func (*SCloudprovider) MarkStartSync

func (self *SCloudprovider) MarkStartSync(userCred mcclient.TokenCredential)

func (*SCloudprovider) PerformSync

func (*SCloudprovider) PerformUpdateCredential

func (self *SCloudprovider) PerformUpdateCredential(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCloudprovider) PostCreate

func (self *SCloudprovider) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SCloudprovider) SaveSysInfo

func (self *SCloudprovider) SaveSysInfo(info jsonutils.JSONObject)

func (*SCloudprovider) ValidateDeleteCondition

func (self *SCloudprovider) ValidateDeleteCondition(ctx context.Context) error

func (*SCloudprovider) ValidateUpdateData

func (self *SCloudprovider) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SCloudproviderManager

var CloudproviderManager *SCloudproviderManager

func (*SCloudproviderManager) FetchCloudproviderById

func (manager *SCloudproviderManager) FetchCloudproviderById(providerId string) *SCloudprovider

func (*SCloudproviderManager) FetchCloudproviderByIdOrName

func (manager *SCloudproviderManager) FetchCloudproviderByIdOrName(providerId string) *SCloudprovider

func (*SCloudproviderManager) InitializeData

func (manager *SCloudproviderManager) InitializeData() error

func (*SCloudproviderManager) ValidateCreateData

func (self *SCloudproviderManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SCloudproviderUsage

type SCloudproviderUsage struct {
	HostCount         int
	VpcCount          int
	StorageCount      int
	StorageCacheCount int
}

type SCloudregion

type SCloudregion struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure

	Latitude  float32 `list:"user"`
	Longitude float32 `list:"user"`
	Provider  string  `width:"64" charset:"ascii" list:"user"`
}

func (*SCloudregion) AllowPerformDefaultVpc

func (self *SCloudregion) AllowPerformDefaultVpc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SCloudregion) CustomizeCreate

func (self *SCloudregion) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SCloudregion) GetCustomizeColumns

func (self *SCloudregion) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SCloudregion) GetExtraDetails

func (self *SCloudregion) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SCloudregion) GetVpcCount

func (self *SCloudregion) GetVpcCount() int

func (*SCloudregion) GetZoneCount

func (self *SCloudregion) GetZoneCount() int

func (*SCloudregion) PerformDefaultVpc

func (self *SCloudregion) PerformDefaultVpc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCloudregion) ValidateDeleteCondition

func (self *SCloudregion) ValidateDeleteCondition(ctx context.Context) error

func (*SCloudregion) ValidateUpdateCondition

func (self *SCloudregion) ValidateUpdateCondition(ctx context.Context) error

type SCloudregionManager

var CloudregionManager *SCloudregionManager

func (*SCloudregionManager) AllowListItems

func (manager *SCloudregionManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SCloudregionManager) FetchRegionById

func (manager *SCloudregionManager) FetchRegionById(id string) *SCloudregion

func (*SCloudregionManager) InitializeData

func (manager *SCloudregionManager) InitializeData() error

func (*SCloudregionManager) ListItemFilter

func (manager *SCloudregionManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SCloudregionManager) SyncRegions

func (*SCloudregionManager) ValidateCreateData

func (manager *SCloudregionManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SDeployConfig

type SDeployConfig struct {
	Path    string
	Action  string
	Content string
}

type SDisk

type SDisk struct {
	db.SSharableVirtualResourceBase

	DiskFormat string `width:"32" charset:"ascii" nullable:"false" default:"qcow2" list:"user"` // Column(VARCHAR(32, charset='ascii'), nullable=False, default='qcow2')
	DiskSize   int    `nullable:"false" list:"user"`                                            // Column(Integer, nullable=False) # in MB
	AccessPath string `width:"256" charset:"ascii" nullable:"true" get:"user"`                  // = Column(VARCHAR(256, charset='ascii'), nullable=True)

	AutoDelete bool `nullable:"false" default:"false" get:"user" update:"user"` // Column(Boolean, nullable=False, default=False)

	StorageId string `width:"128" charset:"ascii" nullable:"false" list:"admin" create:"required"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)

	// # backing template id and type
	TemplateId string `width:"128" charset:"ascii" nullable:"true" list:"user"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=True)
	// # file system
	FsFormat string `width:"32" charset:"ascii" nullable:"true" list:"user"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
	// # disk type, OS, SWAP, DAT
	DiskType string `width:"32" charset:"ascii" nullable:"true" list:"user"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
	// # is persistent
	Nonpersistent bool `default:"false" list:"user"` // Column(Boolean, default=False)
}

func (*SDisk) AllowPerformCancelDelete

func (model *SDisk) AllowPerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SDisk) AllowPerformPurge

func (self *SDisk) AllowPerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SDisk) ClearHostSchedCache

func (self *SDisk) ClearHostSchedCache() error

func (*SDisk) CustomizeDelete

func (self *SDisk) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SDisk) Delete

func (self *SDisk) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SDisk) GetAttachedGuests

func (self *SDisk) GetAttachedGuests() []SGuest

func (*SDisk) GetCloudprovider

func (self *SDisk) GetCloudprovider() *SCloudprovider

func (*SDisk) GetCustomizeColumns

func (self *SDisk) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SDisk) GetExtraDetails

func (self *SDisk) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SDisk) GetFetchUrl

func (self *SDisk) GetFetchUrl() string

func (*SDisk) GetFsFormat

func (self *SDisk) GetFsFormat() string

func (*SDisk) GetGuestDiskCount

func (self *SDisk) GetGuestDiskCount() int

func (*SDisk) GetGuestdisks

func (self *SDisk) GetGuestdisks() []SGuestdisk

func (*SDisk) GetGuests

func (self *SDisk) GetGuests() []SGuest

func (*SDisk) GetPathAtHost

func (self *SDisk) GetPathAtHost(host *SHost) string

func (*SDisk) GetShortDesc

func (self *SDisk) GetShortDesc() *jsonutils.JSONDict

func (*SDisk) GetStorage

func (self *SDisk) GetStorage() *SStorage

func (*SDisk) GetTemplateId

func (self *SDisk) GetTemplateId() string

func (*SDisk) IsLocal

func (self *SDisk) IsLocal() bool

func (*SDisk) PerformCancelDelete

func (self *SDisk) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SDisk) PerformPurge

func (self *SDisk) PerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SDisk) RealDelete

func (self *SDisk) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SDisk) SetDiskReady

func (self *SDisk) SetDiskReady(ctx context.Context, userCred mcclient.TokenCredential, reason string)

func (*SDisk) StartAllocate

func (self *SDisk) StartAllocate(host *SHost, Storage *SStorage, taskId string, userCred mcclient.TokenCredential, rebuild bool)

func (*SDisk) StartDiskDeleteTask

func (self *SDisk) StartDiskDeleteTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string, isPurge bool) error

func (*SDisk) ValidateDeleteCondition

func (self *SDisk) ValidateDeleteCondition(ctx context.Context) error

type SDiskConfig

type SDiskConfig struct {
	ImageId string
	// ImageDiskFormat string
	Size            int    // MB
	Fs              string // file system
	Format          string //
	Driver          string //
	Cache           string //
	Mountpoint      string //
	Backend         string // stroageType
	ImageProperties map[string]string
}

type SDiskManager

type SDiskManager struct {
	db.SSharableVirtualResourceBaseManager
}
var DiskManager *SDiskManager

func (*SDiskManager) CleanPendingDeleteDisks

func (manager *SDiskManager) CleanPendingDeleteDisks(ctx context.Context, userCred mcclient.TokenCredential)

func (*SDiskManager) ListItemFilter

func (manager *SDiskManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SDiskManager) SyncDisks

type SDnsRecord

type SDnsRecord struct {
	db.SAdminSharableVirtualResourceBase
	Ttl int `nullable:"true" default:"0" create:"optional" list:"user" update:"user"`
}

func (*SDnsRecord) AddInfo

func (rec *SDnsRecord) AddInfo(userCred mcclient.TokenCredential, data jsonutils.JSONObject) error

func (*SDnsRecord) AllowPerformAddRecords

func (rec *SDnsRecord) AllowPerformAddRecords(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SDnsRecord) AllowPerformRemoveRecords

func (rec *SDnsRecord) AllowPerformRemoveRecords(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SDnsRecord) GetInfo

func (rec *SDnsRecord) GetInfo() []string

func (*SDnsRecord) GetTtl

func (rec *SDnsRecord) GetTtl() int

func (*SDnsRecord) PerformAddRecords

func (rec *SDnsRecord) PerformAddRecords(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SDnsRecord) PerformRemoveRecords

func (rec *SDnsRecord) PerformRemoveRecords(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SDnsRecord) ValidateUpdateData

func (rec *SDnsRecord) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SDnsRecordManager

type SDnsRecordManager struct {
	db.SAdminSharableVirtualResourceBaseManager
}
var DnsRecordManager *SDnsRecordManager

func (*SDnsRecordManager) CheckNameForDnsType

func (man *SDnsRecordManager) CheckNameForDnsType(name, recType string) (err error)

func (*SDnsRecordManager) GetRecordsLimit

func (man *SDnsRecordManager) GetRecordsLimit() int

GetRecordsLimit implements IAdminSharableVirtualModelManager

func (*SDnsRecordManager) GetRecordsSeparator

func (man *SDnsRecordManager) GetRecordsSeparator() string

GetRecordsSeparator implements IAdminSharableVirtualModelManager

func (*SDnsRecordManager) GetRecordsType

func (man *SDnsRecordManager) GetRecordsType(recs []string) string

func (*SDnsRecordManager) ParseInputInfo

func (man *SDnsRecordManager) ParseInputInfo(data *jsonutils.JSONDict) (rec []string, err error)

ParseInputInfo implements IAdminSharableVirtualModelManager

func (*SDnsRecordManager) QueryDns

func (man *SDnsRecordManager) QueryDns(projectId, name string) *SDnsRecord

func (*SDnsRecordManager) QueryDnsIps

func (man *SDnsRecordManager) QueryDnsIps(projectId, name, kind string) []DnsIp

func (*SDnsRecordManager) ValidateCreateData

func (man *SDnsRecordManager) ValidateCreateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	ownerProjId string,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SGroup

type SGroup struct {
	db.SVirtualResourceBase

	ServiceType string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	ParentId string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	ZoneId string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"required"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	SchedStrategy string `width:"16" charset:"ascii" nullable:"true" default:"" list:"user" update:"user" create:"optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True, default=”)
}

type SGroupJointsBase

type SGroupJointsBase struct {
	db.SVirtualJointResourceBase

	SrvtagId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
}

func (*SGroupJointsBase) GetGroup

func (self *SGroupJointsBase) GetGroup() *SGuest

type SGroupJointsManager

type SGroupJointsManager struct {
	db.SVirtualJointResourceBaseManager
}

func NewGroupJointsManager

func NewGroupJointsManager(dt interface{}, tableName string, keyword string, keywordPlural string, slave db.IVirtualModelManager) SGroupJointsManager

type SGroupManager

type SGroupManager struct {
	db.SVirtualResourceBaseManager
}
var GroupManager *SGroupManager

type SGroupguest

type SGroupguest struct {
	SGroupJointsBase

	Tag     string `width:"256" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"`    // Column(VARCHAR(256, charset='ascii'), nullable=True)
	GuestId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
}

func (*SGroupguest) Delete

func (self *SGroupguest) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGroupguest) Detach

func (self *SGroupguest) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGroupguest) GetCustomizeColumns

func (self *SGroupguest) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGroupguest) GetExtraDetails

func (self *SGroupguest) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGroupguest) GetGuest

func (self *SGroupguest) GetGuest() *SGuest

func (*SGroupguest) Master

func (joint *SGroupguest) Master() db.IStandaloneModel

func (*SGroupguest) Slave

func (joint *SGroupguest) Slave() db.IStandaloneModel

type SGroupguestManager

type SGroupguestManager struct {
	SGroupJointsManager
}
var GroupguestManager *SGroupguestManager

type SGroupnetwork

type SGroupnetwork struct {
	SGroupJointsBase

	NetworkId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)

	IpAddr string `width:"16" charset:"ascii" nullable:"true" list:"user" create:"optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)

	Index int8 `nullable:"false" default:"0" list:"user" list:"user" update:"user" create:"optional"` // Column(TINYINT, nullable=False, default=0)

	EipId string `width:"36" charset:"ascii" nullable:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
}

func (*SGroupnetwork) Delete

func (self *SGroupnetwork) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGroupnetwork) Detach

func (self *SGroupnetwork) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGroupnetwork) GetCustomizeColumns

func (self *SGroupnetwork) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGroupnetwork) GetExtraDetails

func (self *SGroupnetwork) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGroupnetwork) Master

func (joint *SGroupnetwork) Master() db.IStandaloneModel

func (*SGroupnetwork) Slave

func (joint *SGroupnetwork) Slave() db.IStandaloneModel

type SGroupnetworkManager

type SGroupnetworkManager struct {
	SGroupJointsManager
}
var GroupnetworkManager *SGroupnetworkManager

type SGuest

type SGuest struct {
	db.SVirtualResourceBase

	VcpuCount int8 `nullable:"false" default:"1" list:"user" create:"optional"` // Column(TINYINT, nullable=False, default=1)
	VmemSize  int  `nullable:"false" list:"user" create:"required"`             // Column(Integer, nullable=False)

	BootOrder string `width:"8" charset:"ascii" nullable:"true" default:"cdn" list:"user" update:"user" create:"optional"` // Column(VARCHAR(8, charset='ascii'), nullable=True, default='cdn')

	DisableDelete    tristate.TriState `nullable:"false" default:"true" list:"user" update:"user" create:"optional"`           // Column(Boolean, nullable=False, default=True)
	ShutdownBehavior string            `width:"16" charset:"ascii" default:"stop" list:"user" update:"user" create:"optional"` // Column(VARCHAR(16, charset='ascii'), default=SHUTDOWN_STOP)

	KeypairId string `width:"36" charset:"ascii" nullable:"true" list:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	HostId string `width:"36" charset:"ascii" nullable:"true" list:"admin" get:"admin"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	Vga     string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Vdi     string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Machine string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Bios    string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	OsType  string `width:"36" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	FlavorId string `width:"36" charset:"ascii" nullable:"true" list:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)

	SecgrpId      string `width:"36" charset:"ascii" nullable:"true" get:"user" create:"optional"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	AdminSecgrpId string `width:"36" charset:"ascii" nullable:"true" get:"admin"`                  // Column(VARCHAR(36, charset='ascii'), nullable=True)

	Hypervisor string `width:"16" charset:"ascii" nullable:"false" default:"kvm" list:"user" create:"required"` // Column(VARCHAR(16, charset='ascii'), nullable=False, default=HYPERVISOR_DEFAULT)
}

func (*SGuest) AllowDeleteItem

func (self *SGuest) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuest) AllowGetDetailsVnc

func (self *SGuest) AllowGetDetailsVnc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SGuest) AllowPerformCancelDelete

func (model *SGuest) AllowPerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuest) AllowPerformPurge

func (self *SGuest) AllowPerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuest) AllowPerformStart

func (self *SGuest) AllowPerformStart(ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject) bool

func (*SGuest) AllowPerformStop

func (self *SGuest) AllowPerformStop(ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject) bool

func (*SGuest) AllowPerformSyncstatus

func (self *SGuest) AllowPerformSyncstatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuest) Attach2Network

func (self *SGuest) Attach2Network(ctx context.Context, userCred mcclient.TokenCredential, network *SNetwork, pendingUsage quotas.IQuota,
	address string, mac string, driver string, bwLimit int, virtual bool, index int8, reserved bool, allocDir IPAddlocationDirection, requireDesignatedIP bool) error

func (*SGuest) CategorizeDisks

func (self *SGuest) CategorizeDisks() SGuestDiskCategory

func (*SGuest) CategorizeNics

func (self *SGuest) CategorizeNics() SGuestNicCategory

func (*SGuest) CreateDisksOnHost

func (self *SGuest) CreateDisksOnHost(ctx context.Context, userCred mcclient.TokenCredential, host *SHost, data *jsonutils.JSONDict, pendingUsage quotas.IQuota) error

func (*SGuest) CreateIsolatedDeviceOnHost

func (self *SGuest) CreateIsolatedDeviceOnHost(ctx context.Context, userCred mcclient.TokenCredential, host *SHost, data *jsonutils.JSONDict, pendingUsage quotas.IQuota) error

func (*SGuest) CreateNetworksOnHost

func (self *SGuest) CreateNetworksOnHost(ctx context.Context, userCred mcclient.TokenCredential, host *SHost, data *jsonutils.JSONDict, pendingUsage quotas.IQuota) error

func (*SGuest) CustomizeCreate

func (guest *SGuest) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SGuest) CustomizeDelete

func (self *SGuest) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SGuest) Delete

func (self *SGuest) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuest) DeleteAllDisksInDB

func (self *SGuest) DeleteAllDisksInDB(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuest) DetachAllNetworks

func (self *SGuest) DetachAllNetworks(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuest) DiskCount

func (guest *SGuest) DiskCount() int

func (*SGuest) DoCancelPendingDelete

func (self *SGuest) DoCancelPendingDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuest) DoPendingDelete

func (self *SGuest) DoPendingDelete(ctx context.Context, userCred mcclient.TokenCredential)

func (*SGuest) EjectIso

func (self *SGuest) EjectIso(userCred mcclient.TokenCredential) bool

func (*SGuest) GetCustomizeColumns

func (self *SGuest) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuest) GetDeployConfigOnHost

func (self *SGuest) GetDeployConfigOnHost(ctx context.Context, host *SHost, params *jsonutils.JSONDict) *jsonutils.JSONDict

func (*SGuest) GetDetailsVnc

func (self *SGuest) GetDetailsVnc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuest) GetDisks

func (guest *SGuest) GetDisks() []SGuestdisk

func (*SGuest) GetDisksQuery

func (guest *SGuest) GetDisksQuery() *sqlchemy.SQuery

func (*SGuest) GetDriver

func (guest *SGuest) GetDriver() IGuestDriver

func (*SGuest) GetExtraDetails

func (self *SGuest) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuest) GetGroups

func (guest *SGuest) GetGroups() []SGroupguest

func (*SGuest) GetGuestDisk

func (guest *SGuest) GetGuestDisk(diskId string) *SGuestdisk

func (*SGuest) GetHost

func (guest *SGuest) GetHost() *SHost

func (*SGuest) GetHostType

func (guest *SGuest) GetHostType() string

func (*SGuest) GetHypervisor

func (guest *SGuest) GetHypervisor() string

func (*SGuest) GetIsolatedDevices

func (self *SGuest) GetIsolatedDevices() []SIsolatedDevice

func (*SGuest) GetJsonDescAtBaremetal

func (self *SGuest) GetJsonDescAtBaremetal(ctx context.Context, host *SHost) *jsonutils.JSONDict

func (*SGuest) GetJsonDescAtHypervisor

func (self *SGuest) GetJsonDescAtHypervisor(ctx context.Context, host *SHost) *jsonutils.JSONDict

func (*SGuest) GetKeypairPublicKey

func (self *SGuest) GetKeypairPublicKey() string

func (*SGuest) GetNetworks

func (guest *SGuest) GetNetworks() []SGuestnetwork

func (*SGuest) GetNetworksQuery

func (guest *SGuest) GetNetworksQuery() *sqlchemy.SQuery

func (*SGuest) GetOS

func (self *SGuest) GetOS() string

func (*SGuest) GetVdi

func (self *SGuest) GetVdi() string

func (*SGuest) IsExitOnly

func (self *SGuest) IsExitOnly() bool

func (*SGuest) IsLinux

func (self *SGuest) IsLinux() bool

func (*SGuest) IsNetworkAllocated

func (guest *SGuest) IsNetworkAllocated() bool

func (*SGuest) IsWindows

func (self *SGuest) IsWindows() bool

func (*SGuest) JoinGroups

func (self *SGuest) JoinGroups(userCred mcclient.TokenCredential, params *jsonutils.JSONDict)

func (*SGuest) LeaveAllGroups

func (self *SGuest) LeaveAllGroups(userCred mcclient.TokenCredential)

func (*SGuest) NetworkCount

func (guest *SGuest) NetworkCount() int

func (*SGuest) NotifyAdminServerEvent

func (self *SGuest) NotifyAdminServerEvent(ctx context.Context, event string, priority string) error

func (*SGuest) NotifyServerEvent

func (self *SGuest) NotifyServerEvent(event string, priority string, loginInfo bool) error

func (*SGuest) PerformCancelDelete

func (self *SGuest) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuest) PerformPurge

func (self *SGuest) PerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuest) PerformStart

func (self *SGuest) PerformStart(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject,
	data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuest) PerformStop

func (*SGuest) PerformSyncstatus

func (self *SGuest) PerformSyncstatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuest) PostCreate

func (guest *SGuest) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SGuest) RealDelete

func (self *SGuest) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuest) SaveDeployInfo

func (self *SGuest) SaveDeployInfo(ctx context.Context, userCred mcclient.TokenCredential, data jsonutils.JSONObject)

func (*SGuest) SetDisableDelete

func (self *SGuest) SetDisableDelete(val bool) error

func (*SGuest) SetHostId

func (guest *SGuest) SetHostId(hostId string) error

func (*SGuest) StartAutoDeleteGuestTask

func (self *SGuest) StartAutoDeleteGuestTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error

func (*SGuest) StartDeleteGuestTask

func (self *SGuest) StartDeleteGuestTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string, isPurge bool, overridePendingDelete bool) error

func (*SGuest) StartGuestCreateTask

func (self *SGuest) StartGuestCreateTask(ctx context.Context, userCred mcclient.TokenCredential, params *jsonutils.JSONDict, pendingUsage quotas.IQuota, parentTaskId string) error

func (*SGuest) StartGuestDeployTask

func (self *SGuest) StartGuestDeployTask(ctx context.Context, userCred mcclient.TokenCredential, kwargs *jsonutils.JSONDict, action string, parentTaskId string) error

func (*SGuest) StartGuestStopTask

func (self *SGuest) StartGuestStopTask(ctx context.Context, userCred mcclient.TokenCredential, isForce bool, parentTaskId string) error

func (*SGuest) StartGueststartTask

func (self *SGuest) StartGueststartTask(ctx context.Context, userCred mcclient.TokenCredential, data *jsonutils.JSONDict, parentTaskId string) error

func (*SGuest) StartInsertIsoTask

func (self *SGuest) StartInsertIsoTask(ctx context.Context, imageId string, hostId string, userCred mcclient.TokenCredential, parentTaskId string) error

func (*SGuest) StartSyncstatus

func (self *SGuest) StartSyncstatus(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error

func (*SGuest) StartUndeployGuestTask

func (self *SGuest) StartUndeployGuestTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string, targetHostId string) error

func (*SGuest) SyncVMDisks

func (self *SGuest) SyncVMDisks(ctx context.Context, userCred mcclient.TokenCredential, host *SHost, vdisks []cloudprovider.ICloudDisk) compare.SyncResult

func (*SGuest) SyncVMNics

func (self *SGuest) SyncVMNics(ctx context.Context, userCred mcclient.TokenCredential, host *SHost, vnics []cloudprovider.ICloudNic) compare.SyncResult

func (*SGuest) ValidateDeleteCondition

func (guest *SGuest) ValidateDeleteCondition(ctx context.Context) error

func (*SGuest) ValidateUpdateData

func (self *SGuest) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SGuestCountStat

type SGuestCountStat struct {
	TotalGuestCount    int
	TotalCpuCount      int
	TotalMemSize       int
	TotalDiskSize      int
	TotalIsolatedCount int
}

type SGuestDiskCategory

type SGuestDiskCategory struct {
	Root *SDisk
	Swap []*SDisk
	Data []*SDisk
}

type SGuestJointsBase

type SGuestJointsBase struct {
	db.SVirtualJointResourceBase

	GuestId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
}

type SGuestJointsManager

type SGuestJointsManager struct {
	db.SVirtualJointResourceBaseManager
}

func NewGuestJointsManager

func NewGuestJointsManager(dt interface{}, tableName string, keyword string, keywordPlural string, slave db.IVirtualModelManager) SGuestJointsManager

type SGuestManager

type SGuestManager struct {
	db.SVirtualResourceBaseManager
}
var GuestManager *SGuestManager

func (*SGuestManager) AllowListItems

func (manager *SGuestManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SGuestManager) CleanPendingDeleteServers

func (manager *SGuestManager) CleanPendingDeleteServers(ctx context.Context, userCred mcclient.TokenCredential)

func (*SGuestManager) ExtraSearchConditions

func (manager *SGuestManager) ExtraSearchConditions(ctx context.Context, q *sqlchemy.SQuery, like string) []sqlchemy.ICondition

func (*SGuestManager) FetchGuestById

func (manager *SGuestManager) FetchGuestById(guestId string) *SGuest

func (*SGuestManager) GetIpInProjectWithName

func (manager *SGuestManager) GetIpInProjectWithName(projectId, name string, isExitOnly bool) []string

func (*SGuestManager) ListItemFilter

func (manager *SGuestManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SGuestManager) OnCreateComplete

func (manager *SGuestManager) OnCreateComplete(ctx context.Context, items []db.IModel, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SGuestManager) TotalCount

func (manager *SGuestManager) TotalCount(
	projectId string, rangeObj db.IStandaloneModel,
	status []string, hypervisors []string,
	includeSystem bool, pendingDelete bool, hostType string,
) SGuestCountStat

func (*SGuestManager) ValidateCreateData

func (manager *SGuestManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SGuestNicCategory

type SGuestNicCategory struct {
	InternalNics []SGuestnetwork
	ExternalNics []SGuestnetwork
}

type SGuestcdrom

type SGuestcdrom struct {
	db.SModelBase

	Id            string    `width:"36" charset:"ascii" primary:"true"`   // = Column(VARCHAR(36, charset='ascii'), primary_key=True)
	ImageId       string    `width:"36" charset:"ascii" nullable:"true"`  // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Name          string    `width:"64" charset:"ascii" nullable:"true"`  // Column(VARCHAR(64, charset='ascii'), nullable=True)
	Path          string    `width:"256" charset:"ascii" nullable:"true"` // Column(VARCHAR(256, charset='ascii'), nullable=True)
	Size          int       `nullable:"false" default:"0"`                // = Column(Integer, nullable=False, default=0)
	UpdatedAt     time.Time `nullable:"false" updated_at:"true" nullable:"false"`
	UpdateVersion int       `default:"0" nullable:"false" auto_version:"true"`
}

func (*SGuestcdrom) GetDetails

func (self *SGuestcdrom) GetDetails() string

type SGuestcdromManager

type SGuestcdromManager struct {
	db.SModelBaseManager
}
var GuestcdromManager *SGuestcdromManager

type SGuestdisk

type SGuestdisk struct {
	SGuestJointsBase

	DiskId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)

	ImagePath string `width:"256" charset:"ascii" nullable:"false" get:"user" create:"required"` // Column(VARCHAR(256, charset='ascii'), nullable=False)

	Driver    string `width:"32" charset:"ascii" nullable:"true" list:"user" update:"user"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
	CacheMode string `width:"32" charset:"ascii" nullable:"true" list:"user" update:"user"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
	AioMode   string `width:"32" charset:"ascii" nullable:"true" get:"user" update:"user"`  // Column(VARCHAR(32, charset='ascii'), nullable=True)

	Mountpoint string `width:"256" charset:"utf8" nullable:"true" get:"user"` // Column(VARCHAR(256, charset='utf8'), nullable=True)

	Index int8 `nullable:"false" default:"0" list:"user" update:"user"` // Column(TINYINT(4), nullable=False, default=0)
}

func (*SGuestdisk) AllowDeleteItem

func (self *SGuestdisk) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuestdisk) Delete

func (self *SGuestdisk) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuestdisk) Detach

func (self *SGuestdisk) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuestdisk) DoSave

func (self *SGuestdisk) DoSave(driver string, cache string, mountpoint string) error

func (*SGuestdisk) GetCustomizeColumns

func (self *SGuestdisk) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuestdisk) GetDetailedString

func (self *SGuestdisk) GetDetailedString() string

func (*SGuestdisk) GetDisk

func (self *SGuestdisk) GetDisk() *SDisk

func (*SGuestdisk) GetExtraDetails

func (self *SGuestdisk) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuestdisk) GetJsonDescAtHost

func (self *SGuestdisk) GetJsonDescAtHost(host *SHost) jsonutils.JSONObject

func (*SGuestdisk) Master

func (joint *SGuestdisk) Master() db.IStandaloneModel

func (*SGuestdisk) Slave

func (joint *SGuestdisk) Slave() db.IStandaloneModel

type SGuestdiskManager

type SGuestdiskManager struct {
	SGuestJointsManager
}
var GuestdiskManager *SGuestdiskManager

func (*SGuestdiskManager) AllowCreateItem

func (manager *SGuestdiskManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

type SGuestnetwork

type SGuestnetwork struct {
	SGuestJointsBase

	NetworkId string `width:"36" charset:"ascii" nullable:"false" list:"user"  key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	MacAddr   string `width:"32" charset:"ascii" nullable:"false" list:"user"`                   // Column(VARCHAR(32, charset='ascii'), nullable=False)
	IpAddr    string `width:"16" charset:"ascii" nullable:"false" list:"user"`                   // Column(VARCHAR(16, charset='ascii'), nullable=True)
	Ip6Addr   string `width:"64" charset:"ascii" nullable:"true" list:"user"`                    // Column(VARCHAR(64, charset='ascii'), nullable=True)
	Driver    string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user"`      // Column(VARCHAR(16, charset='ascii'), nullable=True)
	BwLimit   int    `nullable:"false" default:"0" list:"user"`                                  // Column(Integer, nullable=False, default=0) # Mbps
	Index     int8   `nullable:"false" default:"0" list:"user" update:"user"`                    // Column(TINYINT, nullable=False, default=0)
	Virtual   bool   `default:"false" list:"user"`                                               // Column(Boolean, default=False)
	Ifname    string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user"`      // Column(VARCHAR(16, charset='ascii'), nullable=True)
}

func (*SGuestnetwork) AllowDeleteItem

func (gn *SGuestnetwork) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuestnetwork) Delete

func (self *SGuestnetwork) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuestnetwork) Detach

func (self *SGuestnetwork) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SGuestnetwork) GetCustomizeColumns

func (self *SGuestnetwork) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuestnetwork) GetDetailedString

func (self *SGuestnetwork) GetDetailedString() string

func (*SGuestnetwork) GetExtraDetails

func (self *SGuestnetwork) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SGuestnetwork) GetFreeIfname

func (self *SGuestnetwork) GetFreeIfname(network *SNetwork, ifTable map[string]bool) string

func (*SGuestnetwork) GetGuest

func (self *SGuestnetwork) GetGuest() *SGuest

func (*SGuestnetwork) GetIfname

func (self *SGuestnetwork) GetIfname() string

func (*SGuestnetwork) GetJsonDescAtHost

func (self *SGuestnetwork) GetJsonDescAtHost(host *SHost) jsonutils.JSONObject

func (*SGuestnetwork) GetNetwork

func (gn *SGuestnetwork) GetNetwork() *SNetwork

func (*SGuestnetwork) GetVirtualIPs

func (self *SGuestnetwork) GetVirtualIPs() []string

func (*SGuestnetwork) IsAllocated

func (self *SGuestnetwork) IsAllocated() bool

func (*SGuestnetwork) IsExit

func (self *SGuestnetwork) IsExit() bool

func (*SGuestnetwork) LogDetachEvent

func (self *SGuestnetwork) LogDetachEvent(userCred mcclient.TokenCredential, guest *SGuest, network *SNetwork)

func (*SGuestnetwork) Master

func (joint *SGuestnetwork) Master() db.IStandaloneModel

func (*SGuestnetwork) Slave

func (joint *SGuestnetwork) Slave() db.IStandaloneModel

func (*SGuestnetwork) ValidateUpdateData

func (self *SGuestnetwork) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SGuestnetworkManager

type SGuestnetworkManager struct {
	SGuestJointsManager
}
var GuestnetworkManager *SGuestnetworkManager

func (*SGuestnetworkManager) AllowCreateItem

func (manager *SGuestnetworkManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SGuestnetworkManager) DeleteGuestNics

func (manager *SGuestnetworkManager) DeleteGuestNics(ctx context.Context, guest *SGuest, userCred mcclient.TokenCredential, network *SNetwork, reserve bool) error

func (*SGuestnetworkManager) GenerateMac

func (manager *SGuestnetworkManager) GenerateMac(netId string, suggestion string) string

func (*SGuestnetworkManager) GetGuestByAddress

func (manager *SGuestnetworkManager) GetGuestByAddress(address string) *SGuest

type SHost

type SHost struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure
	SManagedResourceBase

	Rack  string `width:"16" charset:"ascii" nullable:"true" get:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)
	Slots string `width:"16" charset:"ascii" nullable:"true" get:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)

	AccessMac  string `width:"32" charset:"ascii" nullable:"false" index:"true" list:"admin" update:"admin" create:"admin_required"` // Column(VARCHAR(32, charset='ascii'), nullable=False, index=True)
	AccessIp   string `width:"16" charset:"ascii" nillable:"true" list:"admin" update:"admin" create:"admin_optional"`               // Column(VARCHAR(16, charset='ascii'), nullable=True)
	ManagerUri string `width:"256" charset:"ascii" nullable:"true" list:"admin" update:"admin" create:"admin_optional"`              // Column(VARCHAR(256, charset='ascii'), nullable=True)

	SysInfo jsonutils.JSONObject `nullable:"true" search:"admin" get:"admin" update:"admin" create:"admin_optional"`               // Column(JSONEncodedDict, nullable=True)
	SN      string               `width:"128" charset:"ascii" nullable:"true" list:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(128, charset='ascii'), nullable=True)

	CpuCount    int8    `nullable:"true" list:"admin" update:"admin" create:"admin_optional"`                           // Column(TINYINT, nullable=True) # cpu count
	NodeCount   int8    `nullable:"true" list:"admin" update:"admin" create:"admin_optional"`                           // Column(TINYINT, nullable=True)
	CpuDesc     string  `width:"64" charset:"ascii" nullable:"true" get:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(64, charset='ascii'), nullable=True)
	CpuMhz      int     `nullable:"true" get:"admin" update:"admin" create:"admin_optional"`                            // Column(Integer, nullable=True) # cpu MHz
	CpuCache    int     `nullable:"true" get:"admin" update:"admin" create:"admin_optional"`                            // Column(Integer, nullable=True) # cpu Cache in KB
	CpuReserved int8    `nullable:"true" default:"0" list:"admin" update:"admin" create:"admin_optional"`               // Column(TINYINT, nullable=True, default=0)
	CpuCmtbound float32 `nullable:"true" list:"admin" update:"admin" create:"admin_optional"`                           // = Column(Float, nullable=True)

	MemSize     int     `nullable:"true" list:"admin" update:"admin" create:"admin_optional"`             // Column(Integer, nullable=True) # memory size in MB
	MemReserved int     `nullable:"true" default:"0" list:"admin" update:"admin" create:"admin_optional"` // Column(Integer, nullable=True, default=0) # memory reserved in MB
	MemCmtbound float32 `nullable:"true" update:"admin" create:"admin_optional"`                          // = Column(Float, nullable=True)

	StorageSize   int                  `nullable:"true" list:"admin" update:"admin" create:"admin_optional"`                            // Column(Integer, nullable=True) # storage size in MB
	StorageType   string               `width:"20" charset:"ascii" nullable:"true" list:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(20, charset='ascii'), nullable=True)
	StorageDriver string               `width:"20" charset:"ascii" nullable:"true" update:"admin" create:"admin_optional"`              // Column(VARCHAR(20, charset='ascii'), nullable=True)
	StorageInfo   jsonutils.JSONObject `nullable:"true" get:"admin" update:"admin" create:"admin_optional"`                             // Column(JSONEncodedDict, nullable=True)

	IpmiInfo jsonutils.JSONObject `nullable:"true" get:"admin" update:"admin" create:"admin_optional"` // Column(JSONEncodedDict, nullable=True)

	// Status  string = Column(VARCHAR(16, charset='ascii'), nullable=False, default=baremetalstatus.INIT) # status
	HostStatus string `width:"16" charset:"ascii" nullable:"false" default:"offline" list:"admin"` // Column(VARCHAR(16, charset='ascii'), nullable=False, server_default=HOST_OFFLINE, default=HOST_OFFLINE)

	ZoneId string `width:"128" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)

	HostType string `width:"36" charset:"ascii" nullable:"false" list:"admin" update:"admin" create:"admin_required"` // Column(VARCHAR(36, charset='ascii'), nullable=False)

	Version string `width:"64" charset:"ascii" list:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(64, charset='ascii'))

	IsBaremetal bool `nullable:"true" default:"false" list:"admin" update:"true" create:"admin_optional"` // Column(Boolean, nullable=True, default=False)

	IsMaintenance bool `nullable:"true" default:"false" list:"admin"` // Column(Boolean, nullable=True, default=False)
}

func (*SHost) Attach2Storage

func (self *SHost) Attach2Storage(ctx context.Context, userCred mcclient.TokenCredential, storage *SStorage, mountPoint string) error

func (*SHost) Attach2Wire

func (self *SHost) Attach2Wire(ctx context.Context, userCred mcclient.TokenCredential, wire *SWire) error

func (*SHost) ClearSchedDescCache

func (self *SHost) ClearSchedDescCache() error

func (*SHost) CustomizeDelete

func (self *SHost) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SHost) Delete

func (self *SHost) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHost) DeleteBaremetalnetwork

func (self *SHost) DeleteBaremetalnetwork(ctx context.Context, userCred mcclient.TokenCredential, bn *SHostnetwork, reserve bool)

func (*SHost) GetAdminNetInterface

func (self *SHost) GetAdminNetInterface() *SNetInterface

func (*SHost) GetAttach2Network

func (self *SHost) GetAttach2Network(network *SNetwork) *SHostnetwork

func (*SHost) GetAttachedStorageCapacity

func (self *SHost) GetAttachedStorageCapacity() SStorageCapacity

func (*SHost) GetAttachedStorages

func (self *SHost) GetAttachedStorages() []SStorage

func (*SHost) GetBaremetalnetworks

func (self *SHost) GetBaremetalnetworks() []SHostnetwork

func (*SHost) GetBaremetalnetworksQuery

func (self *SHost) GetBaremetalnetworksQuery() *sqlchemy.SQuery

func (*SHost) GetBaremetalstorage

func (self *SHost) GetBaremetalstorage() *SHoststorage

func (*SHost) GetCPUOvercommitBound

func (self *SHost) GetCPUOvercommitBound() float32

func (*SHost) GetCpuCount

func (self *SHost) GetCpuCount() int

func (*SHost) GetCustomizeColumns

func (self *SHost) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHost) GetExtraDetails

func (self *SHost) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHost) GetFetchUrl

func (self *SHost) GetFetchUrl() string

func (*SHost) GetGuestCount

func (self *SHost) GetGuestCount() int

func (*SHost) GetGuests

func (self *SHost) GetGuests() []SGuest

func (*SHost) GetGuestsQuery

func (self *SHost) GetGuestsQuery() *sqlchemy.SQuery

func (*SHost) GetHostschedtags

func (self *SHost) GetHostschedtags() []SHostschedtag

func (*SHost) GetHoststorageOfId

func (self *SHost) GetHoststorageOfId(storageId string) *SHoststorage

func (*SHost) GetHoststorages

func (self *SHost) GetHoststorages() []SHoststorage

func (*SHost) GetHoststoragesQuery

func (self *SHost) GetHoststoragesQuery() *sqlchemy.SQuery

func (*SHost) GetHostwires

func (self *SHost) GetHostwires() []SHostwire

func (*SHost) GetIHost

func (self *SHost) GetIHost() (cloudprovider.ICloudHost, error)

func (*SHost) GetLeastUsedStorage

func (self *SHost) GetLeastUsedStorage(backend string) *SStorage

func (*SHost) GetMasterHostwire

func (self *SHost) GetMasterHostwire() *SHostwire

func (*SHost) GetMasterWire

func (self *SHost) GetMasterWire() *SWire

func (*SHost) GetMemSize

func (self *SHost) GetMemSize() int

func (*SHost) GetMemoryOvercommitBound

func (self *SHost) GetMemoryOvercommitBound() float32

func (*SHost) GetNetInterface

func (self *SHost) GetNetInterface(mac string) *SNetInterface

func (*SHost) GetNetInterfaces

func (self *SHost) GetNetInterfaces() []SNetInterface

func (*SHost) GetNetworkWithIdAndCredential

func (self *SHost) GetNetworkWithIdAndCredential(netId string, userCred mcclient.TokenCredential, reserved bool) (*SNetwork, error)

func (*SHost) GetNonsystemGuestCount

func (self *SHost) GetNonsystemGuestCount() int

func (*SHost) GetRegion

func (self *SHost) GetRegion() *SCloudregion

func (*SHost) GetRunningGuestCount

func (self *SHost) GetRunningGuestCount() int

func (*SHost) GetStorageCount

func (self *SHost) GetStorageCount() int

func (*SHost) GetVirtualCPUCount

func (self *SHost) GetVirtualCPUCount() float32

func (*SHost) GetVirtualMemorySize

func (self *SHost) GetVirtualMemorySize() float32

func (*SHost) GetWireCount

func (self *SHost) GetWireCount() int

func (*SHost) GetWiresQuery

func (self *SHost) GetWiresQuery() *sqlchemy.SQuery

func (*SHost) GetZone

func (self *SHost) GetZone() *SZone

func (*SHost) RealDelete

func (self *SHost) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHost) Request

func (self *SHost) Request(userCred mcclient.TokenCredential, method string, url string, headers http.Header, body jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SHost) StartDeleteBaremetalTask

func (self *SHost) StartDeleteBaremetalTask(userCred mcclient.TokenCredential) error

func (*SHost) SyncAttachedStorageStatus

func (self *SHost) SyncAttachedStorageStatus()

func (*SHost) SyncHostStorages

func (self *SHost) SyncHostStorages(ctx context.Context, userCred mcclient.TokenCredential, storages []cloudprovider.ICloudStorage) compare.SyncResult

func (*SHost) SyncHostVMs

func (*SHost) SyncHostWires

func (self *SHost) SyncHostWires(ctx context.Context, userCred mcclient.TokenCredential, wires []cloudprovider.ICloudWire) compare.SyncResult

func (*SHost) ValidateDeleteCondition

func (self *SHost) ValidateDeleteCondition(ctx context.Context) error

type SHostGuestResourceUsage

type SHostGuestResourceUsage struct {
	GuestCount     int
	GuestVcpuCount int
	GuestVmemSize  int
}

type SHostJointsBase

type SHostJointsBase struct {
	db.SJointResourceBase
}

func (*SHostJointsBase) AllowDeleteItem

func (self *SHostJointsBase) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SHostJointsBase) AllowGetDetails

func (self *SHostJointsBase) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SHostJointsBase) AllowUpdateItem

func (self *SHostJointsBase) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool

type SHostJointsManager

type SHostJointsManager struct {
	db.SJointResourceBaseManager
}

func NewHostJointsManager

func NewHostJointsManager(dt interface{}, tableName string, keyword string, keywordPlural string, slave db.IStandaloneModelManager) SHostJointsManager

func (*SHostJointsManager) AllowAttach

func (manager *SHostJointsManager) AllowAttach(ctx context.Context, userCred mcclient.TokenCredential, master db.IStandaloneModel, slave db.IStandaloneModel) bool

func (*SHostJointsManager) AllowCreateItem

func (manager *SHostJointsManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SHostJointsManager) AllowListDescendent

func (manager *SHostJointsManager) AllowListDescendent(ctx context.Context, userCred mcclient.TokenCredential, model db.IStandaloneModel, query jsonutils.JSONObject) bool

func (*SHostJointsManager) AllowListItems

func (manager *SHostJointsManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

type SHostManager

var HostManager *SHostManager

func (*SHostManager) AllowGetPropertyBmStartRegisterScript

func (self *SHostManager) AllowGetPropertyBmStartRegisterScript(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SHostManager) ClearAllSchedDescCache

func (maanger *SHostManager) ClearAllSchedDescCache() error

func (*SHostManager) ClearSchedDescCache

func (maanger *SHostManager) ClearSchedDescCache(hostId string) error

func (*SHostManager) FetchHostById

func (manager *SHostManager) FetchHostById(hostId string) *SHost

func (*SHostManager) GetHostsByManagerAndRegion

func (manager *SHostManager) GetHostsByManagerAndRegion(managerId string, regionId string) []SHost

func (*SHostManager) GetPropertyBmStartRegisterScript

func (self *SHostManager) GetPropertyBmStartRegisterScript(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SHostManager) ListItemFilter

func (manager *SHostManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SHostManager) SyncHosts

func (*SHostManager) TotalCount

func (manager *SHostManager) TotalCount(
	userCred mcclient.TokenCredential,
	rangeObj db.IStandaloneModel,
	hostStatus, status string,
	hostTypes []string,
	enabled, isBaremetal tristate.TriState,
) HostsCountStat

type SHostnetwork

type SHostnetwork struct {
	SHostJointsBase

	BaremetalId string `width:"36" charset:"ascii" nullable:"false" list:"admin" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	NetworkId   string `width:"36" charset:"ascii" nullable:"false" list:"admin" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	IpAddr      string `width:"16" charset:"ascii" list:"admin"`                                   // Column(VARCHAR(16, charset='ascii'))
	MacAddr     string `width:"18" charset:"ascii" list:"admin"`                                   // Column(VARCHAR(18, charset='ascii'))
}

func (*SHostnetwork) Delete

func (bn *SHostnetwork) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostnetwork) Detach

func (bn *SHostnetwork) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostnetwork) GetCustomizeColumns

func (bn *SHostnetwork) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostnetwork) GetExtraDetails

func (bn *SHostnetwork) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostnetwork) GetHost

func (bn *SHostnetwork) GetHost() *SHost

func (*SHostnetwork) GetNetInterface

func (bn *SHostnetwork) GetNetInterface() *SNetInterface

func (*SHostnetwork) GetNetwork

func (bn *SHostnetwork) GetNetwork() *SNetwork

func (*SHostnetwork) Master

func (bn *SHostnetwork) Master() db.IStandaloneModel

func (*SHostnetwork) Slave

func (bn *SHostnetwork) Slave() db.IStandaloneModel

type SHostnetworkManager

type SHostnetworkManager struct {
	SHostJointsManager
}
var HostnetworkManager *SHostnetworkManager

func (*SHostnetworkManager) GetHostByAddress

func (man *SHostnetworkManager) GetHostByAddress(addr string) *SHost

func (*SHostnetworkManager) GetHostNetworkByAddress

func (man *SHostnetworkManager) GetHostNetworkByAddress(addr string) *SHostnetwork

func (*SHostnetworkManager) GetNetworkByAddress

func (man *SHostnetworkManager) GetNetworkByAddress(addr string) *SNetwork

func (*SHostnetworkManager) QueryByAddress

func (man *SHostnetworkManager) QueryByAddress(addr string) *sqlchemy.SQuery

type SHostschedtag

type SHostschedtag struct {
	SHostJointsBase

	HostId     string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	SchedtagId string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"` // =Column(VARCHAR(36, charset='ascii'), nullable=False)
}

func (*SHostschedtag) Delete

func (self *SHostschedtag) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostschedtag) Detach

func (self *SHostschedtag) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostschedtag) GetCustomizeColumns

func (self *SHostschedtag) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostschedtag) GetExtraDetails

func (self *SHostschedtag) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostschedtag) Master

func (joint *SHostschedtag) Master() db.IStandaloneModel

func (*SHostschedtag) Slave

func (joint *SHostschedtag) Slave() db.IStandaloneModel

type SHostschedtagManager

type SHostschedtagManager struct {
	SHostJointsManager
}
var HostschedtagManager *SHostschedtagManager

type SHoststorage

type SHoststorage struct {
	SHostJointsBase

	MountPoint string `width:"256" charset:"ascii" nullable:"false" list:"admin" update:"admin" create:"admin_required"` // Column(VARCHAR(256, charset='ascii'), nullable=False)

	HostId    string `width:"36" charset:"ascii" nullable:"false" list:"admin" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	StorageId string `width:"36" charset:"ascii" nullable:"false" list:"admin" key_index:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=False)

	Config       *jsonutils.JSONArray `nullable:"true" get:"admin"`  // Column(JSONEncodedDict, nullable=True)
	RealCapacity int                  `nullable:"true" list:"admin"` // Column(Integer, nullable=True)
}

func (*SHoststorage) Delete

func (self *SHoststorage) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHoststorage) Detach

func (self *SHoststorage) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHoststorage) GetCustomizeColumns

func (self *SHoststorage) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHoststorage) GetExtraDetails

func (self *SHoststorage) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHoststorage) GetGuestDiskCount

func (self *SHoststorage) GetGuestDiskCount() int

func (*SHoststorage) GetHost

func (self *SHoststorage) GetHost() *SHost

func (*SHoststorage) GetStorage

func (self *SHoststorage) GetStorage() *SStorage

func (*SHoststorage) Master

func (joint *SHoststorage) Master() db.IStandaloneModel

func (*SHoststorage) Slave

func (joint *SHoststorage) Slave() db.IStandaloneModel

func (*SHoststorage) ValidateDeleteCondition

func (self *SHoststorage) ValidateDeleteCondition(ctx context.Context) error

type SHoststorageManager

type SHoststorageManager struct {
	SHostJointsManager
}
var HoststorageManager *SHoststorageManager

func (*SHoststorageManager) ValidateCreateData

func (manager *SHoststorageManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SHostwire

type SHostwire struct {
	SHostJointsBase

	Bridge    string `width:"16" charset:"ascii" nullable:"false" list:"admin" update:"admin" create:"admin_required"` // Column(VARCHAR(16, charset='ascii'), nullable=False)
	Interface string `width:"16" charset:"ascii" nullable:"false" list:"admin" update:"admin" create:"admin_required"` // Column(VARCHAR(16, charset='ascii'), nullable=False)
	IsMaster  bool   `nullable:"true" default:"false" update:"admin" create:"admin_optional"`                          // Column(Boolean, nullable=True, default=False)
	MacAddr   string `width:"18" charset:"ascii" list:"admin" update:"admin" create:"admin_required"`                  // Column(VARCHAR(18, charset='ascii'))

	HostId string `width:"128" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)
	WireId string `width:"128" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)
}

func (*SHostwire) Delete

func (self *SHostwire) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostwire) Detach

func (self *SHostwire) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SHostwire) GetCustomizeColumns

func (self *SHostwire) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostwire) GetExtraDetails

func (self *SHostwire) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SHostwire) GetGuestnicsCount

func (self *SHostwire) GetGuestnicsCount() int

func (*SHostwire) GetHost

func (hw *SHostwire) GetHost() *SHost

func (*SHostwire) GetWire

func (hw *SHostwire) GetWire() *SWire

func (*SHostwire) Master

func (joint *SHostwire) Master() db.IStandaloneModel

func (*SHostwire) Slave

func (joint *SHostwire) Slave() db.IStandaloneModel

func (*SHostwire) ValidateDeleteCondition

func (self *SHostwire) ValidateDeleteCondition(ctx context.Context) error

type SHostwireManager

type SHostwireManager struct {
	SHostJointsManager
}
var HostwireManager *SHostwireManager

type SImage

type SImage struct {
	Checksum        string
	ContainerFormat string
	CreatedAt       time.Time
	Deleted         bool
	DiskFormat      string
	Id              string
	IsPublic        bool
	MinDisk         int
	MinRam          int
	Name            string
	Owner           string
	Properties      map[string]string
	Protected       bool
	Size            int
	Status          string
	UpdatedAt       time.Time
}

type SInfrastructure

type SInfrastructure struct {
}

func (*SInfrastructure) AllowDeleteItem

func (self *SInfrastructure) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SInfrastructure) AllowGetDetails

func (self *SInfrastructure) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SInfrastructure) AllowUpdateItem

func (self *SInfrastructure) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool

type SInfrastructureManager

type SInfrastructureManager struct {
}

func (*SInfrastructureManager) AllowCreateItem

func (self *SInfrastructureManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SInfrastructureManager) AllowListItems

func (self *SInfrastructureManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

type SIsolatedDevice

type SIsolatedDevice struct {
	db.SStandaloneResourceBase

	HostId string `width:"36" charset:"ascii" nullable:"false" default:"" index:"true" list:"admin" create:"admin_required"` // Column(VARCHAR(36, charset='ascii'), nullable=False, default=”, server_default=”, index=True)

	// # PCI / GPU-HPC / GPU-VGA / USB / NIC
	DevType string `width:"16" charset:"ascii" nullable:"false" default:"" index:"true" list:"admin" create:"admin_required"` // Column(VARCHAR(16, charset='ascii'), nullable=False, default=”, server_default=”, index=True)

	// # Specific device name read from lspci command, e.g. `Tesla K40m` ...
	Model string `width:"32" charset:"ascii" nullable:"false" default:"" index:"true" list:"admin" create:"admin_required"` // Column(VARCHAR(32, charset='ascii'), nullable=False, default=”, server_default=”, index=True)

	GuestId string `width:"36" charset:"ascii" nullable:"true" index:"true" list:"admin"` // Column(VARCHAR(36, charset='ascii'), nullable=True, index=True)

	// # pci address of `Bus:Device.Function` format, or usb bus address of `bus.addr`
	Addr string `width:"16" charset:"ascii" nullable:"true" list:"admin" update:"admin" create:"admin_optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)

	VendorDeviceId string `width:"16" charset:"ascii" nullable:"true" list:"admin" create:"admin_optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)
}

func (*SIsolatedDevice) CustomizeDelete

func (self *SIsolatedDevice) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SIsolatedDevice) GetCustomizeColumns

func (self *SIsolatedDevice) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SIsolatedDevice) GetExtraDetails

func (self *SIsolatedDevice) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SIsolatedDevice) GetShortDesc

func (self *SIsolatedDevice) GetShortDesc() *jsonutils.JSONDict

func (*SIsolatedDevice) ValidateDeleteCondition

func (self *SIsolatedDevice) ValidateDeleteCondition(ctx context.Context) error

type SIsolatedDeviceConfig

type SIsolatedDeviceConfig struct {
	Id      string
	DevType string
	Model   string
	Vendor  string
}

type SIsolatedDeviceManager

type SIsolatedDeviceManager struct {
	db.SStandaloneResourceBaseManager
}
var IsolatedDeviceManager *SIsolatedDeviceManager

func (*SIsolatedDeviceManager) AllowCreateItem

func (manager *SIsolatedDeviceManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SIsolatedDeviceManager) AllowListItems

func (manager *SIsolatedDeviceManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SIsolatedDeviceManager) ExtraSearchConditions

func (manager *SIsolatedDeviceManager) ExtraSearchConditions(ctx context.Context, q *sqlchemy.SQuery, like string) []sqlchemy.ICondition

func (*SIsolatedDeviceManager) ListItemFilter

func (manager *SIsolatedDeviceManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SIsolatedDeviceManager) ReleaseDevicesOfGuest

func (manager *SIsolatedDeviceManager) ReleaseDevicesOfGuest(guest *SGuest, userCred mcclient.TokenCredential) error

func (*SIsolatedDeviceManager) TotalCount

func (manager *SIsolatedDeviceManager) TotalCount(hostType []string, rangeObj db.IStandaloneModel) IsolatedDeviceCountStat

type SKeypair

type SKeypair struct {
	db.SStandaloneResourceBase

	Scheme      string `width:"12" charset:"ascii" nullable:"true" default:"RSA" list:"user" create:"optional"` // Column(VARCHAR(length=12, charset='ascii'), nullable=True, default='RSA')
	Fingerprint string `width:"48" charset:"ascii" nullable:"false" list:"user"`                                // Column(VARCHAR(length=48, charset='ascii'), nullable=False)
	PrivateKey  string `width:"2048" charset:"ascii" nullable:"false"`                                          // Column(VARCHAR(length=2048, charset='ascii'), nullable=False)
	PublicKey   string `width:"1024" charset:"ascii" nullable:"false" list:"user"`                              // Column(VARCHAR(length=1024, charset='ascii'), nullable=False)
	OwnerId     string `width:"128" charset:"ascii" index:"true" nullable:"false"`                              // Column(VARCHAR(length=36, charset='ascii'), index=True, nullable=False)
}

func (*SKeypair) AllowDeleteItem

func (self *SKeypair) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SKeypair) AllowGetDetails

func (self *SKeypair) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SKeypair) AllowUpdateItem

func (self *SKeypair) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool

func (*SKeypair) GetCustomizeColumns

func (self *SKeypair) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SKeypair) GetExtraDetails

func (self *SKeypair) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SKeypair) GetLinkedGuestsCount

func (self *SKeypair) GetLinkedGuestsCount() int

func (*SKeypair) GetOwnerProjectId

func (self *SKeypair) GetOwnerProjectId() string

func (*SKeypair) IsOwner

func (self *SKeypair) IsOwner(userCred mcclient.TokenCredential) bool

func (*SKeypair) ValidateDeleteCondition

func (self *SKeypair) ValidateDeleteCondition(ctx context.Context) error

type SKeypairManager

type SKeypairManager struct {
	db.SStandaloneResourceBaseManager
}
var KeypairManager *SKeypairManager

func (*SKeypairManager) AllowCreateItem

func (manager *SKeypairManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SKeypairManager) AllowListItems

func (manager *SKeypairManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SKeypairManager) FilterByOwner

func (manager *SKeypairManager) FilterByOwner(q *sqlchemy.SQuery, ownerId string) *sqlchemy.SQuery

func (*SKeypairManager) GetOwnerId

func (manager *SKeypairManager) GetOwnerId(userCred mcclient.TokenCredential) string

func (*SKeypairManager) ListItemFilter

func (manager *SKeypairManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SKeypairManager) ValidateCreateData

func (manager *SKeypairManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SManagedResourceBase

type SManagedResourceBase struct {
	ManagerId string `width:"128" charset:"ascii" nullable:"true" list:"admin" create:"admin_optional"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=True)
}

func (*SManagedResourceBase) GetCloudprovider

func (self *SManagedResourceBase) GetCloudprovider() *SCloudprovider

func (*SManagedResourceBase) GetDriver

func (*SManagedResourceBase) IsManaged

func (self *SManagedResourceBase) IsManaged() bool

type SNetInterface

type SNetInterface struct {
	db.SModelBase

	Mac         string `width:"36" charset:"ascii" primary:"true"`  // Column(VARCHAR(36, charset='ascii'), primary_key=True)
	BaremetalId string `width:"36" charset:"ascii" nullable:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	WireId      string `width:"36" charset:"ascii" nullable:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Rate        int    `nullable:"true"`                            // Column(Integer, nullable=True) # Mbps
	NicType     string `width:"36" charset:"ascii" nullable:"true"` // Column(VARCHAR(36, charset='ascii'), nullable=True)
	Index       int8   `nullable:"true"`                            // Column(TINYINT, nullable=True)
	LinkUp      bool   `nullable:"true"`                            // Column(Boolean, nullable=True)
	Mtu         int16  `nullable:"true"`                            // Column(SMALLINT, nullable=True)
}

func (*SNetInterface) GetBaremetal

func (netif *SNetInterface) GetBaremetal() *SHost

func (*SNetInterface) GetBaremetalNetwork

func (netif *SNetInterface) GetBaremetalNetwork() *SHostnetwork

func (*SNetInterface) GetId

func (netif *SNetInterface) GetId() string

func (*SNetInterface) GetWire

func (netif *SNetInterface) GetWire() *SWire

func (*SNetInterface) Remove

func (self *SNetInterface) Remove(ctx context.Context, userCred mcclient.TokenCredential) error

type SNetInterfaceManager

type SNetInterfaceManager struct {
	db.SModelBaseManager
}
var NetInterfaceManager *SNetInterfaceManager

func (*SNetInterfaceManager) FetchByMac

func (manager *SNetInterfaceManager) FetchByMac(mac string) (*SNetInterface, error)

type SNetwork

type SNetwork struct {
	db.SSharableVirtualResourceBase

	GuestIpStart string `width:"16" charset:"ascii" nullable:"false" list:"user" update:"user" create:"required"` // Column(VARCHAR(16, charset='ascii'), nullable=False)
	GuestIpEnd   string `width:"16" charset:"ascii" nullable:"false" list:"user" update:"user" create:"required"` // Column(VARCHAR(16, charset='ascii'), nullable=False)
	GuestIpMask  int8   `nullable:"false" list:"user" update:"user" create:"required"`                            // Column(TINYINT, nullable=False)
	GuestGateway string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"`  // Column(VARCHAR(16, charset='ascii'), nullable=True)
	GuestDns     string `width:"16" charset:"ascii" nullable:"true" get:"user" update:"user" create:"optional"`   // Column(VARCHAR(16, charset='ascii'), nullable=True)
	GuestDhcp    string `width:"16" charset:"ascii" nullable:"true" get:"user" update:"user" create:"optional"`   // Column(VARCHAR(16, charset='ascii'), nullable=True)

	GuestDomain string `width:"128" charset:"ascii" nullable:"true" get:"user" update:"user"` // Column(VARCHAR(128, charset='ascii'), nullable=True)

	GuestIp6Start string `width:"64" charset:"ascii" nullable:"true"` // Column(VARCHAR(64, charset='ascii'), nullable=True)
	GuestIp6End   string `width:"64" charset:"ascii" nullable:"true"` // Column(VARCHAR(64, charset='ascii'), nullable=True)
	GuestIp6Mask  int8   `nullable:"true"`                            // Column(TINYINT, nullable=True)
	GuestGateway6 string `width:"64" charset:"ascii" nullable:"true"` // Column(VARCHAR(64, charset='ascii'), nullable=True)
	GuestDns6     string `width:"64" charset:"ascii" nullable:"true"` // Column(VARCHAR(64, charset='ascii'), nullable=True)

	GuestDomain6 string `width:"128" charset:"ascii" nullable:"true"` // Column(VARCHAR(128, charset='ascii'), nullable=True)

	VlanId int `nullable:"false" default:"1" list:"user" update:"user" create:"optional"` // Column(Integer, nullable=False, default=1)

	WireId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required"` // Column(VARCHAR(36, charset='ascii'), nullable=False)

	ServerType string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)

	AllocPolicy string `width:"16" charset:"ascii" nullable:"true" get:"user" update:"user" create:"optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True)
}

func ChooseCandidateNetworks

func ChooseCandidateNetworks(nets []SNetwork, isExit bool, serverType string) *SNetwork

func (*SNetwork) AllowGetDetailsReservedIps

func (self *SNetwork) AllowGetDetailsReservedIps(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SNetwork) AllowPerformPurge

func (self *SNetwork) AllowPerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SNetwork) AllowPerformReleaseReservedIp

func (self *SNetwork) AllowPerformReleaseReservedIp(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SNetwork) AllowPerformReserveIp

func (self *SNetwork) AllowPerformReserveIp(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SNetwork) CustomizeCreate

func (self *SNetwork) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SNetwork) CustomizeDelete

func (self *SNetwork) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SNetwork) Delete

func (self *SNetwork) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SNetwork) GetBaremetalNicsCount

func (self *SNetwork) GetBaremetalNicsCount() int

func (*SNetwork) GetCustomizeColumns

func (self *SNetwork) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SNetwork) GetDNS

func (self *SNetwork) GetDNS() string

func (*SNetwork) GetDetailsReservedIps

func (self *SNetwork) GetDetailsReservedIps(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SNetwork) GetDomain

func (self *SNetwork) GetDomain() string

func (*SNetwork) GetExtraDetails

func (self *SNetwork) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SNetwork) GetFreeIP

func (self *SNetwork) GetFreeIP(ctx context.Context, userCred mcclient.TokenCredential, addrTable map[string]bool, candidate string, allocDir IPAddlocationDirection, reserved bool) (string, error)

func (*SNetwork) GetGroupNicsCount

func (self *SNetwork) GetGroupNicsCount() int

func (*SNetwork) GetGuestIpv4StartAddress

func (self *SNetwork) GetGuestIpv4StartAddress() netutils.IPV4Addr

func (*SNetwork) GetGuestnicsCount

func (self *SNetwork) GetGuestnicsCount() int

func (*SNetwork) GetINetwork

func (self *SNetwork) GetINetwork() (cloudprovider.ICloudNetwork, error)

func (*SNetwork) GetNetAddr

func (self *SNetwork) GetNetAddr() netutils.IPV4Addr

func (*SNetwork) GetPrefix

func (self *SNetwork) GetPrefix() (netutils.IPV4Prefix, error)

func (*SNetwork) GetReservedNicsCount

func (self *SNetwork) GetReservedNicsCount() int

func (*SNetwork) GetRoutes

func (self *SNetwork) GetRoutes() [][]string

func (*SNetwork) GetTotalNicCount

func (self *SNetwork) GetTotalNicCount() int

func (*SNetwork) GetUsedAddresses

func (self *SNetwork) GetUsedAddresses() map[string]bool

func (*SNetwork) GetUsedIfnames

func (self *SNetwork) GetUsedIfnames() map[string]bool

func (*SNetwork) GetVpc

func (self *SNetwork) GetVpc() *SVpc

func (*SNetwork) GetWire

func (self *SNetwork) GetWire() *SWire

func (*SNetwork) IsExitNetwork

func (self *SNetwork) IsExitNetwork() bool

func (*SNetwork) PerformPurge

func (*SNetwork) PerformReleaseReservedIp

func (self *SNetwork) PerformReleaseReservedIp(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SNetwork) PerformReserveIp

func (self *SNetwork) PerformReserveIp(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SNetwork) PostCreate

func (self *SNetwork) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SNetwork) RealDelete

func (self *SNetwork) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SNetwork) StartDeleteNetworkTask

func (self *SNetwork) StartDeleteNetworkTask(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SNetwork) SyncWithCloudNetwork

func (self *SNetwork) SyncWithCloudNetwork(userCred mcclient.TokenCredential, extNet cloudprovider.ICloudNetwork) error

func (*SNetwork) ValidateDeleteCondition

func (self *SNetwork) ValidateDeleteCondition(ctx context.Context) error

func (*SNetwork) ValidateUpdateCondition

func (self *SNetwork) ValidateUpdateCondition(ctx context.Context) error

func (*SNetwork) ValidateUpdateData

func (self *SNetwork) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SNetworkConfig

type SNetworkConfig struct {
	Network  string
	Wire     string
	Exit     bool
	Private  bool
	Mac      string
	Address  string
	Address6 string
	Driver   string
	BwLimit  int
	Vip      bool
	Reserved bool
}

type SNetworkManager

type SNetworkManager struct {
	db.SSharableVirtualResourceBaseManager
}
var NetworkManager *SNetworkManager

func (*SNetworkManager) AllowCreateItem

func (manager *SNetworkManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SNetworkManager) GetContextManager

func (manager *SNetworkManager) GetContextManager() []db.IModelManager

func (*SNetworkManager) GetNetworkOfIP

func (manager *SNetworkManager) GetNetworkOfIP(ipAddr string, serverType string, isPublic tristate.TriState) (*SNetwork, error)

func (*SNetworkManager) InitializeData

func (manager *SNetworkManager) InitializeData() error

func (*SNetworkManager) ListItemFilter

func (manager *SNetworkManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SNetworkManager) SyncNetworks

func (*SNetworkManager) TotalPortCount

func (manager *SNetworkManager) TotalPortCount(userCred mcclient.TokenCredential, rangeObj db.IStandaloneModel) NetworkPortStat

func (*SNetworkManager) ValidateCreateData

func (manager *SNetworkManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SQuota

type SQuota struct {
	Cpu            int
	Memory         int
	Storage        int
	Port           int
	Eip            int
	Eport          int
	Bw             int
	Ebw            int
	Keypair        int
	Image          int
	Group          int
	Secgroup       int
	IsolatedDevice int
}

func (*SQuota) Add

func (self *SQuota) Add(quota quotas.IQuota)

func (*SQuota) Exceed

func (self *SQuota) Exceed(quota quotas.IQuota) error

func (*SQuota) FetchSystemQuota

func (self *SQuota) FetchSystemQuota()

func (*SQuota) FetchUsage

func (self *SQuota) FetchUsage(projectId string) error

func (*SQuota) IsEmpty

func (self *SQuota) IsEmpty() bool

func (*SQuota) Sub

func (self *SQuota) Sub(quota quotas.IQuota)

func (*SQuota) ToJSON

func (self *SQuota) ToJSON(prefix string) jsonutils.JSONObject

func (*SQuota) Update

func (self *SQuota) Update(quota quotas.IQuota)

type SReservedip

type SReservedip struct {
	db.SResourceBase

	Id        int64  `primary:"true" auto_increment:"true" list:"admin"`        // = Column(BigInteger, primary_key=True)
	NetworkId string `width:"36" charset:"ascii" nullable:"false" list:"admin"` // Column(VARCHAR(36, charset='ascii'), nullable=False)
	IpAddr    string `width:"16" charset:"ascii" list:"admin"`                  // Column(VARCHAR(16, charset='ascii'))
	Notes     string `width:"512" charset:"utf8" nullable:"true" list:"admin"`  // ]Column(VARCHAR(512, charset='utf8'), nullable=True)
}

func (*SReservedip) AllowDeleteItem

func (self *SReservedip) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SReservedip) AllowGetDetails

func (self *SReservedip) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SReservedip) AllowUpdateItem

func (self *SReservedip) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool

func (*SReservedip) GetCustomizeColumns

func (self *SReservedip) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SReservedip) GetNetwork

func (self *SReservedip) GetNetwork() *SNetwork

func (*SReservedip) Release

func (self *SReservedip) Release(ctx context.Context, userCred mcclient.TokenCredential, network *SNetwork) error

type SReservedipManager

type SReservedipManager struct {
	db.SResourceBaseManager
}
var ReservedipManager *SReservedipManager

func (*SReservedipManager) AllowCreateItem

func (manager *SReservedipManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SReservedipManager) AllowListItems

func (manager *SReservedipManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SReservedipManager) GetReservedIP

func (manager *SReservedipManager) GetReservedIP(network *SNetwork, ip string) *SReservedip

func (*SReservedipManager) GetReservedIPs

func (manager *SReservedipManager) GetReservedIPs(network *SNetwork) []SReservedip

func (*SReservedipManager) ListItemFilter

func (manager *SReservedipManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SReservedipManager) ReserveIP

func (manager *SReservedipManager) ReserveIP(userCred mcclient.TokenCredential, network *SNetwork, ip string, notes string) error

type SSchedtag

type SSchedtag struct {
	db.SStandaloneResourceBase

	DefaultStrategy string `width:"16" charset:"ascii" nullable:"true" default:"" list:"user" update:"admin" create:"admin_optional"` // Column(VARCHAR(16, charset='ascii'), nullable=True, default=”)
}

func (*SSchedtag) AllowGetDetails

func (self *SSchedtag) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SSchedtag) GetCustomizeColumns

func (self *SSchedtag) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SSchedtag) GetExtraDetails

func (self *SSchedtag) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SSchedtag) GetHostCount

func (self *SSchedtag) GetHostCount() int

func (*SSchedtag) GetHostQuery

func (self *SSchedtag) GetHostQuery() *sqlchemy.SQuery

func (*SSchedtag) GetHosts

func (self *SSchedtag) GetHosts() []SHost

func (*SSchedtag) GetShortDesc

func (self *SSchedtag) GetShortDesc() *jsonutils.JSONDict

func (*SSchedtag) ValidateDeleteCondition

func (self *SSchedtag) ValidateDeleteCondition(ctx context.Context) error

func (*SSchedtag) ValidateUpdateData

func (self *SSchedtag) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SSchedtagManager

type SSchedtagManager struct {
	db.SStandaloneResourceBaseManager
}
var SchedtagManager *SSchedtagManager

func (*SSchedtagManager) AllowCreateItem

func (manager *SSchedtagManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SSchedtagManager) AllowListItems

func (manager *SSchedtagManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SSchedtagManager) ValidateCreateData

func (manager *SSchedtagManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

func (*SSchedtagManager) ValidateSchedtags

func (manager *SSchedtagManager) ValidateSchedtags(userCred mcclient.TokenCredential, schedtags map[string]string) (map[string]string, error)

type SSecurityGroup

type SSecurityGroup struct {
	db.SSharableVirtualResourceBase
	IsDirty bool `nullable:"false" default:"false"` // Column(Boolean, nullable=False, default=False)
}

func (*SSecurityGroup) AllowPerformClone

func (self *SSecurityGroup) AllowPerformClone(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SSecurityGroup) DoSync

func (self *SSecurityGroup) DoSync()

func (*SSecurityGroup) GetCustomizeColumns

func (self *SSecurityGroup) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SSecurityGroup) GetExtraDetails

func (self *SSecurityGroup) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SSecurityGroup) GetGuests

func (self *SSecurityGroup) GetGuests() []SGuest

func (*SSecurityGroup) GetGuestsCount

func (self *SSecurityGroup) GetGuestsCount() int

func (*SSecurityGroup) GetGuestsQuery

func (self *SSecurityGroup) GetGuestsQuery() *sqlchemy.SQuery

func (*SSecurityGroup) PerformClone

type SSecurityGroupManager

type SSecurityGroupManager struct {
	db.SSharableVirtualResourceBaseManager
}
var SecurityGroupManager *SSecurityGroupManager

func (*SSecurityGroupManager) FetchSecgroupById

func (manager *SSecurityGroupManager) FetchSecgroupById(secId string) *SSecurityGroup

func (*SSecurityGroupManager) ValidateCreateData

func (manager *SSecurityGroupManager) ValidateCreateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	ownerProjId string,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SSecurityGroupRule

type SSecurityGroupRule struct {
	db.SResourceBase
	Id          string `width:"128" charset:"ascii" primary:"true" list:"user"`
	Priority    int64  `default:"1" list:"user" update:"user" list:"user"`
	Protocol    string `width:"5" charset:"ascii" nullable:"false" list:"user" update:"user"`
	Ports       string `width:"256" charset:"ascii" list:"user" update:"user"`
	Direction   string `width:"3" charset:"ascii" list:"user" create:"required"`
	CIDR        string `width:"256" charset:"ascii" list:"user" update:"user"`
	Action      string `width:"5" charset:"ascii" nullable:"false" list:"user" update:"user" create:"required"`
	Description string `width:"256" charset:"utf8" list:"user" update:"user"`
	SecgroupID  string `width:"128" charset:"ascii" create:"required"`
}

func (*SSecurityGroupRule) AllowDeleteItem

func (self *SSecurityGroupRule) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SSecurityGroupRule) AllowUpdateItem

func (self *SSecurityGroupRule) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool

func (*SSecurityGroupRule) BeforeInsert

func (self *SSecurityGroupRule) BeforeInsert()

func (*SSecurityGroupRule) Delete

func (self *SSecurityGroupRule) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SSecurityGroupRule) GetRule

func (self *SSecurityGroupRule) GetRule() string

func (*SSecurityGroupRule) GetSecGroup

func (self *SSecurityGroupRule) GetSecGroup() *SSecurityGroup

func (*SSecurityGroupRule) PostCreate

func (self *SSecurityGroupRule) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SSecurityGroupRule) PostUpdate

func (self *SSecurityGroupRule) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SSecurityGroupRule) PreDelete

func (self *SSecurityGroupRule) PreDelete(ctx context.Context, userCred mcclient.TokenCredential)

func (*SSecurityGroupRule) ValidateUpdateData

func (self *SSecurityGroupRule) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SSecurityGroupRuleManager

type SSecurityGroupRuleManager struct {
	db.SResourceBaseManager
}
var SecurityGroupRuleManager *SSecurityGroupRuleManager

func (*SSecurityGroupRuleManager) AllowCreateItem

func (manager *SSecurityGroupRuleManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SSecurityGroupRuleManager) AllowListItems

func (manager *SSecurityGroupRuleManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SSecurityGroupRuleManager) FilterById

func (manager *SSecurityGroupRuleManager) FilterById(q *sqlchemy.SQuery, idStr string) *sqlchemy.SQuery

func (*SSecurityGroupRuleManager) ListItemFilter

func (manager *SSecurityGroupRuleManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (sql *sqlchemy.SQuery, err error)

func (*SSecurityGroupRuleManager) ValidateCreateData

func (manager *SSecurityGroupRuleManager) ValidateCreateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	ownerProjId string,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SStorage

type SStorage struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure
	SManagedResourceBase

	Capacity    int                  `nullable:"false" list:"admin" update:"admin" create:"admin_required"`                           // Column(Integer, nullable=False) # capacity of disk in MB
	Reserved    int                  `nullable:"true" default:"0" list:"admin" update:"admin"`                                        // Column(Integer, nullable=True, default=0)
	StorageType string               `width:"32" charset:"ascii" nullable:"false" list:"user" update:"admin" create:"admin_required"` // Column(VARCHAR(32, charset='ascii'), nullable=False)
	MediumType  string               `width:"32" charset:"ascii" nullable:"false" list:"user" update:"admin" create:"admin_required"` // Column(VARCHAR(32, charset='ascii'), nullable=False)
	Cmtbound    float32              `nullable:"true" list:"admin" update:"admin"`                                                    // Column(Float, nullable=True)
	StorageConf jsonutils.JSONObject `nullable:"true" get:"admin" update:"admin"`                                                     // = Column(JSONEncodedDict, nullable=True)

	ZoneId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"admin_required"`

	StoragecacheId string `width:"36" charset:"ascii" nullable:"true" list:"admin" get:"admin"`
}

func (*SStorage) AllowPerformCacheImage

func (self *SStorage) AllowPerformCacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SStorage) AllowPerformUncacheImage

func (self *SStorage) AllowPerformUncacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SStorage) GetAllAttachingHosts

func (self *SStorage) GetAllAttachingHosts() []SHost

func (*SStorage) GetAttachedHosts

func (self *SStorage) GetAttachedHosts() []SHost

func (*SStorage) GetCapacity

func (self *SStorage) GetCapacity() int

func (*SStorage) GetCustomizeColumns

func (self *SStorage) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SStorage) GetDiskCount

func (self *SStorage) GetDiskCount() int

func (*SStorage) GetFreeCapacity

func (self *SStorage) GetFreeCapacity() int

func (*SStorage) GetHostCount

func (self *SStorage) GetHostCount() int

func (*SStorage) GetIStorage

func (self *SStorage) GetIStorage() (cloudprovider.ICloudStorage, error)

func (*SStorage) GetMasterHost

func (self *SStorage) GetMasterHost() *SHost

func (*SStorage) GetOvercommitBound

func (self *SStorage) GetOvercommitBound() float32

func (*SStorage) GetReserved

func (self *SStorage) GetReserved() int

func (*SStorage) GetStoragecache

func (self *SStorage) GetStoragecache() *SStoragecache

func (*SStorage) GetUsedCapacity

func (self *SStorage) GetUsedCapacity(isReady tristate.TriState) int

func (*SStorage) GetZoneId

func (self *SStorage) GetZoneId() string

func (*SStorage) IsLocal

func (self *SStorage) IsLocal() bool

func (*SStorage) PerformCacheImage

func (self *SStorage) PerformCacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SStorage) PerformUncacheImage

func (self *SStorage) PerformUncacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SStorage) SetStoragecache

func (self *SStorage) SetStoragecache(cache *SStoragecache) error

func (*SStorage) SyncStatusWithHosts

func (self *SStorage) SyncStatusWithHosts()

func (*SStorage) ValidateDeleteCondition

func (self *SStorage) ValidateDeleteCondition(ctx context.Context) error

type SStorageCapacity

type SStorageCapacity struct {
	Capacity  int
	Used      int
	Wasted    int
	VCapacity int
}

type SStorageManager

var StorageManager *SStorageManager

func (*SStorageManager) AllowListItems

func (manager *SStorageManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SStorageManager) FetchStorageById

func (manager *SStorageManager) FetchStorageById(storageId string) *SStorage

func (*SStorageManager) GetContextManager

func (manager *SStorageManager) GetContextManager() []db.IModelManager

func (*SStorageManager) InitializeData

func (manager *SStorageManager) InitializeData() error

func (*SStorageManager) ListItemFilter

func (manager *SStorageManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SStorageManager) SyncStorages

func (*SStorageManager) TotalCapacity

func (manager *SStorageManager) TotalCapacity(rangeObj db.IStandaloneModel, hostTypes []string) StoragesCapacityStat

type SStoragecache

type SStoragecache struct {
	db.SStandaloneResourceBase
	SInfrastructure
	SManagedResourceBase

	Path string `width:"256" charset:"utf8" nullable:"true" list:"admin" update:"admin" create:"admin_optional"` // = Column(VARCHAR(256, charset='utf8'), nullable=True)
}

func (*SStoragecache) AllowPerformCacheImage

func (self *SStoragecache) AllowPerformCacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SStoragecache) AllowPerformUncacheImage

func (self *SStoragecache) AllowPerformUncacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SStoragecache) GetCustomizeColumns

func (self *SStoragecache) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SStoragecache) GetExtraDetails

func (self *SStoragecache) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SStoragecache) GetIStorageCache

func (self *SStoragecache) GetIStorageCache() (cloudprovider.ICloudStoragecache, error)

func (*SStoragecache) PerformCacheImage

func (self *SStoragecache) PerformCacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SStoragecache) PerformUncacheImage

func (self *SStoragecache) PerformUncacheImage(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SStoragecache) StartImageCacheTask

func (self *SStoragecache) StartImageCacheTask(ctx context.Context, userCred mcclient.TokenCredential, imageId string, isForce bool, parentTaskId string) error

func (*SStoragecache) StartImageUncacheTask

func (self *SStoragecache) StartImageUncacheTask(ctx context.Context, userCred mcclient.TokenCredential, imageId string, isForce bool, parentTaskId string) error

func (*SStoragecache) ValidateDeleteCondition

func (self *SStoragecache) ValidateDeleteCondition(ctx context.Context) error

type SStoragecacheManager

type SStoragecacheManager struct {
	db.SStandaloneResourceBaseManager
	SInfrastructureManager
}
var StoragecacheManager *SStoragecacheManager

func (*SStoragecacheManager) ListItemFilter

func (manager *SStoragecacheManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SStoragecacheManager) SyncWithCloudStoragecache

func (manager *SStoragecacheManager) SyncWithCloudStoragecache(cloudCache cloudprovider.ICloudStoragecache) (*SStoragecache, error)

type SStoragecachedimage

type SStoragecachedimage struct {
	db.SJointResourceBase
	SInfrastructure

	StoragecacheId string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"`
	CachedimageId  string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required" key_index:"true"`

	ExternalId string `width:"64" charset:"ascii" nullable:"false" get:"admin"`

	Status         string    `width:"32" charset:"ascii" nullable:"false" default:"init" list:"admin" update:"admin" create:"admin_required"` // = Column(VARCHAR(32, charset='ascii'), nullable=False,
	Path           string    `width:"256" charset:"utf8" nullable:"true" list:"admin" update:"admin" create:"admin_optional"`                 // = Column(VARCHAR(256, charset='utf8'), nullable=True)
	LastDownload   time.Time `get:"admin"`                                                                                                    // = Column(DateTime)
	DownloadRefcnt int       `get:"admin"`                                                                                                    // = Column(Integer)
}

func (*SStoragecachedimage) Delete

func (self *SStoragecachedimage) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SStoragecachedimage) Detach

func (self *SStoragecachedimage) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SStoragecachedimage) GetCachedimage

func (self *SStoragecachedimage) GetCachedimage() *SCachedimage

func (*SStoragecachedimage) GetCustomizeColumns

func (self *SStoragecachedimage) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SStoragecachedimage) GetExtraDetails

func (self *SStoragecachedimage) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SStoragecachedimage) GetStoragecache

func (self *SStoragecachedimage) GetStoragecache() *SStoragecache

func (*SStoragecachedimage) Master

func (joint *SStoragecachedimage) Master() db.IStandaloneModel

func (*SStoragecachedimage) SetExternalId

func (self *SStoragecachedimage) SetExternalId(externalId string) error

func (*SStoragecachedimage) SetStatus

func (self *SStoragecachedimage) SetStatus(userCred mcclient.TokenCredential, status string, reason string) error

func (*SStoragecachedimage) Slave

func (joint *SStoragecachedimage) Slave() db.IStandaloneModel

func (*SStoragecachedimage) ValidateDeleteCondition

func (self *SStoragecachedimage) ValidateDeleteCondition(ctx context.Context) error

type SStoragecachedimageManager

type SStoragecachedimageManager struct {
	db.SJointResourceBaseManager
	SInfrastructureManager
}
var StoragecachedimageManager *SStoragecachedimageManager

func (*SStoragecachedimageManager) AllowListDescendent

func (manager *SStoragecachedimageManager) AllowListDescendent(ctx context.Context, userCred mcclient.TokenCredential, model db.IStandaloneModel, query jsonutils.JSONObject) bool

func (*SStoragecachedimageManager) GetStoragecachedimage

func (manager *SStoragecachedimageManager) GetStoragecachedimage(cacheId string, imageId string) *SStoragecachedimage

func (*SStoragecachedimageManager) Register

func (manager *SStoragecachedimageManager) Register(ctx context.Context, userCred mcclient.TokenCredential, cacheId, imageId string) *SStoragecachedimage

type SSyncRange

type SSyncRange struct {
	Force    bool
	FullSync bool
	Region   []string
	Zone     []string
	Host     []string
}

func (*SSyncRange) NeedSyncInfo

func (sr *SSyncRange) NeedSyncInfo() bool

func (*SSyncRange) Normalize

func (sr *SSyncRange) Normalize() error

type SVCenter

type SVCenter struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure

	Hostname string `width:"64" charset:"ascii" nullable:"false" list:"admin"` // = Column(VARCHAR(64, charset='ascii'), nullable=False)
	Port     int    `nullable:"false" list:"admin"`                            // = Column(Integer, nullable=False)
	Account  string `width:"64" charset:"ascii" nullable:"false" list:"admin"` // = Column(VARCHAR(64, charset='ascii'), nullable=False)
	Password string `width:"256" charset:"ascii" nullable:"false"`             // = Column(VARCHAR(256, charset='ascii'), nullable=False)

	LastSync time.Time `nullable:"true" get:"admin"` // = Column(DateTime, nullable=True)

	Version string `width:"32" charset:"ascii" nullable:"true" list:"admin"` // = Column(VARCHAR(32, charset='ascii'), nullable=True)

	Sysinfo jsonutils.JSONObject `nullable:"true" get:"admin"` // = Column(JSONEncodedDict, nullable=True)
}

type SVCenterManager

var VCenterManager *SVCenterManager

func (*SVCenterManager) AllowCreateItem

func (manager *SVCenterManager) AllowCreateItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

type SVpc

type SVpc struct {
	db.SEnabledStatusStandaloneResourceBase
	SInfrastructure
	SManagedResourceBase

	IsDefault bool `default:"false" list:"admin" create:"admin_optional"`

	CidrBlock string `width:"64" charset:"ascii" nullable:"true" list:"admin" create:"admin_required"`

	CloudregionId string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"`
}

func (*SVpc) AllowPerformPurge

func (self *SVpc) AllowPerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SVpc) CustomizeCreate

func (self *SVpc) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SVpc) CustomizeDelete

func (self *SVpc) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SVpc) Delete

func (self *SVpc) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SVpc) GetCloudRegionId

func (self *SVpc) GetCloudRegionId() string

func (*SVpc) GetCustomizeColumns

func (self *SVpc) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SVpc) GetExtraDetails

func (self *SVpc) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SVpc) GetIRegion

func (self *SVpc) GetIRegion() (cloudprovider.ICloudRegion, error)

func (*SVpc) GetIVpc

func (self *SVpc) GetIVpc() (cloudprovider.ICloudVpc, error)

func (*SVpc) GetNetworkCount

func (self *SVpc) GetNetworkCount() int

func (*SVpc) GetRegion

func (self *SVpc) GetRegion() *SCloudregion

func (*SVpc) GetWireCount

func (self *SVpc) GetWireCount() int

func (*SVpc) GetWires

func (self *SVpc) GetWires() []SWire

func (*SVpc) PerformPurge

func (self *SVpc) PerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SVpc) PostCreate

func (self *SVpc) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SVpc) RealDelete

func (self *SVpc) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SVpc) StartDeleteVpcTask

func (self *SVpc) StartDeleteVpcTask(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SVpc) SyncWithCloudVpc

func (self *SVpc) SyncWithCloudVpc(extVPC cloudprovider.ICloudVpc) error

func (*SVpc) ValidateDeleteCondition

func (self *SVpc) ValidateDeleteCondition(ctx context.Context) error

type SVpcManager

var VpcManager *SVpcManager

func (*SVpcManager) GetContextManager

func (manager *SVpcManager) GetContextManager() []db.IModelManager

func (*SVpcManager) InitializeData

func (manager *SVpcManager) InitializeData() error

func (*SVpcManager) ListItemFilter

func (manager *SVpcManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SVpcManager) SyncVPCs

func (*SVpcManager) ValidateCreateData

func (manager *SVpcManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SWire

type SWire struct {
	db.SStandaloneResourceBase
	SInfrastructure

	Bandwidth    int    `list:"admin" update:"admin" nullable:"false" create:"admin_required"`             // = Column(Integer, nullable=False) # bandwidth of network in Mbps
	ScheduleRank int    `list:"admin" update:"admin"`                                                      // = Column(Integer, default=0, nullable=True)
	ZoneId       string `width:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"` // = Column(VARCHAR(36, charset='ascii'), nullable=False)
	VpcId        string `wdith:"36" charset:"ascii" nullable:"false" list:"admin" create:"admin_required"`
}

func (*SWire) GetCandidatePrivateNetwork

func (self *SWire) GetCandidatePrivateNetwork(userCred mcclient.TokenCredential, isExit bool, serverType string) (*SNetwork, error)

func (*SWire) GetCandidatePublicNetwork

func (self *SWire) GetCandidatePublicNetwork(isExit bool, serverType string) (*SNetwork, error)

func (*SWire) GetHostwires

func (wire *SWire) GetHostwires() ([]SHostwire, error)

func (*SWire) GetIWire

func (self *SWire) GetIWire() (cloudprovider.ICloudWire, error)

func (*SWire) GetVpcId

func (wire *SWire) GetVpcId() string

func (*SWire) GetZone

func (self *SWire) GetZone() *SZone

func (*SWire) HostCount

func (wire *SWire) HostCount() int

func (*SWire) NetworkCount

func (wire *SWire) NetworkCount() int

func (*SWire) ValidateDeleteCondition

func (wire *SWire) ValidateDeleteCondition(ctx context.Context) error

func (*SWire) ValidateUpdateData

func (wire *SWire) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SWireManager

var WireManager *SWireManager

func (*SWireManager) FetchWireById

func (manager *SWireManager) FetchWireById(wireId string) *SWire

func (*SWireManager) GetContextManager

func (manager *SWireManager) GetContextManager() []db.IModelManager

func (*SWireManager) InitializeData

func (manager *SWireManager) InitializeData() error

func (*SWireManager) ListItemFilter

func (manager *SWireManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SWireManager) SyncWires

func (*SWireManager) TotalCount

func (manager *SWireManager) TotalCount(rangeObj db.IStandaloneModel, hostTypes []string) WiresCountStat

func (*SWireManager) ValidateCreateData

func (manager *SWireManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SZone

type SZone struct {
	db.SStatusStandaloneResourceBase
	SInfrastructure

	Location string `width:"256" charset:"utf8" get:"user" update:"admin"` // = Column(VARCHAR(256, charset='utf8'))
	Contacts string `width:"256" charset:"utf8" get:"user" update:"admin"` // = Column(VARCHAR(256, charset='utf8'))
	NameCn   string `width:"256" charset:"utf8"`                           // = Column(VARCHAR(256, charset='utf8'))
	// status = Column(VARCHAR(36, charset='ascii'), nullable=False, default=ZONE_DISABLE)
	ManagerUri string `width:"256" charset:"ascii" list:"admin" update:"admin"` // = Column(VARCHAR(256, charset='ascii'), nullable=True)
	// admin_id = Column(VARCHAR(36, charset='ascii'), nullable=False)
	CloudregionId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"admin_required"`
}

func (*SZone) AllowGetDetailsCapabilities

func (self *SZone) AllowGetDetailsCapabilities(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SZone) GeneralUsage

func (zone *SZone) GeneralUsage() ZoneGeneralUsage

func (*SZone) GetCloudRegionId

func (zone *SZone) GetCloudRegionId() string

func (*SZone) GetCustomizeColumns

func (zone *SZone) GetCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SZone) GetDetailsCapabilities

func (self *SZone) GetDetailsCapabilities(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SZone) GetExtraDetails

func (zone *SZone) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict

func (*SZone) GetRegion

func (zone *SZone) GetRegion() *SCloudregion

func (*SZone) HostCount

func (zone *SZone) HostCount(status string, hostStatus string, enabled tristate.TriState, hostType string, isBaremetal tristate.TriState) int

func (*SZone) ValidateDeleteCondition

func (zone *SZone) ValidateDeleteCondition(ctx context.Context) error

type SZoneCapabilities

type SZoneCapabilities struct {
	Hypervisors        []string
	StorageTypes       []string
	GPUModels          []string
	MinNicCount        int
	MaxNicCount        int
	MinDataDiskCount   int
	MaxDataDiskCount   int
	SchedPolicySupport bool
	Usable             bool
}

type SZoneManager

var ZoneManager *SZoneManager

func (*SZoneManager) AllowListItems

func (manager *SZoneManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool

func (*SZoneManager) Count

func (manager *SZoneManager) Count() int

func (*SZoneManager) FetchZoneById

func (manager *SZoneManager) FetchZoneById(zoneId string) *SZone

func (*SZoneManager) GetContextManager

func (manager *SZoneManager) GetContextManager() []db.IModelManager

func (*SZoneManager) InitializeData

func (manager *SZoneManager) InitializeData() error

func (*SZoneManager) ListItemFilter

func (manager *SZoneManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)

func (*SZoneManager) SyncZones

func (*SZoneManager) ValidateCreateData

func (manager *SZoneManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SchedStrategyType

type SchedStrategyType string

type StorageCapacityStat

type StorageCapacityStat struct {
	TotalSize        int64
	TotalSizeVirtual float64
}

type StorageStat

type StorageStat struct {
	Capacity       int
	Reserved       int
	Cmtbound       float32
	UsedCapacity   int
	FailedCapacity int
}

type StoragesCapacityStat

type StoragesCapacityStat struct {
	Capacity        int64
	CapacityVirtual float64
	CapacityUsed    int64
	CapacityUnread  int64
}

type WiresCountStat

type WiresCountStat struct {
	WiresCount    int
	NetCount      int
	GuestNicCount int
	HostNicCount  int
	ReservedCount int
}

type ZoneGeneralUsage

type ZoneGeneralUsage struct {
	Hosts             int
	HostsEnabled      int
	Baremetals        int
	BaremetalsEnabled int
	Wires             int
	Networks          int
	Storages          int
}

Jump to

Keyboard shortcuts

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