You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi all,
I have a django application which has the function of pulling files from s3 bucket using boto3 and pushing it to bitbucket. I understand that theres a post api which allows me to send files into bitbucket. this is an example of the post api
$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \ -F /repo/path/to/word.txt=@word.txt
for the part after the @, what do i include after it since the file retrieved from s3 is in a json format
Hi @cnshum_2019 and welcome to the community.
In the -F argument, the part after @ should be the path to the file and the name of the file on your machine (the one where you have downloaded this file and where you are executing the curl command).
If the file on your machine is named myFile.json and it exists in the current working directory (where the curl command is running), you can simply put myFile.json
The part /repo/path/to/word.txt is the path of the directory in the repo where you want to upload the file, and also the name you want this file to have once uploaded to the repo.
If you want to commit the file to the root of the repo, and you want to name it myFile3.json, then you simply put myFile3.json instead of /repo/path/to/word.txt. You could also keep the same name as locally.
The following call will commit your local file named myFile.json in the repo, and the file will have the name myFile3.json once uploaded to the repo.
curl https://api.bitbucket.org/2.0/repositories/username/slug/src -F myFile3.json=@myFile.json
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.