Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
70aa10df
Commit
70aa10df
authored
Oct 31, 2023
by
Jeremie Bresson
Browse files
Merge remote-tracking branch 'origin/main' into 6.x
parents
4d237225
76468762
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/JobApi.java
View file @
70aa10df
...
@@ -205,8 +205,27 @@ public class JobApi extends AbstractApi implements Constants {
...
@@ -205,8 +205,27 @@ public class JobApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs during execution
* @throws GitLabApiException if any exception occurs during execution
*/
*/
public
Pager
<
Job
>
getJobsForPipeline
(
Object
projectIdOrPath
,
long
pipelineId
,
int
itemsPerPage
)
throws
GitLabApiException
{
public
Pager
<
Job
>
getJobsForPipeline
(
Object
projectIdOrPath
,
long
pipelineId
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Job
>(
this
,
Job
.
class
,
itemsPerPage
,
getDefaultPerPageParam
(),
return
getJobsForPipeline
(
projectIdOrPath
,
pipelineId
,
itemsPerPage
,
null
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"pipelines"
,
pipelineId
,
"jobs"
));
}
/**
* Get a Pager of jobs in a pipeline.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
* @param pipelineId the pipeline ID to get the list of jobs for
* @param itemsPerPage the number of Job instances that will be fetched per page
* @param includeRetried Include retried jobs in the response
* @return a list containing the jobs for the specified project ID and pipeline ID
* @throws GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Job
>
getJobsForPipeline
(
Object
projectIdOrPath
,
long
pipelineId
,
int
itemsPerPage
,
Boolean
includeRetried
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"include_retried"
,
includeRetried
)
.
withParam
(
PER_PAGE_PARAM
,
getDefaultPerPage
());
return
(
new
Pager
<
Job
>(
this
,
Job
.
class
,
itemsPerPage
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"pipelines"
,
pipelineId
,
"jobs"
));
}
}
/**
/**
...
@@ -222,6 +241,20 @@ public class JobApi extends AbstractApi implements Constants {
...
@@ -222,6 +241,20 @@ public class JobApi extends AbstractApi implements Constants {
return
(
getJobsForPipeline
(
projectIdOrPath
,
pipelineId
,
getDefaultPerPage
()).
stream
());
return
(
getJobsForPipeline
(
projectIdOrPath
,
pipelineId
,
getDefaultPerPage
()).
stream
());
}
}
/**
* Get a Stream of jobs in a pipeline.
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param pipelineId the pipeline ID to get the list of jobs for
* @param includeRetried Include retried jobs in the response
* @return a Stream containing the jobs for the specified project ID
* @throws GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Job
>
getJobsStream
(
Object
projectIdOrPath
,
long
pipelineId
,
Boolean
includeRetried
)
throws
GitLabApiException
{
return
(
getJobsForPipeline
(
projectIdOrPath
,
pipelineId
,
getDefaultPerPage
(),
includeRetried
).
stream
());
}
/**
/**
* Get single job in a project.
* Get single job in a project.
*
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment