instance_base.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 multicloud
  15. import (
  16. "context"
  17. "yunion.io/x/pkg/errors"
  18. "yunion.io/x/cloudmux/pkg/cloudprovider"
  19. )
  20. type SInstanceBase struct {
  21. SResourceBase
  22. SBillingBase
  23. }
  24. func (instance *SInstanceBase) GetIHostId() string {
  25. return ""
  26. }
  27. func (instance *SInstanceBase) GetCpuSockets() int {
  28. return 1
  29. }
  30. func (instance *SInstanceBase) GetSerialOutput(port int) (string, error) {
  31. return "", cloudprovider.ErrNotImplemented
  32. }
  33. func (instance *SInstanceBase) ConvertPublicIpToEip() error {
  34. return cloudprovider.ErrNotImplemented
  35. }
  36. func (instance *SInstanceBase) MigrateVM(hostId string) error {
  37. return cloudprovider.ErrNotImplemented
  38. }
  39. func (instance *SInstanceBase) LiveMigrateVM(hostId string) error {
  40. return cloudprovider.ErrNotImplemented
  41. }
  42. func (instance *SInstanceBase) GetInstanceSnapshot(idStr string) (cloudprovider.ICloudInstanceSnapshot, error) {
  43. return nil, cloudprovider.ErrNotImplemented
  44. }
  45. func (instance *SInstanceBase) GetInstanceSnapshots() ([]cloudprovider.ICloudInstanceSnapshot, error) {
  46. return nil, cloudprovider.ErrNotImplemented
  47. }
  48. func (instance *SInstanceBase) CreateInstanceSnapshot(ctx context.Context, name string, desc string) (cloudprovider.ICloudInstanceSnapshot, error) {
  49. return nil, cloudprovider.ErrNotImplemented
  50. }
  51. func (instance *SInstanceBase) ResetToInstanceSnapshot(ctx context.Context, idStr string) error {
  52. return cloudprovider.ErrNotImplemented
  53. }
  54. func (self *SInstanceBase) SaveImage(opts *cloudprovider.SaveImageOptions) (cloudprovider.ICloudImage, error) {
  55. return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "SaveImage")
  56. }
  57. func (self *SInstanceBase) AllocatePublicIpAddress() (string, error) {
  58. return "", errors.Wrapf(cloudprovider.ErrNotImplemented, "AllocatePublicIpAddress")
  59. }
  60. func (self *SInstanceBase) CreateDisk(ctx context.Context, opts *cloudprovider.GuestDiskCreateOptions) (string, error) {
  61. return "", errors.Wrapf(cloudprovider.ErrNotImplemented, "CreateDisk")
  62. }
  63. func (self *SInstanceBase) GetThroughput() int {
  64. return 0
  65. }
  66. func (self *SInstanceBase) GetInternetMaxBandwidthOut() int {
  67. return 0
  68. }
  69. func (ins *SInstanceBase) GetPowerStates() string {
  70. return ""
  71. }
  72. func (ins *SInstanceBase) GetHealthStatus() string {
  73. return ""
  74. }
  75. func (instance *SInstanceBase) GetError() error {
  76. return nil
  77. }
  78. func (instance *SInstanceBase) GetIsolateDeviceIds() ([]string, error) {
  79. return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDeviceIds")
  80. }
  81. func (instance *SInstanceBase) GetContainers() ([]cloudprovider.ICloudContainer, error) {
  82. return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetContainers")
  83. }
  84. func (instance *SInstanceBase) GetModificationTypes() ([]cloudprovider.SInstanceModificationType, error) {
  85. return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetModificationTypes")
  86. }