Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBaaS: Add API endpoint for applying cluster patches #909

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,10 @@ paths:
put:
$ref: 'resources/databases/databases_update_maintenanceWindow.yml'

/v2/databases/{database_cluster_uuid}/install_update:
put:
$ref: 'resources/databases/databases_update_installUpdate.yml'

/v2/databases/{database_cluster_uuid}/backups:
get:
$ref: 'resources/databases/databases_list_backups.yml'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
operationId: databases_install_update

summary: Start Database Maintenance

description: >-
To start the installation of updates for a
database cluster, send a PUT request to
`/v2/databases/$DATABASE_ID/install_update`.

A successful request will receive a 204 No Content status code with no body
in response.

tags:
- Databases

parameters:
- $ref: 'parameters.yml#/database_cluster_uuid'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe a single line in between should be enough.



responses:
'204':
$ref: '../../shared/responses/no_content.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'404':
$ref: '../../shared/responses/not_found.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/databases_update_installUpdate.yml'
- $ref: 'examples/go/databases_update_installUpdate.yml'
- $ref: 'examples/python/databases_update_installUpdate.yml'

security:
- bearer_auth:
- 'database:update'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/install_update"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
lang: Go
source: |-
import (
"context"
"os"

"github.com/digitalocean/godo"
)

func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")

client := godo.NewFromToken(token)
ctx := context.TODO()

_, err := client.Databases.InstallUpdate(ctx, "88055188-9e54-4f21-ab11-8a918ed79ee2")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Python
source: |-
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

update_resp = client.databases.install_update(database_cluster_uuid="a7a8bas")
Loading