Package org.gitlab4j.api
Class TagsApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.TagsApi
-
- All Implemented Interfaces:
Constants
public class TagsApi extends AbstractApi
This class provides an entry point to all the GitLab Tags and Protected Tags API calls.- See Also:
- Tags API at GitLab, Protected Tags API at GitLab
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.api.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.ContributorOrderBy, Constants.DefaultBranchProtectionLevel, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PackageOrderBy, Constants.PackageStatus, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectAccessTokenScope, Constants.ProjectCreationLevel, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.SubgroupCreationLevel, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
Fields inherited from interface org.gitlab4j.api.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReleasecreateRelease(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String releaseNotes)Add release notes to the existing git tag.TagcreateTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref)Creates a tag on a particular ref of the given project.TagcreateTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref, java.lang.String message, java.io.File releaseNotesFile)Creates a tag on a particular ref of a given project.TagcreateTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref, java.lang.String message, java.lang.String releaseNotes)Creates a tag on a particular ref of the given project with optional message and release notes.voiddeleteTag(java.lang.Object projectIdOrPath, java.lang.String tagName)Deletes the tag from a project with the specified tag name.java.util.Optional<ProtectedTag>getOptionalProtectedTag(java.lang.Object projectIdOrPath, java.lang.String name)Get an Optional instance holding a protected tag or wildcard protected tag.java.util.Optional<Tag>getOptionalTag(java.lang.Object projectIdOrPath, java.lang.String tagName)Get an Optional instance holding a Tag instance of a specific repository tag determined by its name.ProtectedTaggetProtectedTag(java.lang.Object projectIdOrPath, java.lang.String name)Gets a single protected tag or wildcard protected tagjava.util.List<ProtectedTag>getProtectedTags(java.lang.Object projectIdOrPath)Gets a list of protected tags from a project.Pager<ProtectedTag>getProtectedTags(java.lang.Object projectIdOrPath, int itemsPerPage)Get a Pager of protected tags for a project.java.util.List<ProtectedTag>getProtectedTags(java.lang.Object projectIdOrPath, int page, int perPage)Gets a list of protected tags from a project and in the specified page range.java.util.stream.Stream<ProtectedTag>getProtectedTagsStream(java.lang.Object projectIdOrPath)Get a Stream of protected tags for a project.TaggetTag(java.lang.Object projectIdOrPath, java.lang.String tagName)Get a specific repository tag determined by its name.java.util.List<Tag>getTags(java.lang.Object projectIdOrPath)Get a list of repository tags from a project, sorted by name in reverse alphabetical order.Pager<Tag>getTags(java.lang.Object projectIdOrPath, int itemsPerPage)Get a list of repository tags from a project, sorted by name in reverse alphabetical order.java.util.List<Tag>getTags(java.lang.Object projectIdOrPath, int page, int perPage)Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.java.util.List<Tag>getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search)Get a list of repository tags from a project, sorted by name in reverse alphabetical order.Pager<Tag>getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search, int itemsPerPage)Get a list of repository tags from a project, sorted by name in reverse alphabetical order.java.util.List<Tag>getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search, int page, int perPage)Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.java.util.stream.Stream<Tag>getTagsStream(java.lang.Object projectIdOrPath)Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.java.util.stream.Stream<Tag>getTagsStream(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search)Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.ProtectedTagprotectTag(java.lang.Object projectIdOrPath, java.lang.String name, AccessLevel createAccessLevel)Protects a single repository tag or several project repository tags using a wildcard protected tag.voidunprotectTag(java.lang.Object projectIdOrPath, java.lang.String name)Unprotects the given protected tag or wildcard protected tag.ReleaseupdateRelease(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String releaseNotes)Updates the release notes of a given release.-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
TagsApi
public TagsApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getTags
public java.util.List<Tag> getTags(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or path- Returns:
- the list of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getTags
public java.util.List<Tag> getTags(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathpage- the page to getperPage- the number of Tag instances per page- Returns:
- the list of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getTags
public Pager<Tag> getTags(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathitemsPerPage- the number of Project instances that will be fetched per page- Returns:
- the Pager of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getTagsStream
public java.util.stream.Stream<Tag> getTagsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Stream of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getTags
public java.util.List<Tag> getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathorderBy- return tags ordered by name or updated fields. Default is updatedsortOrder- return tags sorted in asc or desc order. Default is descsearch- return list of tags matching the search criteria- Returns:
- the list of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs- Since:
- GitLab 11.8
-
getTags
public java.util.List<Tag> getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search, int page, int perPage) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathorderBy- return tags ordered by name or updated fields. Default is updatedsortOrder- return tags sorted in asc or desc order. Default is descsearch- return list of tags matching the search criteriapage- the page to getperPage- the number of Tag instances per page- Returns:
- the list of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs- Since:
- GitLab 11.8
-
getTags
public Pager<Tag> getTags(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search, int itemsPerPage) throws GitLabApiException
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathorderBy- return tags ordered by name or updated fields. Default is updatedsortOrder- return tags sorted in asc or desc order. Default is descsearch- return list of tags matching the search criteriaitemsPerPage- the number of Project instances that will be fetched per page- Returns:
- the Pager of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs- Since:
- GitLab 11.8
-
getTagsStream
public java.util.stream.Stream<Tag> getTagsStream(java.lang.Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, java.lang.String search) throws GitLabApiException
Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.GitLab Endpoint: GET /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathorderBy- return tags ordered by name or updated fields. Default is updatedsortOrder- return tags sorted in asc or desc order. Default is descsearch- return list of tags matching the search criteria- Returns:
- a Stream of tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs- Since:
- GitLab 11.8
-
getTag
public Tag getTag(java.lang.Object projectIdOrPath, java.lang.String tagName) throws GitLabApiException
Get a specific repository tag determined by its name.GitLab Endpoint: GET /projects/:id/repository/tags/:tagName- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- the name of the tag to fetch the info for- Returns:
- a Tag instance with info on the specified tag
- Throws:
GitLabApiException- if any exception occurs
-
getOptionalTag
public java.util.Optional<Tag> getOptionalTag(java.lang.Object projectIdOrPath, java.lang.String tagName) throws GitLabApiException
Get an Optional instance holding a Tag instance of a specific repository tag determined by its name.GitLab Endpoint: GET /projects/:id/repository/tags/:tagName- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- the name of the tag to fetch the info for- Returns:
- an Optional instance with the specified project tag as the value
- Throws:
GitLabApiException- if any exception occurs
-
createTag
public Tag createTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref) throws GitLabApiException
Creates a tag on a particular ref of the given project.GitLab Endpoint: POST /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- The name of the tag Must be unique for the projectref- the git ref to place the tag on- Returns:
- a Tag instance containing info on the newly created tag
- Throws:
GitLabApiException- if any exception occurs
-
createTag
public Tag createTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref, java.lang.String message, java.lang.String releaseNotes) throws GitLabApiException
Creates a tag on a particular ref of the given project with optional message and release notes.GitLab Endpoint: POST /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- The name of the tag Must be unique for the projectref- the git ref to place the tag onmessage- the message to included with the tag (optional)releaseNotes- the release notes for the tag (optional)- Returns:
- a Tag instance containing info on the newly created tag
- Throws:
GitLabApiException- if any exception occurs
-
createTag
public Tag createTag(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String ref, java.lang.String message, java.io.File releaseNotesFile) throws GitLabApiException
Creates a tag on a particular ref of a given project. A message and a File instance containing the release notes are optional. This method is the same ascreateTag(Object, String, String, String, String), but instead allows the release notes to be supplied in a file.GitLab Endpoint: POST /projects/:id/repository/tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- the name of the tag, must be unique for the projectref- the git ref to place the tag onmessage- the message to included with the tag (optional)releaseNotesFile- a whose contents are the release notes (optional)- Returns:
- a Tag instance containing info on the newly created tag
- Throws:
GitLabApiException- if any exception occurs
-
deleteTag
public void deleteTag(java.lang.Object projectIdOrPath, java.lang.String tagName) throws GitLabApiExceptionDeletes the tag from a project with the specified tag name.GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- The name of the tag to delete- Throws:
GitLabApiException- if any exception occurs
-
createRelease
public Release createRelease(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String releaseNotes) throws GitLabApiException
Add release notes to the existing git tag.GitLab Endpoint: POST /projects/:id/repository/tags/:tagName/release- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- the name of a tagreleaseNotes- release notes with markdown support- Returns:
- a Tag instance containing info on the newly created tag
- Throws:
GitLabApiException- if any exception occurs
-
updateRelease
public Release updateRelease(java.lang.Object projectIdOrPath, java.lang.String tagName, java.lang.String releaseNotes) throws GitLabApiException
Updates the release notes of a given release.GitLab Endpoint: PUT /projects/:id/repository/tags/:tagName/release- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathtagName- the name of a tagreleaseNotes- release notes with markdown support- Returns:
- a Tag instance containing info on the newly created tag
- Throws:
GitLabApiException- if any exception occurs
-
getProtectedTags
public java.util.List<ProtectedTag> getProtectedTags(java.lang.Object projectIdOrPath) throws GitLabApiException
Gets a list of protected tags from a project.GitLab Endpoint: GET /projects/:id/protected_tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a List of protected tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getProtectedTags
public java.util.List<ProtectedTag> getProtectedTags(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Gets a list of protected tags from a project and in the specified page range.GitLab Endpoint: GET /projects/:id/protected_tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathpage- the page to getperPage- the number of Tag instances per page- Returns:
- a List of tags for the specified project ID and page range
- Throws:
GitLabApiException- if any exception occurs
-
getProtectedTags
public Pager<ProtectedTag> getProtectedTags(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of protected tags for a project.GitLab Endpoint: GET /projects/:id/protected_tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathitemsPerPage- the number of Project instances that will be fetched per page- Returns:
- the Pager of protected tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getProtectedTagsStream
public java.util.stream.Stream<ProtectedTag> getProtectedTagsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of protected tags for a project.GitLab Endpoint: GET /projects/:id/protected_tags/:name- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Stream of protected tags for the specified project ID
- Throws:
GitLabApiException- if any exception occurs
-
getProtectedTag
public ProtectedTag getProtectedTag(java.lang.Object projectIdOrPath, java.lang.String name) throws GitLabApiException
Gets a single protected tag or wildcard protected tagGitLab Endpoint: GET /projects/:id/protected_tags/:name- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathname- the name of the tag or wildcard- Returns:
- a ProtectedTag instance with info on the specified protected tag
- Throws:
GitLabApiException- if any exception occurs
-
getOptionalProtectedTag
public java.util.Optional<ProtectedTag> getOptionalProtectedTag(java.lang.Object projectIdOrPath, java.lang.String name) throws GitLabApiException
Get an Optional instance holding a protected tag or wildcard protected tag.GitLab Endpoint: GET /projects/:id/protected_tags/:name- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathname- the name of the tag or wildcard- Returns:
- an Optional instance with the specified protected tag as the value
- Throws:
GitLabApiException- if any exception occurs
-
protectTag
public ProtectedTag protectTag(java.lang.Object projectIdOrPath, java.lang.String name, AccessLevel createAccessLevel) throws GitLabApiException
Protects a single repository tag or several project repository tags using a wildcard protected tag.GitLab Endpoint: POST /projects/:id/protected_tags- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathname- the name of the tag or wildcardcreateAccessLevel- the access level allowed to create- Returns:
- a ProtectedTag instance
- Throws:
GitLabApiException- if any exception occurs
-
unprotectTag
public void unprotectTag(java.lang.Object projectIdOrPath, java.lang.String name) throws GitLabApiExceptionUnprotects the given protected tag or wildcard protected tag.GitLab Endpoint: GET /projects/:id/protected_tags/:name- Parameters:
projectIdOrPath- id, path of the project, or a Project instance holding the project ID or pathname- the name of the tag or wildcard- Throws:
GitLabApiException- if any exception occurs
-
-