Skip to content
Snippets Groups Projects

API for creating remote mirrors

Merged Rajendra Kadam requested to merge raju249/gitlab:confapi-repo-push-mirror into master
1 file
+ 18
0
Compare changes
  • Side-by-side
  • Inline
+ 18
0
@@ -26,6 +26,24 @@ class RemoteMirrors < Grape::API
with: Entities::RemoteMirror
end
desc 'Create remote mirror for a project' do
success Entities::RemoteMirror
end
params do
requries :url, type: String, desc: 'The URL for a remote mirror'
end
post ':id/remote_mirrors' do
create_params = declared_params(include_missing: false)
new_mirror = user_project.remote_mirrors.create(create_params)
if new_mirror.persisted?
present new_mirror, with: Entities::RemoteMirror
else
render_validation_error!(new_mirror)
end
end
desc 'Update the attributes of a single remote mirror' do
success Entities::RemoteMirror
end
Loading