Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Salzmann-Jaeckel
boto
Commits
da660c9d
Commit
da660c9d
authored
Aug 26, 2020
by
Christian Salzmann-Jaeckel
Browse files
add s3-boto.py
parent
a84ba914
Changes
1
Hide whitespace changes
Inline
Side-by-side
s3-boto.py
0 → 100755
View file @
da660c9d
#!/usr/bin/python3
import
os
import
boto
import
boto.s3.connection
s3_access_key
=
os
.
environ
[
'AWS_ACCESS_KEY_ID'
]
s3_secret_key
=
os
.
environ
[
'AWS_SECRET_ACCESS_KEY'
]
s3_bucket_name
=
'py3-boto-bucket'
s3_host
=
'rise-s3.zib.de'
# connect to s3 storage
conn
=
boto
.
connect_s3
(
aws_access_key_id
=
s3_access_key
,
aws_secret_access_key
=
s3_secret_key
,
host
=
s3_host
,
is_secure
=
True
,
calling_format
=
boto
.
s3
.
connection
.
OrdinaryCallingFormat
(),
)
# list all buckets
for
bucket
in
conn
.
get_all_buckets
():
print
(
"{name}
\t
{created}"
.
format
(
name
=
bucket
.
name
,
created
=
bucket
.
creation_date
)
)
# create bucket
# bucket = conn.create_bucket(s3_bucket_name)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment