GitLab API

GitlabTool

Actions1000

Overview

This node operation stops a specific environment within a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/environments/{environment_id}/stop`. It is useful for automating environment management tasks such as stopping deployment environments in CI/CD pipelines or project workflows.

Use Case Examples

  1. Stopping a staging environment after tests complete to save resources.
  2. Automating the shutdown of a review app environment when a merge request is closed.

Properties

Name Meaning
Skip Authentication Determines whether to skip API authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to send the request to, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters required in the URL path to identify the project and environment to stop.

Output

JSON

  • status - The HTTP response status indicating the result of the stop environment request.
  • data - The response data from the GitLab API after stopping the environment, typically including environment details or confirmation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and environment ID are correct and accessible by the authenticated user.
  • Verify that the GitLab API token has sufficient permissions to stop environments.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid project or environment ID), and 403 Forbidden (insufficient permissions).

Links

Discussion