yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/instance_base.go (about)

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