Skip to content

Commit

Permalink
Merge pull request #102 from vanntile/master
Browse files Browse the repository at this point in the history
PX-6348: add restart_required endpoint
  • Loading branch information
rsemkin authored Jan 22, 2024
2 parents d74becc + dfeb913 commit 1dcda54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions privx_api/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,15 @@ class MonitorServiceEnum:


class PrivXSettingsEnum:
RESTART_REQUIRED = "SETTINGS.RESTART_REQUIRED"
SCOPE = "SETTINGS.SCOPE"
SCOPE_SCHEMA = "SETTINGS.SCOPE_SCHEMA"
SCOPE_SECTION = "SETTINGS.SCOPE_SECTION"
SCOPE_SECTION_SCHEMA = "SETTINGS.SCOPE_SECTION_SCHEMA"
STATUS = "SETTINGS.STATUS"

urls = {
RESTART_REQUIRED: "/settings/api/v1/restart_required/{scope}",
SCOPE: "/settings/api/v1/settings/{scope}",
SCOPE_SCHEMA: "/settings/api/v1/schema/{scope}",
SCOPE_SECTION: "/settings/api/v1/settings/{scope}/{section}",
Expand Down
14 changes: 14 additions & 0 deletions privx_api/settings_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@


class SettingsServiceAPI(BasePrivXAPI):
def restart_required(self, scope: str, scope_params: dict) -> PrivXAPIResponse:
"""
Verify if restart is required for given settings scope.
Returns:
PrivXAPIResponse
"""
response_status, data = self._http_post(
UrlEnum.SETTINGS.RESTART_REQUIRED,
path_params={"scope": scope},
body=scope_params,
)
return PrivXAPIResponse(response_status, HTTPStatus.OK, data)

def get_settings_service_status(self) -> PrivXAPIResponse:
"""
Get microservice status.
Expand Down

0 comments on commit 1dcda54

Please sign in to comment.