GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to add a new cluster to the GitLab instance via the Admin Clusters API endpoint. It is useful for administrators who need to manage Kubernetes clusters or other cluster resources within GitLab. For example, an admin can automate the addition of clusters to their GitLab environment as part of infrastructure setup or scaling processes.

Use Case Examples

  1. Automate adding Kubernetes clusters to GitLab for CI/CD integration.
  2. Manage GitLab clusters programmatically in an infrastructure-as-code workflow.

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 request is sent.
Method The HTTP method used for the API request, defaulting to GET but set to POST for this operation.
Parameter Schema Defines the schema for the parameters sent in the request body for adding a cluster.
Request Body Schema Defines the schema for the request body content when adding a cluster.
Request Path The API endpoint path for adding a cluster to the GitLab instance.

Output

JSON

  • response - The JSON response from the GitLab API after attempting to add a cluster, typically containing details of the newly added cluster or error information.

Dependencies

  • Requires GitLab API key credential for authentication unless skipping authentication is enabled.

Troubleshooting

  • Ensure the GitLab API key has sufficient permissions to add clusters; otherwise, the request will fail with authorization errors.
  • Verify the baseUrl is correct and accessible; incorrect URLs will cause connection errors.
  • Check that the request body matches the expected schema for adding clusters to avoid validation errors from the API.

Links

Discussion