GitLab API icon

GitLab API

Gitlab

Actions880

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 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 request is sent.
Method The HTTP method to use for the request, default is POST for this operation.
Path Parameters Parameters to specify the project ID or URL-encoded path 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

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the authentication credentials (GitLab API key) are valid and have sufficient permissions to create cluster agents.
  • 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 authentication), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload.

Links

Discussion