Revision 9940eacf

b/snf-app/docs/Makefile
77 77
	@echo
78 78
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
79 79
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Synnefo.qhcp"
80
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/synnefo.qhcp"
81 81
	@echo "To view the help file:"
82
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Synnefo.qhc"
82
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/synnefo.qhc"
83 83

  
84 84
devhelp:
85 85
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
86 86
	@echo
87 87
	@echo "Build finished."
88 88
	@echo "To view the help file:"
89
	@echo "# mkdir -p $$HOME/.local/share/devhelp/Synnefo"
90
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Synnefo"
89
	@echo "# mkdir -p $$HOME/.local/share/devhelp/synnefo"
90
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/synnefo"
91 91
	@echo "# devhelp"
92 92

  
93 93
epub:
b/snf-app/docs/conf.py
1
# -*- coding: utf-8 -*-
2
#
3
# Synnefo documentation build configuration file, created by
4
# sphinx-quickstart on Mon Nov 21 10:56:41 2011.
5
#
6
# This file is execfile()d with the current directory set to its containing dir.
7
#
8
# Note that not all possible configuration values are present in this
9
# autogenerated file.
10
#
11
# All configuration values have a default; values that are commented out
12
# serve to show the default.
13

  
14 1
import sys, os
15 2

  
16
# If extensions (or modules to document with autodoc) are in another directory,
17
# add these directories to sys.path here. If the directory is relative to the
18
# documentation root, use os.path.abspath to make it absolute, like shown here.
19
sys.path.insert(0, os.path.abspath('..'))
20

  
21
from synnefo import settings
22
from django.core.management import setup_environ
23
setup_environ(settings)
24

  
25
# -- General configuration -----------------------------------------------------
26

  
27
# If your documentation needs a minimal Sphinx version, state it here.
28
#needs_sphinx = '1.0'
29 3

  
30
# Add any Sphinx extension module names here, as strings. They can be extensions
31
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
32
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
4
project = u'snf-asterias-app'
5
copyright = u'2012, GRNET'
6
version = '0.8'
7
release = '0.8'
8
html_title = 'synnefo ' + version
33 9

  
34
# Add any paths that contain templates here, relative to this directory.
35 10
templates_path = ['_templates']
36

  
37
# The suffix of source filenames.
38 11
source_suffix = '.rst'
39

  
40
# The encoding of source files.
41
#source_encoding = 'utf-8-sig'
42

  
43
# The master toctree document.
44 12
master_doc = 'index'
45

  
46
# General information about the project.
47
project = u'Synnefo'
48
copyright = u'2011, GRNET'
49

  
50
# The version info for the project you're documenting, acts as replacement for
51
# |version| and |release|, also used in various other places throughout the
52
# built documents.
53
#
54
# The short X.Y version.
55
version = '0.8'
56
# The full version, including alpha/beta/rc tags.
57
release = '0.8rc1'
58

  
59
# The language for content autogenerated by Sphinx. Refer to documentation
60
# for a list of supported languages.
61
#language = None
62

  
63
# There are two options for replacing |today|: either, you set today to some
64
# non-false value, then it is used:
65
#today = ''
66
# Else, today_fmt is used as the format for a strftime call.
67
#today_fmt = '%B %d, %Y'
68

  
69
# List of patterns, relative to source directory, that match files and
70
# directories to ignore when looking for source files.
71 13
exclude_patterns = ['_build']
72

  
73
# The reST default role (used for this markup: `text`) to use for all documents.
74
#default_role = None
75

  
76
# If true, '()' will be appended to :func: etc. cross-reference text.
77
#add_function_parentheses = True
78

  
79
# If true, the current module name will be prepended to all description
80
# unit titles (such as .. function::).
81
#add_module_names = True
82

  
83
# If true, sectionauthor and moduleauthor directives will be shown in the
84
# output. They are ignored by default.
85
#show_authors = False
86

  
87
# The name of the Pygments (syntax highlighting) style to use.
88 14
pygments_style = 'sphinx'
89

  
90
# A list of ignored prefixes for module index sorting.
91
#modindex_common_prefix = []
92

  
93

  
94
# -- Options for HTML output ---------------------------------------------------
95

  
96
# The theme to use for HTML and HTML Help pages.  See the documentation for
97
# a list of builtin themes.
98 15
html_theme = 'nature'
99

  
100
# Theme options are theme-specific and customize the look and feel of a theme
101
# further.  For a list of options available for each theme, see the
102
# documentation.
103
#html_theme_options = {}
104

  
105
# Add any paths that contain custom themes here, relative to this directory.
106
#html_theme_path = []
107

  
108
# The name for this set of Sphinx documents.  If None, it defaults to
109
# "<project> v<release> documentation".
110
#html_title = None
111

  
112
# A shorter title for the navigation bar.  Default is the same as html_title.
113
#html_short_title = None
114

  
115
# The name of an image file (relative to this directory) to place at the top
116
# of the sidebar.
117
#html_logo = None
118

  
119
# The name of an image file (within the static path) to use as favicon of the
120
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
121
# pixels large.
122
#html_favicon = None
123

  
124
# Add any paths that contain custom static files (such as style sheets) here,
125
# relative to this directory. They are copied after the builtin static files,
126
# so a file named "default.css" will overwrite the builtin "default.css".
127 16
html_static_path = ['_static']
17
htmlhelp_basename = 'synnefodoc'
128 18

  
129
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
130
# using the given strftime format.
131
#html_last_updated_fmt = '%b %d, %Y'
132

  
133
# If true, SmartyPants will be used to convert quotes and dashes to
134
# typographically correct entities.
135
#html_use_smartypants = True
136

  
137
# Custom sidebar templates, maps document names to template names.
138
#html_sidebars = {}
139

  
140
# Additional templates that should be rendered to pages, maps page names to
141
# template names.
142
#html_additional_pages = {}
143

  
144
# If false, no module index is generated.
145
#html_domain_indices = True
146

  
147
# If false, no index is generated.
148
#html_use_index = True
149

  
150
# If true, the index is split into individual pages for each letter.
151
#html_split_index = False
152

  
153
# If true, links to the reST sources are added to the pages.
154
#html_show_sourcelink = True
155

  
156
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
157
#html_show_sphinx = True
158

  
159
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
160
#html_show_copyright = True
161

  
162
# If true, an OpenSearch description file will be output, and all pages will
163
# contain a <link> tag referring to it.  The value of this option must be the
164
# base URL from which the finished HTML is served.
165
#html_use_opensearch = ''
166

  
167
# This is the file name suffix for HTML files (e.g. ".xhtml").
168
#html_file_suffix = None
169

  
170
# Output file base name for HTML help builder.
171
htmlhelp_basename = 'Synnefodoc'
172

  
173

  
174
# -- Options for LaTeX output --------------------------------------------------
175

  
176
latex_elements = {
177
# The paper size ('letterpaper' or 'a4paper').
178
#'papersize': 'letterpaper',
179

  
180
# The font size ('10pt', '11pt' or '12pt').
181
#'pointsize': '10pt',
182

  
183
# Additional stuff for the LaTeX preamble.
184
#'preamble': '',
19
intersphinx_mapping = {
20
        'pithon': ('http://docs.python.org/', None),
21
        'django': ('https://docs.djangoproject.com/en/dev/',
22
                   'https://docs.djangoproject.com/en/dev/_objects/')
185 23
}
186 24

  
187
# Grouping the document tree into LaTeX files. List of tuples
188
# (source start file, target name, title, author, documentclass [howto/manual]).
189
latex_documents = [
190
  ('index', 'Synnefo.tex', u'Synnefo Documentation',
191
   u'Authors name', 'manual'),
192
]
193

  
194
# The name of an image file (relative to this directory) to place at the top of
195
# the title page.
196
#latex_logo = None
197

  
198
# For "manual" documents, if this is true, then toplevel headings are parts,
199
# not chapters.
200
#latex_use_parts = False
201

  
202
# If true, show page references after internal links.
203
#latex_show_pagerefs = False
204

  
205
# If true, show URL addresses after external links.
206
#latex_show_urls = False
207

  
208
# Documents to append as an appendix to all manuals.
209
#latex_appendices = []
210

  
211
# If false, no module index is generated.
212
#latex_domain_indices = True
213

  
214

  
215
# -- Options for manual page output --------------------------------------------
216

  
217
# One entry per manual page. List of tuples
218
# (source start file, name, description, authors, manual section).
219
man_pages = [
220
    ('index', 'synnefo', u'Synnefo Documentation',
221
     [u'Authors name'], 1)
222
]
223

  
224
# If true, show URL addresses after external links.
225
#man_show_urls = False
226

  
227

  
228
# -- Options for Texinfo output ------------------------------------------------
229

  
230
# Grouping the document tree into Texinfo files. List of tuples
231
# (source start file, target name, title, author,
232
#  dir menu entry, description, category)
233
texinfo_documents = [
234
  ('index', 'Synnefo', u'Synnefo Documentation', u'Authors name',
235
   'Synnefo', 'One line description of project.', 'Miscellaneous'),
236
]
237

  
238
# Documents to append as an appendix to all manuals.
239
#texinfo_appendices = []
240

  
241
# If false, no module index is generated.
242
#texinfo_domain_indices = True
243

  
244
# How to display URL addresses: 'footnote', 'no', or 'inline'.
245
#texinfo_show_urls = 'footnote'
25
SYNNEFO_DOCS_BASE_URL = 'http://docs.dev.grnet.gr/'
26
SYNNEFO_PROJECTS = {
27
    'synnefo': 'dev',
28
    'pithos': 'dev',
29
    'snf-webproject': 'dev',
30
    'snf-common': 'dev',
31
    'snf-image': 'dev',
32
    'snf-asterias-app': 'dev'
33
}
246 34

  
247
# todo extension configuration
248
todo_include_todos = True
35
for name, ver in SYNNEFO_PROJECTS.iteritems():
36
    intersphinx_mapping[name.replace("-","")] = (SYNNEFO_DOCS_BASE_URL +
37
                                                 '%s/%s/' % (name, ver),
38
                                 None)
249 39

  
250
# autodoc config
251
autodoc_default_flags = ['members']
40
extensions = ['sphinx.ext.intersphinx',
41
              'sphinx.ext.todo',
42
              'sphinx.ext.viewcode']
b/snf-app/docs/index.rst
1
synnefo
2
=======
1
.. _snf-asterias-app:
3 2

  
4
.. image:: /images/synnefo-logo.png
3
Component snf-asterias-app
4
==========================
5 5

  
6
synnefo is software to create massively scalable IaaS clouds.
6
synnefo component :ref:`snf-asterias-app <snf-asterias-app>` defines
7
the web application for asterias. It includes the following:
7 8

  
8
It powers GRNET's `~okeanos cloud service <https://okeanos.grnet.gr>`_.
9
    * A set of Django applications that define among others:
10
        * web UI
11
        * API implementation
12
        * business logic layer
13
        * admin web UI
14
    * :ref:`snf-dispatcher <snf-dispatcher>`, the logic dispatcher
9 15

  
10
This is the main synnefo documentation page.
16
.. todo:: make this section more complete.
11 17

  
12
synnefo comprises the following major components:
18
.. _snf-dispatcher:
13 19

  
14
.. todo:: turn all of the following to links to the documentation, with
15
   intersphinx links.
20
snf-dispatcher
21
--------------
16 22

  
17
.. toctree::
18
   :maxdepth: 1
23
The logic dispatcher provides the context to run the business logic layer of
24
:ref:`asterias <snf-asterias>`. It must run on :ref:`LOGIC <LOGIC_NODE>` nodes.
19 25

  
20
   asterias (name TBD): Compute Service <src/asterias.rst>
21
   pithos+: File storage service <http://docs.dev.grnet.gr/pithos>
22
   plankton: Image registry <src/plankton.rst>
23
   archipelagos: Volume storage service <http://docs.dev.grnet.gr/archipelagos>
24
   astakos: Identity management module <http://docs.dev.grnet.gr/astakos>
25
   aquarium: Billing module <http://docs.dev.grnet.gr/aquarium>
26
   image: Secure image deployment tool <http://docs.dev.grnet.gr/snf-image>
27
   kamaki: Command-line cloud management tool <http://docs.dev.grnet.gr/kamaki>
26
The dispatcher retrieves messages from the queue, over AMQP, and calls the
27
appropriate handler function, based on the type of the message.
28 28

  
29
You may also see the detailed configuration for all
30
:ref:`synnefo software components <components>`.
29
.. _snf-admin:
31 30

  
32
Indices and tables
33
------------------
31
snf-admin
32
---------
34 33

  
34
command :command:`snf-admin` provides the command-line admin interface
35
for :ref:`asterias <snf-asterias>`.
36

  
37
Package installation
38
--------------------
39

  
40
.. todo:: kpap: verify instructions for installation from source.
41

  
42
Use ``pip`` to install the latest version of the package from source,
43
or request a specific version as ``snf-asterias-app==x.y.z``.
44

  
45
.. code-block:: console
46

  
47
   $ pip install snf-asterias-app -f https://code.grnet.gr/projects/synnefo/files
48

  
49
On Debian Squeeze, install the ``snf-asterias-app`` Debian package.
50

  
51
Package configuration
52
---------------------
53

  
54
Web application
55
***************
56

  
57
Please see the configuration section of :ref:`snf-webproject <snf-webproject>`
58
on how to serve :ref:`snf-asterias-app <snf-asterias-app>` as part of a
59
Django project.
60

  
61
snf-dispatcher
62
**************
63

  
64
.. note:: The Debian package configures the init script for
65
   :command:`snf-dispatcher` automatically, see ``/etc/default/snf-dispatcher``.
66

  
67
.. todo:: package an initscript for :command:`snf-dispatcher`
68

  
69
Make sure the logic dispatcher starts automatically on system boot of
70
:ref:`LOGIC <LOGIC_NODE>` nodes. Initscript ``conf/init.d/snf-dispatcher``
71
is provided for your convenience.
72

  
73
You may also start the dispatcher by hand:
74

  
75
.. code-block:: console
76

  
77
  $ snf-dispatcher
78

  
79
The dispatcher should run in at least 2 instances to ensure high
80
(actually, increased) availability.
81

  
82
Package settings
83
----------------
84

  
85
Component :ref:`snf-asterias-app <snf-asterias-app>` requires the following
86
settings, as managed by :ref:`snf-common <snf-common>`:
87

  
88
.. literalinclude:: ../synnefo/app_settings/default/api.py
89
    :lines: 4-
90
.. literalinclude:: ../synnefo/app_settings/default/logging.py
91
    :lines: 4-
92
.. literalinclude:: ../synnefo/app_settings/default/backend.py
93
    :lines: 4-
94
.. literalinclude:: ../synnefo/app_settings/default/plankton.py
95
    :lines: 4-
96
.. literalinclude:: ../synnefo/app_settings/default/queues.py
97
    :lines: 4-
98
.. literalinclude:: ../synnefo/app_settings/default/reconsiliation.py
99
    :lines: 4-
100
.. literalinclude:: ../synnefo/app_settings/default/ui.py
101
    :lines: 4-
102
.. literalinclude:: ../synnefo/app_settings/default/userdata.py
103
    :lines: 4-
104

  
105
.. todo:: make sure the file headers are included properly in documentation.
106
          If not change the :lines setting accordingly.
35 107

  
36
* :ref:`genindex`
37
* :ref:`modindex`
38
* :ref:`search`
b/snf-app/docs/plankton-designimpl-guide.rst
1
.. _plankton-designimpl-guide:
2

  
3
Design and Implementation Guide
4
===============================
5

  
6
.. automodule:: synnefo.plankton.views
7
    :members:
8
    :show-inheritance:
9
    :undoc-members:
b/snf-app/docs/plankton.rst
1
.. _plankton:
2

  
3
Plankton Service
4
----------------
5

  
6
Plankton is the synnefo Image Registry Service and implements the Glance API.
7

  
8
.. todo:: document the Plankton Service.
9

  
10
.. toctree::
11
   :maxdepth: 2
12

  
13
   plankton-designimpl-guide
14
..   plankton-admin-guide
15
..   plankton-dev-guide
16

  
17
Indices and tables
18
==================
19

  
20

  
21
* :ref:`genindex`
22
* :ref:`modindex`
23
* :ref:`search`
/dev/null
1
Administration
2
==============
3

  
4
This file contains notes related to administration of a working Synnefo
5
deployment. This document should be read *after* README.deploy, which contains
6
step-by-step Synnefo deployment instructions.
7

  
8

  
9
Database
10
--------
11

  
12
MySQL: manage.py dbshell seems to ignore the setting of 'init_command'
13
       in settings.DATABASES
14

  
15

  
16
Reconciliation mechanism
17
------------------------
18

  
19
On certain occasions, such as a Ganeti or RabbitMQ failure, the VM state in the
20
system's database may differ from that in the Ganeti installation. The
21
reconciliation process is designed to bring the system's database in sync with
22
what Ganeti knows about each VM, and is able to detect the following three
23
conditions:
24

  
25
 * Stale DB servers without corresponding Ganeti instances
26
 * Orphan Ganeti instances, without corresponding DB entries
27
 * Out-of-sync operstate for DB entries wrt to Ganeti instances
28

  
29
The reconciliation mechanism runs as a management command, e.g., as follows:
30
[PYTHONPATH needs to contain the parent of the synnefo Django project
31
directory]:
32

  
33
/srv/synnefo$ export PYTHONPATH=/srv:$PYTHONPATH
34
vkoukis@dev67:~/synnefo [reconc]$ ./manage.py reconcile --detect-all -v 2
35

  
36
Please see ./manage.py reconcile --help for all the details.
37

  
38
The administrator can also trigger reconciliation of operating state manually,
39
by issuing a Ganeti OP_INSTANCE_QUERY_DATA command on a Synnefo VM, using
40
gnt-instance info.
41

  
42

  
43
Logging
44
-------
45

  
46
Logging in Synnefo is using Python's logging module. The module is configured
47
using dictionary configuration, whose format is described here:
48

  
49
http://docs.python.org/release/2.7.1/library/logging.html#logging-config-dictschema
50

  
51
Note that this is a feature of Python 2.7 that we have backported for use in
52
Python 2.6.
53

  
54
The logging configuration dictionary is defined in settings.d/00-logging.conf
55
and is broken in 4 separate dictionaries:
56

  
57
  * LOGGING is the logging configuration used by the web app. By default all
58
    loggers fall back to the main 'synnefo' logger. The subloggers can be
59
    changed accordingly for finer logging control. e.g. To disable debug
60
    messages from the API set the level of 'synnefo.api' to 'INFO'.
61
  
62
  * DISPATCHER_LOGGING is the logging configuration of the logic/dispatcher.py
63
    command line tool.
64
  
65
  * SNFADMIN_LOGGING is the logging configuration of the snf-admin tool.
66
    Consider using matching configuration for snf-admin and the synnefo.admin
67
    logger of the web app.
68

  
69
Please note the following:
70
  * As of Synnefo v0.7, by default the Django webapp logs to syslog, the
71
    dispatcher logs to /var/log/synnefo/dispatcher.log and the console,
72
    snf-admin logs to the console.
73
  * Different handlers can be set to different logging levels:
74
    for example, everything may appear to the console, but only INFO and higher
75
    may actually be stored in a longer-term logfile.
76

  
77

  
78
Admin Tools
79
-----------
80

  
81
snf-admin is a tool used to perform various administrative tasks. It needs to
82
be able to access the django database, so the following should be able to import
83
the Django settings.
84

  
85
Additionally, administrative tasks can be performed via the admin web interface
86
located in /admin. Only users of type ADMIN can access the admin pages. To change
87
the type of a user to ADMIN, snf-admin can be used:
88

  
89
   snf-admin user modify 42 --type ADMIN
/dev/null
1
Administration Tools User's Guide
2
=================================
3

  
4
Registering an Image
5
--------------------
6

  
7
To upload an image to Pithos and register it for use by Plankton, use the **image upload** command::
8

  
9
    snf-admin image upload Ubuntu /tmp/ubuntu.iso --public
10

  
11
You can additionally pass *disk_format*, *container_format* and other custom metadata::
12

  
13
    snf-admin image upload Ubuntu /tmp/ubuntu.iso --public --disk-format diskdump --meta kernel=2.6.42
14

  
15
The images are uploaded to the *images* container of the *SYSTEM_IMAGES_OWNER* user (defined in settings).
16

  
17
To register an image that is already stored in Pithos, use the **image register** command::
18

  
19
    snf-admin image register Debian pithos://okeanos/images/debian.iso dump --public
20

  
21
As with upload you can additionally pass custom metadata with ``--meta``.
22

  
23
To verify the image use **image list**:
24

  
25
    snf-admin image list -l a58a3cce-c938-6ef4-6b1a-529bda1e9e03
26

  
27

  
28
Modifying an Image
29
------------------
30

  
31
You can modify an already registered image use **image update**::
32

  
33
    snf-admin image update a58a3cce-c938-6ef4-6b1a-529bda1e9e03 --disk-format diskdump --name Xubuntu
34

  
35
To modify just the custom metadata use **image meta**::
36

  
37
    snf-admin image meta a58a3cce-c938-6ef4-6b1a-529bda1e9e03 OS=Linux
38

  
39
To verify all the metadata, use **image meta** with no arguments::
40

  
41
    snf-admin image meta a58a3cce-c938-6ef4-6b1a-529bda1e9e03
/dev/null
1
.. _asterias-admin-guide:
2

  
3
===================
4
Administrator Guide
5
===================
6

  
7
This is the asterias administrator guide.
8

  
9
It contains instructions on how to download, install and configure
10
the synnefo components necessary to deploy the Compute Service. It also covers
11
maintenance issues, e.g., upgrades of existing deployments.
12

  
13
The guide assumes you are familiar with all aspects of downloading, installing
14
and configuring packages for the Linux distribution of your choice.
15

  
16
Overview
17
--------
18

  
19
This guide covers the following:
20

  
21
Architecture
22
    Node types needed for a complete deployment of asterias,
23
    and their roles. Throughout this guide, `node` refers to a physical machine
24
    in the deployment.
25
Installation
26
    The installation of services and synnefo software components for a working
27
    deployment of asterias, either from source packages or the provided
28
    packages for Debian Squeeze.
29
Configuration
30
    Configuration of the various software components comprising an asterias
31
    deployment.
32
Upgrades/Changelogs
33
    Upgrades of existing deployments of asterias to newer versions, associated
34
    Changelogs.
35

  
36
.. _asterias-architecture:
37

  
38
Architecture
39
------------
40

  
41
Nodes in an asterias deployment belong in one of the following types.
42
For every type, we list the services that execute on corresponding nodes.
43

  
44
.. _DB_NODE:
45

  
46
DB
47
**
48

  
49
A node [or more than one nodes, if using an HA configuration], running a DB
50
engine supported by the Django ORM layer. The DB is the single source of
51
truth for the servicing of API requests by asterias.
52

  
53
*Services:* PostgreSQL / MySQL
54

  
55
.. _APISERVER_NODE:
56

  
57
APISERVER
58
*********
59
A node running the ``api`` application contained in
60
:ref:`snf-asterias-app <snf-asterias-app>`. Any number of
61
:ref:`APISERVER <APISERVER_NODE>` nodes
62
can be used, in a load-balancing configuration, without any
63
special consideration. Access to a common DB ensures consistency.
64

  
65
*Services:* Web server, vncauthproxy
66

  
67

  
68
.. _QUEUE_NODE:
69

  
70
QUEUE
71
*****
72
A node running the RabbitMQ software, which provides AMQP functionality. More
73
than one :ref:`QUEUE <QUEUE_NODE>` nodes may be deployed, in an HA
74
configuration. Such deployments require shared storage, provided e.g., by DRBD.
75

  
76
*Services:* RabbitMQ [rabbitmq-server]
77

  
78

  
79
.. _LOGIC_NODE:
80

  
81
LOGIC
82
*****
83

  
84
A node running the business logic of synnefo, in Django. It dequeues
85
messages from QUEUE nodes, and provides the context in which business logic
86
functions run. It uses Django ORM to connect to the common DB and update the
87
state of the system, based on notifications received from the rest of the
88
infrastructure, over AMQP.
89

  
90
*Services:* the synnefo logic dispatcher, ``snf-dispatcher``
91

  
92

  
93
.. _GANETI_NODES:
94
.. _GANETI_MASTER:
95
.. _GANETI_NODE:
96
  
97
GANETI-MASTER and GANETI-NODE
98
*****************************
99
A single GANETI-MASTER and a large number of GANETI-NODEs constitute the
100
Ganeti backend for synnefo, which undertakes all VM management functions.
101
Any APISERVER can issue commands to the GANETI-MASTER, over RAPI, to effect
102
changes in the state of the VMs. The GANETI-MASTER runs the Ganeti request
103
queue.
104

  
105
*Services:*
106
    * only on :ref:`GANETI-MASTER <GANETI_MASTER>`:
107
        * the synnefo Ganeti monitoring daemon, ``snf-ganeti-eventd``
108
        * the synnefo Ganeti hook, ``ganeti/snf-ganeti-hook.py``.
109
    * on every :ref:`GANETI-NODE <GANETI_NODE>`:
110
        * a deployment-specific KVM ifup script
111
        * properly configured :ref:`NFDHCPD <asterias-nfdhcpd-setup>`
112

  
113
.. _WEBAPP_NODE:
114

  
115
Installation
116
------------
117

  
118
Installation of asterias is a two step process:
119

  
120
1. install the external services (prerequisites) on which asterias depends
121
2. install the synnefo software components associated with asterias
122

  
123
Prerequisites
124
*************
125
.. _asterias-install-ganeti:
126

  
127
Ganeti installation
128
```````````````````
129
Synnefo requires a working Ganeti installation at the backend. Installation
130
of Ganeti is not covered by this document, please refer to
131
`ganeti documentation <http://docs.ganeti.org/ganeti/current/html>`_ for all the 
132
gory details. A successful Ganeti installation concludes with a working 
133
:ref:`GANETI-MASTER <GANETI_NODES>` and a number of :ref:`GANETI-NODEs <GANETI_NODES>`.
134

  
135
.. _asterias-install-db:
136

  
137
Database
138
````````
139

  
140
Database installation is done as part of the
141
:ref:`snf-webproject <snf-webproject>` component.
142

  
143
.. _asterias-install-rabbitmq:
144

  
145
RabbitMQ 
146
````````
147

  
148
RabbitMQ is used as a generic message broker for asterias. It should be
149
installed on two seperate :ref:`QUEUE <QUEUE_NODE>` nodes in a high availability
150
configuration as described here:
151

  
152
    http://www.rabbitmq.com/pacemaker.html
153

  
154
After installation, create a user and set its permissions:
155

  
156
.. code-block:: console
157

  
158
    $ rabbitmqctl add_user <username> <password>
159
    $ rabbitmqctl set_permissions -p / <username>  "^.*" ".*" ".*"
160

  
161
The values set for the user and password must be mirrored in the
162
``RABBIT_*`` variables in your settings, as managed by
163
:ref:`snf-common <snf-common>`.
164

  
165
.. todo:: Document an active-active configuration based on the latest version
166
   of RabbitMQ.
167

  
168
.. _asterias-install-vncauthproxy:
169

  
170
vncauthproxy
171
````````````
172

  
173
To support OOB console access to the VMs over VNC, the vncauthproxy
174
daemon must be running on every :ref:`APISERVER <APISERVER_NODE>` node.
175

  
176
.. note:: The Debian package for vncauthproxy undertakes all configuration
177
   automatically.
178

  
179
Download and install the latest vncauthproxy from its own repository,
180
at `https://code.grnet.gr/git/vncauthproxy`, or a specific commit:
181

  
182
.. code-block:: console
183

  
184
    $ bin/pip install -e git+https://code.grnet.gr/git/vncauthproxy@INSERT_COMMIT_HERE#egg=vncauthproxy
185

  
186
Create ``/var/log/vncauthproxy`` and set its permissions appropriately.
187

  
188
Alternatively, build and install Debian packages.
189

  
190
.. code-block:: console
191

  
192
    $ git checkout debian
193
    $ dpkg-buildpackage -b -uc -us
194
    # dpkg -i ../vncauthproxy_1.0-1_all.deb
195

  
196
.. warning::
197
    **Failure to build the package on the Mac.**
198

  
199
    ``libevent``, a requirement for gevent which in turn is a requirement for
200
    vncauthproxy is not included in `MacOSX` by default and installing it with
201
    MacPorts does not lead to a version that can be found by the gevent
202
    build process. A quick workaround is to execute the following commands::
203

  
204
        $ cd $SYNNEFO
205
        $ sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
206
        <the above fails>
207
        $ cd build/gevent
208
        $ sudo python setup.py -I/opt/local/include -L/opt/local/lib build
209
        $ cd $SYNNEFO
210
        $ sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
211

  
212
.. todo:: Mention vncauthproxy bug, snf-vncauthproxy, inability to install using pip
213
.. todo:: kpap: fix installation commands
214

  
215
.. _asterias-install-nfdhcpd:
216

  
217
NFDHCPD
218
```````
219

  
220
Setup Synnefo-specific networking on the Ganeti backend.
221
This part is deployment-specific and must be customized based on the
222
specific needs of the system administrators.
223

  
224
A reference installation will use a Synnefo-specific KVM ifup script,
225
NFDHCPD and pre-provisioned Linux bridges to support public and private
226
network functionality. For this:
227

  
228
Grab NFDHCPD from its own repository (https://code.grnet.gr/git/nfdhcpd),
229
install it, modify ``/etc/nfdhcpd/nfdhcpd.conf`` to reflect your network
230
configuration.
231

  
232
Install a custom KVM ifup script for use by Ganeti, as
233
``/etc/ganeti/kvm-vif-bridge``, on GANETI-NODEs. A sample implementation is
234
provided under ``/contrib/ganeti-hooks``. Set ``NFDHCPD_STATE_DIR`` to point
235
to NFDHCPD's state directory, usually ``/var/lib/nfdhcpd``.
236

  
237
.. todo:: soc: document NFDHCPD installation, settle on KVM ifup script
238

  
239
.. _asterias-install-snfimage:
240

  
241
snf-image
242
`````````
243

  
244
Install the :ref:`snf-image <snf-image>` Ganeti OS provider for image
245
deployment.
246

  
247
For :ref:`asterias <asterias>` to be able to launch VMs from specified
248
Images, you need the snf-image OS Provider installed on *all* Ganeti nodes.
249

  
250
Please see `https://code.grnet.gr/projects/snf-image/wiki`_
251
for installation instructions and documentation on the design
252
and implementation of snf-image.
253

  
254
Please see `https://code.grnet.gr/projects/snf-image/files`
255
for the latest packages.
256

  
257
Images should be stored in ``extdump``, or ``diskdump`` format in a directory
258
of your choice, configurable as ``IMAGE_DIR`` in 
259
:file:`/etc/default/snf-image`.
260

  
261
synnefo components
262
******************
263

  
264
You need to install the appropriate synnefo software components on each node,
265
depending on its type, see :ref:`Architecture <asterias-architecture>`.
266

  
267
Most synnefo components have dependencies on additional Python packages.
268
The dependencies are described inside each package, and are setup
269
automatically when installing using :command:`pip`, or when installing 
270
using your system's package manager.
271

  
272
Please see the page of each synnefo software component for specific
273
installation instructions, where applicable.
274

  
275
Install the following synnefo components:
276

  
277
Nodes of type :ref:`APISERVER <APISERVER_NODE>`
278
    Components
279
    :ref:`snf-common <snf-common>`,
280
    :ref:`snf-webproject <snf-webproject>`,
281
    :ref:`snf-asterias-app <snf-asterias-app>`
282
Nodes of type :ref:`GANETI-MASTER <GANETI_MASTER>` and :ref:`GANETI-NODE <GANETI_NODE>`
283
    Components
284
    :ref:`snf-common <snf-common>`,
285
    :ref:`snf-asterias-ganeti-tools <snf-asterias-ganeti-tools>`
286
Nodes of type :ref:`LOGIC <LOGIC_NODE>`
287
    Components
288
    :ref:`snf-common <snf-common>`,
289
    :ref:`snf-webproject <snf-webproject>`,
290
    :ref:`snf-asterias-app <snf-asterias-app>`.
291

  
292
Configuration
293
-------------
294

  
295
This section targets the configuration of the prerequisites for asterias,
296
and the configuration of the associated synnefo software components.
297

  
298
synnefo components
299
******************
300

  
301
asterias uses :ref:`snf-common <snf-common>` for settings.
302
Please refer to the configuration sections of
303
:ref:`snf-webproject <snf-webproject>`,
304
:ref:`snf-asterias-app <snf-asterias-app>`,
305
:ref:`snf-asterias-ganeti-tools <snf-asterias-ganeti-tools>` for more
306
information on their configuration.
307

  
308
Ganeti
309
``````
310

  
311
Set ``GANETI_NODES``, ``GANETI_MASTER_IP``, ``GANETI_CLUSTER_INFO`` based on
312
your :ref:`Ganeti installation <asterias-install-ganeti>` and change the
313
`BACKEND_PREFIX_ID`` setting, using an custom ``PREFIX_ID``.
314

  
315
Database
316
````````
317

  
318
Once all components are installed and configured,
319
initialize the Django DB:
320

  
321
.. code-block:: console
322

  
323
   $ snf-manage syncdb
324
   $ snf-manage migrate
325

  
326
and load fixtures ``{users, flavors, images}``, 
327
which make the API usable by end users by defining a sample set of users, 
328
hardware configurations (flavors) and OS images:
329

  
330
.. code-block:: console
331

  
332
   $ snf-manage loaddata /path/to/users.json
333
   $ snf-manage loaddata flavors
334
   $ snf-manage loaddata images
335

  
336
.. warning:: 
337
    Be sure to load a custom users.json and select a unique token 
338
    for each of the initial and any other users defined in this file. 
339
    **DO NOT LEAVE THE SAMPLE AUTHENTICATION TOKENS** enabled in deployed
340
    configurations.
341

  
342
sample users.json file:
343

  
344
.. literalinclude:: ../../synnefo/db/fixtures/users.json
345

  
346
`download <../_static/users.json>`_
347

  
348
RabbitMQ
349
````````
350

  
351
Change ``RABBIT_*`` settings to match your :ref:`RabbitMQ setup
352
<asterias-install-rabbitmq>`.
353

  
354
.. include:: ../../Changelog
/dev/null
1
API Guide
2
*********
3

  
4
.. todo:: Document the relation of the API to the OpenStack API v1.1.
5

  
6
This is the guide to the REST API of the synnefo Compute Service.
7
It is meant for users wishing to make calls to the REST API directly.
8

  
9
The :ref:`kamaki <http://docs.dev.grnet.gr/kamaki>` command-line client
10
and associated python library can be used instead of making direct calls to
11
:ref:`asterias <asterias>`.
12

  
13
Overview
14
========
15

  
16
* It is not defined if requests for invalid URLs should return 404 or a Fault.
17
  We return a BadRequest Fault.
18
* It is not defined if requests with a wrong HTTP method should return 405 or a
19
  Fault. We return a BadRequest Fault.
20

  
21

  
22
General API Information
23
=======================
24

  
25
Authentication
26
--------------
27

  
28
* Authentication support is missing.
29

  
30

  
31
Request/Response Types
32
----------------------
33

  
34
* We only support JSON Requests and JSON/XML Responses. XML Requests are not
35
  supported for now.
36

  
37

  
38
Content Compression
39
-------------------
40

  
41
* Optional content compression support is missing.
42

  
43

  
44
Persistent Connections
45
----------------------
46

  
47
* Deployment note: "To prevent abuse, HTTP sessions have a timeout of 20
48
  seconds before being closed."
49

  
50

  
51
Links and References
52
--------------------
53

  
54
* Full URI references support is missing.
55
* Self and bookmark links support is missing.
56

  
57

  
58
Paginated Collections
59
---------------------
60

  
61
* Pagination support is missing.
62

  
63

  
64
Caching
65
-------
66

  
67
* We do not return cached responses.
68

  
69

  
70
Limits
71
------
72

  
73
 * Limits support is missing.
74

  
75

  
76
Efficient Polling with the Changes-Since Parameter
77
--------------------------------------------------
78

  
79
* We only support the changes-since parameter in **List Servers** and **List
80
  Images**.
81
* We assume that garbage collection of deleted servers will only affect servers
82
  deleted ``POLL_TIME`` seconds in the past or earlier. Else we lose the
83
  information of a server getting deleted.
84
* Images do not support a deleted state, so we can not track deletions.
85

  
86

  
87
Versions
88
--------
89

  
90
* Version MIME type support is missing.
91
* Versionless requests are not supported.
92
* We hardcode the ``updated`` field in versions list
93
* Deployment note: The Atom metadata need to be fixed
94

  
95

  
96
Extensions
97
----------
98

  
99
* Extensions support is missing.
100

  
101

  
102
Faults
103
------
104

  
105

  
106
API Operations
107
==============
108

  
109
Servers
110
-------
111

  
112
* ``hostId`` is always empty.
113
* ``affinityId`` is not returned.
114
* ``progress`` is always returned.
115
* ``self`` and ``bookmark`` atom links are not returned.
116
* **Get Server Details** will also return servers with a DELETED state.
117
* **Create Server** ignores ``personality`` of requests.
118
* **Create Server** ignores the disk size of the flavor.
119
* **Create Server** hardcodes the OS.
120
* **Create Server** does not support setting the password in the request.
121

  
122
List Servers
123
............
124

  
125
* **List Servers** returns just ``id`` and ``name`` if details are not
126
  requested.
127
* **List Servers** can return 304 (even though not explicitly stated) when
128
  ``changes-since`` is given.
129

  
130
**Example List Servers: JSON**
131

  
132
.. code-block:: javascript
133

  
134
  {
135
      'servers':
136
          {'values': [
137
              {
138
                  'addresses': {'values': [
139
                          {
140
                              'id': 'public',
141
                              'mac': 'aa:00:00:49:2e:7e',
142
                              'name': 'public',
143
                              'values': [ {'addr': '192.168.32.6', 'version': 4} ]
144
                          }
145
                  ]},
146
                  'created': '2011-04-19T10:18:52.085737+00:00',
147
                  'flavorRef': 1,
148
                  'hostId': '',
149
                  'id': 1,
150
                  'imageRef': 3,
151
                  'metadata': {'values': {'foo': 'bar'}},
152
                  'name': 'My Server',
153
                  'status': 'ACTIVE',
154
                  'updated': u'2011-05-29T14:07:07.037602+00:00'
155
              },
156
              {
157
                  'addresses': {'values': [
158
                          {
159
                              'id': 'public',
160
                              'mac': 'aa:00:00:91:2f:df',
161
                              'name': 'public',
162
                              'values': [ {'addr': '192.168.32.7', 'version': 4} ]
163
                          },
164
                          {
165
                              'id': '2',
166
                              'mac': 'aa:00:00:c3:69:6f',
167
                              'name': 'private'
168
                          },
169
                  ]},
170
                  'created': '2011-05-02T20:51:08.527759+00:00',
171
                  'flavorRef': 1,
172
                  'hostId': '',
173
                  'id': 2,
174
                  'imageRef': 3,
175
                  'name': 'Other Server',
176
                  'progress': 0,
177
                  'status': 'ACTIVE',
178
                  'updated': '2011-05-29T14:59:11.267087+00:00'
179
              }
180
          ]
181
      }
182
  }
183

  
184

  
185
Get Server Stats
186
................
187

  
188
**GET** /servers/*id*/stats
189

  
190
**Normal Response Code**: 200
191

  
192
**Error Response Codes**: computeFault (400, 500), serviceUnavailable (503),
193
unauthorized (401), badRequest (400), itemNotFound (404), overLimit (413)
194

  
195
This operation returns URLs to graphs showing CPU and Network statistics. A
196
``refresh`` attribute is returned as well that is the recommended refresh rate
197
of the stats for the clients.
198

  
199
This operation does not require a request body.
200

  
201
**Example Get Server Stats Response: JSON**:
202

  
203
.. code-block:: javascript
204

  
205
  {
206
      "stats": {
207
          "serverRef": 1,
208
          "refresh": 60,
209
          "cpuBar": "http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/cpu-bar.png",
210
          "cpuTimeSeries": "http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/cpu-ts.png",
211
          "netBar": "http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/net-bar.png",
212
          "netTimeSeries": "http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/net-ts.png"
213
      }
214
  }
215

  
216
**Example Get Network Details Response: XML**:
217

  
218
.. code-block:: xml
219

  
220
  <?xml version="1.0" encoding="UTF-8"?>
221
  <stats xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom"
222
      serverRef="1"
223
      refresh="60"
224
      cpuBar="http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/cpu-bar.png"
225
      cpuTimeSeries="http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/cpu-ts.png"
226
      netBar="http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/net-bar.png"
227
      netTimeSeries="http://stats.okeanos.grnet.gr/b9a1c3ca7e3b9fce75112c43565fb9960b16048c/net-ts.png">
228
  </stats>
229

  
230

  
231
Server Addresses
232
----------------
233

  
234
Server Actions
235
--------------
236

  
237
* **Change Password** is not supported.
238
* **Rebuild Server** is not supported.
239
* **Resize Server** is not supported.
240
* **Confirm Resized Server** is not supported.
241
* **Revert Resized Server** is not supported.
242

  
243
We have have extended the API with the following commands:
244

  
245

  
246
Start Server
247
............
248

  
249
**Normal Response Code**: 202
250

  
251
**Error Response Codes**: serviceUnavailable (503), itemNotFound (404)
252

  
253
The start function transitions a server from an ACTIVE to a STOPPED state.
254

  
255
**Example Action Start: JSON**:
256

  
257
.. code-block:: javascript
258

  
259
  {
260
      "start": {}
261
  }
262

  
263
This operation does not return a response body.
264

  
265

  
266
Shutdown Server
267
...............
268

  
269
**Normal Response Code**: 202
270

  
271
**Error Response Codes**: serviceUnavailable (503), itemNotFound (404)
272

  
273
The start function transitions a server from a STOPPED to an ACTIVE state.
274

  
275
**Example Action Shutdown: JSON**:
276

  
277
.. code-block:: javascript
278

  
279
  {
280
      "shutdown": {}
281
  }
282

  
283
This operation does not return a response body.
284

  
285

  
286
Get Server Console
287

  
288
**Normal Response Code**: 200
289

  
290
**Error Response Codes**: computeFault (400, 500), serviceUnavailable (503), unauthorized (401), badRequest (400), badMediaType(415), itemNotFound (404), buildInProgress (409), overLimit (413)
291

  
292
The console function arranges for an OOB console of the specified type. Only consoles of type "vnc" are supported for now.
293
    
294
It uses a running instance of vncauthproxy to setup proper VNC forwarding with a random password, then returns the necessary VNC connection info to the caller.
295

  
296
**Example Action Console: JSON**:
297

  
298
.. code-block:: javascript
299

  
300
  {
301
      "console": {
302
          "type": "vnc"
303
      }
304
  }
305

  
306
**Example Action Console Response: JSON**:
307

  
308
.. code-block:: javascript
309

  
310
  {
311
      "console": {
312
          "type": "vnc",
313
          "host": "vm42.ocean.grnet.gr",
314
          "port": 1234,
315
          "password": "IN9RNmaV"
316
      }
317
  }
318

  
319
**Example Action Console Response: XML**:
320

  
321
.. code-block:: xml
322

  
323
  <?xml version="1.0" encoding="UTF-8"?>
324
  <console xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom"
325
      type="vnc"
326
      host="vm42.ocean.grnet.gr"
327
      port="1234"
328
      password="IN9RNmaV">
329
  </console>
330

  
331

  
332
Set Firewall Profile
333
....................
334

  
335
**Normal Response Code**: 202
336

  
337
**Error Response Codes**: computeFault (400, 500), serviceUnavailable (503),
338
unauthorized (401), badRequest (400), badMediaType(415), itemNotFound (404),
339
buildInProgress (409), overLimit (413)
340

  
341
The firewallProfile function sets a firewall profile for the public interface
342
of a server.
343

  
344
The allowed profiles are: **ENABLED**, **DISABLED** and **PROTECTED**.
345

  
346
**Example Action firewallProfile: JSON**:
347

  
348
.. code-block:: javascript
349

  
350
  {
351
      "firewallProfile": {
352
          "profile": "ENABLED"
353
      }
354
  }
355

  
356
This operation does not return a response body.
357

  
358

  
359
Flavors
360
-------
361

  
362
* ``self`` and ``bookmark`` atom links are not returned.
363
* **List Flavors** returns just ``id`` and ``name`` if details is not requested.
364

  
365

  
366
Images
367
------
368

  
369
* ``progress`` is always returned.
370
* ``self`` and ``bookmark`` atom links are not returned.
371
* **List Images** returns just ``id`` and ``name`` if details are not requested.
372
* **List Images** can return 304 (even though not explicitly stated) when
373
  ``changes-since`` is given. 
374
* **List Images** does not return deleted images when ``changes-since`` is given.
375

  
376

  
377
Metadata
378
--------
379

  
380
* **Update Server Metadata** and **Update Image Metadata** will only return the
381
  metadata that were updated (some could have been skipped).
382

  
383

  
384
Networks
385
--------
386

  
387
This is an extension to the OpenStack API.
388

  
389
A Server can connect to one or more networks identified by a numeric id. Each
390
user has access only to networks created by himself. When a network is deleted,
391
all connections to it are deleted. Likewise, when a server is deleted, all
392
connections of that server are deleted.
393

  
394
There is a special **public** network with the id *public* that can be accessed
395
at */networks/public*. All servers are connected to **public** by default and
396
this network can not be deleted or modified in any way.
397

  
398

  
399
List Networks
400
.............
401

  
402
**GET** /networks
403

  
404
**GET** /networks/detail
405

  
406
**Normal Response Codes**: 200, 203
407

  
408
**Error Response Codes**: computeFault (400, 500), serviceUnavailable (503),
409
unauthorized (401), badRequest (400), overLimit (413)
410

  
411
This operation provides a list of private networks associated with your account.
412

  
413
This operation does not require a request body.
414

  
415
**Example Networks List Response: JSON (detail)**:
416

  
417
.. code-block:: javascript
418

  
419
  {
420
      "networks": {
421
          "values": [
422
              {
423
                  "id": "public",
424
                  "name": "public",
425
                  "created": "2011-04-20T15:31:08.199640+00:00",
426
                  "updated": "2011-05-06T12:47:05.582679+00:00",
427
                  "servers": {
428
                      "values": [1, 2, 3]
429
                  }
430
              },
431
              {
432
                  "id": 2,
433
                  "name": "private",
434
                  "created": "2011-04-20T14:32:08.199640+00:00",
435
                  "updated": "2011-05-06T11:40:05.582679+00:00",
436
                  "servers": {
437
                      "values": [1]
438
                  }
439
              }
440
          ]
441
      }
442
  }
443

  
444
**Example Networks List Response: XML (detail)**:
445

  
446
.. code-block:: xml
447

  
448
  <?xml version="1.0" encoding="UTF-8"?>
449
  <networks xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom">
450
    <network id="public" name="public" updated="2011-05-02T21:33:25.606672+00:00" created="2011-04-20T15:31:08.199640+00:00">
451
      <servers>
452
        <server id="1"></server>
453
        <server id="2"></server>
454
        <server id="3"></server>
455
      </servers>
456
    </network>
457
    <network id="2" name="private" updated="2011-05-06T12:47:05.582679+00:00" created="2011-04-20T15:31:33.911299+00:00">
458
      <servers>
459
        <server id="1"></server>
460
      </servers>
461
    </network>
462
  </networks>
463

  
464

  
465
Create Network
466
..............
467

  
468
**POST** /networks
469

  
470
**Normal Response Code**: 202
471

  
472
**Error Response Codes**: computeFault (400, 500), serviceUnavailable (503),
473
unauthorized (401), badMediaType(415), badRequest (400), overLimit (413)
474

  
475
This operation asynchronously provisions a new private network.
476

  
477
**Example Create Network Request: JSON**:
478

  
479
.. code-block:: javascript
480

  
481
  {
482
      "network": {
483
          "name": "private_net",
484
      }
485
  }
486

  
487
**Example Create Network Response: JSON**:
488

  
489
.. code-block:: javascript
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff