GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows users to add a new cluster to the GitLab instance via the Admin API endpoint `/api/v4/admin/clusters/add`. It is useful for administrators who want to programmatically manage Kubernetes clusters within GitLab, enabling automation of cluster registration and configuration.

Use Case Examples

  1. An admin automates the addition of Kubernetes clusters to GitLab for CI/CD integration.
  2. A DevOps engineer uses this node to script cluster management tasks in GitLab's admin panel.

Properties

Name Meaning
Skip Authentication Determines whether to skip API authentication for the 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 request is sent.
Method HTTP method to use for the request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Parameter Schema Defines the schema for the request body parameters required to add a cluster, ensuring the request body matches the expected structure.
Request Body Schema Schema for the request body, used to validate the data sent when adding a cluster.
Request Path The API endpoint path for adding a cluster, fixed to `/api/v4/admin/clusters/add`.

Output

JSON

  • id - The unique identifier of the newly added cluster.
  • name - The name of the cluster.
  • provider - The provider of the cluster (e.g., Kubernetes).
  • environment_scope - The environment scope the cluster applies to.
  • created_at - Timestamp when the cluster was created.
  • updated_at - Timestamp when the cluster was last updated.

Dependencies

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

Troubleshooting

  • Ensure the API base URL is correct and accessible.
  • Verify that the authentication credentials are valid and have admin permissions.
  • Check that the request body matches the required schema for adding a cluster.
  • Common error: 401 Unauthorized - indicates invalid or missing authentication credentials.
  • Common error: 400 Bad Request - indicates the request body is malformed or missing required fields.

Links

Discussion