Hi,
I am using python requests library to work with stash REST API. With POST request I have no problem to create a new tag on specified commit:
#!/usr/bin/python3.5
import requests
url = '{}/rest/api/1.0/projects/{}/repos/{}/tags'.format(url, project_name, repo_name)
data = {'force': 'false',
'message': 'Test tag',
'name': '1.0',
'startPoint': 'ffffff',
'type': 'LIGHTWEIGHT'}
headers = {'Content-Type': 'application/json',
'X-Atlassian-Token': 'no-check'}
r = requests.post(url, data=data, header=headers)this gives response 200 and tag 1.0 is created at commit 'ffffff'
<stash base url>/rest/api/1.0/projects/<project>/repos/<repo>/tags
However if I try to follow https://developer.atlassian.com/static/rest/stash/3.11.6/stash-scm-git-rest.html and make DELETE request:
url = '{}/rest/api/1.0/projects/{}/repos/{}/tags/{}'.format(url, project_name, repo_name, tag) # where tag is '1.0'
r = requests.delete(url)I get 404 (not existing) response, and not surprisingly I can't go to url:
<stash base url>/rest/api/1.0/projects/<project>/repos/<repo>/tags/1.0
Even though tag I created is visible in json at:
<stash base url>/rest/api/1.0/projects/<project>/repos/<repo>/tags
So the question is really - what is the correct syntax to access and delete a single tag?
Best Regards,
Majus