Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Last active March 25, 2024 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuvalif/9e4922fe9bb9767426a96739ad9b14bf to your computer and use it in GitHub Desktop.
Save yuvalif/9e4922fe9bb9767426a96739ad9b14bf to your computer and use it in GitHub Desktop.
  • run vstart cluster
  • create the parts:
$ head -c 12M </dev/urandom > myfile1
$ head -c 12M </dev/urandom > myfile2
  • create the bucket:
$ aws s3api create-bucket --bucket aws-bkt5 --endpoint-url http://localhost:8000
  • start the upload
$ aws s3api create-multipart-upload --bucket aws-bkt5 --key 'aws-ob' --endpoint-url http://localhost:8000
  • take the upload-id from the reply, and use in:
$ aws s3api upload-part --bucket aws-bkt5 --key 'aws-ob' --part-number 1 --upload-id <upload id> --body myfile1 --endpoint-url http://localhost:8000
$ aws s3api upload-part --bucket aws-bkt5 --key 'aws-ob' --part-number 2 --upload-id <upload id> --body myfile2 --endpoint-url http://localhost:8000
  • create the multipart verification file based on the etags fro mthe above replies:
$ cat test
{
  "Parts": [
    {
      "ETag": "<etag of myfile1>",
      "PartNumber": 1
    },
    {
      "ETag": "<etag of myfile2>",
      "PartNumber": 2
    }
  ]
}
  • complete the upload:
$ aws s3api complete-multipart-upload --multipart-upload file://test --bucket aws-bkt5 --key 'aws-ob' --upload-id <upload id> --endpoint-url http://localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment