Skip to content

Update a container repository protection rule

PATCH
/api/v4/projects/{id}/registry/protection/repository/rules/{protection_rule_id}

Updates a container repository protection rule for a specified project.

id
required
One of:
string

The ID or URL-encoded path of the project

protection_rule_id
required
integer

The ID of the container protection rule

Media type application/json
object
repository_path_pattern

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

string
nullable
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. To unset the value, use an empty string "".

string
nullable
Allowed values: maintainer owner admin ""
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. To unset the value, use an empty string "".

string
nullable
Allowed values: maintainer owner admin ""

OK

Media type application/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