GitLab API

GitlabTool

Actions1000

Overview

This node operation interacts with the GitLab API to retrieve environment details for a specific project identified by its ID or URL-encoded path. It supports filtering and pagination options to customize the query results. This is useful for DevOps and development teams who want to programmatically access environment information related to their GitLab projects, such as listing all environments, filtering by name or state, and managing large sets of environments with pagination.

Use Case Examples

  1. Retrieve all environments for a project with ID '123'.
  2. Search environments by name or partial match within a project.
  3. Filter environments by their state (available, stopping, stopped) for monitoring or automation purposes.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated access scenarios.
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 requests are sent, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, defaulting to GET. Other methods like POST, PUT, DELETE, HEAD, PATCH are available but GET is typical for this operation.
Query Parameters Collection of optional query parameters to filter and paginate the environments list.
Path Parameters Path parameter specifying the project ID or URL-encoded path to identify the project whose environments are being queried.

Output

JSON

  • id - Unique identifier of the environment.
  • name - Name of the environment.
  • slug - Slug (URL-friendly name) of the environment.
  • external_url - External URL associated with the environment.
  • state - Current state of the environment (e.g., available, stopping, stopped).
  • created_at - Timestamp when the environment was created.
  • updated_at - Timestamp when the environment was last updated.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or URL-encoded path is correct and accessible by the authenticated user to avoid 404 errors.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access project environments to prevent authentication errors.
  • Check that query parameters like 'name' and 'search' are used exclusively as they are mutually exclusive filters.
  • If pagination parameters are used, ensure they are valid integers to avoid request errors.

Links

Discussion