17
17
18
18
class ProjectArtifact (RESTObject ):
19
19
"""Dummy object to manage custom actions on artifacts"""
20
+
20
21
_id_attr = "ref_name"
21
22
22
23
@@ -57,6 +58,7 @@ def download(
57
58
** kwargs : Any ,
58
59
) -> Optional [bytes ]:
59
60
"""Get the job artifacts archive from a specific tag or branch.
61
+
60
62
Args:
61
63
ref_name: Branch or tag name in repository. HEAD or SHA references
62
64
are not supported.
@@ -69,9 +71,11 @@ def download(
69
71
data
70
72
chunk_size: Size of each chunk
71
73
**kwargs: Extra options to send to the server (e.g. sudo)
74
+
72
75
Raises:
73
76
GitlabAuthenticationError: If authentication is not correct
74
77
GitlabGetError: If the artifacts could not be retrieved
78
+
75
79
Returns:
76
80
The artifacts if `streamed` is False, None otherwise.
77
81
"""
@@ -83,7 +87,9 @@ def download(
83
87
assert isinstance (result , requests .Response )
84
88
return utils .response_content (result , streamed , action , chunk_size )
85
89
86
- @cli .register_custom_action ("ProjectArtifactManager" , ("ref_name" , "artifact_path" , "job" ))
90
+ @cli .register_custom_action (
91
+ "ProjectArtifactManager" , ("ref_name" , "artifact_path" , "job" )
92
+ )
87
93
@exc .on_http_error (exc .GitlabGetError )
88
94
def raw (
89
95
self ,
@@ -97,6 +103,7 @@ def raw(
97
103
) -> Optional [bytes ]:
98
104
"""Download a single artifact file from a specific tag or branch from
99
105
within the job's artifacts archive.
106
+
100
107
Args:
101
108
ref_name: Branch or tag name in repository. HEAD or SHA references
102
109
are not supported.
@@ -109,9 +116,11 @@ def raw(
109
116
data
110
117
chunk_size: Size of each chunk
111
118
**kwargs: Extra options to send to the server (e.g. sudo)
119
+
112
120
Raises:
113
121
GitlabAuthenticationError: If authentication is not correct
114
122
GitlabGetError: If the artifacts could not be retrieved
123
+
115
124
Returns:
116
125
The artifact if `streamed` is False, None otherwise.
117
126
"""
0 commit comments