File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,21 @@ def deregister(self, service_id):
274274 """
275275 return self ._put_no_response_body (['deregister' , service_id ])
276276
277+ def maintenance (self , service_id , enable = True , reason = None ):
278+ """Place given service into "maintenance mode".
279+
280+ :param str service_id: The id for the service
281+ :param bool enable: Enable maintenance mode
282+ :param str reason: Reason for putting node in maintenance
283+ :rtype: bool
284+
285+ """
286+ query_params = {'enable' : enable }
287+ if reason :
288+ query_params ['reason' ] = reason
289+ return self ._put_no_response_body (['maintenance' , service_id ],
290+ query_params )
291+
277292 def checks (self ):
278293 """Return the all the checks that are registered with the local agent.
279294 These checks were either provided through configuration files, or
You can’t perform that action at this time.
0 commit comments