API objects to generate sample data for the auto-documentation

Bug #1260337 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Wishlist
Matt Wagner

Bug Description

API-Objects should define sample() methods to provide sample data for generating the JSON and XML examples in the output of the auto-documentation.

e.g:

class Test(base.APIBase):

    foo = wtypes.text

    bar = wtypes.text

    @classmethod
    def sample(cls):
        return cls(foo='fooo', bar='barz' )

Ceilometer already does it[1]

[1] https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L172-L178

Extra info:

To build the documentation do:

(venv)$ python setup.py build_sphinx

The output is at:

ironic/doc/build/html/webapi/v1.html

Changed in ironic:
importance: Undecided → Wishlist
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/61752

Changed in ironic:
status: New → In Progress
Changed in ironic:
assignee: Lucas Alvares Gomes (lucasagomes) → Matt Wagner (matt-wagner)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/61752
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=212381778425b1e33bc4e7592a2d7a0fbb5bf08e
Submitter: Jenkins
Branch: master

commit 212381778425b1e33bc4e7592a2d7a0fbb5bf08e
Author: Lucas Alvares Gomes <email address hidden>
Date: Thu Dec 12 14:09:55 2013 +0000

    API: Add sample() method on Port and PortCollection

    Define sample() method on Port and PortCollection API objects to provide
    sample data for generating the JSON and XML examples in the output of
    the auto-documentation.

    Also, PEP8-fy imports in port.py.

    Change-Id: Ia19a2d79509d4cc820e9dea64d5c2c92dc9b3d2a
    Partial-Bug: #1260337

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65536

Changed in ironic:
assignee: Matt Wagner (matt-wagner) → Devananda van der Veen (devananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/65536
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=09af062109f8f2bd3d58ab2edd625cbe4ddd51f4
Submitter: Jenkins
Branch: master

commit 09af062109f8f2bd3d58ab2edd625cbe4ddd51f4
Author: Matt Wagner <email address hidden>
Date: Wed Jan 8 16:00:22 2014 -0500

    API: Add sample() method on Node

    Defines a sample() method on Node API objects in order to provide
    sample data used in the auto-generated documentation.

    Change-Id: I660361ea3416ed7143b71cc9da5d40f2185a51c3
    Partial-Bug: #1260337

aeva black (tenbrae)
Changed in ironic:
assignee: Devananda van der Veen (devananda) → nobody
Changed in ironic:
assignee: nobody → Matt Wagner (matt-wagner)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/78478

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/78478
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=9b1b10b95d7401b44ad1572f292a7064403ae4db
Submitter: Jenkins
Branch: master

commit 9b1b10b95d7401b44ad1572f292a7064403ae4db
Author: Matt Wagner <email address hidden>
Date: Wed Mar 5 17:33:12 2014 -0500

    API: Add sample() method to remaining models

    Define sample() method on Chassis

    Change-Id: I99fd77914bf4673053c3ebde7f5487da89cbc9c5
    Closes-Bug: #1260337

Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.