Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maap-s3-laptop
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esa-common
maap-s3-laptop
Commits
d6953c0c
Commit
d6953c0c
authored
4 years ago
by
kosted
Browse files
Options
Downloads
Patches
Plain Diff
add refresh and update doc
parent
b3de79d2
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
maap-s3.py
+15
-10
15 additions, 10 deletions
maap-s3.py
with
15 additions
and
10 deletions
maap-s3.py
+
15
−
10
View file @
d6953c0c
...
...
@@ -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
(
'
u
pload
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
(
'
l
s
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment