-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APPS-9764 Add docs for restart API (#941)
* APPS-9764 Add docs for restart API * remove required * add "restart" to valid POST paths to fix linter * change auth requirement to app:update --------- Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
- Loading branch information
1 parent
de14248
commit 231e5bb
Showing
6 changed files
with
73 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
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,44 @@ | ||
operationId: apps_restart | ||
|
||
summary: Restart an App | ||
|
||
description: Perform a rolling restart of all or specific components in an app. | ||
|
||
tags: | ||
- Apps | ||
|
||
parameters: | ||
- $ref: parameters.yml#/app_id | ||
|
||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: models/apps_restart_request.yml | ||
|
||
responses: | ||
"200": | ||
$ref: responses/new_app_deployment.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/apps_restart.yml" | ||
- $ref: "examples/python/apps_restart.yml" | ||
|
||
security: | ||
- bearer_auth: | ||
- "app:update" |
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 POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/apps/{app_id}/restart" |
8 changes: 8 additions & 0 deletions
8
specification/resources/apps/examples/python/apps_restart.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")) | ||
create_resp = client.apps.restart(app_id="b6bdf840", body={"components": ["component1", "component2"]}) |
10 changes: 10 additions & 0 deletions
10
specification/resources/apps/models/apps_restart_request.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,10 @@ | ||
type: object | ||
properties: | ||
components: | ||
title: Optional list of components to restart. If not provided, all components will be restarted. | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- component1 | ||
- component2 |
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