GitLab API

GitlabTool

Actions1000

Overview

This node operation deletes a specific cluster from a project in GitLab using the GitLab API. It is useful for managing and cleaning up clusters associated with projects, especially when a cluster is no longer needed or should be removed for security or organizational reasons. For example, a DevOps engineer might use this node to automate the removal of outdated or unused Kubernetes clusters linked to GitLab projects.

Use Case Examples

  1. Deleting a cluster by specifying the project ID and cluster ID to remove the cluster from the project.
  2. Automating cluster cleanup in CI/CD pipelines by deleting clusters that are no longer in use.

Properties

Name Meaning
Skip Authentication Determines whether to skip the authentication process for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, default is GET but can be set to DELETE for this operation.
Path Parameters Parameters required in the API path to identify the project and cluster to delete, including 'id' (project ID or URL-encoded path) and 'cluster_id' (the cluster ID).

Output

JSON

  • id - The ID or URL-encoded path of the project from which the cluster was deleted.
  • cluster_id - The ID of the cluster that was deleted.
  • statusCode - The HTTP status code returned by the API indicating the result of the delete operation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and cluster ID are correct and exist in GitLab to avoid '404 Not Found' errors.
  • Check that the API key used has sufficient permissions to delete clusters in the specified project to avoid '403 Forbidden' errors.
  • Verify the base URL is correct for the GitLab instance being accessed.

Links

Discussion