GitLab API

GitlabTool

Actions1000

Overview

This node operation allows creating a 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, enabling integration and orchestration of Kubernetes clusters with GitLab CI/CD pipelines.

Use Case Examples

  1. Creating a new cluster agent for a project to manage Kubernetes clusters via GitLab.
  2. Automating cluster agent creation as part of a DevOps workflow to streamline deployment processes.

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 API request is sent.
Method The HTTP method used for the request, default is POST for this operation.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded path to identify 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.
  • project_id - The ID of the project to which the cluster agent belongs.
  • created_at - Timestamp when the cluster agent was created.
  • token - The token associated with the cluster agent for authentication.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to create cluster agents.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist), and 400 Bad Request (invalid request body or parameters).

Links

Discussion