This Page

The quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient Module

exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.Conflict(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = 'Request conflicts with configuration on a different entity.'
exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.Forbidden(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = 'The request is forbidden from accessing the referenced resource.'
class quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NVPApiHelper(api_providers, user, password, request_timeout, http_timeout, retries, redirects, concurrent_connections=3, nvp_gen_timeout=-1)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.api_client.client_eventlet.NvpApiClientEventlet

Helper class to do basic login, cookie management, and provide base method to send HTTP requests.

Implements new eventlet-based framework derived from the management console nvp_gevent_client module.

error_codes = {400: <function zero at 0x9ed9410>, 500: <function zero at 0x9ed9410>, 403: <function fourZeroThree at 0x9ed9398>, 404: <function fourZeroFour at 0x9ed9230>, 503: <function zero at 0x9ed9410>, 409: <function fourZeroNine at 0x9ed92a8>, 301: <function zero at 0x9ed9410>, 307: <function zero at 0x9ed9410>}
fiveZeroThree()
fourZeroFour()
fourZeroNine()
fourZeroThree()
get_nvp_version()
login(user=None, password=None)

Login to NVP controller.

Assumes same password is used for all controllers.

Parameters:
  • user – NVP controller user (usually admin). Provided for backwards compatability. In the normal mode of operation this should be None.
  • password – NVP controller password. Provided for backwards compatability. In the normal mode of operation this should be None.
Returns:

Does not return a value.

request(method, url, body='', content_type='application/json')

Issues request to controller.

zero()
class quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NVPVersion(nvp_version)

Bases: object

Abstracts NVP version by exposing major and minor.

exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException(**kwargs)

Bases: exceptions.Exception

Base NvpApiClient Exception

To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.

message = 'An unknown exception occurred.'
exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.RequestTimeout(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = 'The request has timed out.'
exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.ResourceNotFound(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = 'An entity referenced in the request was not found.'
exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.ServiceUnavailable(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = 'Request could not completed because the associated resource could not be reached.'
exception quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.UnAuthorizedRequest(**kwargs)

Bases: quantum.plugins.nicira.nicira_nvp_plugin.NvpApiClient.NvpApiException

message = "Server denied session's authentication credentials."