通过 cURL 删除 bitbucket 存储库

Cur*_*ser 2 git curl bitbucket bitbucket-api

有人知道如何通过 cURL 从 bitbucket 中删除存储库吗?

目前我已经制作了脚本来通过 curl 在 bitbucket 上创建远程存储库

#!/bin/bash
while read line
do
curl --user user:password https://api.bitbucket.org/1.0/repositories/ --data name=$line --data is_private=true --data owner=OWNER
done<repo_list.txt
Run Code Online (Sandbox Code Playgroud)

但现在我无法通过 curl 从 bitbucket 中删除该存储库

我正在使用

curl -X DELETE --user user:password https://api.bitbucket.org/1.0/repositories/ --data name=$line --data is_private=true --data owner=OWNER
Run Code Online (Sandbox Code Playgroud)

并有错误 {"error": {"message": "'username'", "detail": " File \"/opt/python/domains/bitbucket.org/current/bitbucket/local/env/lib/python2. 7/site-packages/piston/resource.py\", line 208, in call\n}

https://bitbucket.org/zhemao/bitbucket-cli仅从用户帐户中删除存储库,但不能选择删除我所属的其他所有者拥有的存储库。

有任何想法吗 ?

Tac*_*tex 6

对于语法删除回购是从语法不同于创建一个回购协议。

创造:

POST https://bitbucket.org/api/1.0/repositories --data "name=mynewrepo"
Run Code Online (Sandbox Code Playgroud)

删除:

DELETE https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}
Run Code Online (Sandbox Code Playgroud)

此外,不推荐使用 API v1.0 方法,因此您应该使用v2.0 方法

创造:

POST https://api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}
Run Code Online (Sandbox Code Playgroud)

删除:

DELETE https://api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}
Run Code Online (Sandbox Code Playgroud)