I want to achieve API exposing thru API GW which is running in a docker container.
Steps what I have followed.
-Installed API GW in a container.
-Installed stand alone IS for my API development in a different container.
-These two containers are running in one linux machine/ip ex:“1.10.12.122”.
-Created an Orders simple REST API in my IS & worked successfully from the Postman Client.
-During the test what I have observed is, these instances were showing a random host names in the admin pages. I thought it got it’s own container host names respectively.
-When I accessed the API with random host of my IS thru postman, its not able to reach the IS. So used the IP mentioned in the step-3 and did test from Postman and worked.
-So now i want to configure this API in API GW.
-Created a REST descriptor for my API to get a swagger format.
-I got a swagger format and saved into a file.
-Now opened the API GW and registered/created my orders API using create from file(swagger option).
-API is created successfully in API GW and linked postman as my application in application section.
-I have got the Gateway endpoint url for my API.
-Tried accessing the Gateway endpoint of my API from the postman and it’s saying host unreachable.
-Not sure why API GW is not able to talk to the IS which is running in a different container.
Most probably i’m thinking this is something related to communication between one container to another container but not sure if some thing else is required to as part API configuration.
Since i stuck in container to container communication, i tried one more scenario as keeping my Orders API inside the IS which is hosting the API GW, because these two are in same container.
-Moved Orders rest services to in-house IS(hosting the API GW), got a swagger template from REST API descriptor(newly created).
-Imported swagger file into API GW and created a brand new Orders API again in GW.
-I got a new end point of GW.
-Tried hitting this GW endpoint with relevant headers including x-Gateway-APIKey but no help.
-Finally understood, need to do some tweak in the Routing stage in the policies.
-By default Native endpoint URI is “http://randhost-of-that-container:5555/rest/${sys:resource_path}”.
-Added my service name space before the $ symbol and trimmed namespace from the resource and methods section and changed random host to localhost.
-Enabled API and did a hit from postman and got 200 OK but no response.
-I have written my rest service such a way that, if i send order number in the url, it will return the details of that particular order but here if added any extra number(example: passed order 1 in the url) to the GW endpoint, I am getting “orders/1” not found error.
Really wondering why gateway is not able to parse the resourceID and treating resourceID as part of resource.
I have gone thru all API GW SAG videos and its working fine in the videos without any extra settings and when i did same, it’s not working. I am trying with wM free trail docker images. Is this something related to the free trail build or i am missing any extra configurations.
Could you please spend few mins and guide me here, please.