@@ -26,11 +26,11 @@ public RunnersApi(GitLabApi gitLabApi) {
26
26
* @throws GitLabApiException if any exception occurs
27
27
*/
28
28
public List <Runner > getRunners () throws GitLabApiException {
29
- return getRunners (null );
29
+ return getRunners (null , null , null );
30
30
}
31
31
32
32
/**
33
- * Get a list of specific runners available to the user.
33
+ * Get a list of all available runners available to the user with pagination support .
34
34
*
35
35
* GET /runners
36
36
*
@@ -39,8 +39,39 @@ public List<Runner> getRunners() throws GitLabApiException {
39
39
* @throws GitLabApiException if any exception occurs
40
40
*/
41
41
public List <Runner > getRunners (Runner .RunnerStatus scope ) throws GitLabApiException {
42
+ return getRunners (scope , null , null );
43
+ }
44
+
45
+ /**
46
+ * Get a list of all available runners available to the user with pagination support.
47
+ *
48
+ * GET /runners
49
+ *
50
+ * @param page The page offset of runners
51
+ * @param perPage The number of runners to get after the page offset
52
+ * @return List of Runners
53
+ * @throws GitLabApiException if any exception occurs
54
+ */
55
+ public List <Runner > getRunners (int page , int perPage ) throws GitLabApiException {
56
+ return getRunners (null , page , perPage );
57
+ }
58
+
59
+ /**
60
+ * Get a list of specific runners available to the user.
61
+ *
62
+ * GET /runners
63
+ *
64
+ * @param scope The scope of specific runners to show, one of: active, paused, online; showing all runners null
65
+ * @param page The page offset of runners
66
+ * @param perPage The number of runners to get after the page offset
67
+ * @return List of Runners
68
+ * @throws GitLabApiException if any exception occurs
69
+ */
70
+ public List <Runner > getRunners (Runner .RunnerStatus scope , Integer page , Integer perPage ) throws GitLabApiException {
42
71
GitLabApiForm formData = new GitLabApiForm ()
43
- .withParam ("scope" , scope , false );
72
+ .withParam ("scope" , scope , false )
73
+ .withParam ("page" , page , false )
74
+ .withParam ("per_page" , perPage , false );
44
75
Response response = get (Response .Status .OK , formData .asMap (), "runners" );
45
76
return (response .readEntity (new GenericType <List <Runner >>() {
46
77
}));
@@ -84,7 +115,7 @@ public Pager<Runner> getRunners(Runner.RunnerStatus scope, int itemsPerPage) thr
84
115
* @throws GitLabApiException if any exception occurs
85
116
*/
86
117
public List <Runner > getAllRunners () throws GitLabApiException {
87
- return getAllRunners (null );
118
+ return getAllRunners (null , null , null );
88
119
}
89
120
90
121
/**
@@ -97,8 +128,38 @@ public List<Runner> getAllRunners() throws GitLabApiException {
97
128
* @throws GitLabApiException if any exception occurs
98
129
*/
99
130
public List <Runner > getAllRunners (Runner .RunnerStatus scope ) throws GitLabApiException {
131
+ return getAllRunners (scope , null , null );
132
+ }
133
+
134
+ /**
135
+ * Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.
136
+ *
137
+ * GET /runners/all
138
+ *
139
+ * @param page The page offset of runners
140
+ * @param perPage The number of runners to get after the page offset * @return List of Runners
141
+ * @throws GitLabApiException if any exception occurs
142
+ */
143
+ public List <Runner > getAllRunners (int page , int perPage ) throws GitLabApiException {
144
+ return getAllRunners (null , page , perPage );
145
+ }
146
+
147
+ /**
148
+ * Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.
149
+ *
150
+ * GET /runners/all
151
+ *
152
+ * @param scope The scope of specific runners to show, one of: active, paused, online; showing all runners null
153
+ * @param page The page offset of runners
154
+ * @param perPage The number of runners to get after the page offset
155
+ * @return List of Runners
156
+ * @throws GitLabApiException if any exception occurs
157
+ */
158
+ public List <Runner > getAllRunners (Runner .RunnerStatus scope , Integer page , Integer perPage ) throws GitLabApiException {
100
159
GitLabApiForm formData = new GitLabApiForm ()
101
- .withParam ("scope" , scope , false );
160
+ .withParam ("scope" , scope , false )
161
+ .withParam ("page" , page , false )
162
+ .withParam ("per_page" , perPage , false );
102
163
Response response = get (Response .Status .OK , formData .asMap (), "runners" , "all" );
103
164
return (response .readEntity (new GenericType <List <Runner >>() {
104
165
}));
@@ -133,6 +194,7 @@ public Pager<Runner> getAllRunners(Runner.RunnerStatus scope, int itemsPerPage)
133
194
return (new Pager <>(this , Runner .class , itemsPerPage , formData .asMap (), "runners" ));
134
195
}
135
196
197
+
136
198
/**
137
199
* Get details of a runner.
138
200
*
@@ -296,7 +358,7 @@ public List<Runner> getProjectRunners(Integer projectId) throws GitLabApiExcepti
296
358
*
297
359
* GET /projects/:id/runners
298
360
*
299
- * @param projectId The ID of the project owned by the authenticated user
361
+ * @param projectId The ID of the project owned by the authenticated user
300
362
* @param itemsPerPage the number of Project instances that will be fetched per page
301
363
* @return Pager of all Runner available in the project
302
364
* @throws GitLabApiException if any exception occurs
0 commit comments