GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves jobs for a specific project from the GitLab API (v4). It is useful for users who want to monitor or manage CI/CD jobs associated with a GitLab project. For example, a DevOps engineer might use this node to fetch the status of all jobs in a project to automate deployment workflows or generate reports.

Use Case Examples

  1. Fetch all jobs for a project with ID '12345' to check their statuses.
  2. Retrieve only running and pending jobs for a project to monitor active pipelines.

Properties

Name Meaning
Skip Authentication If set to true, the node skips authentication for the request.
Authentication Type of authentication used, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters to filter and paginate the jobs list.
Path Parameters Path parameters required for the request, specifically the project ID.

Output

JSON

  • id - The unique identifier of the job.
  • status - The current status of the job (e.g., running, success, failed).
  • stage - The stage of the pipeline the job belongs to.
  • name - The name of the job.
  • ref - The Git reference (branch or tag) for the job.
  • created_at - Timestamp when the job was created.
  • started_at - Timestamp when the job started.
  • finished_at - Timestamp when the job finished.
  • duration - Duration of the job execution in seconds.
  • web_url - URL to view the job in the GitLab web interface.

Dependencies

  • Requires GitLab API key authentication to access the GitLab API.

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided API key.
  • Check that the API key has sufficient permissions to read job information from the project.
  • If pagination parameters are used, verify that page and per_page values are valid integers.
  • Common error messages include 401 Unauthorized (invalid or missing API key) and 404 Not Found (invalid project ID). Resolving these involves verifying credentials and project existence.

Links

Discussion