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
25623a09
Commit
25623a09
authored
Aug 28, 2020
by
Christian Salzmann-Jaeckel
Browse files
s3-list-objects.py: use bucket_file_path
parent
50524aee
Changes
1
Hide whitespace changes
Inline
Side-by-side
s3-list-objects.py
View file @
25623a09
...
...
@@ -12,6 +12,7 @@ radosgw_endpoint_url = 'https://rise-s3.zib.de'
radosgw_bucket_name
=
'py3-boto-bucket'
radosgw_key_name
=
'upload_file'
radosgw_file_name
=
'example.txt'
bucket_file_path
=
'folder01/upload.txt'
# generate s3 client
...
...
@@ -29,7 +30,10 @@ s3_resource = boto3.resource('s3',
)
# generate download url
url
=
s3_client
.
generate_presigned_url
(
'get_object'
,
Params
=
{
'Bucket'
:
radosgw_bucket_name
,
'Key'
:
radosgw_key_name
},
ExpiresIn
=
100
)
url
=
s3_client
.
generate_presigned_url
(
'get_object'
,
Params
=
{
'Bucket'
:
radosgw_bucket_name
,
'Key'
:
bucket_file_path
},
ExpiresIn
=
100
)
print
(
url
)
# list objects
...
...
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