yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/dbinstance_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 "yunion.io/x/onecloud/pkg/util/billing" 24 ) 25 26 type SDBInstanceBase struct { 27 SVirtualResourceBase 28 SBillingBase 29 } 30 31 func (instance *SDBInstanceBase) GetConnectionStr() string { 32 return "" 33 } 34 35 func (instance *SDBInstanceBase) GetInternalConnectionStr() string { 36 return "" 37 } 38 39 func (instance *SDBInstanceBase) GetDBNetworks() ([]cloudprovider.SDBInstanceNetwork, error) { 40 return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetDBNetworks") 41 } 42 43 func (instance *SDBInstanceBase) GetIDBInstanceParameters() ([]cloudprovider.ICloudDBInstanceParameter, error) { 44 return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIDBInstanceParameters") 45 } 46 47 func (instance *SDBInstanceBase) GetIDBInstanceDatabases() ([]cloudprovider.ICloudDBInstanceDatabase, error) { 48 return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIDBInstanceDatabases") 49 } 50 51 func (instance *SDBInstanceBase) GetIDBInstanceAccounts() ([]cloudprovider.ICloudDBInstanceAccount, error) { 52 return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIDBInstanceAccounts") 53 } 54 55 func (instance *SDBInstanceBase) GetIDBInstanceBackups() ([]cloudprovider.ICloudDBInstanceBackup, error) { 56 return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIDBInstanceBackups") 57 } 58 59 func (instance *SDBInstanceBase) GetCategory() string { 60 return "" 61 } 62 63 func (instance *SDBInstanceBase) Reboot() error { 64 return errors.Wrapf(cloudprovider.ErrNotImplemented, "Reboot") 65 } 66 67 func (instance *SDBInstanceBase) Delete() error { 68 return errors.Wrapf(cloudprovider.ErrNotImplemented, "Delete") 69 } 70 71 func (instance *SDBInstanceBase) GetMasterInstanceId() string { 72 return "" 73 } 74 75 func (instance *SDBInstanceBase) GetSecurityGroupIds() ([]string, error) { 76 return []string{}, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetSecurityGroupIds") 77 } 78 79 func (self *SDBInstanceBase) SetSecurityGroups(ids []string) error { 80 return errors.Wrapf(cloudprovider.ErrNotImplemented, "SetSecurityGroups") 81 } 82 83 func (instance *SDBInstanceBase) Renew(bc billing.SBillingCycle) error { 84 return errors.Wrapf(cloudprovider.ErrNotImplemented, "Renew") 85 } 86 87 func (instance *SDBInstanceBase) ChangeConfig(ctx context.Context, config *cloudprovider.SManagedDBInstanceChangeConfig) error { 88 return errors.Wrapf(cloudprovider.ErrNotImplemented, "ChangeConfig") 89 } 90 91 func (instance *SDBInstanceBase) OpenPublicConnection() error { 92 return errors.Wrapf(cloudprovider.ErrNotImplemented, "OpenPublicConnection") 93 } 94 95 func (instance *SDBInstanceBase) ClosePublicConnection() error { 96 return errors.Wrapf(cloudprovider.ErrNotImplemented, "ClosePublicConnection") 97 } 98 99 func (instance *SDBInstanceBase) CreateDatabase(conf *cloudprovider.SDBInstanceDatabaseCreateConfig) error { 100 return errors.Wrapf(cloudprovider.ErrNotImplemented, "CreateDatabase") 101 } 102 103 func (instance *SDBInstanceBase) CreateAccount(conf *cloudprovider.SDBInstanceAccountCreateConfig) error { 104 return errors.Wrapf(cloudprovider.ErrNotImplemented, "CreateAccount") 105 } 106 107 func (instance *SDBInstanceBase) CreateIBackup(conf *cloudprovider.SDBInstanceBackupCreateConfig) (string, error) { 108 return "", errors.Wrapf(cloudprovider.ErrNotImplemented, "CreateIBackup") 109 } 110 111 func (instance *SDBInstanceBase) RecoveryFromBackup(conf *cloudprovider.SDBInstanceRecoveryConfig) error { 112 return errors.Wrapf(cloudprovider.ErrNotImplemented, "RecoveryFromBackup") 113 } 114 115 func (instance *SDBInstanceBase) GetIops() int { 116 return 0 117 } 118 119 func (instance *SDBInstanceBase) GetDiskSizeUsedMB() int { 120 return 0 121 }