API Endpoint

Cinder has a system for managing multiple APIs on different subdomains. Currently there is support for the OpenStack API.

Common Components

The cinder.api Module

root_app_factory(loader, global_conf, **local_conf)

Tests

The api Module

The api.fakes Module

class Context

Bases: object

class FakeAuthDatabase

Bases: object

static auth_token_create(context, token)
static auth_token_destroy(context, token_id)
static auth_token_get(context, token_hash)
data = {}
class FakeRateLimiter(application)

Bases: object

class FakeRequestContext(*args, **kwargs)

Bases: cinder.context.RequestContext

class FakeRouter(ext_mgr=None)

Bases: oslo_service.wsgi.Router

class FakeToken(**kwargs)

Bases: object

id_count = 0
class HTTPRequest(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)

Bases: webob.request.Request

classmethod blank(*args, **kwargs)
class TestRouter(controller)

Bases: oslo_service.wsgi.Router

get_fake_uuid(token=0)
wsgi_app(inner_app_v2=None, fake_auth=True, fake_auth_context=None, use_no_auth=False, ext_mgr=None, inner_app_v3=None)

The api.openstack Module

The api.openstack.test_wsgi Module

The test_auth Module

class TestCinderKeystoneContextMiddleware(*args, **kwargs)

Bases: cinder.test.TestCase

setUp()
test_no_user_or_user_id()
test_request_id_extracted_from_env()
test_tenant_id_name()
test_user_id_only()
test_user_id_trumps_user()
test_user_only()

The test_faults Module

class TestFaults(*args, **kwargs)

Bases: cinder.test.TestCase

Tests covering cinder.api.openstack.faults:Fault class.

setUp()
test_400_fault_json()

Test fault serialized to JSON via file-extension and/or header.

test_413_fault_json()

Test fault serialized to JSON via file-extension and/or header.

test_fault_has_status_int()

Ensure the status_int is set correctly on faults.