GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the clusters associated with a specific project in GitLab using the GitLab API v4. It is useful for scenarios where you need to manage or monitor Kubernetes clusters linked to a GitLab project, such as fetching cluster details for deployment or integration purposes.

Use Case Examples

  1. Fetch all clusters for a project with ID '123' to display their status in a dashboard.
  2. Retrieve clusters with pagination to handle large sets of clusters efficiently.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication 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 requests are sent.
Method The HTTP method used for the API request, defaulting to GET.
Query Parameters Optional query parameters for pagination, including 'page' for the current page number and 'per_page' for the number of items per page.
Path Parameters Path parameter 'id' representing the ID or URL-encoded path of the project whose clusters are being retrieved.

Output

JSON

  • clusters - Array of cluster objects associated with the specified project.
  • pagination
    • page - Current page number of the results.
    • per_page - Number of items per page in the results.
    • total - Total number of clusters available.

Dependencies

  • GitLab API key credential for authentication unless skipping authentication.

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • If skipping authentication, verify that the GitLab instance allows unauthenticated access to the clusters endpoint.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid project ID), and 400 Bad Request (invalid query parameters). Resolving these involves verifying credentials, project ID, and query parameters.

Links

Discussion