Skip to content

Commit

Permalink
Add support for scalable storage (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinshenker authored Oct 16, 2023
1 parent b86fa7f commit 604eca4
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ requestBody:
version: "14"
region: nyc3
size: db-s-2vcpu-4gb
storage_size_mib: 61440
num_nodes: 2
tags:
- production
Expand All @@ -57,6 +58,7 @@ requestBody:
region: nyc3
size: db-s-2vcpu-4gb
num_nodes: 2
storage_size_mib: 61440
tags:
- production
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ requestBody:
example:
size: db-s-4vcpu-8gb
num_nodes: 3
storage_size_mib: 163840

responses:
'202':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "tags": ["production"]}' \
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "storage_size_mib": 61440, "tags": ["production"]}' \
"https://api.digitalocean.com/v2/databases"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3}' \
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3, "storage_size_mib":163840}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/resize"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ source: |-
Region: "nyc3",
SizeSlug: "db-s-2vcpu-4gb",
NumNodes: 2,
StorageSizeMiB : 61440,
}
cluster, _, err := client.Databases.Create(ctx, createRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ source: |-
resizeRequest := &godo.DatabaseResizeRequest{
SizeSlug: "db-s-4vcpu-8gb",
NumNodes: 3,
StorageSizeMib: 163840,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source: |-
"region": "nyc3",
"size": "db-s-2vcpu-4gb",
"num_nodes": 2,
"storage_size_mib": 61440,
"tags": [
"production"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ source: |-
req = {
"size": "db-s-4vcpu-8gb",
"num_nodes": 3
"num_nodes": 3,
"storage_size_mib": 163840
}
update_resp = client.databases.update_cluster_size(database_cluster_uuid="a7a8bas", body=req)
6 changes: 6 additions & 0 deletions specification/resources/databases/models/database_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ properties:
description: >-
A timestamp referring to the date when the particular version will no longer be available for creating new
clusters. If null, the version does not have an end of availability timeline.
storage_size_mib:
type: integer
example: 61440
description: >-
Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond
what is provided as a base amount from the 'size' and any previously added additional storage.
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ properties:
The number of nodes in the database cluster. Valid values are are 1-3.
In addition to the primary node, up to two standby nodes may be added for
highly available configurations.
storage_size_mib:
type: integer
example: 61440
description: >-
Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond
what is provided as a base amount from the 'size' and any previously added additional storage.
required:
- size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ content:
private_network_uuid: d455e75d-4858-4eec-8c95-da2f0a5f93a7
version_end_of_life: '2023-11-09T00:00:00Z'
version_end_of_availability: '2023-05-09T00:00:00Z'
storage_size_mib: 61440
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ content:
private_network_uuid: d455e75d-4858-4eec-8c95-da2f0a5f93a7
version_end_of_life: '2023-11-09T00:00:00Z'
version_end_of_availability: '2023-05-09T00:00:00Z'
storage_size_mib: 61440

0 comments on commit 604eca4

Please sign in to comment.