Query file list¶
Lists files accessible to a connector. First get the file uri from the response and then preview the file.
GET $CLOUDSIGMA_API_BASE/connectors/files/list
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare personal access token, target workspace ID and connector ID that can access the target workspace. Only connectors that support file enumeration can call this interface.
Request parameters¶
Replace $CONNECTOR_ID, $CLOUDSIGMA_API_KEY, $WORKSPACE_ID in the example with actual values.
curl "$CLOUDSIGMA_API_BASE/connectors/files/list?connector_id=$CONNECTOR_ID&limit=20" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The connector ID to read the file from. |
|
string |
No |
Only fill in when |
|
integer |
No |
This page returns the quantity. |
|
string |
No |
A directory relative to the connector configuration root. Fill in the relative path, do not start with |
|
integer (integer array) |
No |
Common file type code to filter on. |
S3 and OSS use cursor paging. HDFS ignores limit, cursor and returns the full directory. Browsing Local connections is not currently supported.
Ordinary files are filtered by conditions after paging, and directories are always retained and ranked after ordinary files. Therefore, when there is no file on the current page, there may be a next page.
file type code
Basics and Documentation
0- Unrecognized
1- TXT
24- PPT
5- Word
6- Markdown
9- SQL
10- Directory
11- DOCX
12- PPTX
35- DOC
Structured data
7- CSV
8- Parquet
24- XLS
25- XLSX
Images
3- Generic image
20- PNG
21- JPG
22- JPEG
23- BMP
Audio and video
13- WAV
14- MP3
15- AAC
16- FLAC
17- MP4
18- MOV
19- MKV
Web pages and email
27- HTM
28- HTML
29- EML
30- MSG
31- P7S
CAD and compressed package
32- DWG
33- DXF
34- FAS
101- ZIP
102- RAR
103- 7Z
104- TAR
105- TAR.GZ
106- TAR.BZ2
107- GZ
108- BZ2
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"files": [
{
"uri": "/orders.csv",
"filename": "orders.csv",
"size": 1024,
"type": 1,
"path": "/",
"create_time": 0,
"update_time": 0
}
],
"cursor": "next_cursor",
"has_more": true
}
}
Field |
Type |
Description |
|---|---|---|
|
array of object |
Current page file. |
|
string |
File URI. |
|
string |
File name. |
|
integer |
size in bytes. |
|
integer |
type. |
|
string |
path. |
|
integer |
Creation time. |
|
integer |
Update time. |
|
string |
Next page cursor. |
|
boolean |
Whether another page exists. |
Error response¶
{
"code": "ErrServer",
"msg": "server error"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |