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 Nova 2011.1 docs or all OpenStack docs too.

API Endpoint

Nova 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 nova.api Module

The nova.api.cloud Module

OpenStack API

The openstack Module

WSGI middleware for OpenStack API controllers.

class nova.api.openstack.APIRouter(ext_mgr=None)

Bases: nova.wsgi.Router

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

classmethod APIRouter.factory(global_config, **local_config)

Simple paste factory, nova.wsgi.Router doesn’t have one

class nova.api.openstack.APIRouterV10(ext_mgr=None)

Bases: nova.api.openstack.APIRouter

Define routes specific to OpenStack API V1.0.

class nova.api.openstack.APIRouterV11(ext_mgr=None)

Bases: nova.api.openstack.APIRouter

Define routes specific to OpenStack API V1.1.

class nova.api.openstack.FaultWrapper(application)

Bases: nova.wsgi.Middleware

Calls down the middleware stack, making exceptions into faults.

The auth Module

class nova.api.openstack.auth.AuthMiddleware(application, db_driver=None)

Bases: nova.wsgi.Middleware

Authorize the openstack API request or return an HTTP Forbidden.

AuthMiddleware.authenticate(req)
AuthMiddleware.authorize_token(token_hash)

retrieves user information from the datastore given a token

If the token has expired, returns None If the token is not found, returns None Otherwise returns dict(id=(the authorized user’s id))

This method will also remove the token if the timestamp is older than 2 days ago.

AuthMiddleware.get_user_by_authentication(req)
AuthMiddleware.has_authentication(req)

The backup_schedules Module

class nova.api.openstack.backup_schedules.Controller

Bases: nova.api.openstack.common.OpenstackController

The backup schedule API controller for the Openstack API

Controller.create(req, server_id)

No actual update method required, since the existing API allows both create and update through a POST

Controller.delete(req, server_id, id)

Deletes an existing backup schedule

Controller.index(req, server_id)

Returns the list of backup schedules for a given instance

Controller.show(req, server_id, id)

Returns a single backup schedule for a given instance

The faults Module

exception nova.api.openstack.faults.Fault(exception)

Bases: webob.exc.HTTPException

An RS API fault response.

exception nova.api.openstack.faults.OverLimitFault(message, details, retry_time)

Bases: webob.exc.HTTPException

Rate-limited request response.

The flavors Module

class nova.api.openstack.flavors.Controller

Bases: nova.api.openstack.common.OpenstackController

Flavor controller for the OpenStack API.

Controller.detail(req)

Return all flavors in detail.

Controller.index(req)

Return all flavors in brief.

Controller.show(req, id)

Return data about the given flavor id.

class nova.api.openstack.flavors.ControllerV10

Bases: nova.api.openstack.flavors.Controller

class nova.api.openstack.flavors.ControllerV11

Bases: nova.api.openstack.flavors.Controller

ControllerV11.get_default_xmlns(req)

The images Module

class nova.api.openstack.images.Controller(image_service=None, compute_service=None)

Bases: nova.api.openstack.common.OpenstackController

Base wsgi.Controller for retrieving/displaying images.

Controller.create(req)

Snapshot a server instance and save the image.

Parameters:
  • reqwsgi.Request object
Controller.delete(req, id)

Delete an image, if allowed.

Parameters:
  • reqwsgi.Request object
  • id – Image identifier (integer)
Controller.detail(req)

Return a detailed index listing of images available to the request.

Parameters:
  • reqwsgi.Request object.
Controller.get_builder(request)

Indicates that you must use a Controller subclass.

Controller.index(req)

Return an index listing of images available to the request.

Parameters:
  • reqwsgi.Request object
Controller.show(req, id)

Return detailed information about a specific image.

Parameters:
  • reqwsgi.Request object
  • id – Image identifier (integer)
class nova.api.openstack.images.ControllerV10(image_service=None, compute_service=None)

Bases: nova.api.openstack.images.Controller

Version 1.0 specific controller logic.

ControllerV10.get_builder(request)

Property to get the ViewBuilder class we need to use.

class nova.api.openstack.images.ControllerV11(image_service=None, compute_service=None)

Bases: nova.api.openstack.images.Controller

Version 1.1 specific controller logic.

ControllerV11.get_builder(request)

Property to get the ViewBuilder class we need to use.

ControllerV11.get_default_xmlns(req)

The ratelimiting Module

Rate limiting of arbitrary actions.

class nova.api.openstack.ratelimiting.Limiter(limits)

Bases: object

Class providing rate limiting of arbitrary actions.

Limiter.perform(action_name, username='nobody')

Attempt to perform an action by the given username.

action_name: the string name of the action to perform. This must be a key in the limits dict passed to the ctor.

username: an optional string name of the user performing the action. Each user has her own set of rate limiting counters. Defaults to ‘nobody’ (so that if you never specify a username when calling perform(), a single set of counters will be used.)

Return None if the action may proceed. If the action may not proceed because it has been rate limited, return the float number of seconds until the action would succeed.

class nova.api.openstack.ratelimiting.RateLimitingMiddleware(application, service_host=None)

Bases: nova.wsgi.Middleware

Rate limit incoming requests according to the OpenStack rate limits.

RateLimitingMiddleware.get_action_name(req)

Return the action name for this request.

RateLimitingMiddleware.get_delay(action_name, username)

Return the delay for the given action and username, or None if the action would not be rate limited.

RateLimitingMiddleware.rate_limited_request(req, application)

Rate limit the request.

If the request should be rate limited, return a 413 status with a Retry-After header giving the time when the request would succeed.

class nova.api.openstack.ratelimiting.WSGIApp(limiter)

Bases: object

Application that tracks rate limits in memory. Send requests to it of this form:

POST /limiter/<username>/<urlencoded action>

and receive a 200 OK, or a 403 Forbidden with an X-Wait-Seconds header containing the number of seconds to wait before the action would succeed.

class nova.api.openstack.ratelimiting.WSGIAppProxy(service_host)

Bases: object

Limiter lookalike that proxies to a ratelimiting.WSGIApp.

WSGIAppProxy.perform(action, username='nobody')

The servers Module

class nova.api.openstack.servers.Controller

Bases: nova.api.openstack.common.OpenstackController

The Server API controller for the OpenStack API

Controller.action(*args, **kwargs)
Controller.actions(req, id)

Permit Admins to retrieve server actions.

Controller.create(req)

Creates a new server for a given user

Controller.delete(*args, **kwargs)
Controller.detail(req)

Returns a list of server details for a given user

Controller.diagnostics(*args, **kwargs)
Controller.get_ajax_console(*args, **kwargs)
Controller.get_lock(*args, **kwargs)
Controller.get_vnc_console(*args, **kwargs)
Controller.index(req)

Returns a list of server names and ids for a given user

Controller.inject_network_info(*args, **kwargs)
Controller.lock(*args, **kwargs)
Controller.pause(*args, **kwargs)
Controller.rescue(*args, **kwargs)
Controller.reset_network(*args, **kwargs)
Controller.resume(*args, **kwargs)
Controller.show(*args, **kwargs)
Controller.suspend(*args, **kwargs)
Controller.unlock(*args, **kwargs)
Controller.unpause(*args, **kwargs)
Controller.unrescue(*args, **kwargs)
Controller.update(*args, **kwargs)
class nova.api.openstack.servers.ControllerV10

Bases: nova.api.openstack.servers.Controller

class nova.api.openstack.servers.ControllerV11

Bases: nova.api.openstack.servers.Controller

ControllerV11.get_default_xmlns(req)
class nova.api.openstack.servers.ServerCreateRequestXMLDeserializer

Bases: object

Deserializer to handle xml-formatted server create requests.

Handles standard server attributes as well as optional metadata and personality attributes

ServerCreateRequestXMLDeserializer.deserialize(string)

Deserialize an xml-formatted server create request

The sharedipgroups Module

EC2 API

The nova.api.ec2 Module

Starting point for routing EC2 requests.

class nova.api.ec2.Authenticate(application)

Bases: nova.wsgi.Middleware

Authenticate an EC2 request and add ‘ec2.context’ to WSGI environ.

class nova.api.ec2.Authorizer(application)

Bases: nova.wsgi.Middleware

Authorize an EC2 API request.

Return a 401 if ec2.controller and ec2.action in WSGI environ may not be executed in ec2.context.

class nova.api.ec2.Executor

Bases: nova.wsgi.Application

Execute an EC2 API request.

Executes ‘ec2.action’ upon ‘ec2.controller’, passing ‘ec2.context’ and ‘ec2.action_args’ (all variables in WSGI environ.) Returns an XML response, or a 400 upon failure.

class nova.api.ec2.Lockout(application)

Bases: nova.wsgi.Middleware

Lockout for x minutes on y failed auths in a z minute period.

x = lockout_timeout flag y = lockout_window flag z = lockout_attempts flag

Uses memcached if lockout_memcached_servers flag is set, otherwise it uses a very simple in-proccess cache. Due to the simplicity of the implementation, the timeout window is started with the first failed request, so it will block if there are x failed logins within that period.

There is a possible race condition where simultaneous requests could sneak in before the lockout hits, but this is extremely rare and would only result in a couple of extra failed attempts.

class nova.api.ec2.RequestLogging(application)

Bases: nova.wsgi.Middleware

Access-Log akin logging for all EC2 API requests.

RequestLogging.log_request_completion(response, request, start)
class nova.api.ec2.Requestify(app, controller)

Bases: nova.wsgi.Middleware

class nova.api.ec2.Versions

Bases: nova.wsgi.Application

The admin Module

Admin API controller, exposed through http via the api worker.

class nova.api.ec2.admin.AdminController

Bases: object

API Controller for users, hosts, nodes, and workers.

AdminController.deregister_project(context, name)

Permanently deletes a project.

AdminController.deregister_user(context, name, **_kwargs)

Deletes a single user (NOT undoable.) Should throw an exception if the user has instances, volumes, or buckets remaining.

AdminController.describe_host(_context, name, **_kwargs)

Returns status info for single node.

AdminController.describe_hosts(context, **_kwargs)

Returns status info for all nodes. Includes: * Hostname * Compute (up, down, None) * Instance count * Volume (up, down, None) * Volume Count

AdminController.describe_instance_types(context, **_kwargs)

Returns all active instance types data (vcpus, memory, etc.)

AdminController.describe_project(context, name, **kwargs)

Returns project data, including member ids.

AdminController.describe_project_members(context, name, **kwargs)
AdminController.describe_projects(context, user=None, **kwargs)

Returns all projects - should be changed to deal with a list.

AdminController.describe_roles(context, project_roles=True, **kwargs)

Returns a list of allowed roles.

AdminController.describe_user(_context, name, **_kwargs)

Returns user data, including access and secret keys.

AdminController.describe_user_roles(context, user, project=None, **kwargs)

Returns a list of roles for the given user. Omitting project will return any global roles that the user has. Specifying project will return only project specific roles.

AdminController.describe_users(_context, **_kwargs)

Returns all users - should be changed to deal with a list.

AdminController.describe_vpns(context)
AdminController.generate_x509_for_user(context, name, project=None, **kwargs)

Generates and returns an x509 certificate for a single user. Is usually called from a client that will wrap this with access and secret key info, and return a zip file.

AdminController.modify_project(context, name, manager_user, description=None, **kwargs)

Modifies a project

AdminController.modify_project_member(context, user, project, operation, **kwargs)

Add or remove a user from a project.

AdminController.modify_user_role(context, user, role, project=None, operation='add', **kwargs)

Add or remove a role for a user and project.

AdminController.register_project(context, name, manager_user, description=None, member_users=None, **kwargs)

Creates a new project

AdminController.register_user(context, name, **_kwargs)

Creates a new user, and returns generated credentials.

AdminController.start_vpn(context, project)
nova.api.ec2.admin.host_dict(host, compute_service, instances, volume_service, volumes, now)

Convert a host model object to a result dict

nova.api.ec2.admin.instance_dict(inst)
nova.api.ec2.admin.project_dict(project)

Convert the project object to a result dict

nova.api.ec2.admin.user_dict(user, base64_file=None)

Convert the user object to a result dict

nova.api.ec2.admin.vpn_dict(project, vpn_instance)

The apirequest Module

APIRequest class

class nova.api.ec2.apirequest.APIRequest(controller, action, version, args)

Bases: object

APIRequest.invoke(context)

The cloud Module

Cloud Controller: Implementation of EC2 REST API calls, which are dispatched to other nodes via AMQP RPC. State is via distributed datastore.

class nova.api.ec2.cloud.CloudController

Bases: object

CloudController provides the critical dispatch between inbound API calls through the endpoint and messages sent to the other nodes.

CloudController.allocate_address(context, **kwargs)
CloudController.associate_address(context, instance_id, public_ip, **kwargs)
CloudController.attach_volume(context, volume_id, instance_id, device, **kwargs)
CloudController.authorize_security_group_ingress(context, group_name, **kwargs)
CloudController.create_key_pair(context, key_name, **kwargs)
CloudController.create_security_group(context, group_name, group_description)
CloudController.create_volume(context, size, **kwargs)
CloudController.delete_key_pair(context, key_name, **kwargs)
CloudController.delete_security_group(context, group_name, **kwargs)
CloudController.delete_volume(context, volume_id, **kwargs)
CloudController.deregister_image(context, image_id, **kwargs)
CloudController.describe_addresses(context, **kwargs)
CloudController.describe_availability_zones(context, **kwargs)
CloudController.describe_image_attribute(context, image_id, attribute, **kwargs)
CloudController.describe_images(context, image_id=None, **kwargs)
CloudController.describe_instances(context, **kwargs)
CloudController.describe_instances_v6(context, **kwargs)
CloudController.describe_key_pairs(context, key_name=None, **kwargs)
CloudController.describe_regions(context, region_name=None, **kwargs)
CloudController.describe_security_groups(context, group_name=None, **kwargs)
CloudController.describe_snapshots(context, snapshot_id=None, owner=None, restorable_by=None, **kwargs)
CloudController.describe_volumes(context, volume_id=None, **kwargs)
CloudController.detach_volume(context, volume_id, **kwargs)
CloudController.disassociate_address(context, public_ip, **kwargs)
CloudController.format_addresses(context)
CloudController.get_ajax_console(context, instance_id, **kwargs)
CloudController.get_console_output(context, instance_id, **kwargs)
CloudController.get_metadata(address)
CloudController.get_vnc_console(context, instance_id, **kwargs)

Returns vnc browser url. Used by OS dashboard.

CloudController.modify_image_attribute(context, image_id, attribute, operation_type, **kwargs)
CloudController.reboot_instances(context, instance_id, **kwargs)

instance_id is a list of instance ids

CloudController.register_image(context, image_location=None, **kwargs)
CloudController.release_address(context, public_ip, **kwargs)
CloudController.rescue_instance(context, instance_id, **kwargs)

This is an extension to the normal ec2_api

CloudController.revoke_security_group_ingress(context, group_name, **kwargs)
CloudController.run_instances(context, **kwargs)
CloudController.setup()

Ensure the keychains and folders exist.

CloudController.terminate_instances(context, instance_id, **kwargs)

Terminate each instance in instance_id, which is a list of ec2 ids. instance_id is a kwarg so its name cannot be modified.

CloudController.unrescue_instance(context, instance_id, **kwargs)

This is an extension to the normal ec2_api

CloudController.update_image(context, image_id, **kwargs)
CloudController.update_instance(context, instance_id, **kwargs)
CloudController.update_volume(context, volume_id, **kwargs)

The images Module

The metadatarequesthandler Module

Metadata request handler.

class nova.api.ec2.metadatarequesthandler.MetadataRequestHandler

Bases: nova.wsgi.Application

Serve metadata from the EC2 API.

MetadataRequestHandler.lookup(path, data)
MetadataRequestHandler.print_data(data)

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 nova.tests.api.test_wsgi.ControllerTest(methodName='runTest')

Bases: nova.test.TestCase

class ControllerTest.TestRouter

Bases: nova.wsgi.Router

class ControllerTest.TestRouter.TestController

Bases: nova.wsgi.Controller

ControllerTest.TestRouter.TestController.show(req, id)
ControllerTest.test_response_content_type_default_when_unsupported()
ControllerTest.test_response_content_type_from_accept_json()
ControllerTest.test_response_content_type_from_accept_xml()
ControllerTest.test_response_content_type_from_query_extension_json()
ControllerTest.test_response_content_type_from_query_extension_xml()
ControllerTest.test_show()
class nova.tests.api.test_wsgi.RequestTest(methodName='runTest')

Bases: nova.test.TestCase

RequestTest.test_content_type_accept_and_query_extension()
RequestTest.test_content_type_accept_default()
RequestTest.test_content_type_from_accept_xml()
RequestTest.test_content_type_from_query_extension()
RequestTest.test_request_content_type_missing()
RequestTest.test_request_content_type_unsupported()
class nova.tests.api.test_wsgi.SerializerTest(methodName='runTest')

Bases: nova.test.TestCase

SerializerTest.test_deserialize_empty_xml()
SerializerTest.test_deserialize_json()
SerializerTest.test_deserialize_xml()
SerializerTest.test_json()
SerializerTest.test_unsupported_content_type()
SerializerTest.test_xml()
class nova.tests.api.test_wsgi.Test(methodName='runTest')

Bases: nova.test.TestCase

Test.test_debug()
Test.test_router()

The test_api Module

class nova.tests.api.openstack.test_api.APITest(methodName='runTest')

Bases: nova.test.TestCase

APITest.test_exceptions_are_converted_to_faults()

The test_auth Module

class nova.tests.api.openstack.test_auth.Test(methodName='runTest')

Bases: nova.test.TestCase

Test.setUp()
Test.tearDown()
Test.test_authorize_token()
Test.test_authorize_user()
Test.test_bad_token()
Test.test_bad_user_bad_key()
Test.test_bad_user_good_key()
Test.test_no_user()
Test.test_token_expiry()
class nova.tests.api.openstack.test_auth.TestFunctional(methodName='runTest')

Bases: nova.test.TestCase

TestFunctional.test_token_doesnotexist()
TestFunctional.test_token_expiry()
class nova.tests.api.openstack.test_auth.TestLimiter(methodName='runTest')

Bases: nova.test.TestCase

TestLimiter.setUp()
TestLimiter.tearDown()
TestLimiter.test_authorize_token()

The test_faults Module

class nova.tests.api.openstack.test_faults.TestFaults(methodName='runTest')

Bases: nova.test.TestCase

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

TestFaults.test_400_fault_json()

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

TestFaults.test_400_fault_xml()

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

TestFaults.test_413_fault_json()

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

TestFaults.test_413_fault_xml()
TestFaults.test_raise()

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

The test_flavors Module

class nova.tests.api.openstack.test_flavors.FlavorsTest(methodName='runTest')

Bases: nova.test.TestCase

FlavorsTest.setUp()
FlavorsTest.tearDown()
FlavorsTest.test_get_flavor_by_id_v1_0()
FlavorsTest.test_get_flavor_by_id_v1_1()
FlavorsTest.test_get_flavor_by_invalid_id()
FlavorsTest.test_get_flavor_list_detail_v1_0()
FlavorsTest.test_get_flavor_list_detail_v1_1()
FlavorsTest.test_get_flavor_list_v1_0()
FlavorsTest.test_get_flavor_list_v1_1()
nova.tests.api.openstack.test_flavors.return_instance_type_by_flavor_id(context, flavorid)
nova.tests.api.openstack.test_flavors.return_instance_type_not_found(context, flavorid)
nova.tests.api.openstack.test_flavors.return_instance_types(context, num=2)
nova.tests.api.openstack.test_flavors.stub_flavor(flavorid, name, memory_mb='256', local_gb='10')

The test_images Module

Tests of the new image services, both as a service layer, and as a WSGI layer

class nova.tests.api.openstack.test_images.GlanceImageServiceTest(*args, **kwargs)

Bases: nova.tests.api.openstack.test_images._BaseImageServiceTests

Tests the Glance image service, in particular that metadata translation works properly.

At a high level, the translations involved are:

  1. Glance -> ImageService - This is needed so we can support multple ImageServices (Glance, Local, etc)
  2. ImageService -> API - This is needed so we can support multple APIs (OpenStack, EC2)
GlanceImageServiceTest.setUp()
GlanceImageServiceTest.tearDown()
GlanceImageServiceTest.test_create_with_instance_id()

Ensure instance_id is persisted as an image-property

GlanceImageServiceTest.test_create_without_instance_id()

Ensure we can create an image without having to specify an instance_id. Public images are an example of an image not tied to an instance.

class nova.tests.api.openstack.test_images.ImageControllerWithGlanceServiceTest(methodName='runTest')

Bases: nova.test.TestCase

Test of the OpenStack API /images application controller w/Glance.

ImageControllerWithGlanceServiceTest.setUp()

Run before each test.

ImageControllerWithGlanceServiceTest.tearDown()

Run after each test.

ImageControllerWithGlanceServiceTest.test_get_image()
ImageControllerWithGlanceServiceTest.test_get_image_404_json()
ImageControllerWithGlanceServiceTest.test_get_image_404_v1_1_json()
ImageControllerWithGlanceServiceTest.test_get_image_404_v1_1_xml()
ImageControllerWithGlanceServiceTest.test_get_image_404_xml()
ImageControllerWithGlanceServiceTest.test_get_image_details()
ImageControllerWithGlanceServiceTest.test_get_image_details_v1_1()
ImageControllerWithGlanceServiceTest.test_get_image_found()
ImageControllerWithGlanceServiceTest.test_get_image_index()
ImageControllerWithGlanceServiceTest.test_get_image_index_v1_1()
ImageControllerWithGlanceServiceTest.test_get_image_non_existent()
ImageControllerWithGlanceServiceTest.test_get_image_not_owned()

We should return a 404 if we request an image that doesn’t belong to us

ImageControllerWithGlanceServiceTest.test_get_image_v1_1()
ImageControllerWithGlanceServiceTest.test_get_image_v1_1_xml()
ImageControllerWithGlanceServiceTest.test_get_image_xml()
ImageControllerWithGlanceServiceTest.test_get_image_xml_no_name()
class nova.tests.api.openstack.test_images.LocalImageServiceTest(*args, **kwargs)

Bases: nova.tests.api.openstack.test_images._BaseImageServiceTests

Tests the local image service

LocalImageServiceTest.setUp()
LocalImageServiceTest.tearDown()
LocalImageServiceTest.test_get_all_ids_with_incorrect_directory_formats()

The test_ratelimiting Module

The test_servers Module

class nova.tests.api.openstack.test_servers.ServersTest(methodName='runTest')

Bases: nova.test.TestCase

ServersTest.setUp()
ServersTest.tearDown()
ServersTest.test_confirm_resize_server()
ServersTest.test_confirm_resize_server_fails()
ServersTest.test_create_backup_schedules()
ServersTest.test_create_instance()
ServersTest.test_create_instance_name_too_long()
ServersTest.test_create_instance_no_key_pair()
ServersTest.test_create_instance_no_name()
ServersTest.test_create_instance_nonstring_name()
ServersTest.test_create_instance_v11()
ServersTest.test_create_instance_v11_bad_href()
ServersTest.test_create_instance_v11_name_too_long()
ServersTest.test_create_instance_whitespace_name()
ServersTest.test_delete_backup_schedules()
ServersTest.test_delete_server_instance()
ServersTest.test_get_all_server_details_v1_0()
ServersTest.test_get_all_server_details_v1_1()
ServersTest.test_get_all_server_details_with_host()

We want to make sure that if two instances are on the same host, then they return the same hostId. If two instances are on different hosts, they should return different hostId’s. In this test, there are 5 instances - 2 on one host and 3 on another.

ServersTest.test_get_all_server_details_xml_v1_0()
ServersTest.test_get_server_addresses_V10()
ServersTest.test_get_server_addresses_private_V10()
ServersTest.test_get_server_addresses_private_xml_V10()
ServersTest.test_get_server_addresses_public_V10()
ServersTest.test_get_server_addresses_public_xml_V10()
ServersTest.test_get_server_addresses_xml_V10()
ServersTest.test_get_server_backup_schedule()
ServersTest.test_get_server_backup_schedules()
ServersTest.test_get_server_by_id()
ServersTest.test_get_server_by_id_v11()
ServersTest.test_get_server_by_id_with_addresses()
ServersTest.test_get_server_by_id_with_addresses_v11()
ServersTest.test_get_server_by_id_with_addresses_xml()
ServersTest.test_get_server_list()
ServersTest.test_get_server_list_v11()
ServersTest.test_get_servers_with_bad_limit()
ServersTest.test_get_servers_with_bad_marker()
ServersTest.test_get_servers_with_bad_offset()
ServersTest.test_get_servers_with_limit()
ServersTest.test_get_servers_with_limit_and_marker()
ServersTest.test_get_servers_with_limit_and_offset()
ServersTest.test_get_servers_with_marker()
ServersTest.test_get_servers_with_offset()
ServersTest.test_resize_bad_flavor_fails()
ServersTest.test_resize_raises_fails()
ServersTest.test_resize_server()
ServersTest.test_resized_server_has_correct_status()
ServersTest.test_revert_resize_server()
ServersTest.test_revert_resize_server_fails()
ServersTest.test_server_actions()
ServersTest.test_server_backup_schedule_deprecated_v11()
ServersTest.test_server_change_password()
ServersTest.test_server_change_password_bad_request_v1_1()
ServersTest.test_server_change_password_empty_string_v1_1()
ServersTest.test_server_change_password_none_v1_1()
ServersTest.test_server_change_password_not_a_string_v1_1()
ServersTest.test_server_change_password_v1_1()
ServersTest.test_server_diagnostics()
ServersTest.test_server_inject_network_info()
ServersTest.test_server_pause()
ServersTest.test_server_reboot()
ServersTest.test_server_rebuild()
ServersTest.test_server_reset_network()
ServersTest.test_server_resume()
ServersTest.test_server_suspend()
ServersTest.test_server_unpause()
ServersTest.test_update_no_body()
ServersTest.test_update_nonstring_name()

Confirm that update is filtering params

ServersTest.test_update_null_name()

Confirm that update is filtering params

ServersTest.test_update_server_adminPass_ignored_v11()
ServersTest.test_update_server_name_too_long()

Confirm that update is filtering params

ServersTest.test_update_server_v10()
ServersTest.test_update_whitespace_name()

Confirm that update is filtering params

class nova.tests.api.openstack.test_servers.TestGetKernelRamdiskFromImage(methodName='runTest')

Bases: nova.test.TestCase

If we’re building from an AMI-style image, we need to be able to fetch the kernel and ramdisk associated with the machine image. This information is stored with the image metadata and return via the ImageService.

These tests ensure that we parse the metadata return the ImageService correctly and that we handle failure modes appropriately.

TestGetKernelRamdiskFromImage.test_ami_kernel_ramdisk_present()

Return IDs if both kernel and ramdisk are present

TestGetKernelRamdiskFromImage.test_ami_no_kernel()

If an ami is missing a kernel it should raise NotFound

TestGetKernelRamdiskFromImage.test_ami_no_ramdisk()

If an ami is missing a ramdisk it should raise NotFound

TestGetKernelRamdiskFromImage.test_not_ami()

Anything other than ami should return no kernel and no ramdisk

TestGetKernelRamdiskFromImage.test_status_not_active()

We should only allow fetching of kernel and ramdisk information if we have a ‘fully-formed’ image, aka ‘active’

class nova.tests.api.openstack.test_servers.TestServerCreateRequestXMLDeserializer(methodName='runTest')

Bases: unittest.case.TestCase

TestServerCreateRequestXMLDeserializer.setUp()
TestServerCreateRequestXMLDeserializer.test_canonical_request_from_docs()
TestServerCreateRequestXMLDeserializer.test_minimal_request()
TestServerCreateRequestXMLDeserializer.test_request_second_personality_node_ignored()
TestServerCreateRequestXMLDeserializer.test_request_with_empty_metadata()
TestServerCreateRequestXMLDeserializer.test_request_with_empty_metadata_and_personality()
TestServerCreateRequestXMLDeserializer.test_request_with_empty_metadata_and_personality_reversed()
TestServerCreateRequestXMLDeserializer.test_request_with_empty_personality()
TestServerCreateRequestXMLDeserializer.test_request_with_metadata_duplicate_key()
TestServerCreateRequestXMLDeserializer.test_request_with_metadata_missing_key()
TestServerCreateRequestXMLDeserializer.test_request_with_metadata_missing_value()
TestServerCreateRequestXMLDeserializer.test_request_with_one_metadata()
TestServerCreateRequestXMLDeserializer.test_request_with_one_personality()
TestServerCreateRequestXMLDeserializer.test_request_with_one_personality_empty_contents()
TestServerCreateRequestXMLDeserializer.test_request_with_one_personality_empty_contents_variation()
TestServerCreateRequestXMLDeserializer.test_request_with_one_personality_missing_path()
TestServerCreateRequestXMLDeserializer.test_request_with_two_metadata()
TestServerCreateRequestXMLDeserializer.test_request_with_two_metadata_missing_key()
TestServerCreateRequestXMLDeserializer.test_request_with_two_metadata_missing_value()
TestServerCreateRequestXMLDeserializer.test_request_with_two_personalities()
class nova.tests.api.openstack.test_servers.TestServerInstanceCreation(methodName='runTest')

Bases: nova.test.TestCase

TestServerInstanceCreation.setUp()
TestServerInstanceCreation.tearDown()
TestServerInstanceCreation.test_create_instance_admin_pass_json()
TestServerInstanceCreation.test_create_instance_admin_pass_xml()
TestServerInstanceCreation.test_create_instance_personality_empty_content()
TestServerInstanceCreation.test_create_instance_with_no_personality()
TestServerInstanceCreation.test_create_instance_with_no_personality_xml()
TestServerInstanceCreation.test_create_instance_with_null_personality()
TestServerInstanceCreation.test_create_instance_with_personality()
TestServerInstanceCreation.test_create_instance_with_personality_no_contents()
TestServerInstanceCreation.test_create_instance_with_personality_no_path()
TestServerInstanceCreation.test_create_instance_with_personality_not_a_list()
TestServerInstanceCreation.test_create_instance_with_personality_with_non_b64_content()
TestServerInstanceCreation.test_create_instance_with_personality_xml()
TestServerInstanceCreation.test_create_instance_with_three_personalities()
nova.tests.api.openstack.test_servers.fake_compute_api(cls, req, id)
nova.tests.api.openstack.test_servers.instance_address(context, instance_id)
nova.tests.api.openstack.test_servers.instance_update(context, instance_id, kwargs)
nova.tests.api.openstack.test_servers.return_security_group(context, instance_id, security_group_id)
nova.tests.api.openstack.test_servers.return_server(context, id)
nova.tests.api.openstack.test_servers.return_server_with_addresses(private, public)
nova.tests.api.openstack.test_servers.return_servers(context, user_id=1)
nova.tests.api.openstack.test_servers.stub_instance(id, user_id=1, private_address=None, public_addresses=None, host=None)

The test_sharedipgroups Module