Skip to content

Commit f2b94a7

Browse files
author
Gauvain Pocentek
committed
Add v4 support to docs
1 parent 627a6aa commit f2b94a7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/api-usage.rst

+14
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ You can also use configuration files to create ``gitlab.Gitlab`` objects:
4040
See the :ref:`cli_configuration` section for more information about
4141
configuration files.
4242

43+
**GitLab v4 support**
44+
45+
``python-gitlab`` uses the v3 GitLab API by default. Use the ``api_version``
46+
parameter to switch to v4:
47+
48+
.. code-block:: python
49+
50+
import gitlab
51+
52+
gl = gitlab.Gitlab('http://10.0.0.1', 'JVNSESs8EwWRx5yDxM5q', api_version=4)
53+
54+
.. warning::
55+
56+
The v4 support is experimental.
4357

4458
Managers
4559
========

docs/cli.rst

+4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ The configuration file uses the ``INI`` format. It contains at least a
3636
default = somewhere
3737
ssl_verify = true
3838
timeout = 5
39+
api_version = 3
3940
4041
[somewhere]
4142
url = https://some.whe.re
4243
private_token = vTbFeqJYCY3sibBP7BZM
44+
api_version = 4
4345
4446
[elsewhere]
4547
url = http://else.whe.re:8080
@@ -78,6 +80,8 @@ section.
7880
- URL for the GitLab server
7981
* - ``private_token``
8082
- Your user token. Login/password is not supported.
83+
* - ``api_version``
84+
- API version to use (``3`` or ``4``), defaults to ``3``
8185
* - ``http_username``
8286
- Username for optional HTTP authentication
8387
* - ``http_password``

0 commit comments

Comments
 (0)