Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an Endpoint to Update File Types #1548

Open
karatugo opened this issue Jan 24, 2025 · 0 comments
Open

Implement an Endpoint to Update File Types #1548

karatugo opened this issue Jan 24, 2025 · 0 comments
Assignees

Comments

@karatugo
Copy link
Member

Description:
There are scenarios where curators need to update the file type for all studies in a submission or for a specific GCST ID. This requires the creation of a new endpoint in the gwas-sumstats-service that allows curators to send a request via curl to update file types and regenerate the corresponding YAML metadata.

Acceptance Criteria:

  1. A new endpoint is implemented in the gwas-sumstats-service to handle file type updates.
  2. The endpoint accepts a request to update file types for:
    • All studies in a submission.
    • A specific study identified by its GCST ID.
  3. The endpoint regenerates the YAML metadata for the affected studies after updating the file types.
  4. The endpoint is accessible via curl and returns appropriate responses (e.g., success, failure, or validation errors).
  5. Proper error handling is implemented for invalid requests or missing data.
  6. Documentation is updated to include usage examples for the new endpoint.

Proposed Endpoint:

  • Method: POST
  • Path: /v1/update-file-type
  • Request Body:
    {
      "submission_id": "optional_submission_id",
      "gcst_id": "optional_gcst_id",
      "new_file_type": "new_file_type_value"
    }
  • Response:
    • Success: 200 OK with a message confirming the update and metadata regeneration.
    • Failure: 400 Bad Request or 404 Not Found with an error message.

Example Curl Request:

curl -X POST "gwas-ss-service:8000/v1/update-file-type" \
-H "Content-Type: application/json" \
-d '{
  "submission_id": "SUB12345",
  "new_file_type": "updated_file_type"
}'
@karatugo karatugo self-assigned this Jan 24, 2025
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

No branches or pull requests

1 participant