简体   繁体   English

Openstack Neutron:找不到Openstack neutron可能的错误响应消息的列表

[英]Openstack Neutron: Cannot find list of possible error response messages for Openstack neutron

I am using OpenStack Neutron to implement Networking capabilities to the virtual machines. 我正在使用OpenStack Neutron来实现虚拟机的联网功能。 I am making a whole web application out of these. 我正在用这些制作一个完整的Web应用程序。 So, when the error comes from Open stack neutron when setting a gateway or anything I should be able to show my response message based on the message OpenStack neutron gives. 因此,当错误是由于在设置网关或任何其他原因而来自Open stack neutron时,我应该能够基于OpenStack neutron给出的消息显示我的响应消息。

Actual Question: I need Open stack neutron error responses and their codes so that I can write some mapper to show my own error messages. 实际的问题:我需要开放堆中子错误响应及其代码,以便我可以编写一些映射器来显示自己的错误消息。 I tried searching on documentation, repositories. 我尝试搜索文档,存储库。 I could not find. 我找不到。 Can anyone help me with this 谁能帮我这个

If you are using the REST interface, the error codes are typically the HTTP response codes. 如果使用的是REST接口,则错误代码通常是HTTP响应代码。

When any code in neutron raises an exception, the neutron API interface maps this internal exception to one of the HTTP error codes and creates an HTTP response with the exception(error) text and sends it back. 当中子中的任何代码引发异常时,中子API接口都会将此内部异常映射到HTTP错误代码之一,并使用异常(错误)文本创建HTTP响应并将其发送回去。

HTTP responses codes are classified as: 1xx - Informational response, 2xx Success, 3xx Redirection, 4xx Client errors, 5xx Server errors. HTTP响应代码分类为:1xx-信息响应,2xx成功,3xx重定向,4xx客户端错误,5xx服务器错误。

For more details refer to https://en.wikipedia.org/wiki/List_of_HTTP_status_codes 有关更多详细信息,请参阅https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

On the neutron interface, one could typically see the following HTTP error response codes: 在中子接口上,通常可以看到以下HTTP错误响应代码:

  • 400 - Bad request. 400-错误的请求。 Neutron doesn't like an API parameter. Neutron不喜欢API参数。
  • 404 - Not found. 404-找不到。 The resource identified in the REST interface is not valid. REST接口中标识的资源无效。
  • 501 - Not implemented. 501-未实现。 REST API or operation invoked is not implemented yet or not applicable. REST API或调用的操作尚未实现或不适用。
  • 500 - Internal Error. 500-内部错误。 Something unexpected happened inside the neutron. 中子内部发生了意外情况。

For the general classification point of view, when a client receives 4xx (400-499) response code, it means that some parameter sent by the client it unexpected. 从一般分类的角度来看,当客户端收到4xx(400-499)响应代码时,意味着客户端发送的某些参数是意外的。 When it receives 5xx (500-599) response code, it means that something went wrong on the server(neutron) side. 当它收到5xx(500-599)响应代码时,表示服务器(中子)端出了点问题。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM