GitLab API icon

GitLab API

Gitlab

Actions917

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 project snippet when it is no longer needed to keep the project repository clean.
  2. Integrate with a workflow that manages project snippets by removing snippets based on certain conditions or triggers.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using 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, which is DELETE for this operation.
Path Parameters The path parameters required for the API call, including the project ID or URL-encoded path and the snippet ID 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, typically empty on success.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and snippet ID are correct and exist in the GitLab instance to avoid 404 errors.
  • Verify that the authentication credentials have sufficient permissions to delete project snippets to avoid authorization errors.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the API endpoint is reachable.

Links

Discussion