Wiki (Help)

Maap S3 script

Use Maap S3 script in che Theai

Maap S3 script is the script used to interact with the bucket S3 to share data with others maap users or to save data when workspace is full.

**Prerequisites:**

To use the s3 script from a che workspace, you must do these steps

  1. pip install requests

**API Documentation**

The script provide following features:

To see all options run maap-s3.py help

  • login login using the email and the password
    • param 1: email
      • ex: /projects/test/toto.txt
    • param 2: password
      • ex: maap-scientific-data/shared/tkossoko/obs.jar
    • exemple: maap-s3.py login "test@test.com" "Kojhyduiji"
  • upload used to push the data to S3
    • param 1: sourceFile
      • ex: /projects/test/toto.txt
    • param 2: s3 destination path
      • ex: maap-scientific-data/shared/tkossoko/obs.jar
    • exemple: maap-s3.py upload /projects/test/maap.tiff maap-scientific-data/shared/tkossoko/maap.tiff
  • resume use to continue a failed multipart previous upload. When your file is more than 5Giga, the python script use multipart upload. During the process, if the upload fails, please run resume without parameter to continue the upload.
  • download to download a data from S3
    • param 1: s3 path
      • ex: bmap-catalogue-data/bmaap_test/demo/maap.tiff
    • param 2: Workspace destination path
      • ex: /projects/test/maap.tiff
    • exemple: maap-s3.py download maap-scientific-data/shared/tkossoko/maap.tiff /projects/test/maap.tiff
  • list to list a folder from S3
    • param 1: s3 bucket folder
      • ex: maap-scientific-data/shared/demo
    • exemple: maap-s3.py list maap-scientific-data/shared/demo
  • delete to delete a file from S3
    • param 1: s3 file path
      • ex: maap-scientific-data/shared/demo/maap.tiff
    • exemple: s3 delete maap-scientific-data/shared/demo/hello-bjorn.txt
  • refresh to reset credentials and passwords when init fails because you type wrong password or email.
    • exemple: maap-s3.py refresh
  • token to get a bearer token. Needed for wps call for example.
    • exemple: maap-s3.py token "email" "password"

**1- How to use the script ? **

To call the script, just type maap-s3.py in the console.

Typing maap-s3.py help will show all options available and parameters:

0 Comments