Add non-Pro DNS management API#19
Merged
Merged
Conversation
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
Adds client support for NanoKVM 2.4.1 non-Pro DNS management APIs.
This covers the upstream DNS endpoints added to Network settings:
GET /network/dnsPOST /network/dnsDetails
DNSModeDNSInfoGetDNSRspSetDNSReqNanoKVMClient.get_dns().NanoKVMClient.set_dns(mode, servers=None).non_pro="2.4.1"using the application-version guard.set_dns("dhcp").{"mode": "dhcp", "servers": []}when servers are omitted.get_dns()Example Responseset_dns()Example Responseset_dns()returnsNoneon success.Example manual DNS call:
Request JSON sent to NanoKVM:
{ "mode": "manual", "servers": ["1.1.1.1", "8.8.8.8"] }Successful upstream response envelope:
{ "code": 0, "msg": "success", "data": null }Example DHCP DNS call:
Request JSON sent to NanoKVM:
{ "mode": "dhcp", "servers": [] }Compatibility Notes
This is additive for supported non-Pro devices.
On unsupported hardware or older firmware, the client raises
NanoKVMNotSupportedErrorbefore calling the DNS endpoint. This avoids exposing lower-level HTTP/API errors for endpoints that are known not to exist.NanoKVM-Pro was tested directly and returned HTTP
404 Not FoundforGET /network/dns, so these methods remain non-Pro-only.Validation
Live device validation was previously performed against a NanoKVM PCIe device on application
2.4.1, including manual DNS mode and restoring DHCP afterward.