diff options
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r-- | docs/api-usage.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst index edd41d0..f60c0dc 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -20,11 +20,17 @@ To connect to a GitLab server, create a ``gitlab.Gitlab`` object: import gitlab # private token authentication - gl = gitlab.Gitlab('http://10.0.0.1', 'JVNSESs8EwWRx5yDxM5q') + gl = gitlab.Gitlab('http://10.0.0.1', private_token='JVNSESs8EwWRx5yDxM5q') - # or username/password authentication + # oauth token authentication + gl = gitlab.Gitlab('http://10.0.0.1', oauth_token='my_long_token_here') + + # username/password authentication gl = gitlab.Gitlab('http://10.0.0.1', email='jdoe', password='s3cr3t') + # anonymous gitlab instance, read-only for public resources + gl = gitlab.Gitlab('http://10.0.0.1') + # make an API request to create the gl.user object. This is mandatory if you # use the username/password authentication. gl.auth() |