GitLab API

GitlabTool

Actions1000

Overview

This node operation allows creating a new environment within a specified 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 as part of a CI/CD pipeline.

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 authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the request, default is POST for this operation.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded path identifying the GitLab project where the environment will be created.

Output

JSON

  • id - The unique identifier of the created environment.
  • name - The name of the created environment.
  • slug - The slug (URL-friendly name) of 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 authentication credential

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 specified project.
  • Check the base URL to ensure it points to the correct GitLab instance if using a self-hosted GitLab server.
  • If the API returns an error, review the response message for details such as missing required fields or invalid data formats.

Links

Discussion