GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to create remote mirrors for a specified project. It is useful for automating the setup of remote mirrors in GitLab projects, enabling synchronization of repositories across different locations. For example, a user can automate the creation of a remote mirror for a project by providing the project ID and mirror details, streamlining repository management workflows.

Use Case Examples

  1. Automate creation of remote mirrors for GitLab projects to keep repositories synchronized across multiple servers.
  2. Integrate GitLab remote mirror setup into CI/CD pipelines for seamless repository replication.

Properties

Name Meaning
Skip Authentication Determines whether to skip API authentication for the request.
Authentication Specifies the authentication method to use, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance to which the API requests are sent.
Method The HTTP method used for the API request.
Path Parameters Parameters included in the API request path, specifically the project ID for which the remote mirror is created.

Output

JSON

  • id - The unique identifier of the created remote mirror.
  • url - The URL of the remote mirror repository.
  • enabled - Indicates whether the remote mirror is enabled.
  • only_protected_branches - Indicates if only protected branches are mirrored.
  • keep_divergent_refs - Indicates if divergent refs are kept in the mirror.
  • created_at - Timestamp when the remote mirror was created.
  • updated_at - Timestamp when the remote mirror was last updated.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the base URL is correctly set to the GitLab instance URL.
  • Check that the authentication token or API key has sufficient permissions to create remote mirrors on the project.
  • Common error messages include 401 Unauthorized (authentication failure), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves verifying credentials, project ID, and request payload format.

Links

Discussion