API Endpoint

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)

Create a blank request environ (and Request wrapper) with the given path (path should be urlencoded), and any keys from environ.

The path will become path_info, with any query string split off and used.

All necessary keys will be added to the environ, but the values you pass in will take precedence. If you pass in base_url then wsgi.url_scheme, HTTP_HOST, and SCRIPT_NAME will be filled in from that value.

Any extra keyword will be passed to __init__.

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

class ActionDispatcherTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_dispatch()
test_dispatch_action_None()
test_dispatch_default()
class DictSerializerTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_dispatch_default()
class JSONDeserializerTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_json()
class JSONDictSerializerTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_json()
class RequestTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_best_match_language()
test_cache_and_retrieve_backups()
test_cache_and_retrieve_resources()
test_cache_and_retrieve_snapshots()
test_cache_and_retrieve_volume_types()
test_cache_and_retrieve_volumes()
test_content_type_accept_default()
test_content_type_from_accept()
test_content_type_from_accept_best()
test_content_type_from_query_extension()
test_content_type_missing()
test_content_type_unsupported()
test_content_type_with_charset()
class ResourceTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_deserialize_badtype()
test_deserialize_default()
test_dispatch()
test_get_action_args()
test_get_body()
test_get_body_bad_content()
test_get_body_no_content_body()
test_get_body_no_content_type()
test_get_method_action_bad_body()
test_get_method_action_extensions()
test_get_method_action_json()
test_get_method_action_whitelist_extensions()
test_get_method_extensions()
test_get_method_undefined_controller_action()
test_get_method_unknown_controller_action()
test_post_process_extensions_generator()
test_post_process_extensions_generator_response()
test_post_process_extensions_regular()
test_post_process_extensions_regular_response()
test_post_process_extensions_version_not_found()
test_pre_process_extensions_generator()
test_pre_process_extensions_generator_response()
test_pre_process_extensions_regular()
test_process_stack_non_ascii(masker)
test_register_actions()
test_register_extensions()
test_resource_call()
test_resource_not_authorized()
class ResponseObjectTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_default_code()
test_default_serializers()
test_del_header()
test_get_header()
test_header_isolation()
test_modified_code()
test_override_default_code()
test_override_modified_code()
test_set_header()
class TextDeserializerTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_dispatch_default()

The test_auth Module

class TestCinderKeystoneContextMiddleware(*args, **kwargs)

Bases: cinder.test.TestCase

setUp()

Run before each test method to initialize test environment.

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 ExceptionTest(*args, **kwargs)

Bases: cinder.test.TestCase

test_unicode_decode_error()
class TestFaults(*args, **kwargs)

Bases: cinder.test.TestCase

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

setUp()

Run before each test method to initialize test environment.

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.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.