<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 10:33 AM, Eugeniya Kudryashova <span dir="ltr"><<a href="mailto:ekudryashova@mirantis.com" target="_blank">ekudryashova@mirantis.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"><div dir="ltr"><div style="font-size:large"><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Hi, all<br></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent"><br></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Openstack APIs interact with each other and external systems partially by passing of HTTP errors. The only valuable difference between types of exceptions is HTTP-codes, but current codes are generalized, so external system can’t distinguish what actually happened. </span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">As an example two different failures below differs only by error message:</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">request:</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">POST /v2/790f5693e97a40d38c4d5bfdc45acb09/servers HTTP/1.1</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Host: <a href="http://192.168.122.195:8774" target="_blank">192.168.122.195:8774</a></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Auth-Project-Id: demo</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Accept-Encoding: gzip, deflate, compress</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Length: 189</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Accept: application/json</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">User-Agent: python-novaclient</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Auth-Token: 2cfeb9283d784cfba694f3122ef413bf</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Type: application/json</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">{"server": {"name": "demo", "imageRef": "171c9d7d-3912-4547-b2a5-ea157eb08622", "key_name": "test", "flavorRef": "42", "max_count": 1, "min_count": 1, "security_groups": [{"name": "bar"}]}}</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent"></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">response:</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">    </span><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">HTTP/1.1 400 Bad Request</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Length: 118</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Type: application/json; charset=UTF-8</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Compute-Request-Id: req-a995e1fc-7ea4-4305-a7ae-c569169936c0</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Date: Fri, 23 Jan 2015 10:43:33 GMT</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">{"badRequest": {"message": "Security group bar not found for project 790f5693e97a40d38c4d5bfdc45acb09.", "code": 400}}</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">and</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">request:</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">POST /v2/790f5693e97a40d38c4d5bfdc45acb09/servers HTTP/1.1</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Host: <a href="http://192.168.122.195:8774" target="_blank">192.168.122.195:8774</a></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Auth-Project-Id: demo</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Accept-Encoding: gzip, deflate, compress</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Length: 192</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Accept: application/json</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">User-Agent: python-novaclient</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Auth-Token: 24c0d30ff76c42e0ae160fa93db8cf71</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Type: application/json</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">{"server": {"name": "demo", "imageRef": "171c9d7d-3912-4547-b2a5-ea157eb08622", "key_name": "foo", "flavorRef": "42", "max_count": 1, "min_count": 1, "security_groups": [{"name": "default"}]}}</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">response:</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">HTTP/1.1 400 Bad Request</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Length: 70</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Content-Type: application/json; charset=UTF-8</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">X-Compute-Request-Id: req-87604089-7071-40a7-a34b-7bc56d0551f5</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Date: Fri, 23 Jan 2015 10:39:43 GMT</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">{"badRequest": {"message": "Invalid key_name provided.", "code": 400}}</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">The former specifies an incorrect security group name, and the latter an incorrect keypair name. And the problem is, that just looking at the response body and HTTP response code an external system can’t understand what exactly went wrong. And parsing of error messages here is not the way we’d like to solve this problem.</span></p></div></div></blockquote><div><br></div>For the Compute API v 2 we have the shortened Error Code in the documentation at <a href="http://developer.openstack.org/api-ref-compute-v2.html#compute_server-addresses">http://developer.openstack.org/api-ref-compute-v2.html#compute_server-addresses</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">such as:<br><br>Error response codes<br>computeFault (400, 500, …), serviceUnavailable (503), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), itemNotFound (404), buildInProgress (409)</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks to a recent update (well, last fall) to our build tool for docs.<br><br>What we don't have is a table in the docs saying "computeFault has this longer Description" -- is that what you are asking for, for all OpenStack APIs?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Tell me more.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Anne<br><div class="" style="min-height:1px;padding-right:15px;padding-left:15px;float:left;width:658.125px;color:rgb(83,83,83);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px"><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"><div dir="ltr"><div style="font-size:large"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent"> </span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Another example for solving this problem is AWS EC2 exception codes [1] </span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">So if we have some service based on Openstack projects it would be useful to have some concrete error codes(textual or numeric), which could allow to define what actually goes wrong and later correctly process obtained exception. These codes should be predefined for each exception, have documented structure and allow to parse exception correctly in each step of exception handling. </span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">So I’d like to discuss implementing such codes and its usage in openstack projects.</span></p><br><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">[1] - </span><a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;background-color:transparent">http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html</span></a></div></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Anne Gentle<br><a href="mailto:annegentle@justwriteclick.com" target="_blank">annegentle@justwriteclick.com</a></div>
</div></div>