GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-gitlab/docs/gl_objects/badges.rst at main · python-gitlab/python-gitlab

Expand file tree

/

badges.rst

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
53 lines (34 loc) · 1.06 KB
/

badges.rst

Copy path

File metadata and controls

53 lines (34 loc) · 1.06 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Badges

Badges can be associated with groups and projects.

Reference

  • v4 API:
    • :class:`gitlab.v4.objects.GroupBadge`
    • :class:`gitlab.v4.objects.GroupBadgeManager`
    • :attr:`gitlab.v4.objects.Group.badges`
    • :class:`gitlab.v4.objects.ProjectBadge`
    • :class:`gitlab.v4.objects.ProjectBadgeManager`
    • :attr:`gitlab.v4.objects.Project.badges`
  • GitLab API:
    • https://docs.gitlab.com/api/group_badges
    • https://docs.gitlab.com/api/project_badges

Examples

List badges:

badges = group_or_project.badges.list(get_all=True)

Get a badge:

badge = group_or_project.badges.get(badge_id)

Create a badge:

badge = group_or_project.badges.create({'link_url': link, 'image_url': image_link})

Update a badge:

badge.image_url = new_image_url
badge.link_url = new_link_url
badge.save()

Delete a badge:

badge.delete()

Render a badge (preview the generate URLs):

output = group_or_project.badges.render(link, image_link)
print(output['rendered_link_url'])
print(output['rendered_image_url'])
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.