A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://python-gitlab.readthedocs.org/en/stable/gl_objects/deploy_keys.html below:

Deploy keys - python-gitlab v6.2.0

Back to top

Toggle table of contents sidebar

Deploy keys Deploy keys Reference Examples

Add an instance-wide deploy key (requires admin access):

keys = gl.deploykeys.create({'title': 'instance key', 'key': INSTANCE_KEY})

List all deploy keys:

keys = gl.deploykeys.list(get_all=True)
Deploy keys for projects

Deploy keys can be managed on a per-project basis.

Reference Examples

List keys for a project:

keys = project.keys.list(get_all=True)

Get a single deploy key:

key = project.keys.get(key_id)

Create a deploy key for a project:

key = project.keys.create({'title': 'jenkins key',
                           'key': open('/home/me/.ssh/id_rsa.pub').read()})

Delete a deploy key for a project:

key = project.keys.list(key_id, get_all=True)
# or
key.delete()

Enable a deploy key for a project:

project.keys.enable(key_id)

Disable a deploy key for a project:

project.keys.delete(key_id)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4