FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/gitlab/v4/objects/container_registry.py at v8.6.0 · python-gitlab/python-gitlab · GitHub
python-gitlab
python-gitlab
Repository navigation
Code
Issues
16
(16)
Pull requests
15
(15)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
gitlab
/
v4
/
objects
/
container_registry.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (71 loc) · 2.93 KB
Breadcrumbs
python-gitlab
/
gitlab
/
v4
/
objects
/
container_registry.py
Copy path
File metadata and controls
90 lines (71 loc) · 2.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from
__future__
import
annotations
from
typing
import
Any
from
gitlab
import
cli
from
gitlab
import
exceptions
as
exc
from
gitlab
.
base
import
RESTObject
from
gitlab
.
mixins
import
(
DeleteMixin
,
GetMixin
,
ListMixin
,
ObjectDeleteMixin
,
RetrieveMixin
,
)
__all__
=
[
"GroupRegistryRepositoryManager"
,
"ProjectRegistryRepository"
,
"ProjectRegistryRepositoryManager"
,
"ProjectRegistryTag"
,
"ProjectRegistryTagManager"
,
"RegistryRepository"
,
"RegistryRepositoryManager"
,
]
class
ProjectRegistryRepository
(
ObjectDeleteMixin
,
RESTObject
):
tags
:
ProjectRegistryTagManager
class
ProjectRegistryRepositoryManager
(
DeleteMixin
[
ProjectRegistryRepository
],
ListMixin
[
ProjectRegistryRepository
]
):
_path
=
"/projects/{project_id}/registry/repositories"
_obj_cls
=
ProjectRegistryRepository
_from_parent_attrs
=
{
"project_id"
:
"id"
}
class
ProjectRegistryTag
(
ObjectDeleteMixin
,
RESTObject
):
_id_attr
=
"name"
class
ProjectRegistryTagManager
(
DeleteMixin
[
ProjectRegistryTag
],
RetrieveMixin
[
ProjectRegistryTag
]
):
_obj_cls
=
ProjectRegistryTag
_from_parent_attrs
=
{
"project_id"
:
"project_id"
,
"repository_id"
:
"id"
}
_path
=
"/projects/{project_id}/registry/repositories/{repository_id}/tags"
@
cli
.
register_custom_action
(
cls_names
=
"ProjectRegistryTagManager"
,
required
=
(
"name_regex_delete"
,),
optional
=
(
"keep_n"
,
"name_regex_keep"
,
"older_than"
),
)
@
exc
.
on_http_error
(
exc
.
GitlabDeleteError
)
def
delete_in_bulk
(
self
,
name_regex_delete
:
str
,
**
kwargs
:
Any
)
->
None
:
"""Delete Tag in bulk
Args:
name_regex_delete: The regex of the name to delete. To delete all
tags specify .*.
keep_n: The amount of latest tags of given name to keep.
name_regex_keep: The regex of the name to keep. This value
overrides any matches from name_regex.
older_than: 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_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
)
class
GroupRegistryRepositoryManager
(
ListMixin
[
ProjectRegistryRepository
]):
_path
=
"/groups/{group_id}/registry/repositories"
_obj_cls
=
ProjectRegistryRepository
_from_parent_attrs
=
{
"group_id"
:
"id"
}
class
RegistryRepository
(
RESTObject
):
_repr_attr
=
"path"
class
RegistryRepositoryManager
(
GetMixin
[
RegistryRepository
]):
_path
=
"/registry/repositories"
_obj_cls
=
RegistryRepository
Back
|
FazBrowse Home
|
New Git URL