<div dir="ltr">Hi Eric,<div>Congratulations on the new Release! I can't wait to migrate to 1.2.1 !!</div><div><br></div><div>Meanwhile I am still having hard time replacing the implementation URL used in a published API.. Here is what I see..</div><div>When I execute GET, I see the new implementation URL used (<a href="http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf">http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf</a>) but when I do a grep on my old URL "10.0.0.241", I see the matches in index files. How can I rebuild the indices?</div><div><br></div><div><div><br></div><div>[ec2-user@Prism-ST-GWY wildfly-8.2.0.Final]$ curl -XGET <a href="http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source">http://localhost:19200/apiman_gateway/service/prism:osa:1.0/_source</a></div><div>{"endpoint":"<a href="http://internal-XXXX.elb.amazonaws.com:8080/hra-web/services/engine/OSA/cf">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":[]}</div><div><br></div><div><br></div><div>[ec2-user@Prism-ST-GWY wildfly-8.2.0.Final]$ grep -rnw . -e "10.0.0.241"</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_0.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_1y.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/3/index/_1z.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_2.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_3.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/2/index/_4.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/4/index/_0.cfs matches</div><div>Binary file ./standalone/data/es/data/apiman/nodes/0/indices/apiman_gateway/4/index/_1.cfs matches</div></div><div><br></div><div>Thanks</div><div>Sanjay</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 8:08 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">No nothing like that should be needed. Doing that curl command is just like doing an UPDATE on a SQL db. I even tried it locally (switching between URLs by updating that record in elastic) and didn't have any problems.<br>
<br>
Did you restart apiman after the change? Unfortunately (for this use-case) apiman will cache the information so that it doesn't have 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 new data?<br>
<br>
-Eric<span class=""><br>
<br>
On 1/7/2016 2:58 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="">
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 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 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 <<a href="mailto:mssanjay@gmail.com" target="_blank">mssanjay@gmail.com</a><br></span><span class="">
<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></span><span class="">
<<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>>> 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 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><br>
-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<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> <mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a>><br></span>
<mailto:<a href="mailto:eric.wittmann@redhat.com" target="_blank">eric.wittmann@redhat.com</a><div><div class="h5"><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 backend<br>
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<br>
may be able to<br>
get it done. It depends mostly on what configuration<br>
you are<br>
using. But I'll explain based on the most recent 1.1.x<br>
release<br>
(1.1.9.Final) with its default configuration.<br>
<br>
The Manager and Gateway are decoupled, resulting in the<br>
duplication<br>
of *some* of the data (including the endpoint URL). So<br>
when you<br>
"publish" a service from the Manager, the Gateway is given<br>
information about the service. This 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 endpoint<br>
URL for a<br>
service, you would need to update that 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 correct record<br>
and then<br>
update it. If you're using the default 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 the bits<br>
you want to<br>
change, and then update it like so (as an example -<br>
please replace<br>
the JSON below with the JSON you get back from 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 apiman so that<br>
the Gateway<br>
picks up the changes.<br>
<br>
Note: we are making some changes in apiman 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 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 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 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 URL from<br>
UI but still the<br>
gateway is using the old implementation URL specified.<br>
Does it cache the implementation URL once the<br>
service is<br>
published ? Is<br>
there anyway I can update the 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>
Apiman-user mailing list<br>
<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>
<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>
</blockquote>
</blockquote></div><br></div>