Skip to content

Implement file 'ls' API on Agent #382

@spikecurtis

Description

@spikecurtis

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy