Skip to content

Implement file 'ls' API on Agent #382

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

Closed
spikecurtis opened this issue Feb 18, 2025 · 0 comments · Fixed by coder/coder#16736
Closed

Implement file 'ls' API on Agent #382

spikecurtis opened this issue Feb 18, 2025 · 0 comments · Fixed by coder/coder#16736
Assignees

Comments

@spikecurtis
Copy link

Add a new HTTP endpoint to the Agent HTTP API. This API will be in support of Coder Desktop File Sync, so that our GUI can list directories in the workspace when setting up a file sync.

  • API endpoint: api/v0/ls
  • Request format: (example is for /home/coder on a Unix system)
{
  // path components as an ordered list
  "path": ["home", "coder"], 
  // also accepts "home", in which case path is interpreted relative to the home dir
  "relativity": "root" 
}
  • Response format:
{
  // the absolute path we are returning
  "absolute_path": ["home", "coder"],
  "contents": [
    {
      "name": "repos",
      "dir": true,
    },
    {
      "name": "Downloads",
      "dir": true,
    }
  ]
}
  • Errors
    • 403 Forbidden - if the agent doesn’t have permission to list the directory
    • 404 File Not Found - if the directory doesn’t exist
    • We also write a standard codersdk.Response message for any unsuccessful requests.
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 a pull request may close this issue.

2 participants