CMLDEV-1472: Switch set_web_session_timeout to PUT with JSON body - #250
Closed
marpauli-cisco wants to merge 5 commits into
Closed
CMLDEV-1472: Switch set_web_session_timeout to PUT with JSON body#250marpauli-cisco wants to merge 5 commits into
marpauli-cisco wants to merge 5 commits into
Conversation
Server 2.11 replaced `PATCH /web_session_timeout/{timeout}` with `PUT /web_session_timeout` accepting a JSON body and returning the updated value. Update `SystemManagement.set_web_session_timeout` to PUT `{"timeout": ...}` and return the server's response.
Return type changes from `None` to `int`. Callers wanting the new effective value no longer need a follow-up GET. Legacy PATCH route still works server-side for older clients (soft deprecation).
Unit test asserts PUT call + JSON body + int return; runtime test mirrors get/set roundtrip against updated mock.
…ferred-CML-2.11-API-deprecations
… of github-cisco:CiscoDevNet/virl2-client into CMLDEV-1472-Discuss-deferred-CML-2.11-API-deprecations
Collaborator
Author
|
Parent PR #16 in CML was reverted and closed. Therefore, same goes for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SystemManagement.set_web_session_timeoutwith the 2.11 server API introduced under CMLDEV-1472:PUT /web_session_timeoutwith a JSON body, returning the effective timeout.Nonetoint, so callers get the server's post-update value without a follow-up GET.PATCH /web_session_timeout/{timeout}route still exists server-side (soft deprecation), older clients keep working, but this client now targets the new shape.Changes
PCL —
virl2_client/models/system.pyset_web_session_timeout(timeout: int) -> intnow issuesself._session.put(self._url_for("web_session_timeout"), json={"timeout": timeout})and returns.json().Tests
tests/test_system.py::test_set_web_session_timeout: asserts the client callssession.put("web_session_timeout", json={"timeout": 120})and returns the mocked int.tests/test_system_runtime.py::test_web_session_timeout_rt: extends the get/set roundtrip to mock and assert the PUT return value.Verification
poetry run pytest -c pytest.ini tests/test_system.py::test_set_web_session_timeout tests/test_system_runtime.py::test_web_session_timeout_rt— 2 passed.pre-commit run --files virl2_client/models/system.py tests/test_system.py tests/test_system_runtime.py— clean.simplePR undertests/integration/test_server.py::test_web_session_config, which asserts the round-trip against a live controller.