Skip to content

Commit 7b91939

Browse files
Add ListEvents, CancelEvent, and GetEventLogs OpenAPI specs for App Platform (#1143)
* Add ListEvents, CancelEvent, and GetEventLogs OpenAPI specs for App Platform Add OpenAPI specifications for the new App Platform events endpoints: - GET /v2/apps/{app_id}/events - list all events (deployments + autoscaling) - POST /v2/apps/{app_id}/events/{event_id}/cancel - cancel an autoscaling event - GET /v2/apps/{app_id}/events/{event_id}/logs - retrieve autoscaling event logs Includes Event model schema, event_id parameter, AUTOSCALE_EVENT log type, response definitions, and curl/python examples. * Add GetEvent API for App Platform --------- Co-authored-by: Harsh Maru <38807407+harshmaru7@users.noreply.github.com>
1 parent 8ae887b commit 7b91939

19 files changed

+379
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,22 @@ paths:
739739
get:
740740
$ref: "resources/apps/apps_get_job_invocation_logs.yml"
741741

742+
/v2/apps/{app_id}/events:
743+
get:
744+
$ref: "resources/apps/apps_list_events.yml"
745+
746+
/v2/apps/{app_id}/events/{event_id}:
747+
get:
748+
$ref: "resources/apps/apps_get_event.yml"
749+
750+
/v2/apps/{app_id}/events/{event_id}/cancel:
751+
post:
752+
$ref: "resources/apps/apps_cancel_event.yml"
753+
754+
/v2/apps/{app_id}/events/{event_id}/logs:
755+
get:
756+
$ref: "resources/apps/apps_get_event_logs.yml"
757+
742758
/v2/apps/tiers/instance_sizes:
743759
get:
744760
$ref: "resources/apps/apps_list_instanceSizes.yml"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
operationId: apps_cancel_event
2+
3+
summary: Cancel an Event
4+
5+
description: Cancel an in-progress autoscaling event.
6+
7+
tags:
8+
- Apps
9+
10+
parameters:
11+
- $ref: parameters.yml#/app_id
12+
- $ref: parameters.yml#/event_id
13+
14+
responses:
15+
"200":
16+
$ref: responses/cancel_event.yml
17+
18+
"401":
19+
$ref: ../../shared/responses/unauthorized.yml
20+
21+
'404':
22+
$ref: '../../shared/responses/not_found.yml'
23+
24+
"429":
25+
$ref: "../../shared/responses/too_many_requests.yml"
26+
27+
"500":
28+
$ref: ../../shared/responses/server_error.yml
29+
30+
default:
31+
$ref: ../../shared/responses/unexpected_error.yml
32+
33+
x-codeSamples:
34+
- $ref: 'examples/curl/apps_cancel_event.yml'
35+
- $ref: 'examples/python/apps_cancel_event.yml'
36+
37+
security:
38+
- bearer_auth:
39+
- 'app:update'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
operationId: apps_get_event
2+
3+
summary: Get an Event
4+
5+
description: Get a single event for an app.
6+
7+
tags:
8+
- Apps
9+
10+
parameters:
11+
- $ref: parameters.yml#/app_id
12+
- $ref: parameters.yml#/event_id
13+
14+
responses:
15+
"200":
16+
$ref: responses/get_event.yml
17+
18+
"401":
19+
$ref: ../../shared/responses/unauthorized.yml
20+
21+
'404':
22+
$ref: '../../shared/responses/not_found.yml'
23+
24+
"429":
25+
$ref: "../../shared/responses/too_many_requests.yml"
26+
27+
"500":
28+
$ref: ../../shared/responses/server_error.yml
29+
30+
default:
31+
$ref: ../../shared/responses/unexpected_error.yml
32+
33+
x-codeSamples:
34+
- $ref: 'examples/curl/apps_get_event.yml'
35+
- $ref: 'examples/python/apps_get_event.yml'
36+
37+
security:
38+
- bearer_auth:
39+
- 'app:read'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
operationId: apps_get_event_logs
2+
3+
summary: Retrieve Event Logs
4+
5+
description: Retrieve the logs of an autoscaling event for an app.
6+
7+
tags:
8+
- Apps
9+
10+
parameters:
11+
- $ref: parameters.yml#/app_id
12+
- $ref: parameters.yml#/event_id
13+
- $ref: parameters.yml#/live_updates
14+
- $ref: parameters.yml#/log_type
15+
- $ref: parameters.yml#/time_wait
16+
17+
responses:
18+
"200":
19+
$ref: responses/list_logs.yml
20+
21+
"401":
22+
$ref: ../../shared/responses/unauthorized.yml
23+
24+
'404':
25+
$ref: '../../shared/responses/not_found.yml'
26+
27+
"429":
28+
$ref: "../../shared/responses/too_many_requests.yml"
29+
30+
"500":
31+
$ref: ../../shared/responses/server_error.yml
32+
33+
default:
34+
$ref: ../../shared/responses/unexpected_error.yml
35+
36+
x-codeSamples:
37+
- $ref: 'examples/curl/apps_get_event_logs.yml'
38+
- $ref: 'examples/python/apps_get_event_logs.yml'
39+
40+
security:
41+
- bearer_auth:
42+
- 'app:read'
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
operationId: apps_list_events
2+
3+
summary: List App Events
4+
5+
description: List all events for an app, including deployments and autoscaling events.
6+
7+
tags:
8+
- Apps
9+
10+
parameters:
11+
- $ref: parameters.yml#/app_id
12+
- $ref: ../../shared/parameters.yml#/page
13+
- $ref: ../../shared/parameters.yml#/per_page
14+
- description: Filter events by event type.
15+
in: query
16+
name: event_types
17+
required: false
18+
schema:
19+
type: array
20+
items:
21+
type: string
22+
enum:
23+
- UNKNOWN
24+
- DEPLOYMENT
25+
- AUTOSCALING
26+
example: [DEPLOYMENT]
27+
28+
responses:
29+
"200":
30+
$ref: responses/list_events.yml
31+
32+
"401":
33+
$ref: ../../shared/responses/unauthorized.yml
34+
35+
'404':
36+
$ref: '../../shared/responses/not_found.yml'
37+
38+
"429":
39+
$ref: "../../shared/responses/too_many_requests.yml"
40+
41+
"500":
42+
$ref: ../../shared/responses/server_error.yml
43+
44+
default:
45+
$ref: ../../shared/responses/unexpected_error.yml
46+
47+
x-codeSamples:
48+
- $ref: 'examples/curl/apps_list_events.yml'
49+
- $ref: 'examples/python/apps_list_events.yml'
50+
51+
security:
52+
- bearer_auth:
53+
- 'app:read'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X POST \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}/cancel"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}/logs?type=AUTOSCALE_EVENT"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/apps/{app_id}/events"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
lang: Python
2+
source: |-
3+
import os
4+
from pydo import Client
5+
6+
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
7+
8+
get_resp = client.apps.cancel_event(app_id="4f6c71e2", event_id="3aa4d20e")

0 commit comments

Comments
 (0)