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.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
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(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId)
Delete a repository in registry.
|
void |
deleteRepositoryTag(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId,
java.lang.String tagName)
Delete a registry repository tag.
|
void |
deleteRepositoryTags(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId,
java.lang.String nameRegex,
java.lang.Integer keepN,
java.lang.String olderThan)
Delete repository tags in bulk based on given criteria.
|
java.util.Optional<RegistryRepositoryTag> |
getOptionalRepositoryTag(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId,
java.lang.String tagName)
Get details of a registry repository tag as the value of an Optional.
|
java.util.List<RegistryRepository> |
getRepositories(java.lang.Object projectIdOrPath)
Get a list of registry repositories in a project.
|
Pager<RegistryRepository> |
getRepositories(java.lang.Object projectIdOrPath,
int itemsPerPage)
Get a Pager of registry repositories in a project.
|
java.util.List<RegistryRepository> |
getRepositories(java.lang.Object projectIdOrPath,
int page,
int perPage)
Get a list of registry repositories in a project that fall within the specified page parameters.
|
java.util.stream.Stream<RegistryRepository> |
getRepositoriesStream(java.lang.Object projectIdOrPath)
Get a Stream of registry repositories in a project.
|
RegistryRepositoryTag |
getRepositoryTag(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId,
java.lang.String tagName)
Get details of a registry repository tag.
|
java.util.List<RegistryRepositoryTag> |
getRepositoryTags(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId)
Get a list of tags for given registry repository.
|
Pager<RegistryRepositoryTag> |
getRepositoryTags(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId,
int itemsPerPage)
Get a Pager of tags for given registry repository.
|
java.util.stream.Stream<RegistryRepositoryTag> |
getRepositoryTagsStream(java.lang.Object projectIdOrPath,
java.lang.Long repositoryId)
Get a Stream of tags for given registry repository.
|
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
public ContainerRegistryApi(GitLabApi gitLabApi)
public java.util.List<RegistryRepository> getRepositories(java.lang.Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic java.util.List<RegistryRepository> getRepositories(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Package instances per pageGitLabApiException
- if any exception occurspublic Pager<RegistryRepository> getRepositories(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of RegistryRepository instances per pageGitLabApiException
- if any exception occurspublic java.util.stream.Stream<RegistryRepository> getRepositoriesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic void deleteRepository(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic java.util.List<RegistryRepositoryTag> getRepositoryTags(java.lang.Object projectIdOrPath, java.lang.Long repositoryId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic Pager<RegistryRepositoryTag> getRepositoryTags(java.lang.Object projectIdOrPath, java.lang.Long repositoryId, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryitemsPerPage
- the number of RegistryRepositoryTag instances per pageGitLabApiException
- if any exception occurspublic java.util.stream.Stream<RegistryRepositoryTag> getRepositoryTagsStream(java.lang.Object projectIdOrPath, java.lang.Long repositoryId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositoryGitLabApiException
- if any exception occurspublic RegistryRepositoryTag getRepositoryTag(java.lang.Object projectIdOrPath, java.lang.Long repositoryId, java.lang.String tagName) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of tagGitLabApiException
- if any exception occurspublic java.util.Optional<RegistryRepositoryTag> getOptionalRepositoryTag(java.lang.Object projectIdOrPath, java.lang.Long repositoryId, java.lang.String tagName)
GitLab Endpoint: GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of tagpublic void deleteRepositoryTag(java.lang.Object projectIdOrPath, java.lang.Long repositoryId, java.lang.String tagName) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerepositoryId
- the ID of registry repositorytagName
- the name of the tag to deleteGitLabApiException
- if any exception occurspublic void deleteRepositoryTags(java.lang.Object projectIdOrPath, java.lang.Long repositoryId, java.lang.String nameRegex, java.lang.Integer keepN, java.lang.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 Long(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 occurs