<div dir="ltr">Hi Eric,<div>When I run <span style="font-size:12.8px">curl -XGET </span><a href="http://localhost:19200/apiman_gateway/service/_search" rel="noreferrer" target="_blank" style="font-size:12.8px">http://localhost:19200/apiman_gateway/service/_search</a> , I do see Old implementation URLs.</div><div>I have restarted apiman many times. Still the old url is being used.</div><div><br></div><div>Thanks</div><div>Sanjay</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 8:06 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">Thanks. :)<br>
<br>
As for the index files - I think the bigger question is what do you see when you do a search in elastic?<br>
<br>
curl -XGET <a href="http://localhost:19200/apiman_gateway/service/_search" rel="noreferrer" target="_blank">http://localhost:19200/apiman_gateway/service/_search</a><br>
<br>
What are the results of doing the above?<br>
<br>
I don't have any idea what might be stored in the elasticsearch index files - so I can't tell you what to expect from a grep.<br>
<br>
I *can* tell you that there is no re-index operation. When you update the document (via the PUT http request) it should store the new data in ES *and* update its indices. That's EXACTLY what apiman does internally when updating/adding/publishing a service.<br>
<br>
After restarting apiman, is your gateway still using the wrong (old) endpoint?<br>
<br>
One last thing - if you are planning on using this in production, we really recommend that you install a standalone instance of elasticsearch rather than using the one included in the apiman quickstart. There's more information in the production guide:<br>
<br>
<a href="http://www.apiman.io/latest/production-guide.html" rel="noreferrer" target="_blank">http://www.apiman.io/latest/production-guide.html</a><br>
<br>
-Eric<span class=""><br>
<br>
On 1/26/2016 2:08 AM, Sanjay Melinamani wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Eric,<div><div class="h5"><br>
Congratulations on the new Release! I can't wait to migrate to 1.2.1 !!<br>
<br>
Meanwhile I am still having hard time replacing the implementation URL<br>
used in a published API.. Here is what I see..<br>
When I execute GET, I see the new implementation URL used<br>
(<a href="http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf" rel="noreferrer" target="_blank">http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf</a>)<br>
but when I do a grep on my old URL "10.0.0.241", I see the matches in<br>
index files. How can I rebuild the indices?<br>
<br>
<br>
[ec2-user@Prism-ST-GWY wildfly-8.2.0.Final]$ 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://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf" rel="noreferrer" target="_blank">http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf</a>","endpointType":"rest","publicService":false,"organizationId":"prism","serviceId":"osa","version":"1.0","endpointProperties":[],"policies":[]}<br>
<br>
<br>
[ec2-user@Prism-ST-GWY wildfly-8.2.0.Final]$ grep -rnw . -e "10.0.0.241"<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_0.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_1y.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_1z.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_2.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_3.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_4.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/4/index/_0.cfs<br>
matches<br>
Binary file<br>
./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/4/index/_1.cfs<br>
matches<br>
<br>
Thanks<br>
Sanjay<br>
<br>
<br>
<br>
On Thu, Jan 7, 2016 at 8:08 AM, Eric Wittmann <<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><br></div></div><div><div class="h5">
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>>> wrote:<br>
<br>
No nothing like that should be needed. Doing that curl command is<br>
just like doing an UPDATE on a SQL db. I even tried it locally<br>
(switching between URLs by updating that record in elastic) and<br>
didn't have any problems.<br>
<br>
Did you restart apiman after the change? Unfortunately (for this<br>
use-case) apiman will cache the information so that it doesn't have<br>
to do a lookup in ES for *every* request.<br>
<br>
Also what happens how when you do the -XGET call? Do you see the<br>
new data?<br>
<br>
-Eric<br>
<br>
On 1/7/2016 2:58 AM, Sanjay Melinamani wrote:<br>
<br>
Hi Eric,<br>
Even after the restart, gateway is still using the OLD service<br>
implementation URL. Do I have to rebuild the index, clear cache<br>
or do<br>
something else??<br>
When grepped for old URL, I can still see it in indices folder of<br>
elastic search. I tried to clear cache and used refresh commands<br>
but did<br>
not work!<br>
<br>
Appreciate if you can provide some more guidance here.<br>
<br>
Thanks<br>
Sanjay<br>
<br>
<br>
On Wed, Jan 6, 2016 at 12:57 PM, Sanjay Melinamani<br>
<<a href="mailto:mssanjay@gmail.com" target="_blank">mssanjay@gmail.com</a> <mailto:<a href="mailto:mssanjay@gmail.com" target="_blank">mssanjay@gmail.com</a>><br></div></div><span class="">
<mailto:<a href="mailto:mssanjay@gmail.com" target="_blank">mssanjay@gmail.com</a> <mailto:<a href="mailto:mssanjay@gmail.com" target="_blank">mssanjay@gmail.com</a>>>> wrote:<br>
<br>
Thanks a ton! Worked like a charm :)<br>
<br>
Sanjay<br>
<br>
<br>
On Tue, Jan 5, 2016 at 8:01 AM, Eric Wittmann<br>
<<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a> <mailto:<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><br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>>>> wrote:<br>
<br>
Drop the /_source from the PUT command. :)<br>
<br>
-Eric<br>
<br>
On 1/5/2016 1:45 AM, Sanjay Melinamani wrote:<br>
<br>
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<br>
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>
<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><br>
-d<br>
<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<br>
[/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<br>
<<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>><br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a> <mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>>><br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>><br>
<br>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><br>
<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<br>
backend<br>
implementation<br>
endpiont URL without creating a new version of<br>
the service.<br>
<br>
However, if this is a one-off sort of thing<br>
then you<br>
may be able to<br>
get it done. It depends mostly on what<br>
configuration<br>
you are<br>
using. But I'll explain based on the most<br>
recent 1.1.x<br>
release<br>
(1.1.9.Final) with its default configuration.<br>
<br>
The Manager and Gateway are decoupled,<br>
resulting in the<br>
duplication<br>
of *some* of the data (including the endpoint<br>
URL). So<br>
when you<br>
"publish" a service from the Manager, the<br>
Gateway is given<br>
information about the service. This<br>
information is<br>
stored in the<br>
Gateway's "registry". By default the registry<br>
implementation is<br>
elasticsearch. So if you wanted to change the<br>
endpoint<br>
URL for a<br>
service, you would need to update that<br>
information in<br>
your Database<br>
(you did this) *and* in elasticsearch.<br>
<br>
It's actually not that difficult to update the<br>
information in<br>
elasticsearch. You'll need to find the<br>
correct record<br>
and then<br>
update it. If you're using the default<br>
installation,<br>
then ES is<br>
running on port 19200. If you want to change the<br>
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<br>
the bits<br>
you want to<br>
change, and then update it like so (as an<br>
example -<br>
please replace<br>
the JSON below with the JSON you get back from<br>
the GET<br>
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><br>
-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<br>
apiman so that<br>
the Gateway<br>
picks up the changes.<br>
<br>
Note: we are making some changes in apiman<br>
1.2.x that<br>
will make all<br>
of this easier under some circumstances. In<br>
particular, as of<br>
apiman 1.2.0.Final you will be able to re-publish<br>
"Public" services<br>
(now called APIs). So if the API is public<br>
then you<br>
can simply make<br>
changes and then republish those changes to the<br>
Gateway. If the API<br>
is *not* public then the current semantics are the<br>
same: you cannot<br>
make changes and republish because that may<br>
violate<br>
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<br>
existing API<br>
that I have<br>
published to<br>
consumers, I like to change its backend<br>
implementation end point URL<br>
without changing the API service version.<br>
I updated the backend implementation URL in<br>
database table<br>
"service_versions". I can see the updated<br>
URL from<br>
UI but still the<br>
gateway is using the old implementation<br>
URL specified.<br>
Does it cache the implementation URL once the<br>
service is<br>
published ? Is<br>
there anyway I can update the<br>
implementation URL<br>
for an<br>
existing service?<br>
<br>
Appreciate your time and help.<br>
<br>
Thanks<br>
Sanjay<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Apiman-user mailing list<br>
<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>
<mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a><br>
<mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a>>><br>
<mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a><br>
<mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a>><br>
<mailto:<a href="mailto:Apiman-user@lists.jboss.org" target="_blank">Apiman-user@lists.jboss.org</a><br></div></div>
<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>
<br>
<br>
<br>
</blockquote>
</blockquote></div><br></div>