Client API: Deployment servers: Files
The 15 Client API operations for files.
Part of Deployment servers.
Operations
Section titled OperationsSet the mode of files under root: [{"file": name, "mode": "0644"}]
Section titled Set the mode of files under root: [{"file": name, "mode": "0644"}]POST /api/v1/client/servers/{uuid}/files/chmod
Set the mode of files under root: [{"file": name, "mode": "0644"}].
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
root |
string | no |
files |
array of object | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Create a compressed archive of files
Section titled Create a compressed archive of filesPOST /api/v1/client/servers/{uuid}/files/compress
Create a compressed archive of files.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
paths |
array of string | yes |
archive_name |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get contents of a file
Section titled Get contents of a fileGET /api/v1/client/servers/{uuid}/files/contents
Get contents of a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
path |
query | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Duplicate a file next to itself; Wings picks the name copy suffix
Section titled Duplicate a file next to itself; Wings picks the name copy suffixPOST /api/v1/client/servers/{uuid}/files/copy
Duplicate a file next to itself; Wings picks the name copy suffix.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
location |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Extract an archive on the server
Section titled Extract an archive on the serverPOST /api/v1/client/servers/{uuid}/files/decompress
Extract an archive on the server.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
archive_path |
string | yes |
destination |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Delete a file
Section titled Delete a filePOST /api/v1/client/servers/{uuid}/files/delete
Delete a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
path |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Stream one file from Wings through the platform, as an attachment
Section titled Stream one file from Wings through the platform, as an attachmentGET /api/v1/client/servers/{uuid}/files/download
Stream one file from Wings through the platform, as an attachment.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
path |
query | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
List files in a server directory
Section titled List files in a server directoryGET /api/v1/client/servers/{uuid}/files/list
List files in a server directory.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
uuid |
path | string | yes | |
directory |
query | string | no | Default: /. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Create a folder name under root
Section titled Create a folder name under rootPOST /api/v1/client/servers/{uuid}/files/mkdir
Create a folder name under root.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
root |
string | no |
name |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Download and save a file from a URL
Section titled Download and save a file from a URLPOST /api/v1/client/servers/{uuid}/files/pull
Download and save a file from a URL.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
url |
string | yes |
destination_path |
string | yes |
filename |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Stop a download from a URL; downloadid is its identifier
Section titled Stop a download from a URL; downloadid is its identifierPOST /api/v1/client/servers/{uuid}/files/pull/cancel
Stop a download from a URL; download_id is its identifier.
Needs file.create, the key that starts one.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
download_id |
query | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Pull status
Section titled Pull statusGET /api/v1/client/servers/{uuid}/files/pull/status
The downloads from a URL still running on the server, as the daemon
reports them: each with its identifier, the URL and its progress.
Needs file.read.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Rename a file
Section titled Rename a filePOST /api/v1/client/servers/{uuid}/files/rename
Rename a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
old_path |
string | yes |
new_path |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Upload files
Section titled Upload filesPOST /api/v1/client/servers/{uuid}/files/upload
Upload files into directory on the server, as a multipart form with
one or more files parts. The browser never talks to the node.
Each file can be up to 10 GB and streams onto the server as it is read. Needs file.create. A batch is written file by file; when a later file fails after earlier ones landed, the response names both lists rather than failing the whole request, so a retry does not have to guess what is already on disk. A file over the limit answers 413.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
uuid |
path | string | yes | |
directory |
query | string | no | Default: /. |
Request body
Section titled Request bodymultipart/form-data (required)
| Field | Type | Required |
|---|---|---|
files |
array of string (binary) | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Write content to a file
Section titled Write content to a filePOST /api/v1/client/servers/{uuid}/files/write
Write content to a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
path |
string | yes |
content |
string | no |
expected_hash |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |