GitLab API

GitlabTool

Actions905

Overview

This node operation allows importing a project into GitLab via the GitLab API. It is useful for automating the import of project export files into a GitLab instance, specifying project details such as path, name, namespace, and various override parameters to customize the imported project settings. Practical examples include migrating projects from one GitLab instance to another or restoring projects from backups.

Use Case Examples

  1. Import a project export file into a specific namespace with a custom project name.
  2. Overwrite an existing project in the same namespace by enabling the overwrite option.
  3. Customize project settings during import, such as enabling/disabling features like issues, merge requests, or setting access levels.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication Type of authentication used, default is GitLab API key authentication.
baseUrl Base URL of the GitLab instance to which the request is sent, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET. For this operation, POST is used.
Parameter Schema Defines the form data parameters for the import operation, including required fields like 'path' and 'file' (project export file), and optional fields such as 'name', 'namespace', 'overwrite', and many override parameters to customize project settings.
Request Path The API endpoint path for the import operation, fixed as /api/v4/projects/import.

Output

JSON

  • id - ID of the imported project
  • name - Name of the imported project
  • path - Path of the imported project
  • namespace - Namespace where the project is imported
  • description - Description of the imported project
  • visibility - Visibility level of the imported project (private, internal, public)
  • import_status - Status of the import process
  • created_at - Timestamp when the project was created
  • last_activity_at - Timestamp of the last activity in the project

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project export file is correctly formatted and accessible for upload; otherwise, the import will fail.
  • If authentication is skipped or invalid, the API request will be unauthorized; verify API key credentials.
  • Overwriting an existing project requires the 'overwrite' parameter to be true; otherwise, the import will be rejected if a project with the same path exists.
  • Check that the baseUrl is correctly set to the target GitLab instance to avoid connection errors.

Links

Discussion