/files/{user}/size
0.2.18Unchanged since publicationMeasure disk usage for a directory or its immediate subdirectories
filesreadallUrbeStack runs du with the customer's permissions on each request and discards the measurements after responding. It measures allocated disk blocks that count toward the account's disk usage, counts each hard-linked file once, stays on the same filesystem, and skips symbolic link targets. If path names a symbolic link, specify the target directory directly.
With inside set to true, the operation measures each immediate subdirectory of path, up to 5000. The du command has 20 seconds to measure disk usage. If time runs out, timed_out is true, folders contains the completed measurements, and unmeasured lists the remaining directories. A directory is marked partial if it contains entries the customer cannot read. Its reported size includes only the blocks that could be counted.
As a command
Run as root on the serverParameters
userpath ·UsernameRequiredpathquery ·HomePathinsidequery ·booleanExample
See the API overview for how to set $API and $TOKEN.curl -sS -X GET "$API/files/alice/size?path=public_html/index.php&inside=1" \ -H "Authorization: Bearer $TOKEN"
200 OK{
"folders": [
{
"bytes": 1,
"name": "alice",
"partial": true,
"path": "public_html/index.php"
}
],
"inside": true,
"path": "public_html/index.php",
"seconds": 1,
"timed_out": true,
"unmeasured": [
{
"name": "alice",
"path": "public_html/index.php"
}
],
"user": "alice"
}Errors
12 errors, each a status and a sentence400--user is required400<name> is an administrator: administrators have no home400<what> climbs out of the home with ..400<what> has a name over 255 characters400<what> holds a control character400<what> is required400<what> is too long400<what> must start with /, which is the home400Invalid boolean400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Username '<value>' is reserved401Authentication requiredurbestack.com/docs/api/get-files-user-size/