GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows creating a new environment within a specific GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/environments`. It is useful for automating environment management in GitLab projects, such as setting up staging, production, or testing environments programmatically.

Use Case Examples

  1. Automatically create a new environment in a GitLab project when a new feature branch is created.
  2. Set up multiple environments for a project during CI/CD pipeline execution.

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 which the API request is sent.
Method HTTP method to use for the request, default is POST for this operation.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The unique identifier of the created environment.
  • name - The name of the created environment.
  • slug - A URL-friendly identifier for the environment.
  • external_url - The external URL associated with the environment.
  • project_id - The ID of the project to which the environment belongs.
  • state - The current state of the environment (e.g., available, stopped).
  • created_at - Timestamp when the environment was created.
  • updated_at - Timestamp when the environment was last updated.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible by the authenticated user.
  • Verify that the authentication credentials are valid and have sufficient permissions to create environments in the project.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 401 Unauthorized (authentication failure), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload respectively.

Links

Discussion