k8s_client.views.users.files¶
Module Contents¶
Functions¶
|
Get user files list |
|
Get user file content |
|
Get user folder content |
|
Upload a file for a user |
|
Upload a part of a file for a user |
|
Delete a file for an user |
|
Delete a folder for an user |
- k8s_client.views.users.files.get_user_files(username=None, filename=None)¶
Get user files list
Parameters¶
"username": stringName of the owner user for which to get the files list
Query line parameters¶
"cluster_uri"stringName of the cluster where to look for the files. It corresponds to a folder on the main machine where file are synchronized
"relative_path"string, optionalThe relative path from the root folder of the cluster to be used
"filename"stringThe name of the file to view the details
"foldername"stringThe name of the folder to list the details
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:cluster_uriis NOT provided
[code: 200]list [dict], otherwiseEach dict items contains: -
"name": stringName of the item of the dir list
"is_dir"booleanIndicates if the path refers to a file or to a folder
"size"intIndicates the size if the item is a file. If the item is a folder it is always 0.
"content"intAlways 0.
"creation_time"datetimeDatetime of file/folder creation
"modified_time"datetimeDatetime of file/folder update
- k8s_client.views.users.files.get_user_file_content(username=None, filename=None)¶
Get user file content
Parameters¶
"username": stringName of the owner user for which to get the file content
Query line parameters¶
"cluster_uri"stringName of the cluster from where download the files content It corresponds to a folder on the main machine where file are synchronized
"relative_path"string, optionalThe relative path from the root folder of the cluster to be used
"filename"stringThe name of the file to download
Returns¶
[code: 404]Error message if:usernameis NOT inside the DBThe file has not been found
[code: 406]Error message if:cluster_uriis NOT providedrelative_pathis NOT providedfilenameis NOT provided or contains not allowed chars
[code: 200]bytes otherwisethe content of the file
- k8s_client.views.users.files.get_user_folder_content(username=None, foldername=None)¶
Get user folder content
Parameters¶
"username": stringName of the owner user
Query line parameters¶
"cluster_uri"stringName of the cluster from where download the folder. It corresponds to a folder on the main machine where file are synchronized
"relative_path"string, optionalThe relative path from the root folder of the cluster to be used
"foldername"stringThe name of the folder to download
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:cluster_uriis NOT providedrelative_pathis NOT providedfoldernameis NOT provided or contains not allowed chars
[code: 200]bytes otherwisethe zipped content of the folder
- k8s_client.views.users.files.upload_file_for_user_full(username=None)¶
Upload a file for a user
NOT USED
- k8s_client.views.users.files.upload_file_part_for_user(username=None)¶
Upload a part of a file for a user
Parameters¶
"username": stringName of the owner user
Body payload parameters¶
The endpoint is used for 3 cases:
1) speed-test
"command": speed-test"data": blobData to be sent
"cluster-uri"stringName of the cluster on which upload the data
2) Upload part
"command": upload-part"relative-path": stringThe path where to upload the file
"file-name"stringName of the uploading file
"chunk-number": intCounter of the chunk to be uploaded
"chunk-size"intSize of the chunk
"chunk-data"blobData to be sent
"cluster-uri"stringName of the cluster on which upload the data
3) Join parts
"command": join-parts"relative-path": stringThe path where to upload the file
"file-name"stringName of the uploading file
"chunks-count": intTotal number the uploaded chunks
"cluster-uri"stringName of the cluster on which upload the data
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:cluster_uriis NOT providedrelative_pathis NOT provided
[code: 200]list otherwiseThe result of the command
- k8s_client.views.users.files.delete_file_for_user(username=None, file_full_path=None)¶
Delete a file for an user
Parameters¶
"username": stringName of the owner user
Query line parameters¶
"cluster_uri"stringName of the cluster from where delete the file. It corresponds to a folder on the main machine where file are synchronized
"file_full_path"stringThe full relative path of the file to delete
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:cluster_uriis NOT providedfile_full_pathis NOT provided
[code: 200]list otherwiseDeleted file
- k8s_client.views.users.files.delete_folder_for_user(username=None, file_full_path=None)¶
Delete a folder for an user
Parameters¶
"username": stringName of the owner user
Query line parameters¶
"cluster_uri"stringName of the cluster from where delete. It corresponds to a folder on the main machine where file are synchronized
"file_full_path"stringThe full relative path of the folder to delete
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:cluster_uriis NOT providedfile_full_pathis NOT provided
[code: 200]list otherwiseDeleted folder