@@ -158,12 +158,63 @@ def get_tags(self, project, repository, filter='', limit=99999):
158
158
fixed system limits. Default by built-in method: 99999
159
159
:return:
160
160
"""
161
- url = '/ rest/api/1.0/projects/{project}/repos/{repository}/tags' .format (project = project ,
162
- repository = repository )
161
+ url = 'rest/api/1.0/projects/{project}/repos/{repository}/tags' .format (project = project ,
162
+ repository = repository )
163
163
url += '?limit={limit}&filterText={filter}' .format (limit = limit ,
164
164
filter = filter )
165
165
return (self .get (url ) or {}).get ('values' )
166
166
167
+ def get_project_tags (self , project , repository , tag_name ):
168
+ """
169
+ Retrieve a tag in the specified repository.
170
+ The authenticated user must have REPO_READ permission for the context repository to call this resource.
171
+ Search uri is api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name:.*}
172
+ :param project:
173
+ :param repository:
174
+ :param tag_name: OPTIONAL:
175
+ :return:
176
+ """
177
+ url = 'rest/api/1.0/projects/{project}/repos/{repository}/tags/{tag}' .format (project = project ,
178
+ repository = repository ,
179
+ tag = tag_name )
180
+ return self .get (url , not_json_response = True )
181
+
182
+ def set_tag (self , project , repository , tag_name , commit_revision , description = None ):
183
+ """
184
+ Creates a tag using the information provided in the {@link RestCreateTagRequest request}
185
+ The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
186
+ :param project:
187
+ :param repository:
188
+ :param tag_name:
189
+ :param commit_revision: commit hash
190
+ :param description: OPTIONAL:
191
+ :return:
192
+ """
193
+ url = 'rest/api/1.0/projects/{project}/repos/{repository}/tags' .format (project = project ,
194
+ repository = repository )
195
+ body = {}
196
+ if tag_name is not None :
197
+ body ['name' ] = tag_name
198
+ if tag_name is not None :
199
+ body ['startPoint' ] = commit_revision
200
+ if tag_name is not None :
201
+ body ['message' ] = description
202
+ return self .post (url , data = body )
203
+
204
+ def delete_tag (self , project , repository , tag_name ):
205
+ """
206
+ Creates a tag using the information provided in the {@link RestCreateTagRequest request}
207
+ The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
208
+ :param project:
209
+ :param repository:
210
+ :param tag_name:
211
+ :return:
212
+ """
213
+ url = 'rest/git/1.0/projects/{project}/repos/{repository}/tags/{tag}' .format (project = project ,
214
+ repository = repository ,
215
+ tag = tag_name )
216
+ return self .delete (url )
217
+
167
218
def get_diff (self , project , repository , path , hash_oldest , hash_newest ):
168
219
url = 'rest/api/1.0/projects/{project}/repos/{repository}/compare/diff/{path}' .format (project = project ,
169
220
repository = repository ,
0 commit comments