[Openstack-docs] code to build api methods

Anne Gentle annegentle at justwriteclick.com
Tue Oct 22 15:41:35 UTC 2013


Hi Kersten,

I think lots of people are trying to solve for automation and small parts
do help. Thanks David for noting what's missing.

Just last week, Cyril Roelandt said he has written a Sphinx extension to
create the WADL for the Ceilometer docs, see
https://review.openstack.org/#/c/45592/. He says "generated by a Sphinx
extension I wrote (I haven't released it yet, because I need to make it's
ok with the legal department) from the RST files in Ceilometer."

I do want to make sure solutions between projects are similar so that we
have a single process for everyone to follow. But the source files may
differ. Kersten, can you take a look at Cyril's work and see if there's
similarity? I can't tell where your source comes from -- is it json? How
does all this fit into the Pecan and WSME discussions on validation?

Sorry for all the questions, just want to keep an eye on the big picture.

Thanks,
Anne


On Tue, Oct 22, 2013 at 9:35 AM, Kersten J Richter <kersten at us.ibm.com>wrote:

> Thank you for your response.
>
> Forgot the opening request! - added that into the logic.  This specific
> example didn't have any parameters so they are not included.  I will be
> looking at that piece later.
>
> As to this being a fragment, yes I know that.  Obviously the methods need
> to be put together into a single wadl file.  That is part of my question -
> if I created a program that transformed the first bit of code into the
> second, then is that even helpful?  I don't want to spend time on something
> that isn't going to be useful.
>
>
>
> Kersten J. Richter
> Software Engineer
> IBM, Rochester
> Home office: 952-652-5304
>
> If you lend someone $20 and never see that person again, it was probably
> worth it.
>
> [image: Inactive hide details for David Cramer ---10/21/2013 10:14:59
> PM---Hi Kersten, You seem to be missing an opening <request> tag.]David
> Cramer ---10/21/2013 10:14:59 PM---Hi Kersten, You seem to be missing an
> opening <request> tag. Also, this is a
>
> From: David Cramer <david.cramer at rackspace.com>
> To: Kersten J Richter/Rochester/IBM at IBMUS, <
> openstack-docs at lists.openstack.org>,
> Date: 10/21/2013 10:14 PM
> Subject: Re: [Openstack-docs] code to build api methods
> ------------------------------
>
>
>
> Hi Kersten,
> You seem to be missing an opening <request> tag. Also, this is a
> fragment, but presumably in the whole doc you will have declared the
> namespaces wadl and xsdxt.
>
> One thing this example lacks is parameters (header, query, template, and
> "plain" or body params).
>
> Regards,
> David
>
> On 10/21/2013 04:22 PM, Kersten J Richter wrote:
> > Hi all,
> > Working on a code that will transform this:
> >
> > {
> >     "description": "Updates an agent build",
> >     "extension": "os-agents",
> >     "extension_description": "Creates, updates, and deletes guest
> > agents. Use guest agents to access files on the disk, configure
> > networking, or run other applications or scripts in the guest while it
> > runs. This hypervisor-specific extension is not currently enabled for
> > KVM. Use of guest agents is possible only if the underlying service
> > provider uses the Xen driver. ",
> >     "method": "PUT",
> >     "request": "agent-update-put-req.json",
> >     "response": "agent-update-put-resp.json",
> >     "section_name": "Guest Agents",
> >     "status": 200,
> >     "url": "os-agents/{id}"
> > }
> >
> > To this:
> >
> >
> > <method name="PUT" id="os-agents">
> >         <wadl:doc xml:lang="EN" title="Guest Agents"
> >             xmlns="http://docbook.org/ns/docbook">
> >             <para role="shortdesc">Updates an agent build</para>
> >             <para>Creates, updates, and deletes guest
> > agents. Use guest agents to access files on the disk, configure
> > networking, or run other applications or scripts in the guest while it
> > runs. This hypervisor-specific extension is not currently enabled for
> > KVM. Use of guest agents is possible only if the underlying service
> > provider uses the Xen driver.</para>
> >         </wadl:doc>
> >             <representation mediaType="application/json">
> >                 <doc xml:lang="EN">
> >                     <xsdxt:code
> >                         href="../api_samples/agent-update-put-req.json"/>
> >                 </doc>
> >             </representation>
> >         </request>
> >         <response status="200">
> >             <representation mediaType="application/json">
> >                 <doc xml:lang="EN">
> >                     <xsdxt:code
> >
> href="../api_samples/agent-update-put-resp.json"/>
> >                 </doc>
> >             </representation>
> >         </response>
> > </method>
> >
> > Can someone confirm or deny that I'm on the right track?  Does the
> > method look correct? Wanted to see if I was on the right track before I
> > spend too much time working on the code.
> >
> >
> > Kersten J. Richter
> > Software Engineer
> > IBM, Rochester
> > Home office: 952-652-5304
> >
> > If you lend someone $20 and never see that person again, it was probably
> > worth it.
> >
> >
> > _______________________________________________
> > Openstack-docs mailing list
> > Openstack-docs at lists.openstack.org
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
> >
>
>
>
> _______________________________________________
> Openstack-docs mailing list
> Openstack-docs at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
>
>


-- 
Anne Gentle
annegentle at justwriteclick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20131022/de01ff91/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20131022/de01ff91/attachment-0001.gif>


More information about the Openstack-docs mailing list