GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation allows creating a new cluster agent for a specific project in GitLab by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/cluster_agents`. It is useful for automating the management of cluster agents within GitLab projects, such as setting up CI/CD pipelines or managing Kubernetes clusters associated with projects.

Use Case Examples

  1. Creating a cluster agent for a project to enable Kubernetes cluster management via GitLab.
  2. Automating the deployment of cluster agents across multiple projects in GitLab.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, typically a GitLab API key.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, here it is POST for creating a cluster agent.
Path Parameters Parameters included in the URL path, specifically the project ID or URL-encoded path identifying the project for which the cluster agent is created.

Output

JSON

  • id - The unique identifier of the created cluster agent.
  • name - The name of the cluster agent.
  • token - The token associated with the cluster agent for authentication.
  • created_at - Timestamp when the cluster agent was created.
  • updated_at - Timestamp when the cluster agent was last updated.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided API credentials.
  • Verify that the API token has sufficient permissions to create cluster agents in the specified project.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (invalid or missing API token), 404 Not Found (project ID does not exist), and 403 Forbidden (insufficient permissions). Resolving these involves verifying credentials, project existence, and user permissions.

Links

Discussion