Skip to content

Commit a010140

Browse files
Added missign db-related fields (#659)
1 parent 7d14d5c commit a010140

23 files changed

+5371
-1444
lines changed

databases.go

+18-12
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,21 @@ const (
6464

6565
// A Database is a instance of Linode Managed Databases
6666
type Database struct {
67-
ID int `json:"id"`
68-
Status DatabaseStatus `json:"status"`
69-
Label string `json:"label"`
70-
Hosts DatabaseHost `json:"hosts"`
71-
Region string `json:"region"`
72-
Type string `json:"type"`
73-
Engine string `json:"engine"`
74-
Version string `json:"version"`
75-
ClusterSize int `json:"cluster_size"`
76-
Platform DatabasePlatform `json:"platform"`
77-
Fork *DatabaseFork `json:"fork"`
67+
ID int `json:"id"`
68+
Status DatabaseStatus `json:"status"`
69+
Label string `json:"label"`
70+
Hosts DatabaseHost `json:"hosts"`
71+
Region string `json:"region"`
72+
Type string `json:"type"`
73+
Engine string `json:"engine"`
74+
Version string `json:"version"`
75+
ClusterSize int `json:"cluster_size"`
76+
Platform DatabasePlatform `json:"platform"`
77+
Fork *DatabaseFork `json:"fork"`
78+
Updates DatabaseMaintenanceWindow `json:"updates"`
79+
UsedDiskSizeGB int `json:"used_disk_size_gb"`
80+
TotalDiskSizeGB int `json:"total_disk_size_gb"`
81+
Port int `json:"port"`
7882

7983
// Members has dynamic keys so it is a map
8084
Members map[string]DatabaseMemberType `json:"members"`
@@ -134,11 +138,13 @@ type DatabaseType struct {
134138
Disk int `json:"disk"`
135139
Memory int `json:"memory"`
136140
Engines DatabaseTypeEngineMap `json:"engines"`
141+
Deprecated bool `json:"deprecated"`
137142
}
138143

139144
// DatabaseTypeEngineMap stores a list of Database Engine types by engine
140145
type DatabaseTypeEngineMap struct {
141-
MySQL []DatabaseTypeEngine `json:"mysql"`
146+
MySQL []DatabaseTypeEngine `json:"mysql"`
147+
PostgreSQL []DatabaseTypeEngine `json:"postgresql"`
142148
}
143149

144150
// DatabaseTypeEngine Sizes and Prices

go.work.sum

+3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
4747
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
4848
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
4949
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
50+
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
5051
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
5152
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
5253
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
54+
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
55+
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
5356
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
5457
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
5558
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=

mysql.go

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ type MySQLDatabase struct {
4747
Updates DatabaseMaintenanceWindow `json:"updates"`
4848
Fork *DatabaseFork `json:"fork"`
4949
OldestRestoreTime *time.Time `json:"-"`
50+
UsedDiskSizeGB int `json:"used_disk_size_gb"`
51+
TotalDiskSizeGB int `json:"total_disk_size_gb"`
52+
Port int `json:"port"`
5053
}
5154

5255
func (d *MySQLDatabase) UnmarshalJSON(b []byte) error {

postgres.go

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ type PostgresDatabase struct {
6666
Updated *time.Time `json:"-"`
6767
Fork *DatabaseFork `json:"fork"`
6868
OldestRestoreTime *time.Time `json:"-"`
69+
UsedDiskSizeGB int `json:"used_disk_size_gb"`
70+
TotalDiskSizeGB int `json:"total_disk_size_gb"`
6971
}
7072

7173
func (d *PostgresDatabase) UnmarshalJSON(b []byte) error {

test/integration/fixtures/TestDatabase_Engine.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interactions:
4444
Content-Type:
4545
- application/json
4646
Expires:
47-
- Fri, 27 Dec 2024 18:13:13 GMT
47+
- Wed, 22 Jan 2025 15:05:07 GMT
4848
Pragma:
4949
- no-cache
5050
Strict-Transport-Security:
@@ -106,7 +106,7 @@ interactions:
106106
Content-Type:
107107
- application/json
108108
Expires:
109-
- Fri, 27 Dec 2024 18:13:13 GMT
109+
- Wed, 22 Jan 2025 15:05:08 GMT
110110
Pragma:
111111
- no-cache
112112
Strict-Transport-Security:

0 commit comments

Comments
 (0)