Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
- Subject: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
- From: Klaus Berkling <email@hidden>
- Date: Tue, 21 Jun 2011 13:26:16 -0700
Hi all, mostly Pascal
I have progressed in my project and found problem with adding instances in the REST implementation.
I'm now looking at adding instances on a specific host. When adding an instance there is an instance added to each host not just the one indicated in the REST action. The code in JavaMonitor looks like this:
public WOActionResults addInstanceAction() throws Throwable { checkPassword(); MApplication application = (MApplication) routeObjectForKey("name"); addInstance(application, (MHost)routeObjectForKey("host"), false); return response(application, ERXKeyFilter.filterWithNone()); }
However the URL following the documentation passes the host as a key/value pair:
So this could work:
addInstance(application, (MHost)request().stringFormValueForKey("host"), false);
I can't type-cast the string to a MHost but I don't want to fix it this way anyways.
I saw this using the REST way:
restHandler.insertRoute(new ERXRoute("MApplication","/mApplications/{name:MApplication}/addInstance/{host:MHost}", ERXRoute.Method.Get, MApplicationController.class, "addInstance"));
I tried this:
which trows an exception.
Any thoughts one this? What's the preferred way of fixing this?
kib
"Success is not final, failure is not fatal: it is the courage to continue that counts." Winston Churchill
Klaus Berkling Web Application Dev. & Systems Administrator DynEd International, Inc.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden