@@ -19,32 +19,44 @@ const (
1919
2020// A MySQLDatabase is an instance of Linode MySQL Managed Databases
2121type MySQLDatabase struct {
22- ID int `json:"id"`
23- Status DatabaseStatus `json:"status"`
24- Label string `json:"label"`
25- Hosts DatabaseHost `json:"hosts"`
26- Region string `json:"region"`
27- Type string `json:"type"`
28- Engine string `json:"engine"`
29- Version string `json:"version"`
30- ClusterSize int `json:"cluster_size"`
31- ReplicationType string `json:"replication_type"`
32- SSLConnection bool `json:"ssl_connection"`
33- Encrypted bool `json:"encrypted"`
34- AllowList []string `json:"allow_list"`
35- InstanceURI string `json:"instance_uri"`
36- Created * time.Time `json:"-"`
37- Updated * time.Time `json:"-"`
38- Updates DatabaseMaintenanceWindow `json:"updates"`
22+ ID int `json:"id"`
23+ Status DatabaseStatus `json:"status"`
24+ Label string `json:"label"`
25+ Hosts DatabaseHost `json:"hosts"`
26+ Region string `json:"region"`
27+ Type string `json:"type"`
28+ Engine string `json:"engine"`
29+ Version string `json:"version"`
30+ ClusterSize int `json:"cluster_size"`
31+ Platform DatabasePlatform `json:"platform"`
32+
33+ // Members has dynamic keys so it is a map
34+ Members map [string ]DatabaseMemberType `json:"members"`
35+
36+ // Deprecated: ReplicationType is a deprecated property, as it is no longer supported in DBaaS V2.
37+ ReplicationType string `json:"replication_type"`
38+ // Deprecated: SSLConnection is a deprecated property, as it is no longer supported in DBaaS V2.
39+ SSLConnection bool `json:"ssl_connection"`
40+ // Deprecated: Encrypted is a deprecated property, as it is no longer supported in DBaaS V2.
41+ Encrypted bool `json:"encrypted"`
42+
43+ AllowList []string `json:"allow_list"`
44+ InstanceURI string `json:"instance_uri"`
45+ Created * time.Time `json:"-"`
46+ Updated * time.Time `json:"-"`
47+ Updates DatabaseMaintenanceWindow `json:"updates"`
48+ Fork * DatabaseFork `json:"fork"`
49+ OldestRestoreTime * time.Time `json:"-"`
3950}
4051
4152func (d * MySQLDatabase ) UnmarshalJSON (b []byte ) error {
4253 type Mask MySQLDatabase
4354
4455 p := struct {
4556 * Mask
46- Created * parseabletime.ParseableTime `json:"created"`
47- Updated * parseabletime.ParseableTime `json:"updated"`
57+ Created * parseabletime.ParseableTime `json:"created"`
58+ Updated * parseabletime.ParseableTime `json:"updated"`
59+ OldestRestoreTime * parseabletime.ParseableTime `json:"oldest_restore_time"`
4860 }{
4961 Mask : (* Mask )(d ),
5062 }
@@ -55,30 +67,42 @@ func (d *MySQLDatabase) UnmarshalJSON(b []byte) error {
5567
5668 d .Created = (* time .Time )(p .Created )
5769 d .Updated = (* time .Time )(p .Updated )
70+ d .OldestRestoreTime = (* time .Time )(p .OldestRestoreTime )
5871 return nil
5972}
6073
6174// MySQLCreateOptions fields are used when creating a new MySQL Database
6275type MySQLCreateOptions struct {
63- Label string `json:"label"`
64- Region string `json:"region"`
65- Type string `json:"type"`
66- Engine string `json:"engine"`
67- AllowList []string `json:"allow_list,omitempty"`
68- ReplicationType string `json:"replication_type,omitempty"`
69- ClusterSize int `json:"cluster_size,omitempty"`
70- Encrypted bool `json:"encrypted,omitempty"`
71- SSLConnection bool `json:"ssl_connection,omitempty"`
76+ Label string `json:"label"`
77+ Region string `json:"region"`
78+ Type string `json:"type"`
79+ Engine string `json:"engine"`
80+ AllowList []string `json:"allow_list,omitempty"`
81+ ClusterSize int `json:"cluster_size,omitempty"`
82+
83+ // Deprecated: ReplicationType is a deprecated property, as it is no longer supported in DBaaS V2.
84+ ReplicationType string `json:"replication_type,omitempty"`
85+ // Deprecated: Encrypted is a deprecated property, as it is no longer supported in DBaaS V2.
86+ Encrypted bool `json:"encrypted,omitempty"`
87+ // Deprecated: SSLConnection is a deprecated property, as it is no longer supported in DBaaS V2.
88+ SSLConnection bool `json:"ssl_connection,omitempty"`
89+
90+ Fork * DatabaseFork `json:"fork,omitempty"`
7291}
7392
7493// MySQLUpdateOptions fields are used when altering the existing MySQL Database
7594type MySQLUpdateOptions struct {
76- Label string `json:"label,omitempty"`
77- AllowList * []string `json:"allow_list,omitempty"`
78- Updates * DatabaseMaintenanceWindow `json:"updates,omitempty"`
95+ Label string `json:"label,omitempty"`
96+ AllowList * []string `json:"allow_list,omitempty"`
97+ Updates * DatabaseMaintenanceWindow `json:"updates,omitempty"`
98+ Type string `json:"type,omitempty"`
99+ ClusterSize int `json:"cluster_size,omitempty"`
100+ Version string `json:"version,omitempty"`
79101}
80102
81103// MySQLDatabaseBackup is information for interacting with a backup for the existing MySQL Database
104+ // Deprecated: MySQLDatabaseBackup is a deprecated struct, as the backup endpoints are no longer supported in DBaaS V2.
105+ // In DBaaS V2, databases can be backed up via database forking.
82106type MySQLDatabaseBackup struct {
83107 ID int `json:"id"`
84108 Label string `json:"label"`
@@ -87,6 +111,8 @@ type MySQLDatabaseBackup struct {
87111}
88112
89113// MySQLBackupCreateOptions are options used for CreateMySQLDatabaseBackup(...)
114+ // Deprecated: MySQLBackupCreateOptions is a deprecated struct, as the backup endpoints are no longer supported in DBaaS V2.
115+ // In DBaaS V2, databases can be backed up via database forking.
90116type MySQLBackupCreateOptions struct {
91117 Label string `json:"label"`
92118 Target MySQLDatabaseTarget `json:"target"`
@@ -132,6 +158,8 @@ func (c *Client) ListMySQLDatabases(ctx context.Context, opts *ListOptions) ([]M
132158}
133159
134160// ListMySQLDatabaseBackups lists all MySQL Database Backups associated with the given MySQL Database
161+ // Deprecated: ListMySQLDatabaseBackups is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
162+ // In DBaaS V2, databases can be backed up via database forking.
135163func (c * Client ) ListMySQLDatabaseBackups (ctx context.Context , databaseID int , opts * ListOptions ) ([]MySQLDatabaseBackup , error ) {
136164 response , err := getPaginatedResults [MySQLDatabaseBackup ](ctx , c , formatAPIPath ("databases/mysql/instances/%d/backups" , databaseID ), opts )
137165 if err != nil {
@@ -211,6 +239,8 @@ func (c *Client) ResetMySQLDatabaseCredentials(ctx context.Context, databaseID i
211239}
212240
213241// GetMySQLDatabaseBackup returns a specific MySQL Database Backup with the given ids
242+ // Deprecated: GetMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
243+ // In DBaaS V2, databases can be backed up via database forking.
214244func (c * Client ) GetMySQLDatabaseBackup (ctx context.Context , databaseID int , backupID int ) (* MySQLDatabaseBackup , error ) {
215245 e := formatAPIPath ("databases/mysql/instances/%d/backups/%d" , databaseID , backupID )
216246 response , err := doGETRequest [MySQLDatabaseBackup ](ctx , c , e )
@@ -222,13 +252,17 @@ func (c *Client) GetMySQLDatabaseBackup(ctx context.Context, databaseID int, bac
222252}
223253
224254// RestoreMySQLDatabaseBackup returns the given MySQL Database with the given Backup
255+ // Deprecated: RestoreMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
256+ // In DBaaS V2, databases can be backed up via database forking.
225257func (c * Client ) RestoreMySQLDatabaseBackup (ctx context.Context , databaseID int , backupID int ) error {
226258 e := formatAPIPath ("databases/mysql/instances/%d/backups/%d/restore" , databaseID , backupID )
227259 _ , err := doPOSTRequest [MySQLDatabaseBackup , any ](ctx , c , e )
228260 return err
229261}
230262
231263// CreateMySQLDatabaseBackup creates a snapshot for the given MySQL database
264+ // Deprecated: CreateMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
265+ // In DBaaS V2, databases can be backed up via database forking.
232266func (c * Client ) CreateMySQLDatabaseBackup (ctx context.Context , databaseID int , opts MySQLBackupCreateOptions ) error {
233267 e := formatAPIPath ("databases/mysql/instances/%d/backups" , databaseID )
234268 _ , err := doPOSTRequest [MySQLDatabaseBackup ](ctx , c , e , opts )
0 commit comments