• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)


  • Subject: Re: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
  • From: Pascal Robert <email@hidden>
  • Date: Tue, 21 Jun 2011 16:34:52 -0400


Le 2011-06-21 à 16:26, Klaus Berkling a écrit :

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:

http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance&host=10.0.0.10

That would be a ?, not a &

(http://wiki.objectstyle.org/confluence/display/WO/Wonder+JavaMonitor+and+wotaskd)

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:

http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance/10.0.0.10

which trows an exception.

Any thoughts one this? What's the preferred way of fixing this?

Honestly, I don't know what I was taking (and I never took drugs in my life :-)) when I did those interfaces. The real REST way would be to add a POST route to add a new instance. So the URL would be 
http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance/, and the host IP address would be pass in the request (body content).



 _______________________________________________
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

  • Follow-Ups:
    • Re: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
      • From: Klaus Berkling <email@hidden>
References: 
 >Adding Instances (was Re: Deleting instance with REST & JavaMonitor) (From: Klaus Berkling <email@hidden>)

  • Prev by Date: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
  • Next by Date: d2w - huh?
  • Previous by thread: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
  • Next by thread: Re: Adding Instances (was Re: Deleting instance with REST & JavaMonitor)
  • Index(es):
    • Date
    • Thread