FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

python-gitlab/docs/gl_objects/secure_files.rst at v8.6.0 · python-gitlab/python-gitlab · GitHub

Repository navigation

Latest commit

 

History

History
47 lines (31 loc) · 1.02 KB

File metadata and controls

47 lines (31 loc) · 1.02 KB

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/api/secure_files

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(get_all=True)
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()

Back | FazBrowse Home | New Git URL