You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gl_objects/job_token_scope.rst
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,9 +67,18 @@ Remove a project from the project's inbound allowlist::
67
67
.. warning::
68
68
69
69
Similar to above, the ID attributes you receive from the create and list
70
-
APIs are not consistent. To safely retrieve the ID of the allowlisted project
70
+
APIs are not consistent (in create() the id is returned as ``source_project_id`` whereas list() returns as ``id``). To safely retrieve the ID of the allowlisted project
71
71
regardless of how the object was created, always use its ``.get_id()`` method.
72
72
73
+
Using ``.get_id()``::
74
+
75
+
resp = allowlist.create({"target_project_id": 2})
76
+
allowlist_id = resp.get_id()
77
+
78
+
allowlists = project.allowlist.list()
79
+
for allowlist in allowlists:
80
+
allowlist_id == allowlist.get_id()
81
+
73
82
Get a project's CI/CD job token inbound groups allowlist::
0 commit comments