File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -628,7 +628,23 @@ Reference
628
628
Examples
629
629
---------
630
630
631
- Get a service::
631
+ .. danger ::
632
+
633
+ Since GitLab 13.12, ``get() `` calls to project services return a
634
+ ``404 Not Found `` response until they have been activated the first time.
635
+
636
+ To avoid this, we recommend using `lazy=True ` to prevent making
637
+ the initial call when activating new services unless they have
638
+ previously already been activated.
639
+
640
+ Configure and enable a service for the first time::
641
+
642
+ service = project.services.get('asana', lazy=True)
643
+
644
+ service.api_key = 'randomkey'
645
+ service.save()
646
+
647
+ Get an existing service::
632
648
633
649
service = project.services.get('asana')
634
650
# display its status (enabled/disabled)
@@ -642,11 +658,6 @@ List the code names of available services (doesn't return objects)::
642
658
643
659
services = project.services.available()
644
660
645
- Configure and enable a service::
646
-
647
- service.api_key = 'randomkey'
648
- service.save()
649
-
650
661
Disable a service::
651
662
652
663
service.delete()
You can’t perform that action at this time.
0 commit comments