GitLab API

GitlabTool

Actions905

Overview

This node operation deletes review app environments for a specified project in GitLab. It is useful for cleaning up temporary review environments that are no longer needed, helping to manage resources and maintain a tidy project environment. For example, after a feature branch is merged, the corresponding review app environments can be deleted automatically.

Use Case Examples

  1. Automatically delete review app environments older than a certain date to free up resources.
  2. Limit the number of environments deleted in one operation to avoid accidental mass deletion.
  3. Perform a dry run to see which environments would be deleted without actually deleting them.

Properties

Name Meaning
Skip Authentication If 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 to use for the request, default is GET but DELETE is used for this operation.
Parameter Schema Defines the parameters for the API call including project ID, date filter, limit on number of deletions, and dry run flag.
Query Parameters Optional query parameters to filter and control the deletion operation, including 'before' date, 'limit' on number of deletions, and 'dry_run' flag to simulate deletion without actual removal.
Path Parameters Path parameters including the project ID or URL-encoded path identifying the project.

Output

JSON

  • success - Indicates if the deletion operation was successful.
  • deletedCount - Number of environments deleted (or would be deleted in dry run).
  • details - Additional details or messages from the deletion operation.

Dependencies

  • GitLab API authentication

Troubleshooting

  • Ensure the project ID is correct and accessible by the authenticated user to avoid authorization errors.
  • Check the date format for the 'before' parameter; it must be in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).
  • If no environments are deleted, verify the 'dry_run' parameter is set to false to perform actual deletion.
  • API rate limits or permission issues may cause errors; ensure the API token has sufficient permissions.

Links

Discussion