diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-06-30 19:13:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 19:13:45 +0200 |
commit | 85713bbbecdcec577a72749d2e495f823791b00f (patch) | |
tree | feb1f05bb55e18145f3eb312f8106ff55b0d5176 | |
parent | 330d69cd1ed48ca9289cdaa7d00ae7dec6b7dfba (diff) | |
parent | e49ff3f868cbab7ff81115f458840b5f6d27d96c (diff) | |
download | gitlab-85713bbbecdcec577a72749d2e495f823791b00f.tar.gz |
Merge pull request #1537 from antti-mikael/feat/registry-deleteinbulk-keepregex
feat(api): add `name_regex_keep` attribute in `delete_in_bulk()`
-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) |