Package org.gitlab4j.api
Class DeploymentsApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.DeploymentsApi
-
- All Implemented Interfaces:
org.gitlab4j.models.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.models.Constants
org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoCancelPendingPipelines, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
-
Constructor Summary
Constructors Constructor Description DeploymentsApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gitlab4j.api.models.Deployment
addDeployment(java.lang.Object projectIdOrPath, java.lang.String environment, java.lang.String sha, java.lang.String ref, java.lang.Boolean tag, org.gitlab4j.models.Constants.DeploymentStatus status)
Creates a new deployment for a project.org.gitlab4j.api.models.Deployment
getDeployment(java.lang.Object projectIdOrPath, java.lang.Long deploymentId)
Get a specific deployment.java.util.List<org.gitlab4j.api.models.MergeRequest>
getMergeRequests(java.lang.Object projectIdOrPath, java.lang.Long deploymentId)
Get a list of Merge Requests shipped with a given deployment.Pager<org.gitlab4j.api.models.MergeRequest>
getMergeRequests(java.lang.Object projectIdOrPath, java.lang.Long deploymentId, int itemsPerPage)
Get a Pager of Merge Requests shipped with a given deployment.java.util.stream.Stream<org.gitlab4j.api.models.MergeRequest>
getMergeRequestsStream(java.lang.Object projectIdOrPath, java.lang.Long deploymentId)
Get a Stream of Merge Requests shipped with a given deployment.java.util.Optional<org.gitlab4j.api.models.Deployment>
getOptionalDeployment(java.lang.Object projectIdOrPath, java.lang.Long deploymentId)
Get a specific deployment as an Optional instance.java.util.List<org.gitlab4j.api.models.Deployment>
getProjectDeployments(java.lang.Object projectIdOrPath)
Get a list of deployments for the specified project.Pager<org.gitlab4j.api.models.Deployment>
getProjectDeployments(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of all deployments for the specified project.Pager<org.gitlab4j.api.models.Deployment>
getProjectDeployments(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.DeploymentFilter filter)
Get a Pager of all deployments for the specified project.Pager<org.gitlab4j.api.models.Deployment>
getProjectDeployments(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.DeploymentFilter filter, int itemsPerPage)
Get a Pager of all deployments for the specified project.java.util.stream.Stream<org.gitlab4j.api.models.Deployment>
getProjectDeploymentsStream(java.lang.Object projectIdOrPath)
Get a Stream of all deployments for the specified project.java.util.stream.Stream<org.gitlab4j.api.models.Deployment>
getProjectDeploymentsStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.DeploymentFilter filter)
Get a Stream of all deployments for the specified project.org.gitlab4j.api.models.Deployment
updateDeployment(java.lang.Object projectIdOrPath, java.lang.Long deploymentId, org.gitlab4j.models.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, getNamespaceIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
DeploymentsApi
public DeploymentsApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getProjectDeployments
public java.util.List<org.gitlab4j.api.models.Deployment> getProjectDeployments(java.lang.Object projectIdOrPath) throws GitLabApiException
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<org.gitlab4j.api.models.Deployment> getProjectDeployments(java.lang.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<org.gitlab4j.api.models.Deployment> getProjectDeployments(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.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<org.gitlab4j.api.models.Deployment> getProjectDeployments(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.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 java.util.stream.Stream<org.gitlab4j.api.models.Deployment> getProjectDeploymentsStream(java.lang.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 java.util.stream.Stream<org.gitlab4j.api.models.Deployment> getProjectDeploymentsStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.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 org.gitlab4j.api.models.Deployment getDeployment(java.lang.Object projectIdOrPath, java.lang.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
public java.util.Optional<org.gitlab4j.api.models.Deployment> getOptionalDeployment(java.lang.Object projectIdOrPath, java.lang.Long deploymentId)
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 org.gitlab4j.api.models.Deployment addDeployment(java.lang.Object projectIdOrPath, java.lang.String environment, java.lang.String sha, java.lang.String ref, java.lang.Boolean tag, org.gitlab4j.models.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 org.gitlab4j.api.models.Deployment updateDeployment(java.lang.Object projectIdOrPath, java.lang.Long deploymentId, org.gitlab4j.models.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 java.util.List<org.gitlab4j.api.models.MergeRequest> getMergeRequests(java.lang.Object projectIdOrPath, java.lang.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<org.gitlab4j.api.models.MergeRequest> getMergeRequests(java.lang.Object projectIdOrPath, java.lang.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 java.util.stream.Stream<org.gitlab4j.api.models.MergeRequest> getMergeRequestsStream(java.lang.Object projectIdOrPath, java.lang.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
-
-