forked from python-gitlab/python-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_keys.py
More file actions
36 lines (31 loc) · 765 Bytes
/
Copy pathdeploy_keys.py
File metadata and controls
36 lines (31 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# global list
keys = gl.keys.list()
# end global list
# global get
key = gl.keys.get(key_id)
# end global key
# list
keys = gl.project_keys.list(project_id=1)
# or
keys = project.keys.list()
# end list
# get
key = gl.project_keys.get(key_id, project_id=1)
# or
key = project.keys.get(key_id)
# end get
# create
key = gl.project_keys.create({'title': 'jenkins key',
'key': open('/home/me/.ssh/id_rsa.pub').read()},
project_id=1)
# or
key = project.keys.create({'title': 'jenkins key',
'key': open('/home/me/.ssh/id_rsa.pub').read()})
# end create
# delete
key = gl.project_keys.delete(key_id, project_id=1)
# or
key = project.keys.list(key_id)
# or
key.delete()
# end delete