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
b17c8d67
Commit
b17c8d67
authored
May 27, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use PipelineScheduleDetails
parent
c91292b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
lib/api/entities.rb
lib/api/entities.rb
+4
-1
lib/api/pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+10
-10
No files found.
lib/api/entities.rb
View file @
b17c8d67
...
...
@@ -690,10 +690,13 @@ module API
expose
:id
expose
:description
,
:ref
,
:cron
,
:cron_timezone
,
:next_run_at
,
:active
expose
:created_at
,
:updated_at
expose
:last_pipeline
,
using:
Entities
::
PipelineBasic
,
if:
{
type: :full
}
expose
:owner
,
using:
Entities
::
UserBasic
end
class
PipelineScheduleDetails
<
PipelineSchedule
expose
:last_pipeline
,
using:
Entities
::
PipelineBasic
end
class
EnvironmentBasic
<
Grape
::
Entity
expose
:id
,
:name
,
:slug
,
:external_url
end
...
...
lib/api/pipeline_schedules.rb
View file @
b17c8d67
...
...
@@ -21,7 +21,7 @@ module API
end
desc
'Get a single pipeline schedule'
do
success
Entities
::
PipelineSchedule
success
Entities
::
PipelineSchedule
Details
end
params
do
requires
:pipeline_schedule_id
,
type:
Integer
,
desc:
'The pipeline schedule id'
...
...
@@ -31,11 +31,11 @@ module API
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
Details
end
desc
'Create a new pipeline schedule'
do
success
Entities
::
PipelineSchedule
success
Entities
::
PipelineSchedule
Details
end
params
do
requires
:description
,
type:
String
,
desc:
'The description of pipeline schedule'
...
...
@@ -52,14 +52,14 @@ module API
.
execute
if
pipeline_schedule
.
persisted?
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
Details
else
render_validation_error!
(
pipeline_schedule
)
end
end
desc
'Edit a pipeline schedule'
do
success
Entities
::
PipelineSchedule
success
Entities
::
PipelineSchedule
Details
end
params
do
requires
:pipeline_schedule_id
,
type:
Integer
,
desc:
'The pipeline schedule id'
...
...
@@ -75,14 +75,14 @@ module API
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
update
(
declared_params
(
include_missing:
false
))
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
Details
else
render_validation_error!
(
pipeline_schedule
)
end
end
desc
'Take ownership of a pipeline schedule'
do
success
Entities
::
PipelineSchedule
success
Entities
::
PipelineSchedule
Details
end
params
do
requires
:pipeline_schedule_id
,
type:
Integer
,
desc:
'The pipeline schedule id'
...
...
@@ -93,14 +93,14 @@ module API
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
own!
(
current_user
)
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
Details
else
render_validation_error!
(
pipeline_schedule
)
end
end
desc
'Delete a pipeline schedule'
do
success
Entities
::
PipelineSchedule
success
Entities
::
PipelineSchedule
Details
end
params
do
requires
:pipeline_schedule_id
,
type:
Integer
,
desc:
'The pipeline schedule id'
...
...
@@ -110,7 +110,7 @@ module API
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
present
pipeline_schedule
.
destroy
,
with:
Entities
::
PipelineSchedule
,
type: :full
present
pipeline_schedule
.
destroy
,
with:
Entities
::
PipelineSchedule
Details
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