Exceptions

openstacksdk provides a number of exceptions for commonly encountered issues, such as missing API endpoints, various HTTP error codes, timeouts and so forth. It is the responsibility of the calling application to handle these exceptions appropriately.

Available exceptions

Exception definitions.

exception openstack.exceptions.SDKException(message=None, extra_data=None)

The base exception class for all exceptions this library raises.

exception openstack.exceptions.EndpointNotFound(message=None)

A mismatch occurred between what the client and server expect.

exception openstack.exceptions.InvalidResponse(response)

The response from the server is not valid for this request.

exception openstack.exceptions.InvalidRequest(message=None)

The request to the server is not valid.

exception openstack.exceptions.HttpException(message='Error', response=None, http_status=None, details=None, request_id=None)

The base exception for all HTTP error responses.

Initialize RequestException with request and response objects.

exception openstack.exceptions.BadRequestException(message='Error', response=None, http_status=None, details=None, request_id=None)

HTTP 400 Bad Request.

Initialize RequestException with request and response objects.

exception openstack.exceptions.ForbiddenException(message='Error', response=None, http_status=None, details=None, request_id=None)

HTTP 403 Forbidden Request.

Initialize RequestException with request and response objects.

exception openstack.exceptions.ConflictException(message='Error', response=None, http_status=None, details=None, request_id=None)

HTTP 409 Conflict.

Initialize RequestException with request and response objects.

exception openstack.exceptions.PreconditionFailedException(message='Error', response=None, http_status=None, details=None, request_id=None)

HTTP 412 Precondition Failed.

Initialize RequestException with request and response objects.

exception openstack.exceptions.MethodNotSupported(resource, method)

The resource does not support this operation type.

exception openstack.exceptions.DuplicateResource(message=None, extra_data=None)

More than one resource exists with that name.

exception openstack.exceptions.ResourceNotFound(message='Error', response=None, http_status=None, details=None, request_id=None)

No resource exists with that name or ID.

Initialize RequestException with request and response objects.

openstack.exceptions.NotFoundException

alias of ResourceNotFound

exception openstack.exceptions.ResourceTimeout(message=None, extra_data=None)

Timeout waiting for resource.

exception openstack.exceptions.ResourceFailure(message=None, extra_data=None)

General resource failure.

exception openstack.exceptions.InvalidResourceQuery(message=None, extra_data=None)

Invalid query params for resource.

openstack.exceptions.raise_from_response(response, error_message=None)

Raise an instance of an HTTPException based on keystoneauth response.

exception openstack.exceptions.ConfigException(message=None, extra_data=None)

Something went wrong with parsing your OpenStack Config.

exception openstack.exceptions.NotSupported(message=None, extra_data=None)

Request cannot be performed by any supported API version.

exception openstack.exceptions.ValidationException(message=None, extra_data=None)

Validation failed for resource.

exception openstack.exceptions.ServiceDisabledException(message=None, extra_data=None)

This service is disabled for reasons.

exception openstack.exceptions.ServiceDiscoveryException(message=None, extra_data=None)

The service cannot be discovered.

openstack.exceptions.OpenStackCloudException

alias of SDKException