Package org.gitlab4j.api
Class DeploymentsApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.DeploymentsApi
- All Implemented Interfaces:
Constants
public class DeploymentsApi extends AbstractApi
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.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, 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.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 Constructor Description DeploymentsApi(GitLabApi gitLabApi)
-
Method Summary
Modifier and Type Method Description Deployment
addDeployment(Object projectIdOrPath, String environment, String sha, String ref, Boolean tag, Constants.DeploymentStatus status)
Creates a new deployment for a project.Deployment
getDeployment(Object projectIdOrPath, Integer deploymentId)
Get a specific deployment.List<MergeRequest>
getMergeRequests(Object projectIdOrPath, Integer deploymentId)
Get a list of Merge Requests shipped with a given deployment.Pager<MergeRequest>
getMergeRequests(Object projectIdOrPath, Integer deploymentId, int itemsPerPage)
Get a Pager of Merge Requests shipped with a given deployment.Stream<MergeRequest>
getMergeRequestsStream(Object projectIdOrPath, Integer deploymentId)
Get a Stream of Merge Requests shipped with a given deployment.Optional<Deployment>
getOptionalDeployment(Object projectIdOrPath, Integer deploymentId)
Get a specific deployment as an Optional instance.List<Deployment>
getProjectDeployments(Object projectIdOrPath)
Get a list of deployments for the specified project.Pager<Deployment>
getProjectDeployments(Object projectIdOrPath, int itemsPerPage)
Get a Pager of all deployments for the specified project.Pager<Deployment>
getProjectDeployments(Object projectIdOrPath, DeploymentFilter filter)
Get a Pager of all deployments for the specified project.Pager<Deployment>
getProjectDeployments(Object projectIdOrPath, DeploymentFilter filter, int itemsPerPage)
Get a Pager of all deployments for the specified project.Stream<Deployment>
getProjectDeploymentsStream(Object projectIdOrPath)
Get a Stream of all deployments for the specified project.Stream<Deployment>
getProjectDeploymentsStream(Object projectIdOrPath, DeploymentFilter filter)
Get a Stream of all deployments for the specified project.Deployment
updateDeployment(Object projectIdOrPath, Integer 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, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, 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 Integer(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 GitLabApiExceptionGet a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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 GitLabApiExceptionGet a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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 GitLabApiExceptionGet a Pager of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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 GitLabApiExceptionGet a Stream of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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 GitLabApiExceptionGet a Stream of all deployments for the specified project.GitLab Endpoint: GET /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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, Integer deploymentId) throws GitLabApiExceptionGet a specific deployment.GitLab Endpoint: GET /projects/:id/deployments/:deployment_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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 Integer(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 GitLabApiExceptionCreates a new deployment for a project.GitLab Endpoint: POST /projects/:id/deployments
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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, Integer deploymentId, Constants.DeploymentStatus status) throws GitLabApiExceptionUpdates an existing project deploy key.GitLab Endpoint: PUT /projects/:id/deployments/:key_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(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, Integer deploymentId) throws GitLabApiExceptionGet 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 Integer(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, Integer deploymentId, int itemsPerPage) throws GitLabApiExceptionGet 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 Integer(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, Integer deploymentId) throws GitLabApiExceptionGet 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 Integer(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
-