DataFed icon indicating copy to clipboard operation
DataFed copied to clipboard

[Foxx] Foxx API Updates: Update Repository and Allocation Endpoints for Type Support

Open AronPerez opened this issue 6 months ago • 0 comments

Description

As a backend developer, I want to update the Foxx API endpoints to support repository types and the new allocation response format so that metadata-only repositories can execute allocations synchronously without creating tasks.

Response Format Changes

New Allocation Response Format:

// For metadata-only repositories (direct execution)
{
  "execution_method": "direct",
  "result": {
    "allocation": { /* allocation data */ }
  }
}

// For Globus repositories (task execution)
{
  "execution_method": "task",
  "task": { /* task data */ }
}

Data Transfer Error for Metadata-Only:

{
  "error": "ERR_INVALID_OPERATION",
  "message": "Data transfers not supported for metadata-only repository",
  "repo_type": "metadata_only",
  "repo_id": "repo/repo_dev_01"
}

Acceptance Criteria

  • [ ] Update POST /api/repo/create to require and validate the 'type' field
  • [ ] Modify repository creation logic to store type in database
  • [ ] Update GET /api/repo/alloc/create to return new response format
  • [ ] Update GET /api/repo/alloc/delete to return new response format
  • [ ] Implement direct (synchronous) allocation for metadata-only repositories
  • [ ] Maintain task-based allocation for Globus repositories
  • [ ] Add repository type checking to data transfer endpoints (PUT/GET)
  • [ ] Return appropriate errors for unsupported operations on metadata-only repos

Resources

  • Engineering Design Document: spec.md - API Changes section
  • Current endpoints:
    • Repository creation: core/database/foxx/api/repo_router.js:100
    • Allocation create: core/database/foxx/api/repo_router.js:659
    • Allocation delete: core/database/foxx/api/repo_router.js:709
  • Data router: core/database/foxx/api/data_router.js

Dependencies

  • Depends on: Repository Type System (#1514)
  • Blocks: Database Migration, C++ Response Handling

AronPerez avatar Jul 08 '25 16:07 AronPerez