summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2020-04-07 00:55:33 +0200
committerNejc Habjan <hab.nejc@gmail.com>2020-04-07 00:55:33 +0200
commit4cfaa2fd44b64459f6fc268a91d4469284c0e768 (patch)
treec89e1641af92580c6e7435dd3847b58e7b9ce19e /docs
parentc161852b5a976d11f682c5af00ff3f4e8daa26ef (diff)
downloadgitlab-4cfaa2fd44b64459f6fc268a91d4469284c0e768.tar.gz
feat(api): add support for remote mirrors API (#1056)feat/project-remote-mirrors
Diffstat (limited to 'docs')
-rw-r--r--docs/api-objects.rst1
-rw-r--r--docs/gl_objects/remote_mirrors.rst34
2 files changed, 35 insertions, 0 deletions
diff --git a/docs/api-objects.rst b/docs/api-objects.rst
index 32f0d0c..32852f8 100644
--- a/docs/api-objects.rst
+++ b/docs/api-objects.rst
@@ -37,6 +37,7 @@ API examples
gl_objects/projects
gl_objects/protected_branches
gl_objects/runners
+ gl_objects/remote_mirrors
gl_objects/repositories
gl_objects/repository_tags
gl_objects/search
diff --git a/docs/gl_objects/remote_mirrors.rst b/docs/gl_objects/remote_mirrors.rst
new file mode 100644
index 0000000..ea4f72c
--- /dev/null
+++ b/docs/gl_objects/remote_mirrors.rst
@@ -0,0 +1,34 @@
+##########
+Project Remote Mirrors
+##########
+
+Remote Mirrors allow you to set up push mirroring for a project.
+
+References
+==========
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.ProjectRemoteMirror`
+ + :class:`gitlab.v4.objects.ProjectRemoteMirrorManager`
+ + :attr:`gitlab.v4.objects.Project.remote_mirrors`
+
+* GitLab API: https://docs.gitlab.com/ce/api/remote_mirrors.html
+
+Examples
+--------
+
+Get the list of a project's remote mirrors::
+
+ mirrors = project.remote_mirrors.list()
+
+Create (and enable) a remote mirror for a project::
+
+ mirror = project.wikis.create({'url': 'https://gitlab.com/example.git',
+ 'enabled': True})
+
+Update an existing remote mirror's attributes::
+
+ mirror.enabled = False
+ mirror.only_protected_branches = True
+ mirror.save()