Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(api): replace deprecatedname_regex attribute indelete_in_bulk()#1536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletionsgitlab/v4/objects/container_registry.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,26 +31,28 @@ class ProjectRegistryTagManager(DeleteMixin, RetrieveMixin, RESTManager):
_path = "/projects/%(project_id)s/registry/repositories/%(repository_id)s/tags"

@cli.register_custom_action(
"ProjectRegistryTagManager", optional=("name_regex", "keep_n", "older_than")
"ProjectRegistryTagManager",
("name_regex_delete",),
optional=("keep_n", "name_regex_keep", "older_than"),
)
@exc.on_http_error(exc.GitlabDeleteError)
def delete_in_bulk(self,name_regex=".*", **kwargs):
def delete_in_bulk(self,name_regex_delete, **kwargs):
"""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.
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)
name_regex_delete (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", "name_regex_keep", "older_than"]
data = {"name_regex":name_regex}
data = {"name_regex_delete":name_regex_delete}
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)

[8]ページ先頭

©2009-2025 Movatter.jp