<div dir="ltr">Thanks a ton! Worked like a charm :) <div><br></div><div>Sanjay</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 5, 2016 at 8:01 AM, Eric Wittmann <span dir="ltr"><<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Drop the /_source from the PUT command. :)<br>
<br>
-Eric<span class=""><br>
<br>
On 1/5/2016 1:45 AM, Sanjay Melinamani wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Thanks Eric for your reply! makes sense...<br>
<br>
I tried to use the two CURL commands.<br>
<br>
GET worked and I was able to see the end point being used.<br>
curl -XGET<br>
<a href="http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source" rel="noreferrer" target="_blank">http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source</a><br>
{"endpoint":"<a href="http://OLD_URL" rel="noreferrer" target="_blank">http://OLD_URL</a>","endpointType":"rest","publicService":false,"organizationId":"prism","serviceId":"osa","version":"1.0","endpointProperties":[],"policies":[]}<br>
<br>
<br>
<br>
But the PUT failed as below..<br>
<br>
curl -XPUT<br>
<a href="http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source" rel="noreferrer" target="_blank">http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source</a> -d<br>
'{"endpoint":"<a href="http://NEW_URL" rel="noreferrer" target="_blank">http://NEW_URL</a>","endpointType":"rest","publicService":false,"organizationId":"prism","serviceId":"osa","version":"1.0","endpointProperties":[],"policies":[]}'<br>
<br>
No handler found for uri [/apiman_gateway/service/prism:osa:1.0/_source]<br>
and method [PUT]<br>
<br>
<br>
Thanks again for your time<br>
<br>
Sanjay<br>
<br>
<br>
On Mon, Jan 4, 2016 at 11:26 AM, Eric Wittmann <<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><br></span><div><div class="h5">
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>>> wrote:<br>
<br>
Hi Sanjay, thanks for the questions.<br>
<br>
Currently there is no easy way to update the backend implementation<br>
endpiont URL without creating a new version of the service.<br>
<br>
However, if this is a one-off sort of thing then you may be able to<br>
get it done. It depends mostly on what configuration you are<br>
using. But I'll explain based on the most recent 1.1.x release<br>
(1.1.9.Final) with its default configuration.<br>
<br>
The Manager and Gateway are decoupled, resulting in the duplication<br>
of *some* of the data (including the endpoint URL). So when you<br>
"publish" a service from the Manager, the Gateway is given<br>
information about the service. This information is stored in the<br>
Gateway's "registry". By default the registry implementation is<br>
elasticsearch. So if you wanted to change the endpoint URL for a<br>
service, you would need to update that information in your Database<br>
(you did this) *and* in elasticsearch.<br>
<br>
It's actually not that difficult to update the information in<br>
elasticsearch. You'll need to find the correct record and then<br>
update it. If you're using the default installation, then ES is<br>
running on port 19200. If you want to change the following service:<br>
<br>
Organization: Example<br>
Service ID: MyService<br>
Version: 1.0<br>
<br>
Then you might do something like this:<br>
<br>
curl -XGET<br>
<a href="http://localhost:19200/apiman_gateway/service/Example:MyService:1.0/_source" rel="noreferrer" target="_blank">http://localhost:19200/apiman_gateway/service/Example:MyService:1.0/_source</a><br>
<br>
You could then take that JSON result, modify the bits you want to<br>
change, and then update it like so (as an example - please replace<br>
the JSON below with the JSON you get back from the GET above):<br>
<br>
curl -XPUT<br>
<a href="http://localhost:19200/apiman_gateway/service/Example:MyService:1.0" rel="noreferrer" target="_blank">http://localhost:19200/apiman_gateway/service/Example:MyService:1.0</a> -d '<br>
{<br>
"endpoint" : "<a href="http://UPDATED-ENDPOINT-HERE" rel="noreferrer" target="_blank">http://UPDATED-ENDPOINT-HERE</a>",<br>
"endpointType" : "rest",<br>
"publicService" : true,<br>
"organizationId" : "Example",<br>
"serviceId": "MyService",<br>
"version" : "1.0",<br>
"endpointProperties": [],<br>
"policies":[]<br>
}<br>
'<br>
<br>
Once this is done you'll have to restart apiman so that the Gateway<br>
picks up the changes.<br>
<br>
Note: we are making some changes in apiman 1.2.x that will make all<br>
of this easier under some circumstances. In particular, as of<br>
apiman 1.2.0.Final you will be able to re-publish "Public" services<br>
(now called APIs). So if the API is public then you can simply make<br>
changes and then republish those changes to the Gateway. If the API<br>
is *not* public then the current semantics are the same: you cannot<br>
make changes and republish because that may violate contracts that<br>
consumers have made with your API.<br>
<br>
-Eric<br>
<br>
<br>
<br>
On 12/29/2015 12:19 PM, Sanjay Melinamani wrote:<br>
<br>
Hi All,<br>
I am using APIMAN 1.1.9 and for an existing API that I have<br>
published to<br>
consumers, I like to change its backend implementation end point URL<br>
without changing the API service version.<br>
I updated the backend implementation URL in database table<br>
"service_versions". I can see the updated URL from UI but still the<br>
gateway is using the old implementation URL specified.<br>
Does it cache the implementation URL once the service is<br>
published ? Is<br>
there anyway I can update the implementation URL for an<br>
existing service?<br>
<br>
Appreciate your time and help.<br>
<br>
Thanks<br>
Sanjay<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Apiman-user mailing list<br></div></div>
<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a> <mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a>><br>
<a href="https://lists.jboss.org/mailman/listinfo/apiman-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/apiman-user</a><br>
<br>
<br>
</blockquote>
</blockquote></div><br></div>