dbinstance.go 2.5 KB

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