Skip to content
Snippets Groups Projects
Commit d6953c0c authored by kosted's avatar kosted
Browse files

add refresh and update doc

parent b3de79d2
No related branches found
No related tags found
Loading
......@@ -13,17 +13,17 @@ import getopt
MAAP_ENV_TYPE = os.getenv("MAAP_ENV_TYPE")
CLIENT_ID = os.getenv("CLIENT_ID")
BEARER=""
USER_INFO_FILE_PATH="maap-s3-userinfo.json"
USER_INFO_FILE_PATH="/usr/bmap/maap-s3-userinfo.json"
userinfo = {}
def display_help():
print('Usage: [option...] {init|refresh|upload|download|ls|delete}')
print('init Get a fresh token before any request. It ask for email and password')
print('upload myFile.tiff locally path/myFile.tiff in the S3 Upload data in the S3')
print('download path/in/S3/file.tiff myFileName.tiff Download a data from the S3')
print('ls folder/path List data in a subfolder')
print('delete path/in/S3/file.tiff Delete an existing data on S3')
print('refresh refresh credentials and password')
print('Usage: [option...] {-f|-u|-d|-l|-r}')
#print('-i Get a fresh token before any request. It ask for email and password')
print('-u myFile.tiff locally path/myFile.tiff in the S3 Upload data in the S3')
print('-d path/in/S3/file.tiff myFileName.tiff Download a data from the S3')
print('-l folder/path List data in a subfolder')
print('-r path/in/S3/file.tiff Delete an existing data on S3')
print('-f refresh credentials and password')
sys.exit(2)
......@@ -341,7 +341,7 @@ result=0
try:
# Define getopt short and long options
options, args = getopt.getopt(sys.argv[1:], 'u:r:l:d:h', ['upload=', 'remove=','list=','download='])
options, args = getopt.getopt(sys.argv[1:], 'u:r:l:d:i:f', ['upload=', 'remove=','list=','download=','init=','refresh='])
# Read each option using for loop
for opt, arg in options:
......@@ -371,7 +371,12 @@ try:
display_help()
else:
download(argv[1], argv[2])
elif opt in ('-i', '--init'):
# Download a data
init()
elif opt in ('-f', '--refresh'):
# Download a data
refresh()
elif opt in ('-h', '--help'):
# Print the option
display_help()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment