mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-20 21:26:01 +08:00
feat: add ICloudInstanceSnapshot & modify ICloudVM
This commit is contained in:
@@ -320,6 +320,11 @@ type ICloudVM interface {
|
||||
GetError() error
|
||||
|
||||
SetMetadata(tags map[string]string, replace bool) error
|
||||
|
||||
CreateInstanceSnapshot(ctx context.Context, name string, desc string) (ICloudInstanceSnapshot, error)
|
||||
GetInstanceSnapshot(idStr string) (ICloudInstanceSnapshot, error)
|
||||
GetInstanceSnapshots() ([]ICloudInstanceSnapshot, error)
|
||||
ResetToInstanceSnapshot(ctx context.Context, idStr string) error
|
||||
}
|
||||
|
||||
type ICloudNic interface {
|
||||
@@ -431,6 +436,13 @@ type ICloudSnapshot interface {
|
||||
Delete() error
|
||||
}
|
||||
|
||||
type ICloudInstanceSnapshot interface {
|
||||
IVirtualResource
|
||||
|
||||
GetDescription() string
|
||||
Delete() error
|
||||
}
|
||||
|
||||
type ICloudSnapshotPolicy interface {
|
||||
IVirtualResource
|
||||
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
|
||||
package multicloud
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
import (
|
||||
"context"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
)
|
||||
|
||||
type SInstanceBase struct {
|
||||
SResourceBase
|
||||
@@ -44,3 +48,19 @@ func (instance *SInstanceBase) LiveMigrateVM(hostId string) error {
|
||||
func (instance *SInstanceBase) SetMetadata(tags map[string]string, replace bool) error {
|
||||
return cloudprovider.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (instance *SInstanceBase) GetInstanceSnapshot(idStr string) (cloudprovider.ICloudInstanceSnapshot, error) {
|
||||
return nil, cloudprovider.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (instance *SInstanceBase) GetInstanceSnapshots() ([]cloudprovider.ICloudInstanceSnapshot, error) {
|
||||
return nil, cloudprovider.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (instance *SInstanceBase) CreateInstanceSnapshot(ctx context.Context, name string, desc string) (cloudprovider.ICloudInstanceSnapshot, error) {
|
||||
return nil, cloudprovider.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (instance *SInstanceBase) ResetToInstanceSnapshot(ctx context.Context, idStr string) error {
|
||||
return cloudprovider.ErrNotImplemented
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user