Hi Ole, Thanks for you kindly help. Now I know the data type mapping, and I have another question, When I pass parameters to a python api, the api excuted successfully, no error reported, but the final result is not what I want to get, So I want to debug to know where the issue existed, Does python api have debug mode to step in an python api internal to know the parameter that pass to the api is valid ?
Best Regards Yulong Pei -----Original Message----- From: vpp-dev@lists.fd.io [mailto:vpp-dev@lists.fd.io] On Behalf Of Ole Troan Sent: Tuesday, May 7, 2019 3:20 PM To: Pei, Yulong <yulong....@intel.com> Cc: vpp-dev@lists.fd.io; csit-...@lists.fd.io; Ni, Hongjun <hongjun...@intel.com>; Liu, Yu Y <yu.y....@intel.com>; Kinsella, Ray <ray.kinse...@intel.com> Subject: Re: [vpp-dev] [csit-dev] how to know data type mapping between *.api.json with PYTHON API ? Hi Yulong, Good question. That has been on my list of things to document for a while. Does https://gerrit.fd.io/r/#/c/19389/ answer your question? Please suggest improvements and improve the text as you notice gaps. Best regards, Ole > On 7 May 2019, at 07:49, Pei, Yulong <yulong....@intel.com> wrote: > > Hello vpp-dev & csit-dev, > > I have a question about how to know data type mapping between *.api.json > with PYTHON API ? > > Let me use “./src/vnet/ip/ip.api” as example, as I know, vppapigen will > autogenerate “ip.api.json” from “ip.api” > > And then vpp_papi can autogenerate its python api from “ip.api.json”, is > there any way to know data type mapping between *.api.json with PYTHON API ? > > For example: > > In “./src/vnet/ip/ip.api”, > > define ip6_fib_details > { > u32 context; > u32 table_id; > u8 table_name[64]; > u8 address_length; > u8 address[16]; > u32 count; > u32 stats_index; > vl_api_fib_path_t path[count]; > }; > > Then in “ip.api.json”, I got, > > [ > "ip6_fib_details", > [ > "u16", > "_vl_msg_id" > ], > [ > "u32", > "context" > ], > [ > "u32", > "table_id" > ], > [ > "u8", > "table_name", > 64 > ], > [ > "u8", > "address_length" > ], > [ > "u8", > "address", > 16 > ], > [ > "u32", > "count" > ], > [ > "u32", > "stats_index" > ], > [ > "vl_api_fib_path_t", > "path", > 0, > "count" > ], > { > "crc": "0xef11e94d" > } > ], > > My question is that which kind of python data type can be used to map below > json types ? > [ > "u8", > "table_name", > 64 > ], > > [ > "u8", > "address", > 16 > ], > > [ > "vl_api_fib_path_t", > "path", > 0, > "count" > ], > > Best Regards > Yulong Pei > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > > View/Reply Online (#3484): https://lists.fd.io/g/csit-dev/message/3484 > Mute This Topic: https://lists.fd.io/mt/31529209/675193 > Group Owner: csit-dev+ow...@lists.fd.io > Unsubscribe: https://lists.fd.io/g/csit-dev/unsub [otr...@employees.org] > -=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#12952): https://lists.fd.io/g/vpp-dev/message/12952 Mute This Topic: https://lists.fd.io/mt/31529576/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-