| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,5 +15,15 @@ Changes from 0.19 to 0.20 | |||
| 15 | 15 | ||
| 16 | 16 | group.projects.list() | |
| 17 | 17 | ||
| 18 | - Documentation for ``Group`` objects: | ||
| 18 | + Documentation: | ||
| 19 | 19 | http://python-gitlab.readthedocs.io/en/stable/gl_objects/groups.html#examples | |
| 20 | + | ||
| 21 | + Related issue: https://github.com/gpocentek/python-gitlab/issues/209 | ||
| 22 | + | ||
| 23 | + * The ``Key`` objects are deprecated in favor of the new ``DeployKey`` objects. | ||
| 24 | + They are exactly the same but the name makes more sense. | ||
| 25 | + | ||
| 26 | + Documentation: | ||
| 27 | + http://python-gitlab.readthedocs.io/en/stable/gl_objects/deploy_keys.html | ||
| 28 | + | ||
| 29 | + Related issue: https://github.com/gpocentek/python-gitlab/issues/212 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | 1 | # global list | |
| 2 | - keys = gl.keys.list() | ||
| 2 | + keys = gl.deploykeys.list() | ||
| 3 | 3 | # end global list | |
| 4 | 4 | ||
| 5 | 5 | # global get | |
| 6 | - key = gl.keys.get(key_id) | ||
| 6 | + key = gl.deploykeys.get(key_id) | ||
| 7 | 7 | # end global get | |
| 8 | 8 | ||
| 9 | 9 | # list | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,10 @@ Deploy keys | |||
| 5 | 5 | Deploy keys | |
| 6 | 6 | =========== | |
| 7 | 7 | ||
| 8 | - Use :class:`~gitlab.objects.Key` objects to manipulate deploy keys. The | ||
| 9 | - :attr:`gitlab.Gitlab.keys` manager object provides helper functions. | ||
| 8 | + Deploy keys allow read-only access to multiple projects with a single SSH key. | ||
| 9 | + | ||
| 10 | + * Object class: :class:`~gitlab.objects.DeployKey` | ||
| 11 | + * Manager object: :attr:`gitlab.Gitlab.deploykeys` | ||
| 10 | 12 | ||
| 11 | 13 | Examples | |
| 12 | 14 | -------- | |
@@ -26,9 +28,11 @@ Get a single deploy key: | |||
| 26 | 28 | Deploy keys for projects | |
| 27 | 29 | ======================== | |
| 28 | 30 | ||
| 29 | - Use :class:`~gitlab.objects.ProjectKey` objects to manipulate deploy keys for | ||
| 30 | - projects. The :attr:`gitlab.Gitlab.project_keys` and :attr:`Project.keys | ||
| 31 | - <gitlab.objects.Project.keys>` manager objects provide helper functions. | ||
| 31 | + Deploy keys can be managed on a per-project basis. | ||
| 32 | + | ||
| 33 | + * Object class: :class:`~gitlab.objects.ProjectKey` | ||
| 34 | + * Manager objects: :attr:`gitlab.Gitlab.project_keys` and :attr:`Project.keys | ||
| 35 | + <gitlab.objects.Project.keys>` | ||
| 32 | 36 | ||
| 33 | 37 | Examples | |
| 34 | 38 | -------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,6 +91,7 @@ def __init__(self, url, private_token=None, email=None, password=None, | |||
| 91 | 91 | ||
| 92 | 92 | self.broadcastmessages = BroadcastMessageManager(self) | |
| 93 | 93 | self.keys = KeyManager(self) | |
| 94 | + self.deploykeys = DeployKeyManager(self) | ||
| 94 | 95 | self.gitlabciymls = GitlabciymlManager(self) | |
| 95 | 96 | self.gitignores = GitignoreManager(self) | |
| 96 | 97 | self.groups = GroupManager(self) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -802,11 +802,28 @@ class Key(GitlabObject): | |||
| 802 | 802 | canUpdate = False | |
| 803 | 803 | canDelete = False | |
| 804 | 804 | ||
| 805 | + def __init__(self, *args, **kwargs): | ||
| 806 | + warnings.warn("`Key` is deprecated, use `DeployKey` instead", | ||
| 807 | + DeprecationWarning) | ||
| 808 | + super(Key, self).__init__(*args, **kwargs) | ||
| 809 | + | ||
| 805 | 810 | ||
| 806 | 811 | class KeyManager(BaseManager): | |
| 807 | 812 | obj_cls = Key | |
| 808 | 813 | ||
| 809 | 814 | ||
| 815 | + class DeployKey(GitlabObject): | ||
| 816 | + _url = '/deploy_keys' | ||
| 817 | + canGet = 'from_list' | ||
| 818 | + canCreate = False | ||
| 819 | + canUpdate = False | ||
| 820 | + canDelete = False | ||
| 821 | + | ||
| 822 | + | ||
| 823 | + class DeployKeyManager(BaseManager): | ||
| 824 | + obj_cls = DeployKey | ||
| 825 | + | ||
| 826 | + | ||
| 810 | 827 | class NotificationSettings(GitlabObject): | |
| 811 | 828 | _url = '/notification_settings' | |
| 812 | 829 | _id_in_update_url = False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments