GitLab API icon

GitLab API

Gitlab

Actions880

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 lifecycle management in CI/CD pipelines or project automation workflows, such as stopping a deployment environment when it is no longer needed.

Use Case Examples

  1. Automatically stop a staging environment after tests complete.
  2. Stop 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, defaulting to 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, typically details about the stopped environment.

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 key has sufficient permissions to stop environments.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and permissions.
  • Common error: 404 Not Found - indicates the project or environment ID does not exist or is not accessible.

Links

Discussion