mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-05-22 20:40:23 +08:00
./goimports -w -local yunion.io/x/onecloud/ -corp yunion.io/x/ $GOPATH/src/yunion.io/x/onecloud/{cmd,pkg}
34 lines
851 B
Go
34 lines
851 B
Go
package hostdrivers
|
|
|
|
import (
|
|
"yunion.io/x/jsonutils"
|
|
|
|
"yunion.io/x/onecloud/pkg/compute/models"
|
|
"yunion.io/x/onecloud/pkg/httperrors"
|
|
)
|
|
|
|
type SOpenStackHostDriver struct {
|
|
SManagedVirtualizationHostDriver
|
|
}
|
|
|
|
func init() {
|
|
driver := SOpenStackHostDriver{}
|
|
models.RegisterHostDriver(&driver)
|
|
}
|
|
|
|
func (self *SOpenStackHostDriver) GetHostType() string {
|
|
return models.HOST_TYPE_OPENSTACK
|
|
}
|
|
|
|
func (self *SOpenStackHostDriver) ValidateAttachStorage(host *models.SHost, storage *models.SStorage, data *jsonutils.JSONDict) error {
|
|
return httperrors.NewUnsupportOperationError("Not support attach storage for %s host", self.GetHostType())
|
|
}
|
|
|
|
func (self *SOpenStackHostDriver) ValidateDiskSize(storage *models.SStorage, sizeGb int) error {
|
|
return nil
|
|
}
|
|
|
|
func (driver *SOpenStackHostDriver) GetStoragecacheQuota(host *models.SHost) int {
|
|
return 100
|
|
}
|