public class GitLabAPICommits extends Object
http://doc.gitlab.com/ce/api/commits.html
| Constructor and Description |
|---|
GitLabAPICommits(GitLabAPI gitLabAPI) |
| Modifier and Type | Method and Description |
|---|---|
Paged<GitLabCommit> |
getAllCommits(Serializable projectId,
Pagination pagination)
List repository commits
|
GitLabCommit |
getCommit(Serializable projectId,
String commitHash)
Get a single commit
|
Paged<GitLabCommitComments> |
getCommitComments(Serializable projectId,
String commitHash,
Pagination pagination)
Get the comments of a commit
|
Paged<GitLabCommitDiff> |
getCommitDiffs(Serializable projectId,
String commitHash,
Pagination pagination)
Get the diff of a commit
|
Paged<GitLabCommitStatus> |
getCommitStatuses(Serializable projectId,
String commitHash,
Pagination pagination)
Get the status of a commit
|
GitLabCommitComments |
postCommitComments(Serializable projectId,
String commitHash,
String note,
String path,
Integer line,
String lineType)
Post comment to commit
|
GitLabCommitStatus |
postCommitStatus(Serializable projectId,
String commitHash,
String state,
String ref,
String name,
String targetUrl,
String description)
Post the status to commit
|
public GitLabAPICommits(GitLabAPI gitLabAPI)
public Paged<GitLabCommit> getAllCommits(Serializable projectId, Pagination pagination) throws IOException
Get a list of repository commits in a project.
GET /projects/:id/repository/commits
projectId - (required) - The ID of a projectpagination - (optional) - number of projects to return per pageIOExceptionpublic GitLabCommit getCommit(Serializable projectId, String commitHash) throws IOException
Get a specific commit identified by the commit hash or name of a branch or tag.
GET /projects/:id/repository/commits/:sha
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHAIOExceptionpublic Paged<GitLabCommitDiff> getCommitDiffs(Serializable projectId, String commitHash, Pagination pagination) throws IOException
Get the diff of a commit in a project.
GET /projects/:id/repository/commits/:sha/diff
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHApagination - (optional) - number of projects to return per pageIOExceptionpublic Paged<GitLabCommitComments> getCommitComments(Serializable projectId, String commitHash, Pagination pagination) throws IOException
Get the comments of a commit in a project.
GET /projects/:id/repository/commits/:sha/comments
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHApagination - (optional) - number of projects to return per pageIOExceptionpublic GitLabCommitComments postCommitComments(Serializable projectId, String commitHash, String note, String path, Integer line, String lineType) throws IOException
Adds a comment to a commit. Optionally you can post comments on a specific line of a commit. Therefor both path, line_new and line_old are required.
POST /projects/:id/repository/commits/:sha/comments
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHAnote - (required) - Text of commentpath - (optional) - The file pathline - (optional) - The line numberlineType - (optional) - The line type (new or old)IOExceptionpublic Paged<GitLabCommitStatus> getCommitStatuses(Serializable projectId, String commitHash, Pagination pagination) throws IOException
Get the statuses of a commit in a project.
GET /projects/:id/repository/commits/:sha/statuses
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHApagination - (optional) - number of projects to return per pageIOExceptionpublic GitLabCommitStatus postCommitStatus(Serializable projectId, String commitHash, String state, String ref, String name, String targetUrl, String description) throws IOException
Adds or updates a status of a commit.
POST /projects/:id/statuses/:sha
projectId - (required) - The ID of a projectcommitHash - (required) - The commit SHAstate - (required) - The state of the status. Can be: pending, running, success, failed, canceledref - (optional) - The ref (branch or tag) to which the status refersname - (optional) - The label to differentiate this status from the status of other systems. Default: "default"targetUrl - (optional) - The target URL to associate with this statusdescription - (optional) - The short description of the statusIOExceptionCopyright © 2018 Talanlabs. All rights reserved.