Package org.gitlab4j.api
Class ExternalStatusCheckApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.ExternalStatusCheckApi
- All Implemented Interfaces:
Constants
This class implements the client side API for the GitLab external status checks.
See External Status Checks API for more information.
-
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.ContributorOrderBy, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, 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.PackageOrderBy, Constants.PackageStatus, 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
-
Method Summary
Modifier and TypeMethodDescriptioncreateExternalStatusCheck
(Object projectIdOrPath, String name, String externalUrl, List<Long> protectedBranchIds) Creates a new external status check.createExternalStatusCheck
(Object projectIdOrPath, ExternalStatusCheck externalStatusCheck) Creates a new external status check using the information contained in the provided ExternalStatusCheck instance.void
deleteExternalStatusCheck
(Object projectIdOrPath, Long checkId) Deletes an external status check.getExternalStatusChecks
(Object projectIdOrPath) Gets a list of all external status checks for a given project.getExternalStatusChecks
(Object projectIdOrPath, int itemsPerPage) Gets a Pager of all external status checks for a given project.getExternalStatusChecksStream
(Object projectIdOrPath) Gets a Stream of all external status checks for a given project.getExternalStatusCheckStatuses
(Object projectIdOrPath, Long mergeRequestIid) Gets a list of all statuses of the external status checks for a given merge request.getExternalStatusCheckStatuses
(Object projectIdOrPath, Long mergeRequestIid, int itemsPerPage) Gets a Pager of all statuses of the external status checks for a given merge request.getExternalStatusCheckStatusesStream
(Object projectIdOrPath, Long mergeRequestIid) Gets a Stream of all statuses of the external status checks for a given merge request.void
retryExternalStatusCheck
(Object projectIdOrPath, Long mergeRequestIid, Long externalStatusCheckId) Retry the specified failed external status check for a single merge request.setStatusOfExternalStatusCheck
(Object projectIdOrPath, Long mergeRequestIid, String sha, Long externalStatusCheckId, ExternalStatusCheckStatus.Status status) Set the status of an external status check for a given merge request.updateExternalStatusCheck
(Object projectIdOrPath, Long checkId, String name, String externalUrl, List<Long> protectedBranchIds) Updates an existing external status check.updateExternalStatusCheck
(Object projectIdOrPath, ExternalStatusCheck externalStatusCheck) Updates an external status check using the information contained in the provided ExternalStatusCheck instance.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, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
Constructor Details
-
ExternalStatusCheckApi
-
-
Method Details
-
getExternalStatusChecks
public List<ExternalStatusCheck> getExternalStatusChecks(Object projectIdOrPath) throws GitLabApiException Gets a list of all external status checks for a given project.GitLab Endpoint: GET /projects/:id/external_status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a List of ExternalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
getExternalStatusChecks
public Pager<ExternalStatusCheck> getExternalStatusChecks(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException Gets a Pager of all external status checks for a given project.GitLab Endpoint: GET /projects/:id/external_status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathitemsPerPage
- the number of ExternalStatusCheck instances that will be fetched per page- Returns:
- the Pager of ExternalStatusCheck instances
- Throws:
GitLabApiException
- if any exception occurs
-
getExternalStatusChecksStream
public Stream<ExternalStatusCheck> getExternalStatusChecksStream(Object projectIdOrPath) throws GitLabApiException Gets a Stream of all external status checks for a given project.GitLab Endpoint: GET /projects/:id/external_status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Stream of ExternalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
createExternalStatusCheck
public ExternalStatusCheck createExternalStatusCheck(Object projectIdOrPath, String name, String externalUrl, List<Long> protectedBranchIds) throws GitLabApiException Creates a new external status check.GitLab Endpoint: POST /projects/:id/external_status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathname
- Display name of external status check (required)externalUrl
- URL of external status check resource (optional)protectedBranchIds
- IDs of protected branches to scope the rule by (optional)- Returns:
- an ExternalStatusCheck instance containing info on the newly created externalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
createExternalStatusCheck
public ExternalStatusCheck createExternalStatusCheck(Object projectIdOrPath, ExternalStatusCheck externalStatusCheck) throws GitLabApiException Creates a new external status check using the information contained in the provided ExternalStatusCheck instance. Only the following fields from the ExternalStatusCheck instance are used:name - Display name of external status check (required) external url - URL of external status check resource (required) protected branches - the id of the protected branches (optional)
GitLab Endpoint: POST /projects/:id/external_status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathexternalStatusCheck
- the ExternalStatusCheck instance with information for the new external status check- Returns:
- an ExternalStatusCheck instance containing info on the newly created externalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
updateExternalStatusCheck
public ExternalStatusCheck updateExternalStatusCheck(Object projectIdOrPath, Long checkId, String name, String externalUrl, List<Long> protectedBranchIds) throws GitLabApiException Updates an existing external status check.GitLab Endpoint: PUT /projects/:id/external_status_checks/:check_id
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathcheckId
- ID of an external status check to update (required)name
- Display name of external status check (optional)externalUrl
- URL of external status check resource (optional)protectedBranchIds
- IDs of protected branches to scope the rule by (optional)- Returns:
- an ExternalStatusCheck instance containing info on the newly created ExternalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
updateExternalStatusCheck
public ExternalStatusCheck updateExternalStatusCheck(Object projectIdOrPath, ExternalStatusCheck externalStatusCheck) throws GitLabApiException Updates an external status check using the information contained in the provided ExternalStatusCheck instance. Only the following fields from the ExternalStatusCheck instance are used:id - the id of the external status check (required) name - Display name of external status check (optional) external url - URL of external status check resource (optional) protected branches - the id of the protected branches (optional)
GitLab Endpoint: PUT /projects/:id/external_status_checks/:check_id
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathexternalStatusCheck
- the ExternalStatusCheck instance with update information- Returns:
- an ExternalStatusCheck instance containing info on the updated ExternalStatusCheck
- Throws:
GitLabApiException
- if any exception occurs
-
deleteExternalStatusCheck
public void deleteExternalStatusCheck(Object projectIdOrPath, Long checkId) throws GitLabApiException Deletes an external status check.GitLab Endpoint: DELETE /projects/:id/external_status_checks/:check_id
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathcheckId
- ID of an external status check- Throws:
GitLabApiException
- if any exception occurs
-
getExternalStatusCheckStatuses
public List<ExternalStatusCheckStatus> getExternalStatusCheckStatuses(Object projectIdOrPath, Long mergeRequestIid) throws GitLabApiException Gets a list of all statuses of the external status checks for a given merge request.GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the merge request IID to get the statuses- Returns:
- a List of ExternalStatusCheckStatus
- Throws:
GitLabApiException
- if any exception occurs
-
getExternalStatusCheckStatuses
public Pager<ExternalStatusCheckStatus> getExternalStatusCheckStatuses(Object projectIdOrPath, Long mergeRequestIid, int itemsPerPage) throws GitLabApiException Gets a Pager of all statuses of the external status checks for a given merge request.GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the merge request IID to get the statusesitemsPerPage
- the number of ExternalStatusCheckStatus instances that will be fetched per page- Returns:
- the Pager of ExternalStatusCheckStatus instances
- Throws:
GitLabApiException
- if any exception occurs
-
getExternalStatusCheckStatusesStream
public Stream<ExternalStatusCheckStatus> getExternalStatusCheckStatusesStream(Object projectIdOrPath, Long mergeRequestIid) throws GitLabApiException Gets a Stream of all statuses of the external status checks for a given merge request.GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the merge request IID to get the statuses- Returns:
- a Stream of ExternalStatusCheckStatus
- Throws:
GitLabApiException
- if any exception occurs
-
setStatusOfExternalStatusCheck
public ExternalStatusCheckResult setStatusOfExternalStatusCheck(Object projectIdOrPath, Long mergeRequestIid, String sha, Long externalStatusCheckId, ExternalStatusCheckStatus.Status status) throws GitLabApiException Set the status of an external status check for a given merge request.GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/status_check_responses
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the merge request IID to get the statusessha
- the commit SHA to set the status for (required)externalStatusCheckId
- ID of an external status check (required)status
- the status to set (optional)- Returns:
- an ExternalStatusCheckResult instance containing info on the newly created status
- Throws:
GitLabApiException
- if any exception occurs
-
retryExternalStatusCheck
public void retryExternalStatusCheck(Object projectIdOrPath, Long mergeRequestIid, Long externalStatusCheckId) throws GitLabApiException Retry the specified failed external status check for a single merge request. Even though the merge request hasn’t changed, this endpoint resends the current state of merge request to the defined external service.GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/status_checks/:external_status_check_id/retry
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the merge request IID to get the statusesexternalStatusCheckId
- ID of an external status check- Throws:
GitLabApiException
- if any exception occurs
-