GitLab API

GitlabTool

Actions1000

Overview

This node operation allows updating a specific job in GitLab by its ID using the GitLab API. It supports making a PUT request to the endpoint `/api/v4/jobs/{id}` to modify job details. This is useful for automating job management in GitLab CI/CD pipelines, such as updating job status or attributes programmatically.

Use Case Examples

  1. Updating a job's details in GitLab by specifying the job ID and sending the updated data in the request body.
  2. Automating job modifications in GitLab as part of a CI/CD workflow.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but can be set to PUT for this operation.
Path Parameters Parameters to be included in the request path, specifically the job ID to identify which job to update.

Output

JSON

  • id - The unique identifier of the job updated.
  • status - The current status of the job after update.
  • stage - The stage of the pipeline the job belongs to.
  • name - The name of the job.
  • ref - The Git reference (branch or tag) associated with 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.
  • user
    • id - ID of the user who triggered the job.
    • name - Name of the user who triggered the job.
  • pipeline
    • id - ID of the pipeline the job belongs to.
    • status - Status of the pipeline.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the job ID provided in the path parameters is valid and exists in the GitLab instance.
  • Verify that the authentication credentials (GitLab API key) are correctly configured and have sufficient permissions to update jobs.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • If the API returns an error, review the HTTP status code and message for clues, such as 404 for job not found or 401 for unauthorized access.

Links

Discussion