File: cluster_agents.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 (41 lines) | stat: -rw-r--r-- 1,032 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
##############
Cluster agents
##############

You can list and manage project cluster agents with the GitLab agent for Kubernetes.

.. warning::
   Check the GitLab API documentation linked below for project permissions
   required to access specific cluster agent endpoints.

Reference
---------

* v4 API:

  + :class:`gitlab.v4.objects.ProjectClusterAgent`
  + :class:`gitlab.v4.objects.ProjectClusterAgentManager`
  + :attr:`gitlab.v4.objects.Project.cluster_agents`

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

Examples
--------

List cluster agents for a project::

    cluster_agents = project.cluster_agents.list(get_all=True)

Register a cluster agent with a project::

    cluster_agent = project.cluster_agents.create({"name": "Agent 1"})

Retrieve a specific cluster agent for a project::

    cluster_agent = project.cluster_agents.get(cluster_agent.id)

Delete a registered cluster agent from a project::

    cluster_agent = project.cluster_agents.delete(cluster_agent.id)
    # or
    cluster.delete()