GitLab API

GitlabTool

Actions905

Overview

This node operation deletes a specific project snippet in GitLab by making a DELETE request to the GitLab API endpoint `/api/v4/projects/{id}/snippets/{snippet_id}`. It is useful for automating the removal of code snippets associated with a project, for example, cleaning up outdated or unnecessary snippets programmatically.

Use Case Examples

  1. Automatically delete a snippet from a project when it is no longer needed.
  2. Integrate snippet deletion into a CI/CD pipeline to manage project resources.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip authentication for the request.
Authentication The authentication method used for the request, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, defaulting to DELETE for this operation.
Path Parameters Parameters required in the URL path to identify the project and snippet to delete.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • body - Response body from the GitLab API after attempting to delete the snippet.

Dependencies

  • GitLab API credentials for authentication

Troubleshooting

  • Ensure the project ID and snippet ID are correct and exist in GitLab to avoid 404 errors.
  • Check that the API token used has sufficient permissions to delete project snippets to avoid 403 Forbidden errors.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated DELETE requests, which is uncommon.

Links

Discussion