GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves detailed information about a specific job within a project on GitLab using the GitLab API v4. It is useful for scenarios where users need to monitor or manage CI/CD jobs associated with their GitLab projects, such as checking job status, logs, or results.

Use Case Examples

  1. A DevOps engineer wants to fetch the status and details of a particular CI job in a GitLab project to automate deployment decisions.
  2. A project manager needs to retrieve job information to track build progress and report on pipeline health.

Properties

Name Meaning
Skip Authentication Option to bypass authentication for the request, useful for public or unauthenticated API access.
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 request is sent, defaulting to https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Parameter Schema Defines the required path parameters for the API call, including the project ID and job ID.
Request Body Schema Schema for the request body if applicable, null for this GET operation.
Request Path The API endpoint path template used to fetch job details, with placeholders for project and job IDs.
Path Parameters Collection of path parameters including 'id' (project ID) and 'job_id' (job ID) required to identify the job resource.

Output

JSON

  • id - The unique identifier of the job.
  • status - Current status of the job (e.g., success, failed, running).
  • stage - The stage of the pipeline the job belongs to.
  • name - Name of the job.
  • ref - The Git reference (branch or tag) the job is associated with.
  • tag - Indicates if the job is tagged.
  • coverage - Code coverage percentage reported by the job, if available.
  • 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.
  • commit - Details about the commit associated with the job.
  • pipeline - Information about the pipeline the job belongs to.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID ('id') and job ID ('job_id') path parameters are correctly set and valid integers; invalid or missing IDs will cause API errors.
  • If authentication is required and 'Skip Authentication' is false, ensure the GitLab API credential is correctly configured and has sufficient permissions to access the project and job details.
  • Check the baseUrl if using a self-hosted GitLab instance; incorrect URLs will lead to connection failures.
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails. Verify IDs and credentials accordingly.

Links

  • GitLab API - Get a Job - Official GitLab API documentation for retrieving job details by project and job ID.

Discussion