File: pagesdomains.rst

package info (click to toggle)
python-gitlab 1%3A8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,884 kB
  • sloc: python: 25,823; makefile: 171; ruby: 27; javascript: 3
file content (94 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download
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
91
92
93
94
#######################
Pages and Pages domains
#######################

Project pages
=============

References
----------

* v4 API:

  + :class:`gitlab.v4.objects.ProjectPages`
  + :class:`gitlab.v4.objects.ProjectPagesManager`
  + :attr:`gitlab.v4.objects.Project.pages`

* GitLab API: https://docs.gitlab.com/api/pages

Examples
--------

Get Pages settings for a project::

    pages = project.pages.get()

Update Pages settings for a project::

    project.pages.update(new_data={'pages_https_only': True})

Delete (unpublish) Pages for a project (admin only)::

    project.pages.delete()

Pages domains (admin only)
==========================

References
----------

* v4 API:

  + :class:`gitlab.v4.objects.PagesDomain`
  + :class:`gitlab.v4.objects.PagesDomainManager`
  + :attr:`gitlab.Gitlab.pagesdomains`

* GitLab API: https://docs.gitlab.com/api/pages_domains#list-all-pages-domains

Examples
--------

List all the existing domains (admin only)::

    domains = gl.pagesdomains.list(get_all=True)

Project Pages domains
=====================

References
----------

* v4 API:

  + :class:`gitlab.v4.objects.ProjectPagesDomain`
  + :class:`gitlab.v4.objects.ProjectPagesDomainManager`
  + :attr:`gitlab.v4.objects.Project.pagesdomains`

* GitLab API: https://docs.gitlab.com/api/pages_domains#list-pages-domains

Examples
--------

List domains for a project::

    domains = project.pagesdomains.list(get_all=True)

Get a single domain::

    domain = project.pagesdomains.get('d1.example.com')

Create a new domain::

    domain = project.pagesdomains.create({'domain': 'd2.example.com})

Update an existing domain::

    domain.certificate = open('d2.crt').read()
    domain.key = open('d2.key').read()
    domain.save()

Delete an existing domain::

    domain.delete
    # or
    project.pagesdomains.delete('d2.example.com')