Skip to content

feat(api): add /dap/status and /dap/logs API endpoints#280

Merged
mehalter merged 3 commits into
mainfrom
dap_job_api_endpoints
Aug 22, 2025
Merged

feat(api): add /dap/status and /dap/logs API endpoints#280
mehalter merged 3 commits into
mainfrom
dap_job_api_endpoints

Conversation

@mehalter
Copy link
Copy Markdown
Member

@mehalter mehalter commented Aug 21, 2025

This adds 2 API endpoints:

  • /dap/status which takes an AWS Batch jobId and returns the current job information
  • /dap/logs which takes an AWS Cloudwatch log stream name and optionally a next pagination token and a limit and returns all of the log messages along with next/previous pagination tokens if they exist

To Test

  • Call /dap/status on a job or multiple jobs from AWS Batch in the workflow queue. For example:

    curl -k "https://api.cape-dev.org/capi-dev/dap/status?jobIds=4a8215c0-4124-4369-87a7-c2449479b126,79bd3c88-98ff-4ed4-95d4-019b3e69ca67" | jq
  • Call /dap/logs on a logStreamName returned from the previous call. For example:

    curl -k "https://api.cape-dev.org/capi-dev/dap/logs?logStreamName=ccd-pvsl-nextflow-jobdef%2Fdefault%2F47e2026f2734463eab9fc46f2d314e6a" | jq

    You can also pass in limit to limit the number of messages:

    curl -k "https://api.cape-dev.org/capi-dev/dap/logs?limit=10&logStreamName=ccd-pvsl-nextflow-jobdef%2Fdefault%2F47e2026f2734463eab9fc46f2d314e6a" | jq

    And use the nextForwardToken or nextBackwardToken in the response to continue paginating with `nextToken:

    curl -k "https://api.cape-dev.org/capi-dev/dap/logs?limit=10&logStreamName=ccd-pvsl-nextflow-jobdef%2Fdefault%2F47e2026f2734463eab9fc46f2d314e6a&nextToken=b%2F39143968782837487445217361439066721231998068627987300617%2Fs" | jq

@mehalter mehalter force-pushed the dap_job_api_endpoints branch 2 times, most recently from 03f79a4 to de7621c Compare August 22, 2025 15:50
@mehalter mehalter requested a review from thecaffiend August 22, 2025 16:03
Comment thread assets/api/capi/handlers/get_dap_status.py Outdated
Comment thread assets/api/capi/handlers/get_dap_status.py
@mehalter mehalter force-pushed the dap_job_api_endpoints branch from fe47961 to 5a401ee Compare August 22, 2025 20:33
@mehalter mehalter requested a review from thecaffiend August 22, 2025 20:34
@mehalter mehalter merged commit 116c79f into main Aug 22, 2025
6 checks passed
@mehalter mehalter deleted the dap_job_api_endpoints branch August 22, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants