[racktables-users] Re: writing a restful API in php for Racktables

  • From: Chubby Wl <chubbypama@xxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Wed, 8 Aug 2012 18:05:40 -0400

Ian,

I just downloaded the skeleton code you attached to your email back in
July.
It looks fantastic. I tried the few URL examples you posted using my data
and it worked.  Thanks for your work on this.  It's going to benefit a lot
of folks.

I'm just new to racktables / open source development and am trying to get
up to speed quickly.
We actually need an api in short order and I'm trying to evaluate what my
options are.
I guess I'm debating whether or not I should:
-  create my own API of sorts to access RT data using an MVC framework,
strictly for internal use only.
- use your API,depending how far along you are.
- volunteer to help - depending on whether or not I have the skill sets you
need.

Do you have any comments / thoughts?
Have you been posting your code somewhere?  I'd be curious to see what
types of changes you've implemented.

Thanks for your time.

cp.

On Fri, Jul 13, 2012 at 12:41 PM, Ian Bettinger <ibettinger@xxxxxxxxx>wrote:

> Alexey,
>
> Thanks for the input. I've taken a first stab at a skeleton version of
> the api.php file, adding just a couple of methods for now.
>
> Can you take a look and see if this approach makes sense to you? I'm
> not totally familiar with RT's coding style, how you organize things,
> etc, so let me know what needs to change and I'll incorporate it going
> forward.
>
> Cheers,
> Ian
>
>
>
>
>
> On Tue, Jul 3, 2012 at 10:19 PM, Alexey Andriyanov <alan@xxxxxxxxxx>
> wrote:
> > 04.07.2012 02:53, Ian Bettinger пишет:
> >
> >
> >> I've been looking at the plugins system -- is there any way to use it
> >> and not get a fully rendered HTML UI? I'll need to respond to requests
> >> with a plain JSON/YAML page. The only way I could figure to do this
> >> would be to register a new operation that uses the page=file,
> >> tab=download to trigger the appropriate Content-Type: header in the
> >> "download" module.
> >
> >
> > You can install your handler to the default 'interface' module, and then
> > replace the Content-type header, clear the output buffer by calling
> > ob_end_clean() until ob_get_level() returns 0, and call exit() after
> > rendering your result. But I agree, this method is not elegant.
> >
> >
> >> Assuming I haven't missed an easier way to circumvent the navigation
> >> rendering, maybe the best thing would be for me to create an api.php
> >> file at the same level as index.php and go forward with your plan
> >> otherwise. Might be easier to do the REST conversion later that way,
> >> as well.
> >
> > Yes, this could be a better idea.
> >
> >
> > --
> > Best regards,
> > Alexey
> >
> >
>

Other related posts: