blob: 6fe1d2e0ce7e4fd9d437f84e5d1edd8994871948 (
plain)
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
|
############
Secure Files
############
secure files
============
References
----------
* v4 API:
+ :class:`gitlab.v4.objects.ProjectSecureFile`
+ :class:`gitlab.v4.objects.ProjectSecureFileManager`
+ :attr:`gitlab.v4.objects.Project.secure_files`
* GitLab API: https://docs.gitlab.com/ee/api/secure_files.html
Examples
--------
Get a project secure file::
secure_files = gl.projects.get(1, lazy=True).secure_files.get(1)
print(secure_files.name)
List project secure files::
secure_files = gl.projects.get(1, lazy=True).secure_files.list()
print(secure_files[0].name)
Create project secure file::
secure_file = gl.projects.get(1).secure_files.create({"name": "test", "file": "secure.txt"})
Download a project secure file::
content = secure_file.download()
print(content)
with open("/tmp/secure.txt", "wb") as f:
secure_file.download(streamed=True, action=f.write)
Remove a project secure file::
gl.projects.get(1).secure_files.delete(1)
# or
secure_file.delete()
|