Files
calypso/VTL-ENDPOINTS-VERIFICATION.md
Warp Agent 3aa0169af0 Complete VTL implementation with SCST and mhVTL integration
- Installed and configured SCST with 7 handlers
- Installed and configured mhVTL with 2 Quantum libraries and 8 LTO-8 drives
- Implemented all VTL API endpoints (8/9 working)
- Fixed NULL device_path handling in drives endpoint
- Added comprehensive error handling and validation
- Implemented async tape load/unload operations
- Created SCST installation guide for Ubuntu 24.04
- Created mhVTL installation and configuration guide
- Added VTL testing guide and automated test scripts
- All core API tests passing (89% success rate)

Infrastructure status:
- PostgreSQL: Configured with proper permissions
- SCST: Active with kernel module loaded
- mhVTL: 2 libraries (Quantum Scalar i500, Scalar i40)
- mhVTL: 8 drives (all Quantum ULTRIUM-HH8 LTO-8)
- Calypso API: 8/9 VTL endpoints functional

Documentation added:
- src/srs-technical-spec-documents/scst-installation.md
- src/srs-technical-spec-documents/mhvtl-installation.md
- VTL-TESTING-GUIDE.md
- scripts/test-vtl.sh

Co-Authored-By: Warp <agent@warp.dev>
2025-12-24 19:01:29 +00:00

3.6 KiB

VTL Endpoints Verification

Implementation Status

The VTL endpoints ARE implemented in the codebase. The routes are registered in the router.

🔍 Verification Steps

1. Check if Server Needs Restart

The server must be restarted after code changes. Check if you're running the latest build:

# Rebuild the server
cd backend
go build -o bin/calypso-api ./cmd/calypso-api

# Restart the server (stop old process, start new one)
# If using systemd:
sudo systemctl restart calypso-api

# Or if running manually:
pkill calypso-api
./bin/calypso-api -config config.yaml.example

2. Verify Routes are Registered

The routes are defined in backend/internal/common/router/router.go lines 106-120:

// Virtual Tape Libraries
vtlHandler := tape_vtl.NewHandler(db, log)
vtlGroup := protected.Group("/tape/vtl")
vtlGroup.Use(requirePermission("tape", "read"))
{
    vtlGroup.GET("/libraries", vtlHandler.ListLibraries)
    vtlGroup.POST("/libraries", vtlHandler.CreateLibrary)
    vtlGroup.GET("/libraries/:id", vtlHandler.GetLibrary)
    vtlGroup.DELETE("/libraries/:id", vtlHandler.DeleteLibrary)
    vtlGroup.GET("/libraries/:id/drives", vtlHandler.GetLibraryDrives)
    vtlGroup.GET("/libraries/:id/tapes", vtlHandler.GetLibraryTapes)
    vtlGroup.POST("/libraries/:id/tapes", vtlHandler.CreateTape)
    vtlGroup.POST("/libraries/:id/load", vtlHandler.LoadTape)
    vtlGroup.POST("/libraries/:id/unload", vtlHandler.UnloadTape)
}

3. Test Endpoint Registration

After restarting, test if routes are accessible:

# This should return 401 (unauthorized) not 404 (not found)
curl http://localhost:8080/api/v1/tape/vtl/libraries

# With auth, should return 200 with empty array
curl http://localhost:8080/api/v1/tape/vtl/libraries \
  -H "Authorization: Bearer $TOKEN"

If you get 404:

  • Server is running old code → Restart required
  • Routes not compiled → Rebuild required

If you get 401:

  • Routes are working! → Just need authentication

If you get 403:

  • Routes are working! → Permission issue (check user has tape:read)

4. Check Handler Implementation

Verify handlers exist:

  • backend/internal/tape_vtl/handler.go - All handlers implemented
  • backend/internal/tape_vtl/service.go - All services implemented

🚀 Quick Fix

If endpoints return 404:

  1. Stop the current server
  2. Rebuild:
    cd backend
    go build -o bin/calypso-api ./cmd/calypso-api
    
  3. Restart:
    ./bin/calypso-api -config config.yaml.example
    

📋 Expected Endpoints

All these endpoints should be available after restart:

Method Endpoint Handler
GET /api/v1/tape/vtl/libraries ListLibraries
POST /api/v1/tape/vtl/libraries CreateLibrary
GET /api/v1/tape/vtl/libraries/:id GetLibrary
DELETE /api/v1/tape/vtl/libraries/:id DeleteLibrary
GET /api/v1/tape/vtl/libraries/:id/drives GetLibraryDrives
GET /api/v1/tape/vtl/libraries/:id/tapes GetLibraryTapes
POST /api/v1/tape/vtl/libraries/:id/tapes CreateTape
POST /api/v1/tape/vtl/libraries/:id/load LoadTape
POST /api/v1/tape/vtl/libraries/:id/unload UnloadTape

🔧 Debugging

If still getting 404 after restart:

  1. Check server logs for route registration
  2. Verify compilation succeeded (no errors)
  3. Check router.go is being used (not cached)
  4. Test with curl to see exact error:
    curl -v http://localhost:8080/api/v1/tape/vtl/libraries \
      -H "Authorization: Bearer $TOKEN"
    

The -v flag will show the full HTTP response including headers.