diff --git a/features/patroni_api.feature b/features/patroni_api.feature index 57810173..bf1e2fa9 100644 --- a/features/patroni_api.feature +++ b/features/patroni_api.feature @@ -86,7 +86,7 @@ Scenario: check the scheduled restart Then I receive a response code 202 And I sleep for 10 seconds And Response on GET http://127.0.0.1:8008/patroni contains pending_restart after 10 seconds - Given I issue a scheduled restart at http://127.0.0.1:8008 in 1 seconds with {"with_pending_restart_flag": "True"} + Given I issue a scheduled restart at http://127.0.0.1:8008 in 1 seconds with {"restart_pending": "True"} Then I receive a response code 202 And Response on GET http://127.0.0.1:8008/patroni does not contain pending_restart after 10 seconds diff --git a/patroni/api.py b/patroni/api.py index d89ec409..756031f4 100644 --- a/patroni/api.py +++ b/patroni/api.py @@ -216,7 +216,7 @@ class RestApiHandler(BaseHTTPRequestHandler): status_code = 400 data = "PostgreSQL version should be in the first.major.minor format" break - elif k != 'with_pending_restart_flag': + elif k != 'restart_pending': status_code = 400 data = "Unknown filter for the scheduled restart: {0}".format(k) break diff --git a/patroni/ha.py b/patroni/ha.py index f0803708..64105067 100644 --- a/patroni/ha.py +++ b/patroni/ha.py @@ -464,7 +464,7 @@ class Ha(object): if (restart_data and isinstance(restart_data, dict) and not self.restart_matches(restart_data.get('role'), restart_data.get('postgres_version'), - ('with_pending_restart_flag' in restart_data))): + ('restart_pending' in restart_data))): return (False, "restart conditions are not satisfied") with self._async_executor: