Page 1 of 1

Question about Partitions and RESTful Web Services

Posted: Thu Jan 09, 2020 2:15 am
by pkoopmanpk
I build a small POC using the REST Api interface.

After promoting the source from partition DEV to partition ACC I get an error.

Code: Select all

{ "error":{ "messages":[ "Web alias has been used in multiple configurations." ] } }
The error itself is not very surprising.

I guess I can fix it by changing the paths from /getStock to /dev/getStock and /acc/getStock, but that would mean I have to change the API Definition manually every time I promote something.

So my question is: Is there a more elegant solution to handling REST Api's on multiple partitions?

Re: Question about Partitions and RESTful Web Services

Posted: Tue Jan 14, 2020 2:20 am
by jyoung
I don't know if this will help at all but, when you compile a Server Module with an API definition a "map" entry gets written into a conf file that is used at the SYSTEM level and not at the PARTITION level.

In the LANSA Install/run/conf folder should be the webmodules.conf file.
It's a JSON file that maps HTTP requests to Server Module Routines.

This file defines a default partition and I think you can define the partition in the map; however I don't think there is a way to map a single request to multiple partitions.

Be aware that any manual changes to this file will be lost when a Server Module with an API definition is compiled.

The only other "elegant" way that I am aware is to deploy to multiple SYSTEMS instead of PARTITIONS. This is what we do, we have a DEV and PROD system and each have the same partition. Deployments are not very nice, because we have to manually edit the webmodules.conf file on PROD when we deploy a new API (the modules are already compiled so we don't have to worry about over writes).

It would be nice if there was a xPartition variable (like xLanguage) that could be used in the URL to map to the correct partition.

You may want to contact support and see if they have a better option.

Hope this helps,
Joe

Re: Question about Partitions and RESTful Web Services

Posted: Wed Jan 15, 2020 1:54 am
by pkoopmanpk
Thank you for your information.