Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ paths:
get:
$ref: "resources/apps/apps_get_job_invocation.yml"

/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel:
post:
$ref: "resources/apps/apps_cancel_job_invocation.yml"

/v2/apps/{app_id}/jobs/{job_name}/invocations/{job_invocation_id}/logs:
get:
$ref: "resources/apps/apps_get_job_invocation_logs.yml"
Expand Down
41 changes: 41 additions & 0 deletions specification/resources/apps/apps_cancel_job_invocation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
operationId: apps_cancel_job_invocation

summary: Cancel Job Invocation

description: Cancel a specific job invocation for an app.

tags:
- Apps

parameters:
- $ref: parameters.yml#/app_id
- $ref: parameters.yml#/job_invocation_id
- $ref: parameters.yml#/job_name

responses:
"200":
$ref: responses/cancel_job_invocation.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_cancel_job_invocation.yml'
- $ref: 'examples/python/apps_cancel_job_invocation.yml'

security:
- bearer_auth:
- 'app:update'

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}/job-invocations/{job_invocation_id}/cancel"
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.cancel_job_invocation(app_id="4f6c71e2", job_invocation_id="3aa4d20e")
17 changes: 17 additions & 0 deletions specification/resources/apps/responses/cancel_job_invocation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: A JSON with key `job_invocation`

content:
application/json:
schema:
$ref: ../models/app_job_invocation.yml
examples:
job_invocation:
$ref: examples.yml#/job_invocation

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