summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/geo_nodes.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-01 01:04:53 +0100
committerGitHub <noreply@github.com>2021-12-01 01:04:53 +0100
commit8d76826fa64460e504acc5924f859f8dbc246b42 (patch)
tree083fefada982c795e2415092794db429abb0c184 /gitlab/v4/objects/geo_nodes.py
parent5a1678f43184bd459132102cc13cf8426fe0449d (diff)
parent86ab04e54ea4175f10053decfad5086cda7aa024 (diff)
downloadgitlab-master.tar.gz
Merge pull request #1723 from python-gitlab/jlvillal/dead_mastermaster
Close-out `master` branch
Diffstat (limited to 'gitlab/v4/objects/geo_nodes.py')
-rw-r--r--gitlab/v4/objects/geo_nodes.py93
1 files changed, 0 insertions, 93 deletions
diff --git a/gitlab/v4/objects/geo_nodes.py b/gitlab/v4/objects/geo_nodes.py
deleted file mode 100644
index 16fc783..0000000
--- a/gitlab/v4/objects/geo_nodes.py
+++ /dev/null
@@ -1,93 +0,0 @@
-from gitlab import cli
-from gitlab import exceptions as exc
-from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import (
- DeleteMixin,
- ObjectDeleteMixin,
- RetrieveMixin,
- SaveMixin,
- UpdateMixin,
-)
-
-__all__ = [
- "GeoNode",
- "GeoNodeManager",
-]
-
-
-class GeoNode(SaveMixin, ObjectDeleteMixin, RESTObject):
- @cli.register_custom_action("GeoNode")
- @exc.on_http_error(exc.GitlabRepairError)
- def repair(self, **kwargs):
- """Repair the OAuth authentication of the geo node.
-
- Args:
- **kwargs: Extra options to send to the server (e.g. sudo)
-
- Raises:
- GitlabAuthenticationError: If authentication is not correct
- GitlabRepairError: If the server failed to perform the request
- """
- path = "/geo_nodes/%s/repair" % self.get_id()
- server_data = self.manager.gitlab.http_post(path, **kwargs)
- self._update_attrs(server_data)
-
- @cli.register_custom_action("GeoNode")
- @exc.on_http_error(exc.GitlabGetError)
- def status(self, **kwargs):
- """Get the status of the geo node.
-
- Args:
- **kwargs: Extra options to send to the server (e.g. sudo)
-
- Raises:
- GitlabAuthenticationError: If authentication is not correct
- GitlabGetError: If the server failed to perform the request
-
- Returns:
- dict: The status of the geo node
- """
- path = "/geo_nodes/%s/status" % self.get_id()
- return self.manager.gitlab.http_get(path, **kwargs)
-
-
-class GeoNodeManager(RetrieveMixin, UpdateMixin, DeleteMixin, RESTManager):
- _path = "/geo_nodes"
- _obj_cls = GeoNode
- _update_attrs = RequiredOptional(
- optional=("enabled", "url", "files_max_capacity", "repos_max_capacity"),
- )
-
- @cli.register_custom_action("GeoNodeManager")
- @exc.on_http_error(exc.GitlabGetError)
- def status(self, **kwargs):
- """Get the status of all the geo nodes.
-
- Args:
- **kwargs: Extra options to send to the server (e.g. sudo)
-
- Raises:
- GitlabAuthenticationError: If authentication is not correct
- GitlabGetError: If the server failed to perform the request
-
- Returns:
- list: The status of all the geo nodes
- """
- return self.gitlab.http_list("/geo_nodes/status", **kwargs)
-
- @cli.register_custom_action("GeoNodeManager")
- @exc.on_http_error(exc.GitlabGetError)
- def current_failures(self, **kwargs):
- """Get the list of failures on the current geo node.
-
- Args:
- **kwargs: Extra options to send to the server (e.g. sudo)
-
- Raises:
- GitlabAuthenticationError: If authentication is not correct
- GitlabGetError: If the server failed to perform the request
-
- Returns:
- list: The list of failures
- """
- return self.gitlab.http_list("/geo_nodes/current/failures", **kwargs)