Package org.gitlab4j.api
Class DeploymentsApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.DeploymentsApi
- All Implemented Interfaces:
Constants
This class implements the client side API for the GitLab Deployments API calls.
See https://docs.gitlab.com/ee/api/deployments.html
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDeployment
(Object projectIdOrPath, String environment, String sha, String ref, Boolean tag, Constants.DeploymentStatus status) Creates a new deployment for a project.getDeployment
(Object projectIdOrPath, Long deploymentId) Get a specific deployment.getMergeRequests
(Object projectIdOrPath, Long deploymentId) Get a list of Merge Requests shipped with a given deployment.getMergeRequests
(Object projectIdOrPath, Long deploymentId, int itemsPerPage) Get a Pager of Merge Requests shipped with a given deployment.getMergeRequestsStream
(Object projectIdOrPath, Long deploymentId) Get a Stream of Merge Requests shipped with a given deployment.getOptionalDeployment
(Object projectIdOrPath, Long deploymentId) Get a specific deployment as an Optional instance.getProjectDeployments
(Object projectIdOrPath) Get a list of deployments for the specified project.getProjectDeployments
(Object projectIdOrPath, int itemsPerPage) Get a Pager of all deployments for the specified project.getProjectDeployments
(Object projectIdOrPath, DeploymentFilter filter) Get a Pager of all deployments for the specified project.getProjectDeployments
(Object projectIdOrPath, DeploymentFilter filter, int itemsPerPage) Get a Pager of all deployments for the specified project.getProjectDeploymentsStream
(Object projectIdOrPath) Get a Stream of all deployments for the specified project.getProjectDeploymentsStream
(Object projectIdOrPath, DeploymentFilter filter) Get a Stream of all deployments for the specified project.updateDeployment
(Object projectIdOrPath, Long deploymentId, Constants.DeploymentStatus status) Updates an existing project deploy key.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
-
DeploymentsApi
-
-
Method Details
-
getProjectDeployments
Get a list of deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of Deployments
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectDeployments
public Pager<Deployment> getProjectDeployments(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException Get a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Deployments instances that will be fetched per page- Returns:
- a Pager of Deployment
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectDeployments
public Pager<Deployment> getProjectDeployments(Object projectIdOrPath, DeploymentFilter filter) throws GitLabApiException Get a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
-DeploymentFilter
a DeploymentFilter instance with the filter settings- Returns:
- a Pager of Deployment
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectDeployments
public Pager<Deployment> getProjectDeployments(Object projectIdOrPath, DeploymentFilter filter, int itemsPerPage) throws GitLabApiException Get a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
-DeploymentFilter
a DeploymentFilter instance with the filter settingsitemsPerPage
- the number of Deployments instances that will be fetched per page- Returns:
- a Pager of Deployment
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectDeploymentsStream
public Stream<Deployment> getProjectDeploymentsStream(Object projectIdOrPath) throws GitLabApiException Get a Stream of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of Deployment
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectDeploymentsStream
public Stream<Deployment> getProjectDeploymentsStream(Object projectIdOrPath, DeploymentFilter filter) throws GitLabApiException Get a Stream of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
-DeploymentFilter
a DeploymentFilter instance with the filter settings- Returns:
- a list of Deployment
- Throws:
GitLabApiException
- if any exception occurs
-
getDeployment
public Deployment getDeployment(Object projectIdOrPath, Long deploymentId) throws GitLabApiException Get a specific deployment.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- the ID of a project's deployment- Returns:
- the specified Deployment instance
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalDeployment
Get a specific deployment as an Optional instance.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- the ID of a project's deployment- Returns:
- the specified Deployment as an Optional instance
-
addDeployment
public Deployment addDeployment(Object projectIdOrPath, String environment, String sha, String ref, Boolean tag, Constants.DeploymentStatus status) throws GitLabApiException Creates a new deployment for a project.GitLab Endpoint: POST /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceenvironment
- The name of the environment to create the deployment for, requiredsha
- The SHA of the commit that is deployed, requiredref
- The name of the branch or tag that is deployed, requiredtag
- A boolean that indicates if the deployed ref is a tag (true) or not (false), requiredstatus
- The status to filter deployments by, required- Returns:
- a Deployment instance with info on the added deployment
- Throws:
GitLabApiException
- if any exception occurs
-
updateDeployment
public Deployment updateDeployment(Object projectIdOrPath, Long deploymentId, Constants.DeploymentStatus status) throws GitLabApiException Updates an existing project deploy key.GitLab Endpoint: PUT /projects/:id/deployments/:key_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- The ID of the deployment to update, requiredstatus
- The new status of the deployment, required- Returns:
- an updated Deployment instance
- Throws:
GitLabApiException
- if any exception occurs
-
getMergeRequests
public List<MergeRequest> getMergeRequests(Object projectIdOrPath, Long deploymentId) throws GitLabApiException Get a list of Merge Requests shipped with a given deployment.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id/merge_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- The ID of the deployment to update, required- Returns:
- a list containing the MergeRequest instances shipped with a given deployment
- Throws:
GitLabApiException
- GitLabApiException if any exception occurs during execution
-
getMergeRequests
public Pager<MergeRequest> getMergeRequests(Object projectIdOrPath, Long deploymentId, int itemsPerPage) throws GitLabApiException Get a Pager of Merge Requests shipped with a given deployment.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id/merge_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- The ID of the deployment to update, requireditemsPerPage
- the number of Commit instances that will be fetched per page- Returns:
- a Pager containing the MergeRequest instances shipped with a given deployment
- Throws:
GitLabApiException
- GitLabApiException if any exception occurs during execution
-
getMergeRequestsStream
public Stream<MergeRequest> getMergeRequestsStream(Object projectIdOrPath, Long deploymentId) throws GitLabApiException Get a Stream of Merge Requests shipped with a given deployment.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id/merge_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancedeploymentId
- The ID of the deployment to update, required- Returns:
- a Stream containing the MergeRequest instances shipped with a given deployment
- Throws:
GitLabApiException
- GitLabApiException if any exception occurs during execution
-