<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Doug,
<div><br>
<div>
<div>On Feb 27, 2014, at 7:23 AM, Doug Hellmann <<a href="mailto:doug.hellmann@dreamhost.com">doug.hellmann@dreamhost.com</a>> wrote:</div>
<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Feb 27, 2014 at 2:00 AM, Noorul Islam K M <span dir="ltr">
<<a href="mailto:noorul@noorul.com" target="_blank">noorul@noorul.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div class="">Michael Davies <<a href="mailto:michael@the-davies.net">michael@the-davies.net</a>> writes:<br>
<br>
> Hi everyone,<br>
><br>
> Over in "Ironic Land" we're looking at removing XML support from ironic-api<br>
> (i.e. <a href="https://bugs.launchpad.net/ironic/+bug/1271317" target="_blank">
https://bugs.launchpad.net/ironic/+bug/1271317</a>)<br>
><br>
> I've been looking, but I can't seem to find an easy way to modify the<br>
> accepted content_types.<br>
><br>
> Are there any wsgi / WSME / Pecan experts out there who can point me in the<br>
> right direction?<br>
><br>
<br>
</div>
Also in Solum we have a use case where in we would like to have<br>
pecan+wsme accept content-type application/x-yaml.<br>
<br>
It will be great if this can be made configurable.<br>
</blockquote>
<div>
<div class="gmail_default" style="font-size:small"></div>
<div class="gmail_default" style="font-size:small">What do you want to have happen with the YAML?</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
We want to parse it into a graph of objects. It will be similar in nature to processing a Heat template. We will treat the resulting data structure as a model for generation of Heat templates, after some logic is applied to each object in the graph, and the
relations between them.</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail_default" style="font-size:small">Do you want to receive and return YAML to a bunch of API calls? We could add YAML protocol support to WSME to make that happen.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
We might have a total of 3 API calls that take application/x-yaml as inputs in addition to the same calls also accepting application/json.</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail_default" style="font-size:small">Do you want a couple of controller methods to be given a YAML parse result, rather than WSME objects? You could write an expose() decorator for Pecan in Solum. This would be a more appropriate approach if you
just have one or two methods of the API that need YAML support.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Interesting. Can you think of existing implementations we could reference that are using this approach? What would you consider the pro/con balance for this?</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail_default" style="font-size:small">Or do you want the YAML text passed in to you directly, maybe to be uploaded in a single controller method? You should be able to have that by skipping WSME and just using Pecan's expose() decorator with an
appropriate content type, then parsing the body yourself.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
We probably don't need to do our own parsing of the YAML text, as we expect that to be regular YAML. We probably don't need to parse it incrementally as a stream because even our most complex YAML content is not likely to be more than a few hundred nodes, and
should fit into memory. We do, however need to be able to inspect and walk through a resulting data structure that represents the YAML content.</div>
<div><br>
</div>
<div>Would it be sensible to to have a translation shim of some sort that interprets the YAML into JSON, and feeds that into the existing code so that we would be confident there was no difference between parsing the YAML versus parsing equivalent JSON?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Adrian</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>
<div class="gmail_default" style="font-size:small">Doug</div>
<br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<br>
Regards,<br>
Noorul<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br>
</blockquote>
</div>
<br>
</div>
</body>
</html>