Skip to content

Commit

Permalink
database: Add Size to DatabaseReplica struct (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething authored Jul 26, 2024
1 parent 675abbf commit e56b8a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ type DatabaseReplica struct {
PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
Tags []string `json:"tags,omitempty"`
StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
Size string `json:"size"`
}

// DatabasePool represents a database connection pool
Expand Down
12 changes: 9 additions & 3 deletions databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ func TestDatabases_GetReplica(t *testing.T) {
PrivateNetworkUUID: "deadbeef-dead-4aa5-beef-deadbeef347d",
Tags: []string{"production", "staging"},
StorageSizeMib: 51200,
Size: "db-s-1vcpu-1gb",
}

body := `
Expand Down Expand Up @@ -1598,7 +1599,8 @@ func TestDatabases_GetReplica(t *testing.T) {
},
"private_network_uuid": "deadbeef-dead-4aa5-beef-deadbeef347d",
"tags": ["production", "staging"],
"storage_size_mib": 51200
"storage_size_mib": 51200,
"size": "db-s-1vcpu-1gb"
}
}
`
Expand Down Expand Up @@ -1649,6 +1651,7 @@ func TestDatabases_ListReplicas(t *testing.T) {
PrivateNetworkUUID: "deadbeef-dead-4aa5-beef-deadbeef347d",
Tags: []string{"production", "staging"},
StorageSizeMib: 51200,
Size: "db-s-1vcpu-1gb",
},
}

Expand Down Expand Up @@ -1679,7 +1682,8 @@ func TestDatabases_ListReplicas(t *testing.T) {
},
"private_network_uuid": "deadbeef-dead-4aa5-beef-deadbeef347d",
"tags": ["production", "staging"],
"storage_size_mib": 51200
"storage_size_mib": 51200,
"size": "db-s-1vcpu-1gb"
}]
}
`
Expand Down Expand Up @@ -1729,6 +1733,7 @@ func TestDatabases_CreateReplica(t *testing.T) {
PrivateNetworkUUID: "deadbeef-dead-4aa5-beef-deadbeef347d",
Tags: []string{"production", "staging"},
StorageSizeMib: 51200,
Size: "db-s-2vcpu-4gb",
}

body := `
Expand Down Expand Up @@ -1758,7 +1763,8 @@ func TestDatabases_CreateReplica(t *testing.T) {
},
"private_network_uuid": "deadbeef-dead-4aa5-beef-deadbeef347d",
"tags": ["production", "staging"],
"storage_size_mib": 51200
"storage_size_mib": 51200,
"size": "db-s-2vcpu-4gb"
}
}
`
Expand Down

0 comments on commit e56b8a3

Please sign in to comment.