public class GitlabAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.codehaus.jackson.map.ObjectMapper |
MAPPER |
public static GitlabSession connect(String hostUrl, String username, String password) throws IOException
IOExceptionpublic GitlabAPI ignoreCertificateErrors(boolean ignoreCertificateErrors)
public GitlabHTTPRequestor retrieve()
public GitlabHTTPRequestor dispatch()
public boolean isIgnoreCertificateErrors()
public URL getAPIUrl(String tailAPIUrl) throws IOException
IOExceptionpublic URL getUrl(String tailAPIUrl) throws IOException
IOExceptionpublic GitlabGroup getGroup(Integer groupId) throws IOException
IOExceptionpublic List<GitlabGroup> getGroups() throws IOException
IOExceptionpublic List<GitlabGroupMember> getGroupMembers(GitlabGroup group) throws IOException
group - The GitLab GroupIOExceptionpublic List<GitlabGroupMember> getGroupMembers(Integer groupId) throws IOException
groupId - The id of the GitLab GroupIOExceptionpublic GitlabGroup createGroup(String name) throws IOException
name - The name of the group. The
name will also be used as the path
of the group.IOExceptionpublic GitlabGroup createGroup(String name, String path) throws IOException
name - The name of the grouppath - The path for the groupIOExceptionpublic GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess) throws IOException
name - The name of the grouppath - The path for the groupldapCn - LDAP Group Name to sync with, null otherwiseldapAccess - Access level for LDAP group members, null otherwiseIOExceptionpublic GitlabProject getProject(Integer projectId) throws IOException
IOExceptionpublic List<GitlabProject> getProjects() throws IOException
IOExceptionpublic List<GitlabProject> getAllProjects() throws IOException
IOExceptionpublic GitlabProject createProject(String name) throws IOException
name - The name of the projectIOExceptionpublic GitlabProject createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel, String importUrl) throws IOException
name - The name of the projectnamespaceId - The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description - A description for the project, null otherwiseissuesEnabled - Whether Issues should be enabled, otherwise null indicates to use GitLab defaultwallEnabled - Whether The Wall should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled - Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled - Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled - Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultpublik - Whether the project is public or private, if true same as setting visibilityLevel = 20, otherwise null indicates to use GitLab defaultvisibilityLevel - The visibility level of the project, otherwise null indicates to use GitLab defaultimportUrl - The Import URL for the project, otherwise nullIOExceptionpublic GitlabProject createUserProject(Integer userId, String name) throws IOException
userId - The id of the user to create the project forname - The name of the projectIOExceptionpublic GitlabProject createUserProject(Integer userId, String name, String description, String defaultBranch, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel) throws IOException
userId - The id of the user to create the project forname - The name of the projectdescription - A description for the project, null otherwisedefaultBranch - The default branch for the project, otherwise null indicates to use GitLab default (master)issuesEnabled - Whether Issues should be enabled, otherwise null indicates to use GitLab defaultwallEnabled - Whether The Wall should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled - Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled - Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled - Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultpublik - Whether the project is public or private, if true same as setting visibilityLevel = 20, otherwise null indicates to use GitLab defaultvisibilityLevel - The visibility level of the project, otherwise null indicates to use GitLab defaultIOExceptionpublic List<GitlabMergeRequest> getOpenMergeRequests(GitlabProject project) throws IOException
IOExceptionpublic List<GitlabMergeRequest> getMergeRequests(Integer projectId) throws IOException
IOExceptionpublic List<GitlabMergeRequest> getMergeRequests(GitlabProject project) throws IOException
IOExceptionpublic List<GitlabMergeRequest> getAllMergeRequests(GitlabProject project) throws IOException
IOExceptionpublic GitlabMergeRequest getMergeRequest(GitlabProject project, Integer mergeRequestId) throws IOException
IOExceptionpublic List<GitlabNote> getNotes(GitlabMergeRequest mergeRequest) throws IOException
IOExceptionpublic List<GitlabNote> getAllNotes(GitlabMergeRequest mergeRequest) throws IOException
IOExceptionpublic List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest) throws IOException
IOExceptionpublic GitlabNote createNote(GitlabMergeRequest mergeRequest, String body) throws IOException
IOExceptionpublic List<GitlabBranch> getBranches(GitlabProject project) throws IOException
IOExceptionpublic GitlabBranch getBranch(GitlabProject project, String branchName) throws IOException
IOExceptionpublic void protectBranch(GitlabProject project, String branchName) throws IOException
IOExceptionpublic void unprotectBranch(GitlabProject project, String branchName) throws IOException
IOExceptionpublic List<GitlabProjectHook> getProjectHooks(GitlabProject project) throws IOException
IOExceptionpublic GitlabProjectHook getProjectHook(GitlabProject project, String hookId) throws IOException
IOExceptionpublic GitlabProjectHook addProjectHook(GitlabProject project, String url) throws IOException
IOExceptionpublic GitlabProjectHook editProjectHook(GitlabProject project, String hookId, String url) throws IOException
IOExceptionpublic void deleteProjectHook(GitlabProject project, String hookId) throws IOException
IOExceptionpublic List<GitlabIssue> getIssues(GitlabProject project) throws IOException
IOExceptionpublic GitlabIssue getIssue(Integer projectId, Integer issueId) throws IOException
IOExceptionpublic GitlabIssue createIssue(int projectId, int assigneeId, int milestoneId, String labels, String description, String title) throws IOException
IOExceptionpublic GitlabIssue editIssue(int projectId, int issueId, int assigneeId, int milestoneId, String labels, String description, String title, GitlabIssue.Action action) throws IOException
IOExceptionpublic List<GitlabNote> getNotes(GitlabIssue issue) throws IOException
IOExceptionpublic GitlabNote createNote(Integer projectId, Integer issueId, String message) throws IOException
IOExceptionpublic GitlabNote createNote(GitlabIssue issue, String message) throws IOException
IOExceptionpublic List<GitlabMilestone> getMilestones(GitlabProject project) throws IOException
IOExceptionpublic List<GitlabMilestone> getMilestones(Integer projectId) throws IOException
IOExceptionpublic List<GitlabProjectMember> getProjectMembers(GitlabProject project) throws IOException
IOExceptionpublic List<GitlabProjectMember> getProjectMembers(Integer projectId) throws IOException
IOExceptionpublic List<GitlabProjectMember> getNamespaceMembers(GitlabNamespace namespace) throws IOException
namespace - IOExceptionpublic List<GitlabProjectMember> getNamespaceMembers(Integer namespaceId) throws IOException
namespaceId - IOExceptionpublic GitlabSession getCurrentSession() throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.