Module: Gitlab::Client::RemoteMirrors
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/remote_mirrors.rb
Overview
Defines methods related to remote mirrors.
Instance Method Summary collapse
-
#create_remote_mirror(project, url, options = {}) ⇒ Gitlab::ObjectifiedHash
Create a remote mirror.
-
#delete_remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Delete a remote mirror.
-
#edit_remote_mirror(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update a remote mirror’s attributes.
-
#remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Get a specific remote mirror.
-
#remote_mirrors(project) ⇒ Array<Gitlab::ObjectifiedHash>
List a project’s remote mirrors.
-
#sync_remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Force push mirror update.
Instance Method Details
#create_remote_mirror(project, url, options = {}) ⇒ Gitlab::ObjectifiedHash
Create a remote mirror
44 45 46 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 44 def create_remote_mirror(project, url, = {}) post("/projects/#{url_encode project}/remote_mirrors", body: .merge(url: url)) end |
#delete_remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Delete a remote mirror.
73 74 75 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 73 def delete_remote_mirror(project, id) delete("/projects/#{url_encode project}/remote_mirrors/#{id}") end |
#edit_remote_mirror(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update a remote mirror’s attributes
60 61 62 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 60 def edit_remote_mirror(project, id, = {}) put("/projects/#{url_encode project}/remote_mirrors/#{id}", body: ) end |
#remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Get a specific remote mirror.
28 29 30 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 28 def remote_mirror(project, id) get("/projects/#{url_encode project}/remote_mirrors/#{id}") end |
#remote_mirrors(project) ⇒ Array<Gitlab::ObjectifiedHash>
List a project’s remote mirrors
15 16 17 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 15 def remote_mirrors(project) get("/projects/#{url_encode project}/remote_mirrors") end |
#sync_remote_mirror(project, id) ⇒ Gitlab::ObjectifiedHash
Force push mirror update.
86 87 88 |
# File 'lib/gitlab/client/remote_mirrors.rb', line 86 def sync_remote_mirror(project, id) post("/projects/#{url_encode project}/remote_mirrors/#{id}/sync") end |