Description
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