BitBucket 服务器 API 要求删除 and/or 重命名内容

BitBucket Server API Call For Deleting and/or Renaming Content

在此处寻找 API 端点以删除 and/or 重命名存储库中的一段内容。我没有看到任何相关的东西。如何做到这一点? https://developer.atlassian.com/bitbucket/api/2/reference/

不幸的是,2017 年 5 月,Atlassian 表示它是 not supported

看的时候Bitbucket REST API2018年6月的5.10.1版本,还是不支持

/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/files 有一个文件端点,但它只有一个 GET 端点来列出存储库特定目录中的文件。

还有一个 /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*} 端点。它支持 GET 列出存储库目录中的文件,并支持 PUT 每次调用提交一个文件。但是,该端点不支持 DELETE

重命名也是如此。该文档没有提到使用 REST API 调用的能力。

/2.0/repositories/{username}/{repo_slug}/src这个API可用于更新或删除文件。

来自docs

To create a commit that deletes files, use the files parameter:

$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \ -F files=/file/to/delete/1.txt \ -F files=/file/to/delete/2.txt

You can add/modify/delete multiple files in a request. Rename/move a file by deleting the old path and adding the content at the new path.