diff options
author | Antti Tanhuanpää <antti.tanhuanpaa@anders.fi> | 2021-06-29 14:02:13 +0300 |
---|---|---|
committer | Antti Tanhuanpää <antti.tanhuanpaa@anders.fi> | 2021-06-29 14:28:12 +0300 |
commit | e49ff3f868cbab7ff81115f458840b5f6d27d96c (patch) | |
tree | feb1f05bb55e18145f3eb312f8106ff55b0d5176 /gitlab | |
parent | 330d69cd1ed48ca9289cdaa7d00ae7dec6b7dfba (diff) | |
download | gitlab-e49ff3f868cbab7ff81115f458840b5f6d27d96c.tar.gz |
feat(api): add `name_regex_keep` attribute in `delete_in_bulk()`
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/v4/objects/container_registry.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gitlab/v4/objects/container_registry.py b/gitlab/v4/objects/container_registry.py index f144c42..432cb7f 100644 --- a/gitlab/v4/objects/container_registry.py +++ b/gitlab/v4/objects/container_registry.py @@ -38,17 +38,19 @@ class ProjectRegistryTagManager(DeleteMixin, RetrieveMixin, RESTManager): """Delete Tag in bulk Args: - name_regex (string): The regex of the name to delete. To delete all - tags specify .*. - keep_n (integer): The amount of latest tags of given name to keep. - older_than (string): Tags to delete that are older than the given time, - written in human readable form 1h, 1d, 1month. - **kwargs: Extra options to send to the server (e.g. sudo) + name_regex (string): The regex of the name to delete. To delete all + tags specify .*. + keep_n (integer): The amount of latest tags of given name to keep. + name_regex_keep (string): The regex of the name to keep. This value + overrides any matches from name_regex. + older_than (string): Tags to delete that are older than the given time, + written in human readable form 1h, 1d, 1month. + **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request """ - valid_attrs = ["keep_n", "older_than"] + valid_attrs = ["keep_n", "name_regex_keep", "older_than"] data = {"name_regex": name_regex} data.update({k: v for k, v in kwargs.items() if k in valid_attrs}) self.gitlab.http_delete(self.path, query_data=data, **kwargs) |