Skip to content

Commit

Permalink
DBaaS | Add API endpoint for applying cluster patches (#909)
Browse files Browse the repository at this point in the history
* [DBAAS-35] | Add API endpoint for applying cluster patches

* Update specification/resources/databases/databases_update_installUpdate.yml

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>

* Update specification/resources/databases/databases_update_installUpdate.yml

Co-authored-by: danaelhe <42972711+danaelhe@users.noreply.github.com>

* changed the structure

* Add 'install' to linter rules for allowed operation names.

---------

Co-authored-by: v.sharma <v.sharma@digitalocean.com>
Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
Co-authored-by: danaelhe <42972711+danaelhe@users.noreply.github.com>
Co-authored-by: Andrew Starr-Bochicchio <a.starr.b@gmail.com>
  • Loading branch information
5 people committed Sep 17, 2024
1 parent a6ae557 commit 21e0351
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 1 deletion.
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,45 @@
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'

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")
2 changes: 1 addition & 1 deletion spectral/functions/validateOpIDNaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PATCH = ["patch"];
const POST = ["create", "post", "add", "tag", "install", "reset", "upgrade",
"recycle", "run", "retry", "validate", "assign", "unassign", "cancel", "list",
"destroy", "delete", "update", "attach", "revert", "commit"];
const PUT = ["update", "promote"];
const PUT = ["update", "promote", "install"];

const articles = ["_a_", "_an_", "_the_"]

Expand Down

0 comments on commit 21e0351

Please sign in to comment.