-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APPS-9908 Add docs for exec endpoint (#945)
* APPS-9908 Add docs for exec endpoint * update wording
- Loading branch information
1 parent
90e7d90
commit b7a368d
Showing
10 changed files
with
146 additions
and
0 deletions.
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,42 @@ | ||
operationId: apps_get_exec | ||
|
||
summary: Retrieve Exec URL for Deployment | ||
|
||
description: | ||
Returns a websocket URL that allows sending/receiving console input and output | ||
to a component of the specified deployment if one exists. | ||
|
||
tags: | ||
- Apps | ||
|
||
parameters: | ||
- $ref: parameters.yml#/app_id | ||
- $ref: parameters.yml#/deployment_id | ||
- $ref: parameters.yml#/component | ||
|
||
responses: | ||
"200": | ||
$ref: responses/get_exec.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_get_exec.yml" | ||
- $ref: "examples/python/apps_get_exec.yml" | ||
|
||
security: | ||
- bearer_auth: | ||
- "app:update" |
41 changes: 41 additions & 0 deletions
41
specification/resources/apps/apps_get_exec_active_deployment.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,41 @@ | ||
operationId: apps_get_exec_active_deployment | ||
|
||
summary: Retrieve Exec URL | ||
|
||
description: | ||
Returns a websocket URL that allows sending/receiving console input and output | ||
to a component of the active deployment if one exists. | ||
|
||
tags: | ||
- Apps | ||
|
||
parameters: | ||
- $ref: parameters.yml#/app_id | ||
- $ref: parameters.yml#/component | ||
|
||
responses: | ||
"200": | ||
$ref: responses/get_exec.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_get_exec_active_deployment.yml" | ||
- $ref: "examples/python/apps_get_exec_active_deployment.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 GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec" |
6 changes: 6 additions & 0 deletions
6
specification/resources/apps/examples/curl/apps_get_exec_active_deployment.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 GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/apps/{app_id}/components/{component_name}/exec" |
8 changes: 8 additions & 0 deletions
8
specification/resources/apps/examples/python/apps_get_exec.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")) | ||
get_resp = client.apps.get_exec(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component") |
8 changes: 8 additions & 0 deletions
8
specification/resources/apps/examples/python/apps_get_exec_active_deployment.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")) | ||
get_resp = client.apps.get_exec_active_deployment(app_id="a6adf840", component_name="component") |
6 changes: 6 additions & 0 deletions
6
specification/resources/apps/models/apps_get_exec_response.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 @@ | ||
properties: | ||
url: | ||
description: A websocket URL that allows sending/receiving console input and receiving console output. | ||
type: string | ||
example: wss://exec/?token=xxx | ||
type: object |
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,17 @@ | ||
description: A JSON object with a websocket URL that allows sending/receiving console input and output. | ||
|
||
content: | ||
application/json: | ||
schema: | ||
$ref: ../models/apps_get_exec_response.yml | ||
examples: | ||
exec: | ||
$ref: examples.yml#/exec | ||
|
||
headers: | ||
ratelimit-limit: | ||
$ref: ../../../shared/headers.yml#/ratelimit-limit | ||
ratelimit-remaining: | ||
$ref: ../../../shared/headers.yml#/ratelimit-remaining | ||
ratelimit-reset: | ||
$ref: ../../../shared/headers.yml#/ratelimit-reset |