[op5-users] Ninja api

Michael Hobbs mike at mikehobbs.co.uk
Wed Aug 19 12:25:26 CEST 2009


Thanks for this Per

I'll work on a wrapper for grabbing host data

Mike

-----Original Message-----
From: op5-users-bounces at lists.op5.com
[mailto:op5-users-bounces at lists.op5.com] On Behalf Of Per Åsberg
Sent: 19 August 2009 09:59
To: Mailinglist for op5's products
Subject: Re: [op5-users] Ninja api

Michael Hobbs skrev:

> Um one thing I cant see application/methods do you mean
application/models?

That is correct, it should be application/models

> Also is it possible to call the api directly via the command line on the
> nagios server
> 
> e.g  could I do a get Host_Model/hostinfo?name=XX or something similar
> 
> and get back the host data for host XX as a string
> 
> or would I have to write a wrapper to call the data directly and return it

It is not possible to call the models directly. You should create a
controller 
(which you might call a wrapper if you like) which in turn uses the
method(s) 
in the model in question.

And yes, it is possible to use Ninja from the command line if you have 
configured cli_access in config/config.php to allow this (i.e not false).
See install_scripts/auth_import.php for examples.

Hope this helps.

Regards,

/Per

---------------
Per Åsberg
Senior Developer
www.op5.com

_______________________________________________
op5-users mailing list
op5-users at lists.op5.com
http://lists.op5.com/mailman/listinfo/op5-users


More information about the op5-users mailing list