GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation allows users to create a new registry protection repository rule for a specific project in GitLab via the GitLab API. It is useful for automating the management of container registry protection rules within GitLab projects, such as setting up rules to control access or behavior of container images in the project's registry.

Use Case Examples

  1. Automatically add a registry protection rule to a project when a new project is created.
  2. Manage container registry rules programmatically across multiple projects to enforce security policies.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
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 to identify the project.

Output

JSON

  • response - The JSON response from the GitLab API containing details of the created registry protection repository rule.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the authentication credentials (API key) are valid and have sufficient permissions to create registry protection rules.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload respectively.

Links

Discussion