Package org.gitlab4j.api
Class RunnersApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.RunnersApi
- All Implemented Interfaces:
Constants
This class provides an entry point to all the GitLab API repository files calls.
-
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 TypeMethodDescriptionvoid
deleteRunner
(String token) Deletes a registered Runner.disableRunner
(Object projectIdOrPath, Long runnerId) Disable a specific runner from the project.enableRunner
(Object projectIdOrPath, Long runnerId) Enable an available specific runner in the project.Get a list of all runners in the GitLab instance (specific and shared).getAllRunners
(int itemsPerPage) Get a list of all runners in the GitLab instance (specific and shared).getAllRunners
(int page, int perPage) Get a list of all runners in the GitLab instance (specific and shared).getAllRunners
(Runner.RunnerType type, Runner.RunnerStatus status) Get a list of all runners in the GitLab instance (specific and shared).getAllRunners
(Runner.RunnerType type, Runner.RunnerStatus status, int itemsPerPage) Get a list of all runners in the GitLab instance (specific and shared).getAllRunners
(Runner.RunnerType type, Runner.RunnerStatus status, int page, int perPage) Get a list of all runners in the GitLab instance (specific and shared).Get a Stream of all runners in the GitLab instance (specific and shared).getAllRunnersStream
(Runner.RunnerType type, Runner.RunnerStatus status) Get a Stream of all runners in the GitLab instance (specific and shared).List jobs that are being processed or were processed by specified Runner.List jobs that are being processed or were processed by specified Runner.List jobs that are being processed or were processed by specified Runner.List jobs that are being processed or were processed by specified Runner.getJobsStream
(Long runnerId) Get a Stream of jobs that are being processed or were processed by specified Runner.getJobsStream
(Long runnerId, JobStatus status) Get a Stream of jobs that are being processed or were processed by specified Runner.getProjectRunners
(Object projectIdOrPath) List all runners (specific and shared) available in the project.getProjectRunners
(Object projectIdOrPath, int itemsPerPage) List all runners (specific and shared) available in the project.getProjectRunnersStream
(Object projectIdOrPath) Get a Stream all runners (specific and shared) available in the project.getRunnerDetail
(Long runnerId) Get details of a runner.Get a list of all available runners available to the user.getRunners
(int itemsPerPage) Get a list of all available runners available to the user.getRunners
(int page, int perPage) Get a list of all available runners available to the user with pagination support.getRunners
(Runner.RunnerType type, Runner.RunnerStatus status) Get a list of all available runners available to the user with pagination support.getRunners
(Runner.RunnerType type, Runner.RunnerStatus status, int itemsPerPage) Get a list of specific runners available to the user.getRunners
(Runner.RunnerType type, Runner.RunnerStatus status, int page, int perPage) Get a list of specific runners available to the user.Get a Stream of all available runners available to the user.getRunnersStream
(Runner.RunnerType type, Runner.RunnerStatus status) Get a Stream of all available runners available to the user with pagination support.registerRunner
(String token, String description, Boolean active, List<String> tagList, Boolean runUntagged, Boolean locked, Integer maximumTimeout) Register a new runner for the gitlab instance.void
removeRunner
(Long runnerId) Remove a runner.updateRunner
(Long runnerId, String description, Boolean active, List<String> tagList, Boolean runUntagged, Boolean locked, RunnerDetail.RunnerAccessLevel accessLevel) Update details of a runner.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
-
RunnersApi
-
-
Method Details
-
getRunners
Get a list of all available runners available to the user.GitLab Endpoint: GET /runners
- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunners
Get a list of all available runners available to the user with pagination support.GitLab Endpoint: GET /runners
- Parameters:
page
- The page offset of runnersperPage
- The number of runners to get after the page offset- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunners
Get a list of all available runners available to the user.GitLab Endpoint: GET /runners
- Parameters:
itemsPerPage
- the number of Runner instances that will be fetched per page- Returns:
- a Pager containing the Runners for the user
- Throws:
GitLabApiException
- if any exception occurs
-
getRunnersStream
Get a Stream of all available runners available to the user.GitLab Endpoint: GET /runners
- Returns:
- Stream of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunners
public List<Runner> getRunners(Runner.RunnerType type, Runner.RunnerStatus status) throws GitLabApiException Get a list of all available runners available to the user with pagination support.GitLab Endpoint: GET /runners
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or null- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunners
public List<Runner> getRunners(Runner.RunnerType type, Runner.RunnerStatus status, int page, int perPage) throws GitLabApiException Get a list of specific runners available to the user.GitLab Endpoint: GET /runners
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or nullpage
- the page offset of runnersperPage
- the number of runners to get after the page offset- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunners
public Pager<Runner> getRunners(Runner.RunnerType type, Runner.RunnerStatus status, int itemsPerPage) throws GitLabApiException Get a list of specific runners available to the user.GitLab Endpoint: GET /runners
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or nullitemsPerPage
- The number of Runner instances that will be fetched per page- Returns:
- a Pager containing the Runners for the user
- Throws:
GitLabApiException
- if any exception occurs
-
getRunnersStream
public Stream<Runner> getRunnersStream(Runner.RunnerType type, Runner.RunnerStatus status) throws GitLabApiException Get a Stream of all available runners available to the user with pagination support.GitLab Endpoint: GET /runners
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or null- Returns:
- Stream of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Returns:
- a List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
page
- The page offset of runnersperPage
- The number of runners to get after the page offset- Returns:
- a list of all runners in the GitLab instance
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
itemsPerPage
- The number of Runner instances that will be fetched per page- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunnersStream
Get a Stream of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Returns:
- a Stream of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
public List<Runner> getAllRunners(Runner.RunnerType type, Runner.RunnerStatus status) throws GitLabApiException Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or null- Returns:
- a List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
public List<Runner> getAllRunners(Runner.RunnerType type, Runner.RunnerStatus status, int page, int perPage) throws GitLabApiException Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or nullpage
- The page offset of runnersperPage
- The number of runners to get after the page offset- Returns:
- List of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunners
public Pager<Runner> getAllRunners(Runner.RunnerType type, Runner.RunnerStatus status, int itemsPerPage) throws GitLabApiException Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or nullitemsPerPage
- The number of Runner instances that will be fetched per page- Returns:
- a Pager containing the Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getAllRunnersStream
public Stream<Runner> getAllRunnersStream(Runner.RunnerType type, Runner.RunnerStatus status) throws GitLabApiException Get a Stream of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.GitLab Endpoint: GET /runners/all
- Parameters:
type
- the type of runners to show, one of: instance_type, group_type, project_type, or nullstatus
- the status of runners to show, one of: active, paused, online, offline, or null- Returns:
- a Stream of Runners
- Throws:
GitLabApiException
- if any exception occurs
-
getRunnerDetail
Get details of a runner.GitLab Endpoint: GET /runners/:id
- Parameters:
runnerId
- Runner id to get details for- Returns:
- RunnerDetail instance.
- Throws:
GitLabApiException
- if any exception occurs
-
updateRunner
public RunnerDetail updateRunner(Long runnerId, String description, Boolean active, List<String> tagList, Boolean runUntagged, Boolean locked, RunnerDetail.RunnerAccessLevel accessLevel) throws GitLabApiException Update details of a runner.GitLab Endpoint: PUT /runners/:id
- Parameters:
runnerId
- The ID of a runnerdescription
- The description of a runneractive
- The state of a runner; can be set to true or falsetagList
- The list of tags for a runner; put array of tags, that should be finally assigned to a runnerrunUntagged
- Flag indicating the runner can execute untagged jobslocked
- Flag indicating the runner is lockedaccessLevel
- The access_level of the runner; not_protected or ref_protected- Returns:
- RunnerDetail instance.
- Throws:
GitLabApiException
- if any exception occurs
-
removeRunner
Remove a runner.GitLab Endpoint: DELETE /runners/:id
- Parameters:
runnerId
- The ID of a runner- Throws:
GitLabApiException
- if any exception occurs
-
getJobs
List jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runner- Returns:
- List jobs that are being processed or were processed by specified Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getJobsStream
Get a Stream of jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runner- Returns:
- a Stream of jobs that are being processed or were processed by specified Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getJobs
List jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runnerstatus
- Status of the job; one of: running, success, failed, canceled- Returns:
- List jobs that are being processed or were processed by specified Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getJobsStream
Get a Stream of jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runnerstatus
- Status of the job; one of: running, success, failed, canceled- Returns:
- a Stream of jobs that are being processed or were processed by specified Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getJobs
List jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runneritemsPerPage
- The number of Runner instances that will be fetched per page- Returns:
- a Pager containing the Jobs for the Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getJobs
public Pager<Job> getJobs(Long runnerId, JobStatus status, int itemsPerPage) throws GitLabApiException List jobs that are being processed or were processed by specified Runner.GitLab Endpoint: GET /runners/:id/jobs
- Parameters:
runnerId
- The ID of a runnerstatus
- Status of the job; one of: running, success, failed, canceleditemsPerPage
- The number of Runner instances that will be fetched per page- Returns:
- a Pager containing the Jobs for the Runner
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectRunners
List all runners (specific and shared) available in the project. Shared runners are listed if at least one shared runner is defined and shared runners usage is enabled in the project's settings.GitLab Endpoint: GET /projects/:id/runners
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- List of all Runner available in the project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectRunnersStream
Get a Stream all runners (specific and shared) available in the project. Shared runners are listed if at least one shared runner is defined and shared runners usage is enabled in the project's settings.GitLab Endpoint: GET /projects/:id/runners
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of all Runner available in the project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectRunners
public Pager<Runner> getProjectRunners(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException List all runners (specific and shared) available in the project. Shared runners are listed if at least one shared runner is defined and shared runners usage is enabled in the project's settings.GitLab Endpoint: GET /projects/:id/runners
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- Pager of all Runner available in the project
- Throws:
GitLabApiException
- if any exception occurs
-
enableRunner
Enable an available specific runner in the project.GitLab Endpoint: POST /projects/:id/runners
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerunnerId
- The ID of a runner- Returns:
- Runner instance of the Runner enabled
- Throws:
GitLabApiException
- if any exception occurs
-
disableRunner
Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner. If so, an error is returned. Use theremoveRunner(Long)
instead.GitLab Endpoint: DELETE /projects/:id/runners/:runner_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancerunnerId
- The ID of a runner- Returns:
- Runner instance of the Runner disabled
- Throws:
GitLabApiException
- if any exception occurs
-
registerRunner
public RunnerDetail registerRunner(String token, String description, Boolean active, List<String> tagList, Boolean runUntagged, Boolean locked, Integer maximumTimeout) throws GitLabApiException Register a new runner for the gitlab instance.GitLab Endpoint: POST /runners/
- Parameters:
token
- the token of the project (for project specific runners) or the token from the admin pagedescription
- The description of a runneractive
- The state of a runner; can be set to true or falsetagList
- The list of tags for a runner; put array of tags, that should be finally assigned to a runnerrunUntagged
- Flag indicating the runner can execute untagged jobslocked
- Flag indicating the runner is lockedmaximumTimeout
- the maximum timeout set when this Runner will handle the job- Returns:
- RunnerDetail instance.
- Throws:
GitLabApiException
- if any exception occurs
-
deleteRunner
Deletes a registered Runner.GitLab Endpoint: DELETE /runners/
- Parameters:
token
- the runners authentication token- Throws:
GitLabApiException
- if any exception occurs
-