Class 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 interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • 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 instance
        itemsPerPage - 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 instance
        filter - 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 instance
        filter - DeploymentFilter a DeploymentFilter instance with the filter settings
        itemsPerPage - 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 instance
        filter - 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 instance
        deploymentId - 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 instance
        deploymentId - 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 instance
        environment - The name of the environment to create the deployment for, required
        sha - The SHA of the commit that is deployed, required
        ref - The name of the branch or tag that is deployed, required
        tag - A boolean that indicates if the deployed ref is a tag (true) or not (false), required
        status - 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 instance
        deploymentId - The ID of the deployment to update, required
        status - 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 instance
        deploymentId - 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 instance
        deploymentId - The ID of the deployment to update, required
        itemsPerPage - 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 instance
        deploymentId - 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