projects

Create a container repository protection rule

Creates a container repository protection rule for a specified project to control who can push or delete container images.

post/api/v4/projects/{id}/registry/protection/repository/rules

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

repository_path_patternstring required

Container repository path pattern protected by the protection rule. For example flight/flight-*. Wildcard character * allowed.

minimum_access_level_for_push'maintainer' | 'owner' | 'admin'

Minimum GitLab access level to allow to push container images to the container registry. For example maintainer, owner or admin.

minimum_access_level_for_delete'maintainer' | 'owner' | 'admin'

Minimum GitLab access level to allow to delete container images in the container registry. For example maintainer, owner or admin.

Response

Create a container repository protection rule

idinteger required
project_idinteger required
repository_path_patternstring required
minimum_access_level_for_pushstring required
minimum_access_level_for_deletestring required

Example response

{
  "id": 1,
  "project_id": 1,
  "repository_path_pattern": "flightjs/flight0",
  "minimum_access_level_for_push": "maintainer",
  "minimum_access_level_for_delete": "maintainer"
}

Changes

No recorded changes to this operation across all 5 revisions of this API.