Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7b643c02
Commit
7b643c02
authored
Nov 21, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify output
parent
b7ed102e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
lib/api/entities.rb
lib/api/entities.rb
+7
-4
lib/api/runners.rb
lib/api/runners.rb
+2
-2
No files found.
lib/api/entities.rb
View file @
7b643c02
...
@@ -832,18 +832,21 @@ module API
...
@@ -832,18 +832,21 @@ module API
expose
:id
,
:sha
,
:ref
,
:status
expose
:id
,
:sha
,
:ref
,
:status
end
end
class
Job
<
Grape
::
Entity
class
Job
Basic
<
Grape
::
Entity
expose
:id
,
:status
,
:stage
,
:name
,
:ref
,
:tag
,
:coverage
expose
:id
,
:status
,
:stage
,
:name
,
:ref
,
:tag
,
:coverage
expose
:created_at
,
:started_at
,
:finished_at
expose
:created_at
,
:started_at
,
:finished_at
expose
:duration
expose
:duration
expose
:user
,
with:
User
expose
:user
,
with:
User
expose
:artifacts_file
,
using:
JobArtifactFile
,
if:
->
(
job
,
opts
)
{
job
.
artifacts?
}
expose
:commit
,
with:
Commit
expose
:commit
,
with:
Commit
expose
:runner
,
with:
Runner
expose
:pipeline
,
with:
PipelineBasic
expose
:pipeline
,
with:
PipelineBasic
end
end
class
JobWithProject
<
Job
class
Job
<
JobBasic
expose
:artifacts_file
,
using:
JobArtifactFile
,
if:
->
(
job
,
opts
)
{
job
.
artifacts?
}
expose
:runner
,
with:
Runner
end
class
JobBasicWithProject
<
JobBasic
expose
:project
,
with:
ProjectIdentity
expose
:project
,
with:
ProjectIdentity
end
end
...
...
lib/api/runners.rb
View file @
7b643c02
...
@@ -86,7 +86,7 @@ module API
...
@@ -86,7 +86,7 @@ module API
end
end
desc
'List jobs running on a runner'
do
desc
'List jobs running on a runner'
do
success
Entities
::
JobWithProject
success
Entities
::
Job
Basic
WithProject
end
end
params
do
params
do
requires
:id
,
type:
Integer
,
desc:
'The ID of the runner'
requires
:id
,
type:
Integer
,
desc:
'The ID of the runner'
...
@@ -103,7 +103,7 @@ module API
...
@@ -103,7 +103,7 @@ module API
jobs
=
jobs
.
where
(
status:
params
[
:status
].
to_sym
)
jobs
=
jobs
.
where
(
status:
params
[
:status
].
to_sym
)
end
end
present
paginate
(
jobs
),
with:
Entities
::
JobWithProject
present
paginate
(
jobs
),
with:
Entities
::
Job
Basic
WithProject
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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