yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/cloudprovider/dbinstance.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 cloudprovider
    16  
    17  import "yunion.io/x/onecloud/pkg/util/billing"
    18  
    19  type TBackupMethod string
    20  
    21  const (
    22  	BackupMethodLogical  = TBackupMethod("Logical")
    23  	BackupMethodPhysical = TBackupMethod("Physical")
    24  	BackupMethodUnknown  = TBackupMethod("")
    25  )
    26  
    27  type SDBInstanceNetwork struct {
    28  	IP        string
    29  	NetworkId string
    30  }
    31  
    32  type SExtraIp struct {
    33  	IP  string
    34  	URL string
    35  }
    36  
    37  type SZoneInfo struct {
    38  	Zone1  string
    39  	Zone2  string
    40  	Zone3  string
    41  	ZoneId string
    42  }
    43  
    44  type SInstanceType struct {
    45  	InstanceType string
    46  	SZoneInfo
    47  }
    48  
    49  type SManagedDBInstanceCreateConfig struct {
    50  	Name        string
    51  	Description string
    52  	StorageType string
    53  	DiskSizeGB  int
    54  	SInstanceType
    55  	VcpuCount        int
    56  	VmemSizeMb       int
    57  	VpcId            string
    58  	SecgroupIds      []string
    59  	NetworkId        string
    60  	Address          string
    61  	Engine           string
    62  	EngineVersion    string
    63  	Category         string
    64  	Port             int
    65  	MasterInstanceId string
    66  	Password         string
    67  	Username         string
    68  	ProjectId        string
    69  
    70  	MultiAz bool
    71  
    72  	BillingCycle *billing.SBillingCycle
    73  	Tags         map[string]string
    74  
    75  	// 仅从备份恢复到新实例用到
    76  	RdsId    string
    77  	BackupId string
    78  }
    79  
    80  type SManagedDBInstanceChangeConfig struct {
    81  	DiskSizeGB   int
    82  	InstanceType string
    83  }
    84  
    85  type SDBInstanceDatabaseCreateConfig struct {
    86  	Name         string
    87  	CharacterSet string
    88  	Description  string
    89  }
    90  
    91  type SDBInstancePrivilege struct {
    92  	Account   string
    93  	Database  string
    94  	Privilege string
    95  }
    96  
    97  type SDBInstanceAccountCreateConfig struct {
    98  	Name        string
    99  	Host        string
   100  	Description string
   101  	Password    string
   102  }
   103  
   104  type SDBInstanceBackupCreateConfig struct {
   105  	Name        string
   106  	Description string
   107  	Databases   []string
   108  }
   109  
   110  type SDBInstanceRecoveryConfig struct {
   111  	BackupId                   string
   112  	Databases                  map[string]string
   113  	OriginDBInstanceExternalId string
   114  }