GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves jobs for a specific project from the GitLab API (version 4). It is useful for scenarios where users want to monitor or analyze the CI/CD jobs associated with a GitLab project, such as checking job statuses, filtering jobs by scope, or paginating through job results. For example, a user can fetch all running or pending jobs for a project to track pipeline progress.

Use Case Examples

  1. Fetch all jobs for a project with ID '12345'.
  2. Retrieve only running and pending jobs for a project to monitor active pipelines.
  3. Paginate through jobs to process large sets of job data in batches.

Properties

Name Meaning
Skip Authentication Whether to skip authentication when making the API request.
Authentication The authentication method used for the API request, hidden if Skip Authentication is true.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request (GET, POST, PUT, DELETE, HEAD, PATCH).
Query Parameters Optional query parameters to filter and paginate the jobs list.
Path Parameters Path parameters required for the API endpoint.

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) the job is associated with.
  • 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.
  • user - Information about the user who triggered the job.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • Verify that the base URL is correct and points to a valid GitLab instance.
  • Check that the authentication credentials are valid and have sufficient permissions to access project jobs.
  • If pagination parameters are used, ensure they are valid integers and within allowed ranges.
  • Common error messages include 404 Not Found (project or jobs not found), 401 Unauthorized (authentication failure), and 400 Bad Request (invalid parameters). Resolving these involves correcting the input parameters, authentication, or permissions.

Links

Discussion