Hi, I have been working on varlink implementation and there is issue. Nmstate schema uses hyphen for key values but varlink doesn’t support hyphen instead they recommend to use underscore. I have implemented functions convert to nmstate schema format to varlink format and vise-versa for operations but when passing data via varlink it should be in varlink supported format. Should I change the schema to match varlink format or leave it? Nmstate schema format output {dns-resolver': {'config': { 'server': [], 'search': [] } } Varlink format output {'dns_resolver': {'config': {'search': [], 'server': [] } }
Hello!
In my opinion, we should force the users to use the varlink format. In order to do this, when implementing the schema constants getters we can convert them to the varlink format. What do you think? Thanks!
On Mon, May 18, 2020 at 10:29 PM Arunagirinadan Sudharshan sudhan97@fedoraproject.org wrote:
Hi, I have been working on varlink implementation and there is issue. Nmstate schema uses hyphen for key values but varlink doesn’t support hyphen instead they recommend to use underscore. I have implemented functions convert to nmstate schema format to varlink format and vise-versa for operations but when passing data via varlink it should be in varlink supported format. Should I change the schema to match varlink format or leave it? Nmstate schema format output {dns-resolver': {'config': { 'server': [], 'search': [] } } Varlink format output {'dns_resolver': {'config': {'search': [], 'server': [] } } _______________________________________________ nmstate-devel mailing list -- nmstate-devel@lists.fedorahosted.org To unsubscribe send an email to nmstate-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/nmstate-devel@lists.fedorahoste...
On Mon, May 18, 2020 at 08:29:10PM -0000, Arunagirinadan Sudharshan wrote:
Hi, I have been working on varlink implementation and there is issue. Nmstate schema uses hyphen for key values but varlink doesn’t support hyphen instead they recommend to use underscore.
Yes. The varlink definition is:
field_name [A-Za-z](_?[A-Za-z0-9])*
I have implemented functions convert to nmstate schema format to varlink format and vise-versa for operations but when passing data via varlink it should be in varlink supported format. Should I change the schema to match varlink format or leave it?
Changing schema will break backward compatibility which is not a good choice.
The varlink interface does not have to compile with existing schema. You can convert all hyphen to underscore in varlink interface definition.
Hi,
Am Di., 19. Mai 2020 um 09:35 Uhr schrieb Gris Ge fge@redhat.com:
The varlink interface does not have to compile with existing schema. You can convert all hyphen to underscore in varlink interface
what is the schema you want to do define in varlink? In my proof-of-concept it was:
interface io.nmstate
method Set(state: object) -> (state: object) method Get() -> (state: object)
This should make it work with Nmstate using dashes in the state. It seems that you are going to define the details for the state in varlink as well. If this is causing too much trouble, just define the state as object. This will also simplify it when new items are added to the Nmstate state schema. I guess the Set should be improved to also accept other options regarding checkpoints and return the checkpoint and the methods for checkpoint handling need to be added. Also the errors should be mentioned.
What do you think?
Thanks Till
Thanks, then its easier defining varlink interface.
nmstate-devel@lists.fedorahosted.org