dbinstance_database.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 compute
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. type SDBInstanceDatabasePrivilege struct {
  17. // 数据库账号名称或Id
  18. // required: true
  19. Account string `json:"account"`
  20. // swagger:ignore
  21. DBInstanceaccountId string `json:"db_instanceaccount_id"`
  22. // 权限
  23. //
  24. //
  25. //
  26. // | 平台 |Rds引擎 | 支持类型 |
  27. // | ---- |------- | -------- |
  28. // | Aliyun |MySQL, MariaBD | rw, r, ddl, dml |
  29. // | Aliyun |SQLServer | rw, r, owner |
  30. // | Huawei |MySQL, MariaDB | rw, r |
  31. // 同一平台不同的rds类型支持的权限不尽相同
  32. // required: true
  33. Privilege string `json:"privilege"`
  34. }
  35. type DBInstanceDatabaseCreateInput struct {
  36. apis.StatusStandaloneResourceCreateInput
  37. // rds实例名称或Id,建议使用Id
  38. //
  39. //
  40. //
  41. // | 平台 |支持Rds引擎 |
  42. // | ---- |------- |
  43. // | Aliyun |MySQL, MariaBD, SQLServer |
  44. // | 华为云 |MySQL, MariaBD |
  45. // | 腾讯云 | |
  46. // required: true
  47. // 阿里云SQL Server 2017集群版不支持创建数据库
  48. // 阿里云只读实例不支持创建数据库
  49. // 实例状态必须是运行中
  50. DBInstance string `json:"dbinstance"`
  51. // swagger:ignore
  52. DBInstanceId string `json:"dbinstance_id"`
  53. // 数据库字符集
  54. // required: true
  55. CharacterSet string `json:"character_set"`
  56. // 赋予账号权限
  57. // required: false
  58. Accounts []SDBInstanceDatabasePrivilege `json:"accounts"`
  59. }
  60. type DBInstancedatabaseDetails struct {
  61. apis.StatusStandaloneResourceDetails
  62. apis.ProjectizedResourceInfo
  63. DBInstanceResourceInfo
  64. SDBInstanceDatabase
  65. // 数据库权限
  66. DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges"`
  67. ProjectId string `json:"tenant_id"`
  68. }
  69. type DBInstanceparameterDetails struct {
  70. apis.StandaloneResourceDetails
  71. DBInstanceResourceInfo
  72. SDBInstanceParameter
  73. }
  74. type DBInstanceDatabaseUpdateInput struct {
  75. apis.StatusStandaloneResourceBaseUpdateInput
  76. }