~citrix-openstack/nova/xenapi

« back to all changes in this revision

Viewing changes to doc/source/devref/services.rst

  • Committer: Tarmac
  • Author(s): Todd Willey, root, Vishvananda Ishaya, Joe Heck, root, Andy Smith, Anne Gentle, Dean Troyer, Devin Carlen
  • Date: 2010-11-16 02:34:47 UTC
  • mfrom: (386.2.71 trunkdoc)
  • Revision ID: hudson@openstack.org-20101116023447-pz7n6ps5rf0fnjea
Lots of documentation and docstring updates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
..
 
2
      Copyright 2010 United States Government as represented by the
 
3
      Administrator of the National Aeronautics and Space Administration.
 
4
      All Rights Reserved.
 
5
 
 
6
      Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
      not use this file except in compliance with the License. You may obtain
 
8
      a copy of the License at
 
9
 
 
10
          http://www.apache.org/licenses/LICENSE-2.0
 
11
 
 
12
      Unless required by applicable law or agreed to in writing, software
 
13
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
      License for the specific language governing permissions and limitations
 
16
      under the License.
 
17
 
 
18
.. _service_manager_driver:
 
19
 
 
20
Services, Managers and Drivers
 
21
==============================
 
22
 
 
23
The responsibilities of Services, Managers, and Drivers, can be a bit confusing to people that are new to nova.  This document attempts to outline the division of responsibilities to make understanding the system a little bit easier.
 
24
 
 
25
Currently, Managers and Drivers are specified by flags and loaded using utils.load_object().  This method allows for them to be implemented as singletons, classes, modules or objects.  As long as the path specified by the flag leads to an object (or a callable that returns an object) that responds to getattr, it should work as a manager or driver.
 
26
 
 
27
 
 
28
The :mod:`nova.service` Module
 
29
------------------------------
 
30
 
 
31
.. automodule:: nova.service
 
32
    :noindex:
 
33
    :members:
 
34
    :undoc-members:
 
35
    :show-inheritance:
 
36
 
 
37
 
 
38
The :mod:`nova.manager` Module
 
39
------------------------------
 
40
 
 
41
.. automodule:: nova.manager
 
42
    :noindex:
 
43
    :members:
 
44
    :undoc-members:
 
45
    :show-inheritance:
 
46
 
 
47
 
 
48
Implementation-Specific Drivers
 
49
-------------------------------
 
50
 
 
51
A manager will generally load a driver for some of its tasks. The driver is responsible for specific implementation details.  Anything running shell commands on a host, or dealing with other non-python code should probably be happening in a driver.
 
52
 
 
53
Drivers should minimize touching the database, although it is currently acceptable for implementation specific data. This may be reconsidered at some point.
 
54
 
 
55
It usually makes sense to define an Abstract Base Class for the specific driver (i.e. VolumeDriver), to define the methods that a different driver would need to implement.