Contents Menu Expand Light mode Dark mode Auto light/dark mode
python-gitlab v4.2.0
python-gitlab v4.2.0

Table of Contents

  • Getting started with the CLI
  • Getting started with the API
  • Advanced usage
  • CLI examples
  • API examples
    • Access requests
    • Appearance
    • Applications
    • Award Emojis
    • Badges
    • Branches
    • Migrations (Bulk Imports)
    • Broadcast messages
    • CI Lint
    • Commits
    • Deploy keys
    • Deploy tokens
    • Deployments
    • Discussions
    • Draft Notes
    • Environments
    • Events
    • Epics
    • Features flags
    • Geo nodes
    • Groups
    • Group Access Tokens
    • Invitations
    • Issues
    • Iterations
    • CI/CD job token scope
    • Keys
    • Issue boards
    • Labels
    • Notification settings
    • Merge Trains
    • Merge requests
    • Merge request approvals settings
    • Milestones
    • Namespaces
    • Notes
    • Packages
    • Pages domains
    • Personal Access Tokens
    • Pipelines and Jobs
    • Projects
    • Project Access Tokens
    • Protected branches
    • Protected environments
    • Releases
    • Runners
    • Project Remote Mirrors
    • Registry Repositories
    • Registry Repository Tags
    • Resource Groups
    • Search API
    • Secure Files
    • Settings
    • Snippets
    • Statistics
    • System hooks
    • Templates
    • Todos
    • Topics
    • Users and current user
    • CI/CD Variables
    • Sidekiq metrics
    • Wiki pages
    • Clusters (DEPRECATED)
  • API reference (gitlab package)
    • gitlab.v4 package
  • CLI reference (gitlab command)
  • Lower-level APIs
  • CHANGELOG
  • Release notes
  • FAQ
  v: latest
Versions
master
latest
stable
v4.2.0
v4.1.1
v4.1.0
v4.0.0
v3.15.0
v3.14.0
v3.13.0
v3.12.0
v3.11.0
v3.10.0
v3.9.0
v3.8.1
v3.8.0
v3.7.0
v3.6.0
v3.5.0
v3.4.0
v3.3.0
v3.2.0
v3.1.1
v3.1.0
v3.0.0
v2.10.1
v2.10.0
v2.9.0
v2.8.0
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.2
v2.1.1
v2.1.0
v2.0.1
v2.0.0
v1.15.0
v1.14.0
v1.13.0
v1.12.1
v1.12.0
v1.11.0
v1.10.0
main
Downloads
pdf
epub
On Read the Docs
Project Home
Builds
Back to top
Edit this page

Keys#

Keys#

Reference#

  • v4 API

    • gitlab.v4.objects.Key

    • gitlab.v4.objects.KeyManager

    • gitlab.Gitlab.keys

  • GitLab API: https://docs.gitlab.com/ce/api/keys.html

Examples#

Get an ssh key by its id (requires admin access):

key = gl.keys.get(key_id)

Get an ssh key (requires admin access) or a deploy key by its fingerprint:

key = gl.keys.get(fingerprint="SHA256:ERJJ/OweAM6jA8OjJ/gXs4N5fqUaREEJnz/EyfywfXY")
Next
Issue boards
Previous
CI/CD job token scope
Copyright © Copyright 2013-2019 Gauvain Pocentek, 2019-2023 python-gitlab team
Made with Sphinx and @pradyunsg's Furo
On this page
  • Keys
    • Keys
      • Reference
      • Examples