-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBaaS | Add API endpoint for applying cluster patches (#909)
* [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
1 parent
a6ae557
commit 21e0351
Showing
6 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
specification/resources/databases/databases_update_installUpdate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
6 changes: 6 additions & 0 deletions
6
specification/resources/databases/examples/curl/databases_update_installUpdate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
17 changes: 17 additions & 0 deletions
17
specification/resources/databases/examples/go/databases_update_installUpdate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} |
8 changes: 8 additions & 0 deletions
8
specification/resources/databases/examples/python/databases_update_installUpdate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters