diff --git a/src/cloud/common/CloudServer.rb b/src/cloud/common/CloudServer.rb index 91c5335701..59ad085e7f 100755 --- a/src/cloud/common/CloudServer.rb +++ b/src/cloud/common/CloudServer.rb @@ -22,6 +22,18 @@ require 'CloudAuth' # API (OCA). Any cloud implementation should derive from this class ############################################################################## class CloudServer + ########################################################################## + # Class Constants. Define the OpenNebula Error and HTTP codes mapping + ########################################################################## + HTTP_ERROR_CODE = { + OpenNebula::Error::EAUTHENTICATION => 401, + OpenNebula::Error::EAUTHORIZATION => 403, + OpenNebula::Error::ENO_EXISTS => 404, + OpenNebula::Error::EACTION => 500, + OpenNebula::Error::EXML_RPC_API => 500, + OpenNebula::Error::EINTERNAL => 500, + OpenNebula::Error::ENOTDEFINED => 500 + } ########################################################################## # Public attributes