在Stash标签上删除请求

问题描述 投票:2回答:1

这个问题类似于Git delete branch without cloning?,整体上非常简单,但由于某种原因,我找不到正确的答案。

我正在使用Stash REST API来更新Stash存储库中的标签。发送POST请求并添加新标记很容易(例如使用python请求,但可以与curl相同):

#!/usr/bin/python3.5

import requests

url = '.../rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags'

data = {'force': 'false',
        'message': 'Updated tag',
        'name': 'LATEST_SUCCESSFUL',
        'startPoint': 'ffffff',
        'type': 'LIGHTWEIGHT'}

headers = {'Content-Type': 'application/json',
           'X-Atlassian-Token': 'no-check'}

r = requests.post(url, data=data, header=headers)

这工作正常,但我想保留远程删除此标记的选项。根据文件https://developer.atlassian.com/static/rest/stash/3.11.6/stash-scm-git-rest.html?_ga=1.6600434.1354597480.1483944905这应该工作:

url = '.../rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/LATEST_SUCCESSFUL
r = requests.delete(url)

但我在这里得到404错误。所以问题是,访问(和删除)单个标签的正确方法是什么?

python rest request tags bitbucket-server
1个回答
1
投票

答案结果很简单,因为标签删除请求应该命中

rest/git/1.0/...

代替

rest/api/1.0/...

但后者适用于获取请求。

© www.soinside.com 2019 - 2024. All rights reserved.