deployer.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package deploy_iface
  15. import (
  16. "yunion.io/x/onecloud/pkg/hostman/guestfs/fsdriver"
  17. "yunion.io/x/onecloud/pkg/hostman/hostdeployer/apis"
  18. )
  19. type IDeployer interface {
  20. Connect(desc *apis.GuestDesc, diskId string) error
  21. Disconnect() error
  22. GetPartitions() []fsdriver.IDiskPartition
  23. IsLVMPartition() bool
  24. Zerofree()
  25. ResizePartition(diskId string, rootPartDev string) error
  26. FormatPartition(fs, uuid string, features *apis.FsFeatures) error
  27. MakePartition(fs string) error
  28. MountRootfs(readonly bool) (fsdriver.IRootFsDriver, error)
  29. UmountRootfs(fd fsdriver.IRootFsDriver) error
  30. DetectIsUEFISupport(rootfs fsdriver.IRootFsDriver) bool
  31. DetectIsBIOSSupport(rootfs fsdriver.IRootFsDriver) bool
  32. DeployGuestfs(req *apis.DeployParams) (res *apis.DeployGuestFsResponse, err error)
  33. ResizeFs(req *apis.ResizeFsParams) (res *apis.Empty, err error)
  34. FormatFs(req *apis.FormatFsParams) (*apis.Empty, error)
  35. SaveToGlance(req *apis.SaveToGlanceParams) (*apis.SaveToGlanceResponse, error)
  36. ProbeImageInfo(req *apis.ProbeImageInfoPramas) (*apis.ImageInfo, error)
  37. }