@@ -3444,3 +3444,80 @@ def mark_all_as_done(self, **kwargs):
34443444 return int (result )
34453445 except ValueError :
34463446 return 0
3447+
3448+
3449+ class GeoNode (SaveMixin , ObjectDeleteMixin , RESTObject ):
3450+ @cli .register_custom_action ('GeoNode' )
3451+ @exc .on_http_error (exc .GitlabRepairError )
3452+ def repair (self , ** kwargs ):
3453+ """Repair the OAuth authentication of the geo node.
3454+
3455+ Args:
3456+ **kwargs: Extra options to send to the server (e.g. sudo)
3457+
3458+ Raises:
3459+ GitlabAuthenticationError: If authentication is not correct
3460+ GitlabRepairError: If the server failed to perform the request
3461+ """
3462+ path = '/geo_nodes/%s/repair' % self .get_id ()
3463+ server_data = self .manager .gitlab .http_post (path , ** kwargs )
3464+ self ._update_attrs (server_data )
3465+
3466+ @cli .register_custom_action ('GeoNode' )
3467+ @exc .on_http_error (exc .GitlabGetError )
3468+ def status (self , ** kwargs ):
3469+ """Get the status of the geo node.
3470+
3471+ Args:
3472+ **kwargs: Extra options to send to the server (e.g. sudo)
3473+
3474+ Raises:
3475+ GitlabAuthenticationError: If authentication is not correct
3476+ GitlabGetError: If the server failed to perform the request
3477+
3478+ Returns:
3479+ dict: The status of the geo node
3480+ """
3481+ path = '/geo_nodes/%s/status' % self .get_id ()
3482+ return self .manager .gitlab .http_get (path , ** kwargs )
3483+
3484+
3485+ class GeoNodeManager (RetrieveMixin , UpdateMixin , DeleteMixin , RESTManager ):
3486+ _path = '/geo_nodes'
3487+ _obj_cls = GeoNode
3488+ _update_attrs = (tuple (), ('enabled' , 'url' , 'files_max_capacity' ,
3489+ 'repos_max_capacity' ))
3490+
3491+ @cli .register_custom_action ('GeoNodeManager' )
3492+ @exc .on_http_error (exc .GitlabGetError )
3493+ def status (self , ** kwargs ):
3494+ """Get the status of all the geo nodes.
3495+
3496+ Args:
3497+ **kwargs: Extra options to send to the server (e.g. sudo)
3498+
3499+ Raises:
3500+ GitlabAuthenticationError: If authentication is not correct
3501+ GitlabGetError: If the server failed to perform the request
3502+
3503+ Returns:
3504+ list: The status of all the geo nodes
3505+ """
3506+ return self .gitlab .http_list ('/geo_nodes/status' , ** kwargs )
3507+
3508+ @cli .register_custom_action ('GeoNodeManager' )
3509+ @exc .on_http_error (exc .GitlabGetError )
3510+ def current_failures (self , ** kwargs ):
3511+ """Get the list of failures on the current geo node.
3512+
3513+ Args:
3514+ **kwargs: Extra options to send to the server (e.g. sudo)
3515+
3516+ Raises:
3517+ GitlabAuthenticationError: If authentication is not correct
3518+ GitlabGetError: If the server failed to perform the request
3519+
3520+ Returns:
3521+ list: The list of failures
3522+ """
3523+ return self .gitlab .http_list ('/geo_nodes/current/failures' , ** kwargs )
0 commit comments