Repository navigation
Add the non-Pro 2.5.3 media API, account permissions and explicit virtual device state - #70
Merged
Merged
Conversation
…tual device state NanoKVM 2.5.3 replaced the image page with a storage API, added fine-grained account permissions and let a virtual device be set on or off instead of toggled; 2.5.4 added directory creation. - MediaController covers /storage/media: list, state, transfer status, mount, eject, delete, and listing, upload, download, mkdir (2.5.4) and delete of files inside an image or the shared data partition. rel names an image; leaving it out addresses the partition. A refused download raises the device error and leaves no file behind. - get_permissions(), Permission, and permissions= / rotate_mcp_key= on create_user, update_user and delete_user; GetAccountRsp and UserInfo carry the grants. Older firmware refuses the new arguments locally. - update_virtual_device(enable=) needs non-Pro 2.5.3: older firmware ignores the field and toggles, so it is refused there. - StatusImageRsp gains loaded and total.
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.
Follow-up to #69: brings the client up to NanoKVM non-Pro 2.5.3 and 2.5.4 (CHANGELOG).
Virtual media (2.5.3)
MediaControllerfor/storage/media/*:get_media,get_media_state,get_media_status,mount_media,eject_media,delete_media,list_media_files,upload_media_file,download_media_file,delete_media_file,download_media, andcreate_media_directory(2.5.4).relnames an image. Leaving it out means the shared data partition.Account permissions (2.5.3)
get_permissions()returns the catalog, and there is a newPermissionenum.create_user,update_useranddelete_usergainpermissions=androtate_mcp_key=(ondelete_user, onlyrotate_mcp_key=).GetAccountRsp.permissionsandUserInfo.permissionscarry the grants. Anulllist from the device reads as empty.Virtual device state (2.5.3)
update_virtual_device(enable=...)sets the device on or off instead of toggling it.StatusImageRspgainsloadedandtotal.docs/api.mddocuments all of the above.Tests:
pytest529 passed. Pre-commit (ruff, ruff-format, codespell, mypy) passed. Not tested on a live device on 2.5.3 or 2.5.4.