Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable s3api #38

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Enable s3api #38

merged 1 commit into from
Dec 12, 2023

Conversation

csc-felipe
Copy link
Contributor

@csc-felipe csc-felipe commented Dec 11, 2023

Enable s3 api compatibility layer.

Test with s3cmd:

  1. create credentials
$ docker exec -it <image-id> bash
$ openstack ec2 credentials create
+------------+---------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                           |
+------------+---------------------------------------------------------------------------------------------------------------------------------+
| access     | 0a09f306baa04358aa88e50c4853329f                                                                                                |
| links      | {'self': 'http://localhost:5000/v3/users/2855fdd6794e4d38b4e14b036094524f/credentials/OS-EC2/0a09f306baa04358aa88e50c4853329f'} |
| project_id | 3ec1214fab494db0b8e2fb4e8f16b42a                                                                                                |
| secret     | b15fdf7a8ed947f7afe6fa3b01a376cc                                                                                                |
| trust_id   | None                                                                                                                            |
| user_id    | 2855fdd6794e4d38b4e14b036094524f                                                                                                |
+------------+---------------------------------------------------------------------------------------------------------------------------------+
  1. create s3 config file
cat > s3.cfg << EOF
[default]
access_key = 0a09f306baa04358aa88e50c4853329f
secret_key = b15fdf7a8ed947f7afe6fa3b01a376cc
host_base = 127.0.0.1:8080
host_bucket = 127.0.0.1:8080
use_https = false

EOF
  1. use s3cmd
# create a bucket
$ s3cmd -c s3.cfg mb s3://config
Bucket 's3://config/' created

# upload the config file
$ s3cmd -c s3.cfg put s3.cfg s3://config/s3.cfg 
upload: 's3.cfg' -> 's3://config/s3.cfg'  [1 of 1]
 176 of 176   100% in    0s     3.33 KB/s  done

# list all objects
$ s3cmd -c s3.cfg la
2023-12-11 18:23          176  s3://config/s3.cfg

@csc-felipe csc-felipe requested a review from blankdots December 11, 2023 18:25
@csc-felipe csc-felipe self-assigned this Dec 11, 2023
@blankdots
Copy link
Contributor

can we include the test instructions into the main readme as well ?

@csc-felipe
Copy link
Contributor Author

can we include the test instructions into the main readme as well ?

Good idea, added them and documentation for the API endpoints as well.

@csc-felipe csc-felipe merged commit 3251b19 into main Dec 12, 2023
2 checks passed
@csc-felipe csc-felipe deleted the feature/s3api branch December 12, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants