Adding custom fields in Kong while adding service


#1

My requirement is to post multiple service information to KONG GW. And later to add rate limiting and authentication plugins over them.
My query is, while adding a service, can i give my own fields in data. Say for example,
curl -i -X POST
–url http://localhost:8001/services/
–data ‘name=example-service’
–data ‘url=http://mockbin.org’
–data ‘serVersion=0.1’

Here serVersion is unknown to Kong it seems. In such cases, while my service have additional infos, how can I add this to Kong ?

I am new to Kong, and hence might be lacking in few understandings. Kindly apologize.


#2

https://docs.konghq.com/0.14.x/admin-api/#add-service doesn’t show any attribute like serVersion - and Kong doesn’t yet support adding arbitrary keys or tags to entities.

If Kong doesn’t have a field for storing the info you want to store, then you need to store it elsewhere, and somehow link that record to the relevant Kong record(s).

If this answers your question, please mark this topic as “Solved” - thanks!


#3

Hi. Thanks for the reply.

I was using cassandra 2.2 as DB for Kong.

Following your reply,
I altered TABLE entry of service(kong.services) to include a custom_data field.
Where I believe I can add my data.

Is this matching with the method which you pointed ?