Skip to content

API route to get a list of project services for a project

Description

Currently, the services API has routes for creating, editing, and deleting services. But there is no way to either list all available services, or to list the active services for a specific project. The problem is that the list of services cannot be programmatically retrieved. If I wanted, for whatever reason, to programatically delete all service integrations for a specific project then I would have to hard-code the list of services to run the DELETE on. This list of services can change during future Gitlab upgrades.

Proposal

  • A new API route GET /projects/:id/services to list all the active services for a project.
  • Optionally a route to get ALL services that the current version of Gitlab supports

Links / references

Documentation blurb

Overview

What is it?

  • A new API endpoint returning JSON containing service integrations for a project.

Why should someone use this feature?

  • Because there is no way to programmtically know what services a project is currently using. And there is no list of services available. With this feature, there is no need to guess or make assumptions about what services a project is using.

What is the underlying (business) problem?

  • The user would have to run a GET /projects/:id/services/:service for all services to know which ones the project is using. Furthermore, that list of services to ping is hardcoded since there is no API route to list ALL services that Gitlab supports.

How do you use this feature?

  • Make an GET request to the API at /projects/:id/services and have it return JSON containing, at minimum, a list of service integrations for the project. Perhaps also include some common meta-data (like date added?).

Use cases

Who is this for? Provide one or more use cases.

Use case: I want to load up a Gitlab backup onto a staging Gitlab server. However, I do not need webhooks and service integrations for the staging server (wouldn't want Slack alerts on pushes). So I want to delete webhooks and service integrations for all projects. With webhooks, there is an API to list all webhooks a project is using. I would want a similar API for service integrations.

Feature checklist

Make sure these are completed before closing the issue, with a link to the relevant commit.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖