Package org.gitlab4j.api
Class TagsApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.TagsApi
- All Implemented Interfaces:
Constants
This class provides an entry point to all the GitLab Tags and Protected Tags API calls.
-
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.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.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateRelease
(Object projectIdOrPath, String tagName, String releaseNotes) Add release notes to the existing git tag.Creates a tag on a particular ref of the given project.createTag
(Object projectIdOrPath, String tagName, String ref, String message, File releaseNotesFile) Creates a tag on a particular ref of a given project.Creates a tag on a particular ref of the given project with optional message and release notes.void
Deletes the tag from a project with the specified tag name.getOptionalProtectedTag
(Object projectIdOrPath, String name) Get an Optional instance holding a protected tag or wildcard protected tag.getOptionalTag
(Object projectIdOrPath, String tagName) Get an Optional instance holding a Tag instance of a specific repository tag determined by its name.getProtectedTag
(Object projectIdOrPath, String name) Gets a single protected tag or wildcard protected taggetProtectedTags
(Object projectIdOrPath) Gets a list of protected tags from a project.getProtectedTags
(Object projectIdOrPath, int itemsPerPage) Get a Pager of protected tags for a project.getProtectedTags
(Object projectIdOrPath, int page, int perPage) Gets a list of protected tags from a project and in the specified page range.getProtectedTagsStream
(Object projectIdOrPath) Get a Stream of protected tags for a project.Get a specific repository tag determined by its name.Get a list of repository tags from a project, sorted by name in reverse alphabetical order.Get a list of repository tags from a project, sorted by name in reverse alphabetical order.Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.getTags
(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, String search) Get a list of repository tags from a project, sorted by name in reverse alphabetical order.getTags
(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, String search, int itemsPerPage) Get a list of repository tags from a project, sorted by name in reverse alphabetical order.getTags
(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, 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.getTagsStream
(Object projectIdOrPath) Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.getTagsStream
(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, String search) Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.protectTag
(Object projectIdOrPath, String name, AccessLevel createAccessLevel) Protects a single repository tag or several project repository tags using a wildcard protected tag.void
unprotectTag
(Object projectIdOrPath, String name) Unprotects the given protected tag or wildcard protected tag.updateRelease
(Object projectIdOrPath, String tagName, 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 Details
-
TagsApi
-
-
Method Details
-
getTags
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
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
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
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 List<Tag> getTags(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, 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 List<Tag> getTags(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, 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(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, 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 Stream<Tag> getTagsStream(Object projectIdOrPath, Constants.TagOrderBy orderBy, Constants.SortOrder sortOrder, 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
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 Optional<Tag> getOptionalTag(Object projectIdOrPath, 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
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(Object projectIdOrPath, String tagName, String ref, String message, 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(Object projectIdOrPath, String tagName, String ref, String message, 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
Deletes 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(Object projectIdOrPath, String tagName, 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(Object projectIdOrPath, String tagName, 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
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 List<ProtectedTag> getProtectedTags(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(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 Stream<ProtectedTag> getProtectedTagsStream(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
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 Optional<ProtectedTag> getOptionalProtectedTag(Object projectIdOrPath, 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(Object projectIdOrPath, String name, AccessLevel createAccessLevel) throws GitLabApiException Protects a single repository tag or several project repository tags using a wildcard protected tag.GitLab Endpoint: GET /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
Unprotects 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
-