Skip to content

Commit 0eb6b52

Browse files
authored
Update cluster naming conventions (#251)
1 parent 2b10acf commit 0eb6b52

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

planetscale/keyspaces.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Keyspace struct {
1717
ResizePending bool `json:"resize_pending"`
1818
Resizing bool `json:"resizing"`
1919
Ready bool `json:"ready"`
20-
ClusterSize string `json:"cluster_rate_name"`
20+
ClusterSize string `json:"cluster_name"`
2121
CreatedAt time.Time `json:"created_at"`
2222
UpdatedAt time.Time `json:"updated_at"`
2323
}
@@ -84,8 +84,8 @@ type KeyspaceResizeRequest struct {
8484
State string `json:"state"`
8585
Actor *Actor `json:"actor"`
8686

87-
ClusterSize string `json:"cluster_rate_name"`
88-
PreviousClusterSize string `json:"previous_cluster_rate_name"`
87+
ClusterSize string `json:"cluster_name"`
88+
PreviousClusterSize string `json:"previous_cluster_name"`
8989

9090
Replicas uint `json:"replicas"`
9191
ExtraReplicas uint `json:"extra_replicas"`

planetscale/keyspaces_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestKeyspaces_Resize(t *testing.T) {
170170

171171
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
172172
w.WriteHeader(200)
173-
out := `{"id":"thisisanid","type":"KeyspaceResizeRequest","state":"pending","started_at":"2024-06-25T18:03:09.459Z","completed_at":"2024-06-25T18:04:06.228Z","created_at":"2024-06-25T18:03:09.439Z","updated_at":"2024-06-25T18:04:06.238Z","actor":{"id":"actorid","type":"User","display_name":"Test User"},"cluster_rate_name":"PS_10","extra_replicas":1,"previous_cluster_rate_name":"PS_10","replicas":3,"previous_replicas":5}`
173+
out := `{"id":"thisisanid","type":"KeyspaceResizeRequest","state":"pending","started_at":"2024-06-25T18:03:09.459Z","completed_at":"2024-06-25T18:04:06.228Z","created_at":"2024-06-25T18:03:09.439Z","updated_at":"2024-06-25T18:04:06.238Z","actor":{"id":"actorid","type":"User","display_name":"Test User"},"cluster_name":"PS_10","extra_replicas":1,"previous_cluster_name":"PS_10","replicas":3,"previous_replicas":5}`
174174
_, err := w.Write([]byte(out))
175175
c.Assert(err, qt.IsNil)
176176
c.Assert(r.Method, qt.Equals, http.MethodPut)
@@ -232,7 +232,7 @@ func TestKeyspaces_ResizeStatus(t *testing.T) {
232232

233233
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
234234
w.WriteHeader(200)
235-
out := `{"type":"list","current_page":1,"next_page":null,"next_page_url":null,"prev_page":null,"prev_page_url":null,"data":[{"id":"thisisanid","type":"KeyspaceResizeRequest","state":"completed","started_at":"2024-06-25T18:03:09.459Z","completed_at":"2024-06-25T18:04:06.228Z","created_at":"2024-06-25T18:03:09.439Z","updated_at":"2024-06-25T18:04:06.238Z","actor":{"id":"thisisanid","type":"User","display_name":"Test User"},"cluster_rate_name":"PS_10","extra_replicas":0,"previous_cluster_rate_name":"PS_10","replicas":2,"previous_replicas":5}]}`
235+
out := `{"type":"list","current_page":1,"next_page":null,"next_page_url":null,"prev_page":null,"prev_page_url":null,"data":[{"id":"thisisanid","type":"KeyspaceResizeRequest","state":"completed","started_at":"2024-06-25T18:03:09.459Z","completed_at":"2024-06-25T18:04:06.228Z","created_at":"2024-06-25T18:03:09.439Z","updated_at":"2024-06-25T18:04:06.238Z","actor":{"id":"thisisanid","type":"User","display_name":"Test User"},"cluster_name":"PS_10","extra_replicas":0,"previous_cluster_name":"PS_10","replicas":2,"previous_replicas":5}]}`
236236
_, err := w.Write([]byte(out))
237237
c.Assert(err, qt.IsNil)
238238
c.Assert(r.Method, qt.Equals, http.MethodGet)

0 commit comments

Comments
 (0)