GitLab API

GitlabTool

Actions905

Overview

This node operation deletes a specific cluster agent token from a GitLab project. It is useful for managing and revoking access tokens associated with cluster agents in GitLab projects, enhancing security by allowing users to remove tokens that are no longer needed or compromised. For example, a DevOps engineer can automate the removal of expired or unused cluster agent tokens to maintain secure access control.

Use Case Examples

  1. Deleting a cluster agent token by specifying the project ID, agent ID, and token ID to revoke access for that token.
  2. Automating token cleanup in CI/CD pipelines to ensure only active tokens are valid.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method for the request, default is GET but DELETE is used for this operation.
Path Parameters Parameters required in the request path to identify the project, cluster agent, and token to delete.

Output

JSON

  • success - Indicates if the token deletion was successful
  • statusCode - HTTP status code returned by the API
  • message - Additional message or error details from the API response

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID, agent ID, and token ID are correct and exist in GitLab.
  • Verify that the API key used has sufficient permissions to delete cluster agent tokens.
  • Check network connectivity and the base URL configuration if requests fail.
  • Common error: 404 Not Found - The specified project, agent, or token does not exist.
  • Common error: 401 Unauthorized - Authentication failed or API key is invalid.

Links

Discussion