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

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(*args, **keywargs)
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()
class ValidBodyTest(*args, **kwargs)

Bases: cinder.test.TestCase

setUp()
test_is_valid_body()
test_is_valid_body_empty()
test_is_valid_body_malformed_entity()
test_is_valid_body_no_entity()
test_is_valid_body_none()
test_validate_name_and_description_with_desc_as_int()
test_validate_name_and_description_with_desc_too_long()
test_validate_name_and_description_with_desc_zero_length()
test_validate_name_and_description_with_name_as_int()
test_validate_name_and_description_with_name_contains_white_spaces()
test_validate_name_and_description_with_name_too_long()
test_validate_name_and_description_with_name_zero_length()
test_validate_string_length_with_name_contains_white_spaces()
test_validate_string_length_with_name_too_long()

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.