Create a container repository protection rule
POST
/api/v4/projects/{id}/registry/protection/repository/rules
Creates a container repository protection rule for a specified project to control who can push or delete container images.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
repository_path_pattern
required
Container repository path pattern protected by the protection rule.
For example flight/flight-*. Wildcard character * allowed.
string
minimum_access_level_for_push
Minimum GitLab access level to allow to push container images to the container registry. For example maintainer, owner or admin.
string
minimum_access_level_for_delete
Minimum GitLab access level to allow to delete container images in the container registry. For example maintainer, owner or admin.
string
Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
integer format: int64
project_id
integer format: int64
repository_path_pattern
string
minimum_access_level_for_push
string
minimum_access_level_for_delete
string
Example
{ "id": 1, "project_id": 1, "repository_path_pattern": "flightjs/flight0", "minimum_access_level_for_push": "maintainer", "minimum_access_level_for_delete": "maintainer"}Bad Request
Unauthorized
Forbidden
Not Found
Unprocessable Entity