Configuring Tigris via the API

I am attempting to setup and configure a bucket in Tigris using the API. I have a bucket created and am trying to curl it with this

❯ curl -f https://fly.storage.tigris.dev/mybucket.example.com --aws-sigv4 --user $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY -X PATCH -H "Content-Type: application/json" -H "Accept: application/json" -H "x-amz-acl: public-read" --data-raw '{"cache_control":"", "website":{"domain_name": "mybucket.example.com"}, "object_regions": "","additional_http_headers":""}' -i

However I get the following error from curl

curl: (22) The requested URL returned error: 403
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

I’ve replaced the creds a few times to make sure they are right and they definitely have Admin access to my buckets.

I’m also wondering if I can configure the shadow bucket options via the API, if so, how?

Hi @cullen - Can you try following ?

--user "tid_<>:_tsec<>"

Note: double quotes around user creds.

also

--aws-sigv4 "aws:amz:auto:s3"

The full cURL should look like this

curl 'https://fly.storage.tigris.dev/mybucket.example.com' \
  --aws-sigv4 "aws:amz:auto:s3" \
  --user "<tid_>:<tsec_>" \
  -X 'PATCH' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-amz-acl: public-read' \
  --data-raw '{"cache_control":"","website":{"domain_name":"mybucket.example.com"},"object_regions":"","additional_http_headers":null}'

Thank you! Adding those fixed the error. Do you know if/how I could configure the shadow bucket options via the API?

Hi @cullen

You can use this data payload in the same API to configure shadow-bucket

--data-raw '{"shadow_bucket":{"access_key":"<access_key">,"secret_key":"<access_secret>","region":"<some-region>","name":"<remote-bucket-name>","endpoint":"<https://remote-bucket.url>","write_through":<false>},"cache_control":"","website":{"domain_name":"<your_domain_name>"},"object_regions":"","additional_http_headers":null}'
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.