Skip to content

Commit

Permalink
docs(projects): document 404 gotcha with unactivated integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Jun 25, 2022
1 parent 194b6be commit 522ecff
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions docs/gl_objects/projects.rst
Expand Up @@ -628,7 +628,23 @@ Reference
Examples
---------

Get a service::
.. danger::

Since GitLab 13.12, ``get()`` calls to project services return a
``404 Not Found`` response until they have been activated the first time.

To avoid this, we recommend using `lazy=True` to prevent making
the initial call when activating new services unless they have
previously already been activated.

Configure and enable a service for the first time::

service = project.services.get('asana', lazy=True)

service.api_key = 'randomkey'
service.save()

Get an existing service::

service = project.services.get('asana')
# display its status (enabled/disabled)
Expand All @@ -642,11 +658,6 @@ List the code names of available services (doesn't return objects)::

services = project.services.available()

Configure and enable a service::

service.api_key = 'randomkey'
service.save()

Disable a service::

service.delete()
Expand Down

0 comments on commit 522ecff

Please sign in to comment.