GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves a specific version of a Terraform state from a GitLab project using the GitLab API. It is useful for DevOps and infrastructure teams who manage Terraform state files within GitLab and need to access historical versions of these states for auditing, rollback, or analysis purposes. For example, a user can fetch the Terraform state version 5 for a project with ID '123' and state name 'production'.

Use Case Examples

  1. Retrieve Terraform state version 10 for project ID 'my-group/my-project' and state name 'staging'.
  2. Fetch Terraform state version 3 for project ID '456' and state name 'dev'.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent. Defaults to https://gitlab.com.
Method The HTTP method used for the API request. Defaults to GET.
Parameter Schema Defines the required path parameters for the API call: project ID or URL-encoded path, Terraform state name, and version serial number.
Request Body Schema Schema for the request body, which is null for this GET operation.
Request Path The API endpoint path template for the request: /api/v4/projects/{id}/terraform/state/{name}/versions/{serial}.
Path Parameters Collection of path parameters required for the API call: 'id' (project ID or URL-encoded path), 'name' (Terraform state name), and 'serial' (version number of the state).

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • name - The name of the Terraform state.
  • serial - The version number of the Terraform state.
  • stateData - The detailed data of the specified Terraform state version returned by the API.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID, Terraform state name, and version serial are correctly specified; incorrect values will result in API errors such as 404 Not Found.
  • Authentication errors may occur if the GitLab API key credential is missing or invalid; verify the credential configuration.
  • Network or base URL misconfiguration can cause connection failures; confirm the baseUrl is correct and accessible.

Links

Discussion