3 @qhcN @sddlmZddlmZddlmZmZddlmZm Z m Z m Z ddddgZ Gd dde eZ Gd ddee eZGd dde eZGd ddee eZd S))cli) exceptions) RESTManager RESTObject) DeleteMixin ListMixinObjectDeleteMixin RetrieveMixinProjectRegistryRepository ProjectRegistryRepositoryManagerProjectRegistryTagProjectRegistryTagManagerc@seZdZdZdS)r tagsr Nrr )r)__name__ __module__ __qualname__Z _managersrrc/home/ec2-user/environment/venv/lib/python3.6/dist-packages/gitlab/v4/objects/container_registry.pyr sc@seZdZdZeZddiZdS)r z./projects/%(project_id)s/registry/repositories project_ididN)rrr_pathr _obj_cls_from_parent_attrsrrrrr sc@seZdZdZdS)r nameN)rrrZ_id_attrrrrrr sc@sBeZdZeZdddZdZejdd de j e j dd d Z d S)r rr)rZ repository_idzE/projects/%(project_id)s/registry/repositories/%(repository_id)s/tags name_regexkeep_n older_than)optional.*c sLdddgd|i}|jfdd|jD|jj|jfd|i|dS) aNDelete 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) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request rZname_regex_keeprrcsi|]\}}|kr||qSrr).0kv) valid_attrsrr 7sz.Z query_dataN)updateitemsgitlabZ http_deletepath)selfrkwargsdatar)r#rdelete_in_bulk!s z(ProjectRegistryTagManager.delete_in_bulkN)rrr)r) rrrr rrrrZregister_custom_actionexcZ on_http_errorZGitlabDeleteErrorr,rrrrr s  N)r'rrr-Z gitlab.baserrZ gitlab.mixinsrrrr __all__r r r r rrrrs