Package org.gitlab4j.api
Class PackagesApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.PackagesApi
- All Implemented Interfaces:
Constants
This class implements the client side API for the GitLab Packages API. See Packages API at GitLab for more information.
NOTE: This API is not available in the Community edition of 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.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 TypeMethodDescriptionvoid
deletePackage
(Object projectIdOrPath, Long packageId) Deletes a project package.getPackage
(Object projectIdOrPath, Long packageId) Get a single project package.getPackageFiles
(Object projectIdOrPath, Long packageId) Get a list of package files of a single package.getPackageFiles
(Object projectIdOrPath, Long packageId, int itemsPerPage) Get a Pager of project package files.getPackageFiles
(Object projectIdOrPath, Long packageId, int page, int perPage) Get a list of package files of a single package for the specified page.getPackages
(Object projectIdOrPath) Get a list of project packages.getPackages
(Object projectIdOrPath, int itemsPerPage) Get a Pager of project packages.getPackages
(Object projectIdOrPath, int page, int perPage) Get a list of project packages for the specified page.getPackages
(Object projectIdOrPath, PackageFilter filter, int itemsPerPage) Get a Pager of project packages.getPackagesStream
(Object projectIdOrPath) Get a Stream of project packages.getPackagesStream
(Object projectIdOrPath, Long packageId) Get a Stream of project package files.getPackagesStream
(Object projectIdOrPath, PackageFilter filter) Get a Stream of project packages.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
-
PackagesApi
-
-
Method Details
-
getPackages
Get a list of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public List<Package> getPackages(Object projectIdOrPath, int page, int perPage) throws GitLabApiException Get a list of project packages for the specified page. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
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 page- Returns:
- a list of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public Pager<Package> getPackages(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException Get a Pager of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Package instances per page- Returns:
- a Pager of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public Pager<Package> getPackages(Object projectIdOrPath, PackageFilter filter, int itemsPerPage) throws GitLabApiException Get a Pager of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
- the PackageFilter instance holding the filter values for the queryitemsPerPage
- the number of Package instances per page- Returns:
- a Pager of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
Get a Stream of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
public Stream<Package> getPackagesStream(Object projectIdOrPath, PackageFilter filter) throws GitLabApiException Get a Stream of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
- the PackageFilter instance holding the filter values for the query- Returns:
- a Stream of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackage
Get a single project package.GitLab Endpoint: GET /projects/:id/packages/:package_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get- Returns:
- a Package instance for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public List<PackageFile> getPackageFiles(Object projectIdOrPath, Long packageId) throws GitLabApiException Get a list of package files of a single package.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files for- Returns:
- a list of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public List<PackageFile> getPackageFiles(Object projectIdOrPath, Long packageId, int page, int perPage) throws GitLabApiException Get a list of package files of a single package for the specified page.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files forpage
- the page to getperPage
- the number of PackageFile instances per page- Returns:
- a list of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public Pager<PackageFile> getPackageFiles(Object projectIdOrPath, Long packageId, int itemsPerPage) throws GitLabApiException Get a Pager of project package files.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files foritemsPerPage
- the number of PackageFile instances per page- Returns:
- a Pager of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
public Stream<PackageFile> getPackagesStream(Object projectIdOrPath, Long packageId) throws GitLabApiException Get a Stream of project package files.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files for- Returns:
- a Stream of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
deletePackage
Deletes a project package.GitLab Endpoint: DELETE /projects/:id/packages/:package_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to delete- Throws:
GitLabApiException
- if any exception occurs
-