GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation cancels a specific job within a GitLab project by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/jobs/{job_id}/cancel`. It is useful for automating CI/CD pipeline management, allowing users to programmatically stop running or pending jobs in their GitLab projects.

Use Case Examples

  1. Cancel a running job in a GitLab project to free up resources or stop an erroneous pipeline.
  2. Automate job cancellation in response to external triggers or conditions in a workflow.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to POST for this operation.
Path Parameters Parameters required in the URL path to identify the project and job to cancel.

Output

JSON

  • id - The ID of the canceled job
  • status - The status of the job after cancellation, typically 'canceled'
  • project_id - The ID of the project to which the job belongs
  • user - Information about the user who triggered the cancellation
  • created_at - Timestamp when the job was created
  • started_at - Timestamp when the job started
  • finished_at - Timestamp when the job finished or was canceled

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the job_id and project id path parameters are correctly set and correspond to existing resources in GitLab.
  • Authentication errors may occur if the API key is missing, invalid, or lacks sufficient permissions to cancel jobs.
  • Network or baseUrl misconfiguration can cause request failures; verify the baseUrl is correct for your GitLab instance.

Links

Discussion