public class ContainerRegistryApi extends AbstractApi
This class implements the client side API for the GitLab Container Registry API. See Container Registry API at GitLab for more information.
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.Encoding, Constants.EpicOrderBy, 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.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor and Description |
---|
ContainerRegistryApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
void |
deleteRepository(Object projectIdOrPath,
Integer repositoryId)
Delete a repository in registry.
|
void |
deleteRepositoryTag(Object projectIdOrPath,
Integer repositoryId,
String tagName)
Delete a registry repository tag.
|
void |
deleteRepositoryTags(Object projectIdOrPath,
Integer repositoryId,
String nameRegex,
Integer keepN,
String olderThan)
Delete repository tags in bulk based on given criteria.
|
Optional<RegistryRepositoryTag> |
getOptionalRepositoryTag(Object projectIdOrPath,
Integer repositoryId,
String tagName)
Get details of a registry repository tag as the value of an Optional.
|
List<RegistryRepository> |
getRepositories(Object projectIdOrPath)
Get a list of registry repositories in a project.
|
Pager<RegistryRepository> |
getRepositories(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of registry repositories in a project.
|
List<RegistryRepository> |
getRepositories(Object projectIdOrPath,
int page,
int perPage)
Get a list of registry repositories in a project that fall within the specified page parameters.
|
Stream<RegistryRepository> |
getRepositoriesStream(Object projectIdOrPath)
Get a Stream of registry repositories in a project.
|
RegistryRepositoryTag |
getRepositoryTag(Object projectIdOrPath,
Integer repositoryId,
String tagName)
Get details of a registry repository tag.
|
List<RegistryRepositoryTag> |
getRepositoryTags(Object projectIdOrPath,
Integer repositoryId)
Get a list of tags for given registry repository.
|
Pager<RegistryRepositoryTag> |
getRepositoryTags(Object projectIdOrPath,
Integer repositoryId,
int itemsPerPage)
Get a Pager of tags for given registry repository.
|
Stream<RegistryRepositoryTag> |
getRepositoryTagsStream(Object projectIdOrPath,
Integer repositoryId)
Get a Stream of tags for given registry repository.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public ContainerRegistryApi(GitLabApi gitLabApi)
public List<RegistryRepository> getRepositories(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<RegistryRepository> getRepositories(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Package instances per pageGitLabApiException
- if any exception occurspublic Pager<RegistryRepository> getRepositories(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of RegistryRepository instances per pageGitLabApiException
- if any exception occurspublic Stream<RegistryRepository> getRepositoriesStream(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic void deleteRepository(Object projectIdOrPath, Integer repositoryId) throws GitLabApiException
This operation is executed asynchronously and might take some time to get executed.
GitLab Endpoint: DELETE /projects/:id/registry/repositories/:repository_id
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic List<RegistryRepositoryTag> getRepositoryTags(Object projectIdOrPath, Integer repositoryId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic Pager<RegistryRepositoryTag> getRepositoryTags(Object projectIdOrPath, Integer repositoryId, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryitemsPerPage
- the number of RegistryRepositoryTag instances per pageGitLabApiException
- if any exception occurspublic Stream<RegistryRepositoryTag> getRepositoryTagsStream(Object projectIdOrPath, Integer repositoryId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic RegistryRepositoryTag getRepositoryTag(Object projectIdOrPath, Integer repositoryId, String tagName) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of tagGitLabApiException
- if any exception occurspublic Optional<RegistryRepositoryTag> getOptionalRepositoryTag(Object projectIdOrPath, Integer repositoryId, String tagName)
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of tagpublic void deleteRepositoryTag(Object projectIdOrPath, Integer repositoryId, String tagName) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of the tag to deleteGitLabApiException
- if any exception occurspublic void deleteRepositoryTags(Object projectIdOrPath, Integer repositoryId, String nameRegex, Integer keepN, String olderThan) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/registry/repositories/:repository_id/tags
This API call performs the following operations:
These operations are executed asynchronously and it might take time to get executed. You can run this at most once an hour for a given container repository.
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorynameRegex
- the regex of the name to delete. To delete all tags specify .*
.keepN
- the amount of latest tags of given name to keep.olderThan
- tags to delete that are older than the given time, written in human readable form
1h
, 1d
, 1month
.GitLabApiException
- if any exception occursCopyright © 2019. All rights reserved.