Table Of Contents

Previous topic

Authentication and Authorization

Next topic

Scheduler

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Cinder 2011.2 docs or all OpenStack docs too.

API Endpoint

Cinder has a system for managing multiple APIs on different subdomains. Currently there is support for the OpenStack API, as well as the Amazon EC2 API.

Common Components

The cinder.api Module

The cinder.api.cloud Module

OpenStack API

The openstack Module

WSGI middleware for OpenStack API controllers.

class APIMapper(controller_scan=<function controller_scan at 0x9fde25c>, directory=None, always_scan=False, register=True, explicit=True)

Bases: routes.mapper.Mapper

APIMapper.routematch(url=None, environ=None)
class APIRouter(ext_mgr=None)

Bases: cinder.wsgi.Router

Routes requests on the OpenStack API to the appropriate controller and method.

APIRouter.ExtensionManager = None
classmethod APIRouter.factory(global_config, **local_config)

Simple paste factory, cinder.wsgi.Router doesn’t have

class FaultWrapper(application)

Bases: cinder.wsgi.Middleware

Calls down the middleware stack, making exceptions into faults.

static FaultWrapper.status_to_type(status)
class ProjectMapper(controller_scan=<function controller_scan at 0x9fde25c>, directory=None, always_scan=False, register=True, explicit=True)

Bases: cinder.api.openstack.APIMapper

ProjectMapper.resource(member_name, collection_name, **kwargs)

The auth Module

class NoAuthMiddleware(application)

Bases: cinder.wsgi.Middleware

Return a fake token if one isn’t specified.

EC2 API

The cinder.api.ec2 Module

The cloud Module

The metadatarequesthandler Module

Tests

The api_unittest Module

The api_integration Module

The cloud_unittest Module

The api.fakes Module

The api.test_wsgi Module

Test WSGI basics and provide some helper functions for other WSGI tests.

class Test(methodName='runTest')

Bases: cinder.test.TestCase

Test.test_debug()
Test.test_router()

The test_api Module

The test_auth Module

The test_faults Module

class FaultsXMLSerializationTestV11(methodName='runTest')

Bases: cinder.test.TestCase

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

FaultsXMLSerializationTestV11.test_400_fault()
FaultsXMLSerializationTestV11.test_404_fault()
FaultsXMLSerializationTestV11.test_413_fault()
class TestFaults(methodName='runTest')

Bases: cinder.test.TestCase

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

TestFaults.test_400_fault_json()

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

TestFaults.test_413_fault_json()

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

TestFaults.test_fault_has_status_int()

Ensure the status_int is set correctly on faults

TestFaults.test_raise()

Ensure the ability to raise Fault in WSGI-ified methods.

TestFaults.test_raise_403()

Ensure the ability to raise Fault in WSGI-ified methods.

TestFaults.test_xml_serializer()

Ensure that a v1.1 request responds with a v1 xmlns