import neutron master of cba140daccd7c4f715263cda422d5cec27af069d
Merge Neutron master branch to tacker master branch with modification of tox.ini and .gitreview. This patch imports the following change set of Neutron. > commit cba140daccd7c4f715263cda422d5cec27af069d > Merge: 63d8237 6bed4a0 > Author: Jenkins <jenkins@review.openstack.org> > Date: Sun Jun 22 16:02:56 2014 +0000 > > Merge "Adding static routes data for members" Change-Id: I5a0f522bc20530c46e35dc9e03fe72d72ad04577
This commit is contained in:
parent
9a3ba5b0d6
commit
8aff29509f
7
.coveragerc
Normal file
7
.coveragerc
Normal file
@ -0,0 +1,7 @@
|
||||
[run]
|
||||
branch = True
|
||||
source = neutron
|
||||
omit = neutron/tests/*,neutron/plugins/cisco/test/*,neutron/openstack/*
|
||||
|
||||
[report]
|
||||
ignore-errors = True
|
28
.gitignore
vendored
Normal file
28
.gitignore
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
AUTHORS
|
||||
build/*
|
||||
build-stamp
|
||||
ChangeLog
|
||||
cover/
|
||||
.coverage
|
||||
covhtml/
|
||||
dist/
|
||||
doc/build
|
||||
*.DS_Store
|
||||
*.pyc
|
||||
neutron.egg-info/
|
||||
neutron/vcsversion.py
|
||||
neutron/versioninfo
|
||||
pbr*.egg/
|
||||
quantum.egg-info/
|
||||
quantum/vcsversion.py
|
||||
quantum/versioninfo
|
||||
run_tests.err.log
|
||||
run_tests.log
|
||||
setuptools*.egg/
|
||||
subunit.log
|
||||
.testrepository
|
||||
.tox/
|
||||
.venv/
|
||||
*.mo
|
||||
*.sw?
|
||||
*~
|
11
.mailmap
Normal file
11
.mailmap
Normal file
@ -0,0 +1,11 @@
|
||||
# Format is:
|
||||
# <preferred e-mail> <other e-mail 1>
|
||||
# <preferred e-mail> <other e-mail 2>
|
||||
lawrancejing <lawrancejing@gmail.com> <liuqing@windawn.com>
|
||||
Jiajun Liu <jiajun@unitedstack.com> <iamljj@gmail.com>
|
||||
Zhongyue Luo <zhongyue.nah@intel.com> <lzyeval@gmail.com>
|
||||
Kun Huang <gareth@unitedstack.com> <academicgareth@gmail.com>
|
||||
Zhenguo Niu <zhenguo@unitedstack.com> <Niu.ZGlinux@gmail.com>
|
||||
Isaku Yamahata <isaku.yamahata@intel.com> <isaku.yamahata@gmail.com>
|
||||
Isaku Yamahata <isaku.yamahata@intel.com> <yamahata@private.email.ne.jp>
|
||||
Morgan Fainberg <morgan.fainberg@gmail.com> <m@metacloud.com>
|
42
.pylintrc
Normal file
42
.pylintrc
Normal file
@ -0,0 +1,42 @@
|
||||
# The format of this file isn't really documented; just use --generate-rcfile
|
||||
[MASTER]
|
||||
# Add <file or directory> to the black list. It should be a base name, not a
|
||||
# path. You may set this option multiple times.
|
||||
ignore=test
|
||||
|
||||
[Messages Control]
|
||||
# NOTE(justinsb): We might want to have a 2nd strict pylintrc in future
|
||||
# C0111: Don't require docstrings on every method
|
||||
# W0511: TODOs in code comments are fine.
|
||||
# W0142: *args and **kwargs are fine.
|
||||
# W0622: Redefining id is fine.
|
||||
disable=C0111,W0511,W0142,W0622
|
||||
|
||||
[Basic]
|
||||
# Variable names can be 1 to 31 characters long, with lowercase and underscores
|
||||
variable-rgx=[a-z_][a-z0-9_]{0,30}$
|
||||
|
||||
# Argument names can be 2 to 31 characters long, with lowercase and underscores
|
||||
argument-rgx=[a-z_][a-z0-9_]{1,30}$
|
||||
|
||||
# Method names should be at least 3 characters long
|
||||
# and be lowecased with underscores
|
||||
method-rgx=([a-z_][a-z0-9_]{2,50}|setUp|tearDown)$
|
||||
|
||||
# Module names matching neutron-* are ok (files in bin/)
|
||||
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$
|
||||
|
||||
# Don't require docstrings on tests.
|
||||
no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$
|
||||
|
||||
[Design]
|
||||
max-public-methods=100
|
||||
min-public-methods=0
|
||||
max-args=6
|
||||
|
||||
[Variables]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid to define new builtins when possible.
|
||||
# _ is used by our localization
|
||||
additional-builtins=_
|
4
.testr.conf
Normal file
4
.testr.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[DEFAULT]
|
||||
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
28
HACKING.rst
Normal file
28
HACKING.rst
Normal file
@ -0,0 +1,28 @@
|
||||
Neutron Style Commandments
|
||||
=======================
|
||||
|
||||
- Step 1: Read the OpenStack Style Commandments
|
||||
http://docs.openstack.org/developer/hacking/
|
||||
- Step 2: Read on
|
||||
|
||||
Neutron Specific Commandments
|
||||
--------------------------
|
||||
|
||||
- [N320] Validate that LOG messages, except debug ones, have translations
|
||||
|
||||
Creating Unit Tests
|
||||
-------------------
|
||||
For every new feature, unit tests should be created that both test and
|
||||
(implicitly) document the usage of said feature. If submitting a patch for a
|
||||
bug that had no unit test, a new passing unit test should be added. If a
|
||||
submitted bug fix does have a unit test, be sure to add a new one that fails
|
||||
without the patch and passes with the patch.
|
||||
|
||||
All unittest classes must ultimately inherit from testtools.TestCase. In the
|
||||
Neutron test suite, this should be done by inheriting from
|
||||
neutron.tests.base.BaseTestCase.
|
||||
|
||||
All setUp and tearDown methods must upcall using the super() method.
|
||||
tearDown methods should be avoided and addCleanup calls should be preferred.
|
||||
Never manually create tempfiles. Always use the tempfile fixtures from
|
||||
the fixture library to ensure that they are cleaned up.
|
176
LICENSE
Normal file
176
LICENSE
Normal file
@ -0,0 +1,176 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
14
MANIFEST.in
Normal file
14
MANIFEST.in
Normal file
@ -0,0 +1,14 @@
|
||||
include AUTHORS
|
||||
include README.rst
|
||||
include ChangeLog
|
||||
include LICENSE
|
||||
include neutron/db/migration/README
|
||||
include neutron/db/migration/alembic.ini
|
||||
include neutron/db/migration/alembic_migrations/script.py.mako
|
||||
include neutron/db/migration/alembic_migrations/versions/README
|
||||
recursive-include neutron/locale *
|
||||
|
||||
exclude .gitignore
|
||||
exclude .gitreview
|
||||
|
||||
global-exclude *.pyc
|
25
README.rst
Normal file
25
README.rst
Normal file
@ -0,0 +1,25 @@
|
||||
# -- Welcome!
|
||||
|
||||
You have come across a cloud computing network fabric controller. It has
|
||||
identified itself as "Neutron." It aims to tame your (cloud) networking!
|
||||
|
||||
# -- External Resources:
|
||||
|
||||
The homepage for Neutron is: http://launchpad.net/neutron . Use this
|
||||
site for asking for help, and filing bugs. Code is available on github at
|
||||
<http://github.com/openstack/neutron>.
|
||||
|
||||
The latest and most in-depth documentation on how to use Neutron is
|
||||
available at: <http://docs.openstack.org>. This includes:
|
||||
|
||||
Neutron Administrator Guide
|
||||
http://docs.openstack.org/trunk/openstack-network/admin/content/
|
||||
|
||||
Neutron API Reference:
|
||||
http://docs.openstack.org/api/openstack-network/2.0/content/
|
||||
|
||||
The start of some developer documentation is available at:
|
||||
http://wiki.openstack.org/NeutronDevelopment
|
||||
|
||||
For help using or hacking on Neutron, you can send mail to
|
||||
<mailto:openstack-dev@lists.openstack.org>.
|
180
TESTING.rst
Normal file
180
TESTING.rst
Normal file
@ -0,0 +1,180 @@
|
||||
Testing Neutron
|
||||
=============================================================
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The unit tests are meant to cover as much code as possible and should
|
||||
be executed without the service running. They are designed to test
|
||||
the various pieces of the neutron tree to make sure any new changes
|
||||
don't break existing functionality.
|
||||
|
||||
The functional tests are intended to validate actual system
|
||||
interaction. Mocks should be used sparingly, if at all. Care
|
||||
should be taken to ensure that existing system resources are not
|
||||
modified and that resources created in tests are properly cleaned
|
||||
up.
|
||||
|
||||
Development process
|
||||
-------------------
|
||||
|
||||
It is expected that any new changes that are proposed for merge
|
||||
come with tests for that feature or code area. Ideally any bugs
|
||||
fixes that are submitted also have tests to prove that they stay
|
||||
fixed! In addition, before proposing for merge, all of the
|
||||
current tests should be passing.
|
||||
|
||||
Virtual environments
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Testing OpenStack projects, including Neutron, is made easier with `DevStack <https://github.com/openstack-dev/devstack>`_.
|
||||
|
||||
Create a machine (such as a VM or Vagrant box) running a distribution supported
|
||||
by DevStack and install DevStack there. For example, there is a Vagrant script
|
||||
for DevStack at https://github.com/bcwaldon/vagrant_devstack.
|
||||
|
||||
.. note::
|
||||
|
||||
If you prefer not to use DevStack, you can still check out source code on your local
|
||||
machine and develop from there.
|
||||
|
||||
|
||||
Running unit tests
|
||||
------------------
|
||||
|
||||
There are three mechanisms for running tests: run_tests.sh, tox,
|
||||
and nose. Before submitting a patch for review you should always
|
||||
ensure all test pass; a tox run is triggered by the jenkins gate
|
||||
executed on gerrit for each patch pushed for review.
|
||||
|
||||
With these mechanisms you can either run the tests in the standard
|
||||
environment or create a virtual environment to run them in.
|
||||
|
||||
By default after running all of the tests, any pep8 errors
|
||||
found in the tree will be reported.
|
||||
|
||||
|
||||
With `run_tests.sh`
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can use the `run_tests.sh` script in the root source directory to execute
|
||||
tests in a virtualenv::
|
||||
|
||||
./run_tests -V
|
||||
|
||||
|
||||
With `nose`
|
||||
~~~~~~~~~~~
|
||||
|
||||
You can use `nose`_ to run individual tests, as well as use for debugging
|
||||
portions of your code::
|
||||
|
||||
source .venv/bin/activate
|
||||
pip install nose
|
||||
nosetests
|
||||
|
||||
There are disadvantages to running Nose - the tests are run sequentially, so
|
||||
race condition bugs will not be triggered, and the full test suite will
|
||||
take significantly longer than tox & testr. The upside is that testr has
|
||||
some rough edges when it comes to diagnosing errors and failures, and there is
|
||||
no easy way to set a breakpoint in the Neutron code, and enter an
|
||||
interactive debugging session while using testr.
|
||||
|
||||
.. _nose: https://nose.readthedocs.org/en/latest/index.html
|
||||
|
||||
With `tox`
|
||||
~~~~~~~~~~
|
||||
|
||||
Neutron, like other OpenStack projects, uses `tox`_ for managing the virtual
|
||||
environments for running test cases. It uses `Testr`_ for managing the running
|
||||
of the test cases.
|
||||
|
||||
Tox handles the creation of a series of `virtualenvs`_ that target specific
|
||||
versions of Python (2.6, 2.7, 3.3, etc).
|
||||
|
||||
Testr handles the parallel execution of series of test cases as well as
|
||||
the tracking of long-running tests and other things.
|
||||
|
||||
Running unit tests is as easy as executing this in the root directory of the
|
||||
Neutron source code::
|
||||
|
||||
tox
|
||||
|
||||
For more information on the standard Tox-based test infrastructure used by
|
||||
OpenStack and how to do some common test/debugging procedures with Testr,
|
||||
see this wiki page:
|
||||
|
||||
https://wiki.openstack.org/wiki/Testr
|
||||
|
||||
.. _Testr: https://wiki.openstack.org/wiki/Testr
|
||||
.. _tox: http://tox.readthedocs.org/en/latest/
|
||||
.. _virtualenvs: https://pypi.python.org/pypi/virtualenv
|
||||
|
||||
|
||||
Running individual tests
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For running individual test modules or cases, you just need to pass
|
||||
the dot-separated path to the module you want as an argument to it.
|
||||
|
||||
For executing a specific test case, specify the name of the test case
|
||||
class separating it from the module path with a colon.
|
||||
|
||||
For example, the following would run only the JSONV2TestCase tests from
|
||||
neutron/tests/unit/test_api_v2.py::
|
||||
|
||||
$ ./run_tests.sh neutron.tests.unit.test_api_v2:JSONV2TestCase
|
||||
|
||||
or::
|
||||
|
||||
$ ./tox neutron.tests.unit.test_api_v2:JSONV2TestCase
|
||||
|
||||
Adding more tests
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Neutron has a fast growing code base and there is plenty of areas that
|
||||
need to be covered by unit and functional tests.
|
||||
|
||||
To get a grasp of the areas where tests are needed, you can check
|
||||
current coverage by running::
|
||||
|
||||
$ ./run_tests.sh -c
|
||||
|
||||
Debugging
|
||||
---------
|
||||
|
||||
By default, calls to pdb.set_trace() will be ignored when tests
|
||||
are run. For pdb statements to work, invoke run_tests as follows::
|
||||
|
||||
$ ./run_tests.sh -d [test module path]
|
||||
|
||||
It's possible to debug tests in a tox environment::
|
||||
|
||||
$ tox -e venv -- python -m testtools.run [test module path]
|
||||
|
||||
Tox-created virtual environments (venv's) can also be activated
|
||||
after a tox run and reused for debugging::
|
||||
|
||||
$ tox -e venv
|
||||
$ . .tox/venv/bin/activate
|
||||
$ python -m testtools.run [test module path]
|
||||
|
||||
Tox packages and installs the neutron source tree in a given venv
|
||||
on every invocation, but if modifications need to be made between
|
||||
invocation (e.g. adding more pdb statements), it is recommended
|
||||
that the source tree be installed in the venv in editable mode::
|
||||
|
||||
# run this only after activating the venv
|
||||
$ pip install --editable .
|
||||
|
||||
Editable mode ensures that changes made to the source tree are
|
||||
automatically reflected in the venv, and that such changes are not
|
||||
overwritten during the next tox run.
|
||||
|
||||
Post-mortem debugging
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Setting OS_POST_MORTEM_DEBUG=1 in the shell environment will ensure
|
||||
that pdb.post_mortem() will be invoked on test failure::
|
||||
|
||||
$ OS_POST_MORTEM_DEBUG=1 ./run_tests.sh -d [test module path]
|
21
bin/neutron-rootwrap
Executable file
21
bin/neutron-rootwrap
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (c) 2012 OpenStack Foundation.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.rootwrap import cmd
|
||||
|
||||
cmd.main()
|
141
bin/neutron-rootwrap-xen-dom0
Executable file
141
bin/neutron-rootwrap-xen-dom0
Executable file
@ -0,0 +1,141 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2012 Openstack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Neutron root wrapper for dom0.
|
||||
|
||||
Executes networking commands in dom0. The XenAPI plugin is
|
||||
responsible determining whether a command is safe to execute.
|
||||
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import json
|
||||
import os
|
||||
import select
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
import XenAPI
|
||||
|
||||
|
||||
RC_UNAUTHORIZED = 99
|
||||
RC_NOCOMMAND = 98
|
||||
RC_BADCONFIG = 97
|
||||
RC_XENAPI_ERROR = 96
|
||||
|
||||
|
||||
def parse_args():
|
||||
# Split arguments, require at least a command
|
||||
exec_name = sys.argv.pop(0)
|
||||
# argv[0] required; path to conf file
|
||||
if len(sys.argv) < 2:
|
||||
print("%s: No command specified" % exec_name)
|
||||
sys.exit(RC_NOCOMMAND)
|
||||
|
||||
config_file = sys.argv.pop(0)
|
||||
user_args = sys.argv[:]
|
||||
|
||||
return exec_name, config_file, user_args
|
||||
|
||||
|
||||
def _xenapi_section_name(config):
|
||||
sections = [sect for sect in config.sections() if sect.lower() == "xenapi"]
|
||||
if len(sections) == 1:
|
||||
return sections[0]
|
||||
|
||||
print("Multiple [xenapi] sections or no [xenapi] section found!")
|
||||
sys.exit(RC_BADCONFIG)
|
||||
|
||||
|
||||
def load_configuration(exec_name, config_file):
|
||||
config = ConfigParser.RawConfigParser()
|
||||
config.read(config_file)
|
||||
try:
|
||||
exec_dirs = config.get("DEFAULT", "exec_dirs").split(",")
|
||||
filters_path = config.get("DEFAULT", "filters_path").split(",")
|
||||
section = _xenapi_section_name(config)
|
||||
url = config.get(section, "xenapi_connection_url")
|
||||
username = config.get(section, "xenapi_connection_username")
|
||||
password = config.get(section, "xenapi_connection_password")
|
||||
except ConfigParser.Error:
|
||||
print("%s: Incorrect configuration file: %s" % (exec_name, config_file))
|
||||
sys.exit(RC_BADCONFIG)
|
||||
if not url or not password:
|
||||
msg = ("%s: Must specify xenapi_connection_url, "
|
||||
"xenapi_connection_username (optionally), and "
|
||||
"xenapi_connection_password in %s") % (exec_name, config_file)
|
||||
print(msg)
|
||||
sys.exit(RC_BADCONFIG)
|
||||
return dict(
|
||||
filters_path=filters_path,
|
||||
url=url,
|
||||
username=username,
|
||||
password=password,
|
||||
exec_dirs=exec_dirs,
|
||||
)
|
||||
|
||||
|
||||
def filter_command(exec_name, filters_path, user_args, exec_dirs):
|
||||
# Add ../ to sys.path to allow running from branch
|
||||
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(exec_name),
|
||||
os.pardir, os.pardir))
|
||||
if os.path.exists(os.path.join(possible_topdir, "neutron", "__init__.py")):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from oslo.rootwrap import wrapper
|
||||
|
||||
# Execute command if it matches any of the loaded filters
|
||||
filters = wrapper.load_filters(filters_path)
|
||||
filter_match = wrapper.match_filter(
|
||||
filters, user_args, exec_dirs=exec_dirs)
|
||||
if not filter_match:
|
||||
print("Unauthorized command: %s" % ' '.join(user_args))
|
||||
sys.exit(RC_UNAUTHORIZED)
|
||||
|
||||
|
||||
def run_command(url, username, password, user_args, cmd_input):
|
||||
try:
|
||||
session = XenAPI.Session(url)
|
||||
session.login_with_password(username, password)
|
||||
host = session.xenapi.session.get_this_host(session.handle)
|
||||
result = session.xenapi.host.call_plugin(
|
||||
host, 'netwrap', 'run_command',
|
||||
{'cmd': json.dumps(user_args), 'cmd_input': json.dumps(cmd_input)})
|
||||
return json.loads(result)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
sys.exit(RC_XENAPI_ERROR)
|
||||
|
||||
|
||||
def main():
|
||||
exec_name, config_file, user_args = parse_args()
|
||||
config = load_configuration(exec_name, config_file)
|
||||
filter_command(exec_name, config['filters_path'], user_args, config['exec_dirs'])
|
||||
|
||||
# If data is available on the standard input, we need to pass it to the
|
||||
# command executed in dom0
|
||||
cmd_input = None
|
||||
if select.select([sys.stdin,],[],[],0.0)[0]:
|
||||
cmd_input = "".join(sys.stdin)
|
||||
|
||||
return run_command(config['url'], config['username'], config['password'],
|
||||
user_args, cmd_input)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(main())
|
96
doc/Makefile
Normal file
96
doc/Makefile
Normal file
@ -0,0 +1,96 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
SPHINXSOURCE = source
|
||||
PAPER =
|
||||
BUILDDIR = build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SPHINXSOURCE)
|
||||
|
||||
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
|
||||
|
||||
.DEFAULT_GOAL = html
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
if [ -f .autogenerated ] ; then \
|
||||
cat .autogenerated | xargs rm ; \
|
||||
rm .autogenerated ; \
|
||||
fi
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/nova.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/nova.qhc"
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
||||
"run these through (pdf)latex."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
135
doc/pom.xml
Normal file
135
doc/pom.xml
Normal file
@ -0,0 +1,135 @@
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.openstack.docs</groupId>
|
||||
<artifactId>openstack-guide</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>OpenStack Guides</name>
|
||||
<!-- ################################################ -->
|
||||
<!-- USE "mvn clean generate-sources" to run this POM -->
|
||||
<!-- ################################################ -->
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>Rackspace Research Repositories</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>rackspace-research</id>
|
||||
<name>Rackspace Research Repository</name>
|
||||
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>rackspace-research</id>
|
||||
<name>Rackspace Research Repository</name>
|
||||
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>target/docbkx/pdf</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.fo</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.rackspace.cloud.api</groupId>
|
||||
<artifactId>clouddocs-maven-plugin</artifactId>
|
||||
<version>1.0.5-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>goal1</id>
|
||||
<goals>
|
||||
<goal>generate-pdf</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<highlightSource>false</highlightSource>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>goal2</id>
|
||||
<goals>
|
||||
<goal>generate-webhelp</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<!-- These parameters only apply to webhelp -->
|
||||
<enableDisqus>0</enableDisqus>
|
||||
<disqusShortname>openstackdocs</disqusShortname>
|
||||
<enableGoogleAnalytics>1</enableGoogleAnalytics>
|
||||
<googleAnalyticsId>UA-17511903-6</googleAnalyticsId>
|
||||
<generateToc>
|
||||
appendix toc,title
|
||||
article/appendix nop
|
||||
article toc,title
|
||||
book title,figure,table,example,equation
|
||||
chapter toc,title
|
||||
part toc,title
|
||||
preface toc,title
|
||||
qandadiv toc
|
||||
qandaset toc
|
||||
reference toc,title
|
||||
set toc,title
|
||||
</generateToc>
|
||||
<!-- The following elements sets the autonumbering of sections in output for chapter numbers but no numbered sections-->
|
||||
<sectionAutolabel>0</sectionAutolabel>
|
||||
<sectionLabelIncludesComponentLabel>0</sectionLabelIncludesComponentLabel>
|
||||
<postProcess>
|
||||
<!-- Copies the figures to the correct location for webhelp -->
|
||||
<copy todir="${basedir}/target/docbkx/webhelp/neutron-api-1.0/figures">
|
||||
<fileset dir="${basedir}/source/docbkx/neutron-api-1.0/figures">
|
||||
<include name="**/*.png" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- New stuff -->
|
||||
<copy
|
||||
todir="${basedir}/target/docbkx/webhelp/trunk/developer/neutron-api-1.0">
|
||||
<fileset
|
||||
dir="${basedir}/target/docbkx/webhelp/neutron-api-1.0/neutron-api-guide/">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<!--Moves PDFs to the needed placement -->
|
||||
<move failonerror="false"
|
||||
file="${basedir}/target/docbkx/pdf/neutron-api-1.0/neutron-api-guide.pdf"
|
||||
tofile="${basedir}/target/docbkx/webhelp/trunk/developer/neutron-api-1.0/neutron-api-guide-trunk.pdf"/>
|
||||
|
||||
<!--Deletes leftover uneeded directories -->
|
||||
<delete
|
||||
dir="${basedir}/target/docbkx/webhelp/neutron-api-1.0"/>
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- These parameters apply to pdf and webhelp -->
|
||||
<xincludeSupported>true</xincludeSupported>
|
||||
<sourceDirectory>source/docbkx</sourceDirectory>
|
||||
<includes>
|
||||
neutron-api-1.0/neutron-api-guide.xml
|
||||
</includes>
|
||||
<profileSecurity>reviewer</profileSecurity>
|
||||
<branding>openstack</branding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
250
doc/source/conf.py
Normal file
250
doc/source/conf.py
Normal file
@ -0,0 +1,250 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2010 OpenStack Foundation.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#
|
||||
# Keystone documentation build configuration file, created by
|
||||
# sphinx-quickstart on Tue May 18 13:50:15 2010.
|
||||
#
|
||||
# This file is execfile()'d with the current directory set to it's containing
|
||||
# dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
NEUTRON_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
||||
sys.path.insert(0, NEUTRON_DIR)
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.ifconfig',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.pngmath',
|
||||
'sphinx.ext.graphviz',
|
||||
'sphinx.ext.todo',
|
||||
'oslosphinx']
|
||||
|
||||
todo_include_todos = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = []
|
||||
if os.getenv('HUDSON_PUBLISH_DOCS'):
|
||||
templates_path = ['_ga', '_templates']
|
||||
else:
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Neutron'
|
||||
copyright = u'2011-present, OpenStack Foundation.'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# Version info
|
||||
from neutron.version import version_info as neutron_version
|
||||
release = neutron_version.release_string()
|
||||
# The short X.Y version.
|
||||
version = neutron_version.version_string()
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of documents that shouldn't be included in the build.
|
||||
# unused_docs = []
|
||||
|
||||
# List of directories, relative to source directory, that shouldn't be searched
|
||||
# for source files.
|
||||
exclude_trees = []
|
||||
|
||||
# The reST default role (for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
show_authors = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
modindex_common_prefix = ['neutron.']
|
||||
|
||||
# -- Options for man page output --------------------------------------------
|
||||
|
||||
# Grouping the document tree for man pages.
|
||||
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
|
||||
|
||||
man_pages = [
|
||||
('man/neutron-server', 'neutron-server', u'Neutron Server',
|
||||
[u'OpenStack'], 1)
|
||||
]
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||
# html_theme_path = ["."]
|
||||
# html_theme = '_theme'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = ['_theme']
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
# html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
git_cmd = "git log --pretty=format:'%ad, commit %h' --date=local -n1"
|
||||
html_last_updated_fmt = os.popen(git_cmd).read()
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_use_modindex = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = ''
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'neutrondoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ------------------------------------------------
|
||||
|
||||
# The paper size ('letter' or 'a4').
|
||||
#latex_paper_size = 'letter'
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#latex_font_size = '10pt'
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'Neutron.tex', u'Neutron Documentation',
|
||||
u'Neutron development team', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#latex_preamble = ''
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_use_modindex = True
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
intersphinx_mapping = {'python': ('http://docs.python.org/', None),
|
||||
'nova': ('http://nova.openstack.org', None),
|
||||
'swift': ('http://swift.openstack.org', None),
|
||||
'glance': ('http://glance.openstack.org', None),
|
||||
'horizon': ('http://horizon.openstack.org', None),
|
||||
'keystone': ('http://keystone.openstack.org', None),
|
||||
}
|
7
doc/source/devref/advanced_services.rst
Normal file
7
doc/source/devref/advanced_services.rst
Normal file
@ -0,0 +1,7 @@
|
||||
Advanced Services
|
||||
=================
|
||||
|
||||
.. toctree::
|
||||
fwaas
|
||||
lbaas
|
||||
vpnaas
|
18
doc/source/devref/api_extensions.rst
Normal file
18
doc/source/devref/api_extensions.rst
Normal file
@ -0,0 +1,18 @@
|
||||
==============
|
||||
API Extensions
|
||||
==============
|
||||
|
||||
API extensions is the standard way of introducing new functionality
|
||||
to the Neutron project, it allows plugins to
|
||||
determine if they wish to support the functionality or not.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
The easiest way to demonstrate how an API extension is written, is
|
||||
by studying an existing API extension and explaining the different layers.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
security_group_api
|
57
doc/source/devref/api_layer.rst
Normal file
57
doc/source/devref/api_layer.rst
Normal file
@ -0,0 +1,57 @@
|
||||
Neutron WSGI/HTTP API layer
|
||||
===========================
|
||||
|
||||
This section will cover the internals of Neutron's HTTP API, and the classes
|
||||
in Neutron that can be used to create Extensions to the Neutron API.
|
||||
|
||||
Python web applications interface with webservers through the Python Web
|
||||
Server Gateway Interface (WSGI) - defined in `PEP 333 <http://legacy.python.org/dev/peps/pep-0333/>`_
|
||||
|
||||
Startup
|
||||
-------
|
||||
|
||||
Neutron's WSGI server is started from the `server module <http://git.openstack.org/cgit/openstack/neutron/tree/neutron/server/__init__.py>`_
|
||||
and the entry point `serve_wsgi` is called to build an instance of the
|
||||
`NeutronApiService`_, which is then returned to the server module,
|
||||
which spawns a `Eventlet`_ `GreenPool`_ that will run the WSGI
|
||||
application and respond to requests from clients.
|
||||
|
||||
|
||||
.. _NeutronApiService: http://git.openstack.org/cgit/openstack/neutron/tree/neutron/service.py
|
||||
|
||||
.. _Eventlet: http://eventlet.net/
|
||||
|
||||
.. _GreenPool: http://eventlet.net/doc/modules/greenpool.html
|
||||
|
||||
WSGI Application
|
||||
----------------
|
||||
|
||||
During the building of the NeutronApiService, the `_run_wsgi` function
|
||||
creates a WSGI application using the `load_paste_app` function inside
|
||||
`config.py`_ - which parses `api-paste.ini`_ - in order to create a WSGI app
|
||||
using `Paste`_'s `deploy`_.
|
||||
|
||||
The api-paste.ini file defines the WSGI applications and routes - using the
|
||||
`Paste INI file format`_.
|
||||
|
||||
The INI file directs paste to instantiate the `APIRouter`_ class of
|
||||
Neutron, which contains several methods that map Neutron resources (such as
|
||||
Ports, Networks, Subnets) to URLs, and the controller for each resource.
|
||||
|
||||
|
||||
.. _config.py: http://git.openstack.org/cgit/openstack/neutron/tree/neutron/common/config.py
|
||||
|
||||
.. _api-paste.ini: http://git.openstack.org/cgit/openstack/neutron/tree/etc/api-paste.ini
|
||||
|
||||
.. _APIRouter: http://git.openstack.org/cgit/openstack/neutron/tree/neutron/api/v2/router.py
|
||||
|
||||
.. _Paste: http://pythonpaste.org/
|
||||
|
||||
.. _Deploy: http://pythonpaste.org/deploy/
|
||||
|
||||
.. _Paste INI file format: http://pythonpaste.org/deploy/#applications
|
||||
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
`Yong Sheng Gong: Deep Dive into Neutron <http://www.slideshare.net/gongys2004/inside-neutron-2>`_
|
25
doc/source/devref/common.rst
Normal file
25
doc/source/devref/common.rst
Normal file
@ -0,0 +1,25 @@
|
||||
..
|
||||
Copyright 2010-2011 United States Government as represented by the
|
||||
Administrator of the National Aeronautics and Space Administration.
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
Open Stack Common
|
||||
=================
|
||||
|
||||
A number of modules used are from the openstack-common project.
|
||||
The imported files are in 'neutron/openstack-common.conf'.
|
||||
More information can be found at `OpenStack Common`_.
|
||||
|
||||
.. _`OpenStack Common`: https://launchpad.net/openstack-common
|
2
doc/source/devref/db_layer.rst
Normal file
2
doc/source/devref/db_layer.rst
Normal file
@ -0,0 +1,2 @@
|
||||
Neutron Database Layer
|
||||
======================
|
49
doc/source/devref/development.environment.rst
Normal file
49
doc/source/devref/development.environment.rst
Normal file
@ -0,0 +1,49 @@
|
||||
..
|
||||
Copyright 2010-2013 United States Government as represented by the
|
||||
Administrator of the National Aeronautics and Space Administration.
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
Setting Up a Development Environment
|
||||
====================================
|
||||
|
||||
This page describes how to setup a working Python development
|
||||
environment that can be used in developing Neutron on Ubuntu, Fedora or
|
||||
Mac OS X. These instructions assume you're already familiar with
|
||||
Git and Gerrit, which is a code repository mirror and code review toolset
|
||||
, however if you aren't please see `this Git tutorial`_ for an introduction
|
||||
to using Git and `this wiki page`_ for a tutorial on using Gerrit and Git for
|
||||
code contribution to Openstack projects.
|
||||
|
||||
.. _this Git tutorial: http://git-scm.com/book/en/Getting-Started
|
||||
.. _this wiki page: https://wiki.openstack.org/wiki/Gerrit_Workflow
|
||||
|
||||
Following these instructions will allow you to run the Neutron unit
|
||||
tests. If you want to be able to run Neutron in a full OpenStack environment,
|
||||
you can use the excellent `DevStack`_ project to do so. There is a wiki page
|
||||
that describes `setting up Neutron using DevStack`_.
|
||||
|
||||
.. _DevStack: https://github.com/openstack-dev/devstack
|
||||
.. _setting up Neutron using Devstack: https://wiki.openstack.org/wiki/NeutronDevstack
|
||||
|
||||
Getting the code
|
||||
----------------
|
||||
|
||||
Grab the code from GitHub::
|
||||
|
||||
git clone git://git.openstack.org/openstack/neutron.git
|
||||
cd neutron
|
||||
|
||||
|
||||
.. include:: ../../../TESTING.rst
|
30
doc/source/devref/fwaas.rst
Normal file
30
doc/source/devref/fwaas.rst
Normal file
@ -0,0 +1,30 @@
|
||||
Firewall as a Service
|
||||
=====================
|
||||
|
||||
`Design Document`_
|
||||
|
||||
.. _Design Document: https://docs.google.com/document/d/1PJaKvsX2MzMRlLGfR0fBkrMraHYF0flvl0sqyZ704tA/edit#heading=h.aed6tiupj0qk
|
||||
|
||||
Plugin
|
||||
------
|
||||
.. automodule:: neutron.services.firewall.fwaas_plugin
|
||||
|
||||
.. autoclass:: FirewallPlugin
|
||||
:members:
|
||||
|
||||
Database layer
|
||||
--------------
|
||||
|
||||
.. automodule:: neutron.db.firewall.firewall_db
|
||||
|
||||
.. autoclass:: Firewall_db_mixin
|
||||
:members:
|
||||
|
||||
|
||||
Driver layer
|
||||
------------
|
||||
|
||||
.. automodule:: neutron.services.firewall.drivers.fwaas_base
|
||||
|
||||
.. autoclass:: FwaasDriverBase
|
||||
:members:
|
65
doc/source/devref/index.rst
Normal file
65
doc/source/devref/index.rst
Normal file
@ -0,0 +1,65 @@
|
||||
..
|
||||
Copyright 2010-2011 United States Government as represented by the
|
||||
Administrator of the National Aeronautics and Space Administration.
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
Developer Guide
|
||||
===============
|
||||
|
||||
In the Developer Guide, you will find information on Neutron's lower level
|
||||
programming APIs. There are sections that cover the core pieces of Neutron,
|
||||
including its database, message queue, and scheduler components. There are
|
||||
also subsections that describe specific plugins inside Neutron.
|
||||
|
||||
|
||||
Programming HowTos and Tutorials
|
||||
--------------------------------
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
development.environment
|
||||
|
||||
|
||||
Neutron Internals
|
||||
-----------------
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
api_layer
|
||||
api_extensions
|
||||
plugin-api
|
||||
db_layer
|
||||
rpc_api
|
||||
layer3
|
||||
l2_agents
|
||||
advanced_services
|
||||
|
||||
|
||||
Module Reference
|
||||
----------------
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
.. todo::
|
||||
|
||||
Add in all the big modules as automodule indexes.
|
||||
|
||||
|
||||
Indices and tables
|
||||
------------------
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
7
doc/source/devref/l2_agents.rst
Normal file
7
doc/source/devref/l2_agents.rst
Normal file
@ -0,0 +1,7 @@
|
||||
L2 Agent Networking
|
||||
-------------------
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
openvswitch_agent
|
||||
linuxbridge_agent
|
199
doc/source/devref/layer3.rst
Normal file
199
doc/source/devref/layer3.rst
Normal file
@ -0,0 +1,199 @@
|
||||
Layer 3 Networking in Neutron - via Layer 3 agent & OpenVSwitch
|
||||
===============================================================
|
||||
|
||||
This page discusses the usage of Neutron with Layer 3 functionality enabled.
|
||||
|
||||
Neutron logical network setup
|
||||
-----------------------------
|
||||
::
|
||||
|
||||
vagrant@precise64:~/devstack$ neutron net-list
|
||||
+--------------------------------------+---------+--------------------------------------------------+
|
||||
| id | name | subnets |
|
||||
+--------------------------------------+---------+--------------------------------------------------+
|
||||
| 84b6b0cc-503d-448a-962f-43def05e85be | public | 3a56da7c-2f6e-41af-890a-b324d7bc374d |
|
||||
| a4b4518c-800d-4357-9193-57dbb42ac5ee | private | 1a2d26fb-b733-4ab3-992e-88554a87afa6 10.0.0.0/24 |
|
||||
+--------------------------------------+---------+--------------------------------------------------+
|
||||
vagrant@precise64:~/devstack$ neutron subnet-list
|
||||
+--------------------------------------+------+-------------+--------------------------------------------+
|
||||
| id | name | cidr | allocation_pools |
|
||||
+--------------------------------------+------+-------------+--------------------------------------------+
|
||||
| 1a2d26fb-b733-4ab3-992e-88554a87afa6 | | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"} |
|
||||
+--------------------------------------+------+-------------+--------------------------------------------+
|
||||
vagrant@precise64:~/devstack$ neutron port-list
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
| id | name | mac_address | fixed_ips |
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
| 0ba8700e-da06-4318-8fe9-00676dd994b8 | | fa:16:3e:78:43:5b | {"subnet_id": "1a2d26fb-b733-4ab3-992e-88554a87afa6", "ip_address": "10.0.0.1"} |
|
||||
| b2044570-ad52-4f31-a2c3-5d767dc9a8a7 | | fa:16:3e:5b:cf:4c | {"subnet_id": "1a2d26fb-b733-4ab3-992e-88554a87afa6", "ip_address": "10.0.0.3"} |
|
||||
| bb60d1bb-0cab-41cb-9678-30d2b2fdb169 | | fa:16:3e:af:a9:bd | {"subnet_id": "1a2d26fb-b733-4ab3-992e-88554a87afa6", "ip_address": "10.0.0.2"} |
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
|
||||
vagrant@precise64:~/devstack$ neutron subnet-show 1a2d26fb-b733-4ab3-992e-88554a87afa6
|
||||
+------------------+--------------------------------------------+
|
||||
| Field | Value |
|
||||
+------------------+--------------------------------------------+
|
||||
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
|
||||
| cidr | 10.0.0.0/24 |
|
||||
| dns_nameservers | |
|
||||
| enable_dhcp | True |
|
||||
| gateway_ip | 10.0.0.1 |
|
||||
| host_routes | |
|
||||
| id | 1a2d26fb-b733-4ab3-992e-88554a87afa6 |
|
||||
| ip_version | 4 |
|
||||
| name | |
|
||||
| network_id | a4b4518c-800d-4357-9193-57dbb42ac5ee |
|
||||
| tenant_id | 3368290ab10f417390acbb754160dbb2 |
|
||||
+------------------+--------------------------------------------+
|
||||
|
||||
|
||||
Neutron logical router setup
|
||||
----------------------------
|
||||
|
||||
* http://docs.openstack.org/admin-guide-cloud/content/ch_networking.html#under_the_hood_openvswitch_scenario1_network
|
||||
|
||||
|
||||
::
|
||||
|
||||
vagrant@precise64:~/devstack$ neutron router-list
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
| id | name | external_gateway_info |
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
| 569469c7-a2a5-4d32-9cdd-f0b18a13f45e | router1 | {"network_id": "84b6b0cc-503d-448a-962f-43def05e85be"} |
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
vagrant@precise64:~/devstack$ neutron router-show router1
|
||||
+-----------------------+--------------------------------------------------------+
|
||||
| Field | Value |
|
||||
+-----------------------+--------------------------------------------------------+
|
||||
| admin_state_up | True |
|
||||
| external_gateway_info | {"network_id": "84b6b0cc-503d-448a-962f-43def05e85be"} |
|
||||
| id | 569469c7-a2a5-4d32-9cdd-f0b18a13f45e |
|
||||
| name | router1 |
|
||||
| routes | |
|
||||
| status | ACTIVE |
|
||||
| tenant_id | 3368290ab10f417390acbb754160dbb2 |
|
||||
+-----------------------+--------------------------------------------------------+
|
||||
vagrant@precise64:~/devstack$ neutron router-port-list router1
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
| id | name | mac_address | fixed_ips |
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
| 0ba8700e-da06-4318-8fe9-00676dd994b8 | | fa:16:3e:78:43:5b | {"subnet_id": "1a2d26fb-b733-4ab3-992e-88554a87afa6", "ip_address": "10.0.0.1"} |
|
||||
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
|
||||
|
||||
Neutron Routers are realized in OpenVSwitch
|
||||
-------------------------------------------
|
||||
|
||||
.. image:: http://docs.openstack.org/admin-guide-cloud/content/figures/10/a/common/figures/under-the-hood-scenario-1-ovs-network.png
|
||||
|
||||
|
||||
"router1" in the Neutron logical network is realized through a port ("qr-0ba8700e-da") in OpenVSwitch - attached to "br-int"::
|
||||
|
||||
vagrant@precise64:~/devstack$ sudo ovs-vsctl show
|
||||
b9b27fc3-5057-47e7-ba64-0b6afe70a398
|
||||
Bridge br-int
|
||||
Port "qr-0ba8700e-da"
|
||||
tag: 1
|
||||
Interface "qr-0ba8700e-da"
|
||||
type: internal
|
||||
Port br-int
|
||||
Interface br-int
|
||||
type: internal
|
||||
Port int-br-ex
|
||||
Interface int-br-ex
|
||||
Port "tapbb60d1bb-0c"
|
||||
tag: 1
|
||||
Interface "tapbb60d1bb-0c"
|
||||
type: internal
|
||||
Port "qvob2044570-ad"
|
||||
tag: 1
|
||||
Interface "qvob2044570-ad"
|
||||
Port "int-br-eth1"
|
||||
Interface "int-br-eth1"
|
||||
Bridge "br-eth1"
|
||||
Port "phy-br-eth1"
|
||||
Interface "phy-br-eth1"
|
||||
Port "br-eth1"
|
||||
Interface "br-eth1"
|
||||
type: internal
|
||||
Bridge br-ex
|
||||
Port phy-br-ex
|
||||
Interface phy-br-ex
|
||||
Port "qg-0143bce1-08"
|
||||
Interface "qg-0143bce1-08"
|
||||
type: internal
|
||||
Port br-ex
|
||||
Interface br-ex
|
||||
type: internal
|
||||
ovs_version: "1.4.0+build0"
|
||||
|
||||
|
||||
vagrant@precise64:~/devstack$ brctl show
|
||||
bridge name bridge id STP enabled interfaces
|
||||
br-eth1 0000.e2e7fc5ccb4d no
|
||||
br-ex 0000.82ee46beaf4d no phy-br-ex
|
||||
qg-39efb3f9-f0
|
||||
qg-77e0666b-cd
|
||||
br-int 0000.5e46cb509849 no int-br-ex
|
||||
qr-54c9cd83-43
|
||||
qvo199abeb2-63
|
||||
qvo1abbbb60-b8
|
||||
tap74b45335-cc
|
||||
qbr199abeb2-63 8000.ba06e5f8675c no qvb199abeb2-63
|
||||
tap199abeb2-63
|
||||
qbr1abbbb60-b8 8000.46a87ed4fb66 no qvb1abbbb60-b8
|
||||
tap1abbbb60-b8
|
||||
virbr0 8000.000000000000 yes
|
||||
|
||||
Finding the router in ip/ipconfig
|
||||
---------------------------------
|
||||
|
||||
* http://docs.openstack.org/admin-guide-cloud/content/ch_networking.html
|
||||
|
||||
The neutron-l3-agent uses the Linux IP stack and iptables to perform L3 forwarding and NAT.
|
||||
In order to support multiple routers with potentially overlapping IP addresses, neutron-l3-agent
|
||||
defaults to using Linux network namespaces to provide isolated forwarding contexts. As a result,
|
||||
the IP addresses of routers will not be visible simply by running "ip addr list" or "ifconfig" on
|
||||
the node. Similarly, you will not be able to directly ping fixed IPs.
|
||||
|
||||
To do either of these things, you must run the command within a particular router's network
|
||||
namespace. The namespace will have the name "qrouter-<UUID of the router>.
|
||||
|
||||
.. image:: http://docs.openstack.org/admin-guide-cloud/content/figures/10/a/common/figures/under-the-hood-scenario-1-ovs-netns.png
|
||||
|
||||
For example::
|
||||
|
||||
vagrant@precise64:~$ neutron router-list
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
| id | name | external_gateway_info |
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
| ad948c6e-afb6-422a-9a7b-0fc44cbb3910 | router1 | {"network_id": "e6634fef-03fa-482a-9fa7-e0304ce5c995"} |
|
||||
+--------------------------------------+---------+--------------------------------------------------------+
|
||||
vagrant@precise64:~/devstack$ sudo ip netns exec qrouter-ad948c6e-afb6-422a-9a7b-0fc44cbb3910 ip addr list
|
||||
18: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
|
||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||
inet 127.0.0.1/8 scope host lo
|
||||
inet6 ::1/128 scope host
|
||||
valid_lft forever preferred_lft forever
|
||||
19: qr-54c9cd83-43: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
|
||||
link/ether fa:16:3e:dd:c1:8f brd ff:ff:ff:ff:ff:ff
|
||||
inet 10.0.0.1/24 brd 10.0.0.255 scope global qr-54c9cd83-43
|
||||
inet6 fe80::f816:3eff:fedd:c18f/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
20: qg-77e0666b-cd: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
|
||||
link/ether fa:16:3e:1f:d3:ec brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.27.130/28 brd 192.168.27.143 scope global qg-77e0666b-cd
|
||||
inet6 fe80::f816:3eff:fe1f:d3ec/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
|
||||
Provider Networking
|
||||
-------------------
|
||||
|
||||
Neutron can also be configured to create `provider networks <http://docs.openstack.org/admin-guide-cloud/content/ch_networking.html#provider_terminology>`_
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
* `Packet Pushers - Neutron Network Implementation on Linux <http://packetpushers.net/openstack-neutron-network-implementation-in-linux/>`_
|
||||
* `OpenStack Cloud Administrator Guide <http://docs.openstack.org/admin-guide-cloud/content/ch_networking.html>`_
|
||||
* `Neutron - Layer 3 API extension usage guide <http://docs.openstack.org/api/openstack-network/2.0/content/router_ext.html>`_
|
||||
* `Darragh O'Reilly - The Quantum L3 router and floating IPs <http://techbackground.blogspot.com/2013/05/the-quantum-l3-router-and-floating-ips.html>`_
|
32
doc/source/devref/lbaas.rst
Normal file
32
doc/source/devref/lbaas.rst
Normal file
@ -0,0 +1,32 @@
|
||||
Loadbalancer as a Service
|
||||
=========================
|
||||
|
||||
|
||||
https://wiki.openstack.org/wiki/Neutron/LBaaS/Architecture
|
||||
|
||||
https://wiki.openstack.org/wiki/Neutron/LBaaS/API_1.0
|
||||
|
||||
|
||||
Plugin
|
||||
------
|
||||
.. automodule:: neutron.services.loadbalancer.plugin
|
||||
|
||||
.. autoclass:: LoadBalancerPlugin
|
||||
:members:
|
||||
|
||||
Database layer
|
||||
--------------
|
||||
|
||||
.. automodule:: neutron.db.loadbalancer.loadbalancer_db
|
||||
|
||||
.. autoclass:: LoadBalancerPluginDb
|
||||
:members:
|
||||
|
||||
|
||||
Driver layer
|
||||
------------
|
||||
|
||||
.. automodule:: neutron.services.loadbalancer.drivers.abstract_driver
|
||||
|
||||
.. autoclass:: LoadBalancerAbstractDriver
|
||||
:members:
|
2
doc/source/devref/linuxbridge_agent.rst
Normal file
2
doc/source/devref/linuxbridge_agent.rst
Normal file
@ -0,0 +1,2 @@
|
||||
L2 Networking with Linux Bridge
|
||||
-------------------------------
|
21
doc/source/devref/openvswitch_agent.rst
Normal file
21
doc/source/devref/openvswitch_agent.rst
Normal file
@ -0,0 +1,21 @@
|
||||
====================
|
||||
OpenVSwitch L2 Agent
|
||||
====================
|
||||
|
||||
This Agent uses the `OpenVSwitch`_ virtual switch to create L2
|
||||
connectivity for instances, along with bridges created in conjunction
|
||||
with OpenStack Nova for filtering.
|
||||
|
||||
ovs-neutron-agent can be configured to use two different networking technologies to create tenant isolation, either GRE tunnels or VLAN tags.
|
||||
|
||||
VLAN Tags
|
||||
---------
|
||||
|
||||
.. image:: http://docs.openstack.org/admin-guide-cloud/content/figures/10/a/common/figures/under-the-hood-scenario-1-ovs-compute.png
|
||||
|
||||
.. _OpenVSwitch: http://openvswitch.org
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
|
||||
* `Darragh O'Reilly - The Open vSwitch plugin with VLANs <http://techbackground.blogspot.com/2013/07/the-open-vswitch-plugin-with-vlans.html>`_
|
12
doc/source/devref/plugin-api.rst
Normal file
12
doc/source/devref/plugin-api.rst
Normal file
@ -0,0 +1,12 @@
|
||||
Neutron Plugin Architecture
|
||||
===========================
|
||||
|
||||
`Salvatore Orlando: How to write a Neutron Plugin (if you really need to) <http://www.slideshare.net/salv_orlando/how-to-write-a-neutron-plugin-if-you-really-need-to>`_
|
||||
|
||||
Plugin API
|
||||
----------
|
||||
|
||||
.. automodule:: neutron.neutron_plugin_base_v2
|
||||
|
||||
.. autoclass:: NeutronPluginBaseV2
|
||||
:members:
|
2
doc/source/devref/rpc_api.rst
Normal file
2
doc/source/devref/rpc_api.rst
Normal file
@ -0,0 +1,2 @@
|
||||
Neutron RCP API Layer
|
||||
=====================
|
50
doc/source/devref/security_group_api.rst
Normal file
50
doc/source/devref/security_group_api.rst
Normal file
@ -0,0 +1,50 @@
|
||||
Guided Tour: The Neutron Security Group API
|
||||
===========================================
|
||||
|
||||
https://wiki.openstack.org/wiki/Neutron/SecurityGroups
|
||||
|
||||
|
||||
API Extension
|
||||
-------------
|
||||
|
||||
The API extension is the 'front' end portion of the code, which handles defining a `REST-ful API`_, which is used by tenants.
|
||||
|
||||
|
||||
.. _`REST-ful API`: https://github.com/openstack/neutron/blob/master/neutron/extensions/securitygroup.py
|
||||
|
||||
|
||||
Database API
|
||||
------------
|
||||
|
||||
The Security Group API extension adds a number of `methods to the database layer`_ of Neutron
|
||||
|
||||
.. _`methods to the database layer`: https://github.com/openstack/neutron/blob/master/neutron/db/securitygroups_db.py
|
||||
|
||||
Agent RPC
|
||||
---------
|
||||
|
||||
This portion of the code handles processing requests from tenants, after they have been stored in the database. It involves messaging all the L2 agents
|
||||
running on the compute nodes, and modifying the IPTables rules on each hypervisor.
|
||||
|
||||
|
||||
* `Plugin RPC classes <https://github.com/openstack/neutron/blob/master/neutron/db/securitygroups_rpc_base.py>`_
|
||||
|
||||
* `SecurityGroupServerRpcCallbackMixin <https://github.com/openstack/neutron/blob/master/neutron/db/securitygroups_rpc_base.py#L126>`_ - defines the RPC API that the plugin uses to communicate with the agents running on the compute nodes
|
||||
* SecurityGroupServerRpcMixin - Defines the API methods used to fetch data from the database, in order to return responses to agents via the RPC API
|
||||
|
||||
* `Agent RPC classes <https://github.com/openstack/neutron/blob/master/neutron/agent/securitygroups_rpc.py>`_
|
||||
|
||||
* The SecurityGroupServerRpcApiMixin defines the API methods that can be called by agents, back to the plugin that runs on the Neutron controller
|
||||
* The SecurityGroupAgentRpcCallbackMixin defines methods that a plugin uses to call back to an agent after performing an action called by an agent.
|
||||
|
||||
|
||||
IPTables Driver
|
||||
---------------
|
||||
|
||||
* ``prepare_port_filter`` takes a ``port`` argument, which is a ``dictionary`` object that contains information about the port - including the ``security_group_rules``
|
||||
|
||||
* ``prepare_port_filter`` `appends the port to an internal dictionary <https://github.com/openstack/neutron/blob/master/neutron/agent/linux/iptables_firewall.py#L60>`_, ``filtered_ports`` which is used to track the internal state.
|
||||
|
||||
* Each security group has a `chain <http://www.thegeekstuff.com/2011/01/iptables-fundamentals/>`_ in Iptables.
|
||||
|
||||
* The ``IptablesFirewallDriver`` has a method to `convert security group rules into iptables statements <https://github.com/openstack/neutron/blob/master/neutron/agent/linux/iptables_firewall.py#L248>`_
|
21
doc/source/devref/vpnaas.rst
Normal file
21
doc/source/devref/vpnaas.rst
Normal file
@ -0,0 +1,21 @@
|
||||
VPN as a Service
|
||||
=====================
|
||||
|
||||
`API Specification`_
|
||||
|
||||
.. _API Specification: http://docs.openstack.org/api/openstack-network/2.0/content/vpnaas_ext.html
|
||||
|
||||
Plugin
|
||||
------
|
||||
.. automodule:: neutron.services.vpn.plugin
|
||||
|
||||
.. autoclass:: VPNPlugin
|
||||
:members:
|
||||
|
||||
Database layer
|
||||
--------------
|
||||
|
||||
.. automodule:: neutron.db.vpn.vpn_db
|
||||
|
||||
.. autoclass:: VPNPluginDb
|
||||
:members:
|
14
doc/source/docbkx/docbkx-example/README
Normal file
14
doc/source/docbkx/docbkx-example/README
Normal file
@ -0,0 +1,14 @@
|
||||
README
|
||||
|
||||
This docbkx-example folder is provided for those who want to use the maven mojo supplied with the project to build their own documents to PDF and HTML (webhelp) format. It's intended to be a template and model.
|
||||
|
||||
You can edit the src/docbkx/example.xml file using vi, emacs, or another DocBook editor. At Rackspace we use Oxygen. Both Oxygen and XML Mind offer free licenses to those working on open source project documentation.
|
||||
|
||||
To build the output, install Apache Maven (https://maven.apache.org/) and then run:
|
||||
|
||||
mvn clean generate-sources
|
||||
|
||||
in the directory containing the pom.xml file.
|
||||
|
||||
Feel free to ask questions of the openstack-docs team at https://launchpad.net/~openstack-doc.
|
||||
|
38
doc/source/docbkx/docbkx-example/pom.xml
Normal file
38
doc/source/docbkx/docbkx-example/pom.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>my-groupid</groupId>
|
||||
<artifactId>my-guide</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>OpenStack stand alone documentation examples</name>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.agilejava.docbkx</groupId>
|
||||
<artifactId>docbkx-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate-pdf</goal>
|
||||
<goal>generate-webhelp</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<xincludeSupported>true</xincludeSupported>
|
||||
<chunkSectionDepth>100</chunkSectionDepth>
|
||||
<postProcess>
|
||||
<copy todir="target/docbkx/webhelp/example/content/figures">
|
||||
<fileset dir="src/docbkx/figures">
|
||||
<include name="**/*.png" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
318
doc/source/docbkx/docbkx-example/src/docbkx/example.xml
Normal file
318
doc/source/docbkx/docbkx-example/src/docbkx/example.xml
Normal file
@ -0,0 +1,318 @@
|
||||
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml" version="5.0" status="DRAFT">
|
||||
<title>Maven Example Documentation</title>
|
||||
<info>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname/>
|
||||
<surname/>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<orgname>Badges! We don't need any stinking badges!</orgname>
|
||||
</affiliation>
|
||||
</author>
|
||||
<copyright>
|
||||
<year>2011</year>
|
||||
<holder>Timothy D. Witham</holder>
|
||||
</copyright>
|
||||
<releaseinfo>Example v0.1</releaseinfo>
|
||||
<productname>Product Name Doesn't Exist - it's an example!™</productname>
|
||||
<pubdate>2011-01-01</pubdate>
|
||||
<legalnotice role="rs-api">
|
||||
<annotation>
|
||||
<remark>Copyright details are filled in by the template. Change the value of the role
|
||||
attribute on the legalnotice element to change the license. </remark>
|
||||
</annotation>
|
||||
</legalnotice>
|
||||
<abstract>
|
||||
<para> This document is intended for individuals who whish to produce documentation using Maven and having
|
||||
the same "feel" as the documentation that is produced by the mainline OpenStack projects.
|
||||
</para>
|
||||
</abstract>
|
||||
<cover>
|
||||
<para>this is a placeholder for the front cover</para>
|
||||
</cover>
|
||||
<cover>
|
||||
<para>this is a placeholder for the back cover</para>
|
||||
</cover>
|
||||
</info>
|
||||
<chapter>
|
||||
<title>Overview</title>
|
||||
<para>Welcome to the getting started with Maven documentation. Congratulations you have
|
||||
successfully downloaded and built the example.
|
||||
</para>
|
||||
<para>For more details on the Product Name service, please refer to <link
|
||||
xlink:href="http://www.rackspacecloud.com/cloud_hosting_products/files"
|
||||
>http://www.rackspacecloud.com/cloud_hosting_products/product name</link>
|
||||
</para>
|
||||
<para>We welcome feedback, comments, and bug reports at <link
|
||||
xlink:href="mailto:support@rackspacecloud.com">support@rackspacecloud.com</link>. </para>
|
||||
<section>
|
||||
<title>Intended Audience</title>
|
||||
<para>This guide is intended to individuals who want to develop standalone documentation
|
||||
to use within an OpenStack deployment. Using this tool chain will give you the look and
|
||||
feel of the mainline OpenStack documentation.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Document Change History</title>
|
||||
<para>This version of the Maven Getting Started Guide replaces and obsoletes all previous versions. The
|
||||
most recent changes are described in the table below:</para>
|
||||
<informaltable rules="all">
|
||||
<thead>
|
||||
<tr>
|
||||
<td align="center" colspan="1">Revision Date</td>
|
||||
<td align="center" colspan="4">Summary of Changes</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="1" align="center">July. 14, 2011</td>
|
||||
<td colspan="4">
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>Initial document creation.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</informaltable>
|
||||
</section>
|
||||
<section>
|
||||
<title>Additional Resources</title>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="http://www.openstack.org">
|
||||
Openstack - Cloud Software
|
||||
</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="http://www.docbook.org">
|
||||
Docbook Main Web Site
|
||||
</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="http://docbook.org/tdg/en/html/quickref.html">
|
||||
Docbook Quick Reference
|
||||
</link>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>Concepts</title>
|
||||
<para>
|
||||
Need to put something here.
|
||||
</para>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>How do I?</title>
|
||||
|
||||
<section>
|
||||
<title>Notes and including images</title>
|
||||
<para>So I want an note and an image in this section ...</para>
|
||||
<note>
|
||||
<para>This is an example of a note. </para>
|
||||
</note>
|
||||
|
||||
<para>Here's a sample figure in svg and png formats:</para>
|
||||
<figure xml:id="CFinterfaces">
|
||||
<title>Sample Image</title>
|
||||
<mediaobject>
|
||||
<imageobject role="fo">
|
||||
<imagedata fileref="figures/example.svg" contentwidth="5in"/>
|
||||
</imageobject>
|
||||
<imageobject role="html">
|
||||
<imagedata fileref="figures/example.png"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</section>
|
||||
<section>
|
||||
<title>Multiple Related Documents</title>
|
||||
<para>
|
||||
What you need to do in order to have multiple documents fit within the
|
||||
build structure.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Using multiple files for a document</title>
|
||||
<para>
|
||||
What you need to do in order to have a single document that is made up of multiple
|
||||
files.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Who, What, Where, When and Why of pom.xml</title>
|
||||
<para>
|
||||
You will of noticed the <emphasis>pom.xml</emphasis> file at the root directory.
|
||||
This file is used to set the project parameters for the documentation. Including
|
||||
what type of documentation to produce and any post processing that needs to happen.
|
||||
If you want to know more about
|
||||
<link
|
||||
xlink:href="http://www.openstack.org">
|
||||
pom.xml - need a link
|
||||
</link>
|
||||
then follow the link.
|
||||
</para>
|
||||
<para> For the <emphasis>pom.xml</emphasis>file that was included in this distribution we will
|
||||
parse the individual lines and explaine the meaning.
|
||||
</para>
|
||||
<para>
|
||||
<programlisting language="xml"> <xi:include href="../../pom.xml" parse="text" /></programlisting>
|
||||
</para>
|
||||
<section>
|
||||
<title> <project> </title>
|
||||
<para>
|
||||
What is all of this stuff and why is it important?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <modelVersion> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <groupId> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <artifactId> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <version> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <packaging> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <name> </title>
|
||||
<para>
|
||||
Name of your document.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <build> </title>
|
||||
<para>
|
||||
Make some documents.
|
||||
</para>
|
||||
<section>
|
||||
<title> <plugin(s)> </title>
|
||||
<para>
|
||||
What does this do and why?
|
||||
</para>
|
||||
<section>
|
||||
<title> <groupId> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <artifactId> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <execution(s)> </title>
|
||||
<para>
|
||||
What goes in here and why?
|
||||
</para>
|
||||
<section>
|
||||
<title> <goal(s)> </title>
|
||||
<para>
|
||||
Different types of goals and why you use them.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <phase> </title>
|
||||
<para>
|
||||
What does this section do? What phases can you specify.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title> <configuration> </title>
|
||||
<para>
|
||||
What does this section do?
|
||||
</para>
|
||||
<section>
|
||||
<title> <xincludeSupported> </title>
|
||||
<para>
|
||||
What does this do and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <chunkSectionDepth> </title>
|
||||
<para>
|
||||
What does this do and why?
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title> <postprocess> </title>
|
||||
<para>
|
||||
What does this section do? What are possible pieces?
|
||||
</para>
|
||||
<section>
|
||||
<title> <copy> </title>
|
||||
<para>
|
||||
What does this section do? What are possible pieces?
|
||||
</para>
|
||||
<section>
|
||||
<title> <fileset> </title>
|
||||
<para>
|
||||
What does this section do? What are possible pieces?
|
||||
</para>
|
||||
<section>
|
||||
<title> <include> </title>
|
||||
<para>
|
||||
What does this section do? What are possible pieces?
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Who, What, Where, When and Why of build.xml</title>
|
||||
<para>
|
||||
You will of noticed the <emphasis>build.xml</emphasis> file at the root directory.
|
||||
This file is used to set the project parameters for the documentation. Including
|
||||
what type of documentation to produce and any post processing that needs to happen.
|
||||
If you want to know more about
|
||||
<link
|
||||
xlink:href="http://www.openstack.org">
|
||||
pom.xml - need a link
|
||||
</link>
|
||||
then follow the link.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>Troubleshooting</title>
|
||||
<para>Sometimes things go wrong...</para>
|
||||
</chapter>
|
||||
</book>
|
@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram>
|
||||
<source><![CDATA[bfs:BFS[a]
|
||||
/queue:FIFO
|
||||
someNode:Node
|
||||
node:Node
|
||||
adjList:List
|
||||
adj:Node
|
||||
|
||||
bfs:queue.new
|
||||
bfs:someNode.setLevel(0)
|
||||
bfs:queue.insert(someNode)
|
||||
[c:loop while queue != ()]
|
||||
bfs:node=queue.remove()
|
||||
bfs:level=node.getLevel()
|
||||
bfs:adjList=node.getAdjacentNodes()
|
||||
[c:loop 0 <= i < #adjList]
|
||||
bfs:adj=adjList.get(i)
|
||||
bfs:nodeLevel=adj.getLevel()
|
||||
[c:alt nodeLevel IS NOT defined]
|
||||
bfs:adj.setLevel(level+1)
|
||||
bfs:queue.insert(adj)
|
||||
--[else]
|
||||
bfs:nothing to do
|
||||
[/c]
|
||||
[/c]
|
||||
[/c]
|
||||
bfs:queue.destroy()]]></source>
|
||||
<configuration>
|
||||
<property name="actorWidth" value="25"/>
|
||||
<property name="allowMessageProperties" value="false"/>
|
||||
<property name="arrowSize" value="6"/>
|
||||
<property name="colorizeThreads" value="true"/>
|
||||
<property name="destructorWidth" value="30"/>
|
||||
<property family="Dialog" name="font" size="12" style="0"/>
|
||||
<property name="fragmentMargin" value="8"/>
|
||||
<property name="fragmentPadding" value="10"/>
|
||||
<property name="fragmentTextPadding" value="3"/>
|
||||
<property name="glue" value="10"/>
|
||||
<property name="headHeight" value="35"/>
|
||||
<property name="headLabelPadding" value="5"/>
|
||||
<property name="headWidth" value="100"/>
|
||||
<property name="initialSpace" value="10"/>
|
||||
<property name="leftMargin" value="5"/>
|
||||
<property name="lineWrap" value="false"/>
|
||||
<property name="lowerMargin" value="5"/>
|
||||
<property name="mainLifelineWidth" value="8"/>
|
||||
<property name="messageLabelSpace" value="3"/>
|
||||
<property name="messagePadding" value="6"/>
|
||||
<property name="noteMargin" value="6"/>
|
||||
<property name="notePadding" value="6"/>
|
||||
<property name="opaqueMessageText" value="false"/>
|
||||
<property name="returnArrowVisible" value="true"/>
|
||||
<property name="rightMargin" value="5"/>
|
||||
<property name="selfMessageHorizontalSpace" value="15"/>
|
||||
<property name="separatorBottomMargin" value="8"/>
|
||||
<property name="separatorTopMargin" value="15"/>
|
||||
<property name="shouldShadowParticipants" value="true"/>
|
||||
<property name="spaceBeforeActivation" value="2"/>
|
||||
<property name="spaceBeforeAnswerToSelf" value="10"/>
|
||||
<property name="spaceBeforeConstruction" value="6"/>
|
||||
<property name="spaceBeforeSelfMessage" value="7"/>
|
||||
<property name="subLifelineWidth" value="6"/>
|
||||
<property name="tc0" value="-1118482"/>
|
||||
<property name="tc1" value="-256"/>
|
||||
<property name="tc2" value="-65536"/>
|
||||
<property name="tc3" value="-16776961"/>
|
||||
<property name="tc4" value="-16711936"/>
|
||||
<property name="tc5" value="-4144960"/>
|
||||
<property name="tc6" value="-65281"/>
|
||||
<property name="tc7" value="-14336"/>
|
||||
<property name="tc8" value="-20561"/>
|
||||
<property name="tc9" value="-12566464"/>
|
||||
<property name="threadNumbersVisible" value="false"/>
|
||||
<property name="threaded" value="true"/>
|
||||
<property name="upperMargin" value="5"/>
|
||||
<property name="verticallySplit" value="true"/>
|
||||
</configuration>
|
||||
</diagram>
|
523
doc/source/docbkx/docbkx-example/src/docbkx/figures/example.svg
Normal file
523
doc/source/docbkx/docbkx-example/src/docbkx/figures/example.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 207 KiB |
112
doc/source/docbkx/quantum-api-1.0/common.ent
Normal file
112
doc/source/docbkx/quantum-api-1.0/common.ent
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
<!--
|
||||
A collection of common faults, these are pretty much expected
|
||||
in every request.
|
||||
-->
|
||||
<!ENTITY commonFaults
|
||||
'
|
||||
<response xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:computeFault"/>
|
||||
<representation mediaType="application/json"/>
|
||||
</response>
|
||||
<response status="503" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:serviceUnavailable"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="401" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:unauthorized"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="403" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:forbidden"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="400" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:badRequest"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="405" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:badMethod"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="413" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:overLimit"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults on GET
|
||||
-->
|
||||
<!ENTITY getFaults
|
||||
'
|
||||
<response status="404" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:itemNotFound"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults on POST/PUT
|
||||
-->
|
||||
<!ENTITY postPutFaults
|
||||
'
|
||||
<response status="415" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:badMediaType"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults that can occur when we are building servers or images.
|
||||
-->
|
||||
<!ENTITY buildFaults
|
||||
'
|
||||
<response status="503" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:serverCapacityUnavailable"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Holds build in progress which occurs when an operation fails
|
||||
because the server is in the process of being built.
|
||||
-->
|
||||
<!ENTITY inProgressFault
|
||||
'
|
||||
<response status="409" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="osapi:buildInProgress"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
|
||||
<!-- Image List Parameters -->
|
||||
|
||||
<!ENTITY imageListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="server" style="query" required="false" type="xsd:anyURI"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="name" style="query" required="false" type="xsd:string"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="status" style="query" required="false" type="osapi:ImageStatus"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="type" style="query" required="false" type="xsd:string" default="ALL">
|
||||
<option value="BASE"/>
|
||||
<option value="SERVER"/>
|
||||
<option value="ALL"/>
|
||||
</param>
|
||||
'>
|
||||
|
||||
<!-- Server List Parameters -->
|
||||
|
||||
<!ENTITY serverListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="image" style="query" required="false" type="xsd:anyURI"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="flavor" style="query" required="false" type="xsd:anyURI"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="name" style="query" required="false" type="xsd:string"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="status" style="query" required="false" type="osapi:ServerStatus"/>
|
||||
'>
|
||||
|
||||
<!-- Flavor List Parameters -->
|
||||
|
||||
<!ENTITY flavorListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="minDisk" style="query" required="false" type="xsd:int"/>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="minRam" style="query" required="false" type="xsd:int"/>
|
||||
'>
|
70
doc/source/docbkx/quantum-api-1.0/figures/Arrow_east.svg
Normal file
70
doc/source/docbkx/quantum-api-1.0/figures/Arrow_east.svg
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg:svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="13.895596"
|
||||
height="6.3500013"
|
||||
viewBox="0 0 13.895595 6.3500013"
|
||||
id="svg2868"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.48.0 r9654"
|
||||
sodipodi:docname="Arrow_east.svg"><svg:metadata
|
||||
id="metadata3857"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></svg:metadata><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1131"
|
||||
inkscape:window-height="740"
|
||||
id="namedview3855"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.313708"
|
||||
inkscape:cx="8.6182271"
|
||||
inkscape:cy="-2.2709277"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2868"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" /><svg:defs
|
||||
id="defs2874" />
|
||||
|
||||
|
||||
<namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
pageopacity="0.0"
|
||||
pageshadow="2"
|
||||
window-width="640"
|
||||
window-height="541"
|
||||
zoom="0.34493828"
|
||||
cx="372.04722"
|
||||
cy="256.66814"
|
||||
window-x="75"
|
||||
window-y="152"
|
||||
current-layer="svg2033">
|
||||
</namedview>
|
||||
<svg:g
|
||||
transform="matrix(-0.01540104,0,0,-0.01741068,13.895596,6.3500014)"
|
||||
id="Ebene_1">
|
||||
<svg:polygon
|
||||
points="902.25049,222.98633 233.17773,222.98633 233.17773,364.71875 0,182.35938 233.17773,0 233.17773,141.73242 902.25049,141.73242 902.25049,222.98633 "
|
||||
id="path2050" />
|
||||
</svg:g>
|
||||
</svg:svg>
|
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="19.21315"
|
||||
height="18.294994"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.45"
|
||||
sodipodi:modified="true"
|
||||
version="1.0">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.9195959"
|
||||
inkscape:cx="17.757032"
|
||||
inkscape:cy="7.298821"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:window-width="984"
|
||||
inkscape:window-height="852"
|
||||
inkscape:window-x="148"
|
||||
inkscape:window-y="66" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-192.905,-516.02064)">
|
||||
<path
|
||||
style="fill:#000000"
|
||||
d="M 197.67968,534.31563 C 197.40468,534.31208 196.21788,532.53719 195.04234,530.37143 L 192.905,526.43368 L 193.45901,525.87968 C 193.76371,525.57497 194.58269,525.32567 195.27896,525.32567 L 196.5449,525.32567 L 197.18129,527.33076 L 197.81768,529.33584 L 202.88215,523.79451 C 205.66761,520.74678 208.88522,517.75085 210.03239,517.13691 L 212.11815,516.02064 L 207.90871,520.80282 C 205.59351,523.43302 202.45735,527.55085 200.93947,529.95355 C 199.42159,532.35625 197.95468,534.31919 197.67968,534.31563 z "
|
||||
id="path2223" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
337
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_java.js
Normal file
337
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_java.js
Normal file
@ -0,0 +1,337 @@
|
||||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['java'] = [
|
||||
[
|
||||
[
|
||||
/\b(?:import|package)\b/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\/\/\//g,
|
||||
'sh_comment',
|
||||
1
|
||||
],
|
||||
[
|
||||
/\/\//g,
|
||||
'sh_comment',
|
||||
7
|
||||
],
|
||||
[
|
||||
/\/\*\*/g,
|
||||
'sh_comment',
|
||||
8
|
||||
],
|
||||
[
|
||||
/\/\*/g,
|
||||
'sh_comment',
|
||||
9
|
||||
],
|
||||
[
|
||||
/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
|
||||
'sh_number',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
10
|
||||
],
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
11
|
||||
],
|
||||
[
|
||||
/(\b(?:class|interface))([ \t]+)([$A-Za-z0-9_]+)/g,
|
||||
['sh_keyword', 'sh_normal', 'sh_classname'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:abstract|assert|break|case|catch|class|const|continue|default|do|else|extends|false|final|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|static|strictfp|super|switch|synchronized|throw|throws|true|this|transient|try|volatile|while)\b/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
|
||||
'sh_symbol',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\{|\}/g,
|
||||
'sh_cbracket',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
|
||||
'sh_function',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,
|
||||
['sh_usertype', 'sh_usertype', 'sh_normal'],
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
]
|
||||
];
|
347
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_javascript.js
Normal file
347
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_javascript.js
Normal file
@ -0,0 +1,347 @@
|
||||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['javascript'] = [
|
||||
[
|
||||
[
|
||||
/\/\/\//g,
|
||||
'sh_comment',
|
||||
1
|
||||
],
|
||||
[
|
||||
/\/\//g,
|
||||
'sh_comment',
|
||||
7
|
||||
],
|
||||
[
|
||||
/\/\*\*/g,
|
||||
'sh_comment',
|
||||
8
|
||||
],
|
||||
[
|
||||
/\/\*/g,
|
||||
'sh_comment',
|
||||
9
|
||||
],
|
||||
[
|
||||
/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,
|
||||
['sh_symbol', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,
|
||||
['sh_number', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,
|
||||
['sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,
|
||||
'sh_regexp',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
|
||||
'sh_number',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
10
|
||||
],
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
11
|
||||
],
|
||||
[
|
||||
/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
|
||||
'sh_symbol',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\{|\}/g,
|
||||
'sh_cbracket',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,
|
||||
'sh_predef_var',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,
|
||||
'sh_predef_func',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
|
||||
'sh_function',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
]
|
||||
];
|
538
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_main.js
Normal file
538
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_main.js
Normal file
@ -0,0 +1,538 @@
|
||||
/*
|
||||
SHJS - Syntax Highlighting in JavaScript
|
||||
Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
|
||||
License: http://shjs.sourceforge.net/doc/gplv3.html
|
||||
*/
|
||||
|
||||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
var sh_requests = {};
|
||||
|
||||
function sh_isEmailAddress(url) {
|
||||
if (/^mailto:/.test(url)) {
|
||||
return false;
|
||||
}
|
||||
return url.indexOf('@') !== -1;
|
||||
}
|
||||
|
||||
function sh_setHref(tags, numTags, inputString) {
|
||||
var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos);
|
||||
if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') {
|
||||
url = url.substr(1, url.length - 2);
|
||||
}
|
||||
if (sh_isEmailAddress(url)) {
|
||||
url = 'mailto:' + url;
|
||||
}
|
||||
tags[numTags - 2].node.href = url;
|
||||
}
|
||||
|
||||
/*
|
||||
Konqueror has a bug where the regular expression /$/g will not match at the end
|
||||
of a line more than once:
|
||||
|
||||
var regex = /$/g;
|
||||
var match;
|
||||
|
||||
var line = '1234567890';
|
||||
regex.lastIndex = 10;
|
||||
match = regex.exec(line);
|
||||
|
||||
var line2 = 'abcde';
|
||||
regex.lastIndex = 5;
|
||||
match = regex.exec(line2); // fails
|
||||
*/
|
||||
function sh_konquerorExec(s) {
|
||||
var result = [''];
|
||||
result.index = s.length;
|
||||
result.input = s;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights all elements containing source code in a text string. The return
|
||||
value is an array of objects, each representing an HTML start or end tag. Each
|
||||
object has a property named pos, which is an integer representing the text
|
||||
offset of the tag. Every start tag also has a property named node, which is the
|
||||
DOM element started by the tag. End tags do not have this property.
|
||||
@param inputString a text string
|
||||
@param language a language definition object
|
||||
@return an array of tag objects
|
||||
*/
|
||||
function sh_highlightString(inputString, language) {
|
||||
if (/Konqueror/.test(navigator.userAgent)) {
|
||||
if (! language.konquered) {
|
||||
for (var s = 0; s < language.length; s++) {
|
||||
for (var p = 0; p < language[s].length; p++) {
|
||||
var r = language[s][p][0];
|
||||
if (r.source === '$') {
|
||||
r.exec = sh_konquerorExec;
|
||||
}
|
||||
}
|
||||
}
|
||||
language.konquered = true;
|
||||
}
|
||||
}
|
||||
|
||||
var a = document.createElement('a');
|
||||
var span = document.createElement('span');
|
||||
|
||||
// the result
|
||||
var tags = [];
|
||||
var numTags = 0;
|
||||
|
||||
// each element is a pattern object from language
|
||||
var patternStack = [];
|
||||
|
||||
// the current position within inputString
|
||||
var pos = 0;
|
||||
|
||||
// the name of the current style, or null if there is no current style
|
||||
var currentStyle = null;
|
||||
|
||||
var output = function(s, style) {
|
||||
var length = s.length;
|
||||
// this is more than just an optimization - we don't want to output empty <span></span> elements
|
||||
if (length === 0) {
|
||||
return;
|
||||
}
|
||||
if (! style) {
|
||||
var stackLength = patternStack.length;
|
||||
if (stackLength !== 0) {
|
||||
var pattern = patternStack[stackLength - 1];
|
||||
// check whether this is a state or an environment
|
||||
if (! pattern[3]) {
|
||||
// it's not a state - it's an environment; use the style for this environment
|
||||
style = pattern[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentStyle !== style) {
|
||||
if (currentStyle) {
|
||||
tags[numTags++] = {pos: pos};
|
||||
if (currentStyle === 'sh_url') {
|
||||
sh_setHref(tags, numTags, inputString);
|
||||
}
|
||||
}
|
||||
if (style) {
|
||||
var clone;
|
||||
if (style === 'sh_url') {
|
||||
clone = a.cloneNode(false);
|
||||
}
|
||||
else {
|
||||
clone = span.cloneNode(false);
|
||||
}
|
||||
clone.className = style;
|
||||
tags[numTags++] = {node: clone, pos: pos};
|
||||
}
|
||||
}
|
||||
pos += length;
|
||||
currentStyle = style;
|
||||
};
|
||||
|
||||
var endOfLinePattern = /\r\n|\r|\n/g;
|
||||
endOfLinePattern.lastIndex = 0;
|
||||
var inputStringLength = inputString.length;
|
||||
while (pos < inputStringLength) {
|
||||
var start = pos;
|
||||
var end;
|
||||
var startOfNextLine;
|
||||
var endOfLineMatch = endOfLinePattern.exec(inputString);
|
||||
if (endOfLineMatch === null) {
|
||||
end = inputStringLength;
|
||||
startOfNextLine = inputStringLength;
|
||||
}
|
||||
else {
|
||||
end = endOfLineMatch.index;
|
||||
startOfNextLine = endOfLinePattern.lastIndex;
|
||||
}
|
||||
|
||||
var line = inputString.substring(start, end);
|
||||
|
||||
var matchCache = [];
|
||||
for (;;) {
|
||||
var posWithinLine = pos - start;
|
||||
|
||||
var stateIndex;
|
||||
var stackLength = patternStack.length;
|
||||
if (stackLength === 0) {
|
||||
stateIndex = 0;
|
||||
}
|
||||
else {
|
||||
// get the next state
|
||||
stateIndex = patternStack[stackLength - 1][2];
|
||||
}
|
||||
|
||||
var state = language[stateIndex];
|
||||
var numPatterns = state.length;
|
||||
var mc = matchCache[stateIndex];
|
||||
if (! mc) {
|
||||
mc = matchCache[stateIndex] = [];
|
||||
}
|
||||
var bestMatch = null;
|
||||
var bestPatternIndex = -1;
|
||||
for (var i = 0; i < numPatterns; i++) {
|
||||
var match;
|
||||
if (i < mc.length && (mc[i] === null || posWithinLine <= mc[i].index)) {
|
||||
match = mc[i];
|
||||
}
|
||||
else {
|
||||
var regex = state[i][0];
|
||||
regex.lastIndex = posWithinLine;
|
||||
match = regex.exec(line);
|
||||
mc[i] = match;
|
||||
}
|
||||
if (match !== null && (bestMatch === null || match.index < bestMatch.index)) {
|
||||
bestMatch = match;
|
||||
bestPatternIndex = i;
|
||||
if (match.index === posWithinLine) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bestMatch === null) {
|
||||
output(line.substring(posWithinLine), null);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
// got a match
|
||||
if (bestMatch.index > posWithinLine) {
|
||||
output(line.substring(posWithinLine, bestMatch.index), null);
|
||||
}
|
||||
|
||||
var pattern = state[bestPatternIndex];
|
||||
|
||||
var newStyle = pattern[1];
|
||||
var matchedString;
|
||||
if (newStyle instanceof Array) {
|
||||
for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {
|
||||
matchedString = bestMatch[subexpression + 1];
|
||||
output(matchedString, newStyle[subexpression]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
matchedString = bestMatch[0];
|
||||
output(matchedString, newStyle);
|
||||
}
|
||||
|
||||
switch (pattern[2]) {
|
||||
case -1:
|
||||
// do nothing
|
||||
break;
|
||||
case -2:
|
||||
// exit
|
||||
patternStack.pop();
|
||||
break;
|
||||
case -3:
|
||||
// exitall
|
||||
patternStack.length = 0;
|
||||
break;
|
||||
default:
|
||||
// this was the start of a delimited pattern or a state/environment
|
||||
patternStack.push(pattern);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// end of the line
|
||||
if (currentStyle) {
|
||||
tags[numTags++] = {pos: pos};
|
||||
if (currentStyle === 'sh_url') {
|
||||
sh_setHref(tags, numTags, inputString);
|
||||
}
|
||||
currentStyle = null;
|
||||
}
|
||||
pos = startOfNextLine;
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// DOM-dependent functions
|
||||
|
||||
function sh_getClasses(element) {
|
||||
var result = [];
|
||||
var htmlClass = element.className;
|
||||
if (htmlClass && htmlClass.length > 0) {
|
||||
var htmlClasses = htmlClass.split(' ');
|
||||
for (var i = 0; i < htmlClasses.length; i++) {
|
||||
if (htmlClasses[i].length > 0) {
|
||||
result.push(htmlClasses[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function sh_addClass(element, name) {
|
||||
var htmlClasses = sh_getClasses(element);
|
||||
for (var i = 0; i < htmlClasses.length; i++) {
|
||||
if (name.toLowerCase() === htmlClasses[i].toLowerCase()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
htmlClasses.push(name);
|
||||
element.className = htmlClasses.join(' ');
|
||||
}
|
||||
|
||||
/**
|
||||
Extracts the tags from an HTML DOM NodeList.
|
||||
@param nodeList a DOM NodeList
|
||||
@param result an object with text, tags and pos properties
|
||||
*/
|
||||
function sh_extractTagsFromNodeList(nodeList, result) {
|
||||
var length = nodeList.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var node = nodeList.item(i);
|
||||
switch (node.nodeType) {
|
||||
case 1:
|
||||
if (node.nodeName.toLowerCase() === 'br') {
|
||||
var terminator;
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
terminator = '\r';
|
||||
}
|
||||
else {
|
||||
terminator = '\n';
|
||||
}
|
||||
result.text.push(terminator);
|
||||
result.pos++;
|
||||
}
|
||||
else {
|
||||
result.tags.push({node: node.cloneNode(false), pos: result.pos});
|
||||
sh_extractTagsFromNodeList(node.childNodes, result);
|
||||
result.tags.push({pos: result.pos});
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
result.text.push(node.data);
|
||||
result.pos += node.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Extracts the tags from the text of an HTML element. The extracted tags will be
|
||||
returned as an array of tag objects. See sh_highlightString for the format of
|
||||
the tag objects.
|
||||
@param element a DOM element
|
||||
@param tags an empty array; the extracted tag objects will be returned in it
|
||||
@return the text of the element
|
||||
@see sh_highlightString
|
||||
*/
|
||||
function sh_extractTags(element, tags) {
|
||||
var result = {};
|
||||
result.text = [];
|
||||
result.tags = tags;
|
||||
result.pos = 0;
|
||||
sh_extractTagsFromNodeList(element.childNodes, result);
|
||||
return result.text.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
Merges the original tags from an element with the tags produced by highlighting.
|
||||
@param originalTags an array containing the original tags
|
||||
@param highlightTags an array containing the highlighting tags - these must not overlap
|
||||
@result an array containing the merged tags
|
||||
*/
|
||||
function sh_mergeTags(originalTags, highlightTags) {
|
||||
var numOriginalTags = originalTags.length;
|
||||
if (numOriginalTags === 0) {
|
||||
return highlightTags;
|
||||
}
|
||||
|
||||
var numHighlightTags = highlightTags.length;
|
||||
if (numHighlightTags === 0) {
|
||||
return originalTags;
|
||||
}
|
||||
|
||||
var result = [];
|
||||
var originalIndex = 0;
|
||||
var highlightIndex = 0;
|
||||
|
||||
while (originalIndex < numOriginalTags && highlightIndex < numHighlightTags) {
|
||||
var originalTag = originalTags[originalIndex];
|
||||
var highlightTag = highlightTags[highlightIndex];
|
||||
|
||||
if (originalTag.pos <= highlightTag.pos) {
|
||||
result.push(originalTag);
|
||||
originalIndex++;
|
||||
}
|
||||
else {
|
||||
result.push(highlightTag);
|
||||
if (highlightTags[highlightIndex + 1].pos <= originalTag.pos) {
|
||||
highlightIndex++;
|
||||
result.push(highlightTags[highlightIndex]);
|
||||
highlightIndex++;
|
||||
}
|
||||
else {
|
||||
// new end tag
|
||||
result.push({pos: originalTag.pos});
|
||||
|
||||
// new start tag
|
||||
highlightTags[highlightIndex] = {node: highlightTag.node.cloneNode(false), pos: originalTag.pos};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (originalIndex < numOriginalTags) {
|
||||
result.push(originalTags[originalIndex]);
|
||||
originalIndex++;
|
||||
}
|
||||
|
||||
while (highlightIndex < numHighlightTags) {
|
||||
result.push(highlightTags[highlightIndex]);
|
||||
highlightIndex++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Inserts tags into text.
|
||||
@param tags an array of tag objects
|
||||
@param text a string representing the text
|
||||
@return a DOM DocumentFragment representing the resulting HTML
|
||||
*/
|
||||
function sh_insertTags(tags, text) {
|
||||
var doc = document;
|
||||
|
||||
var result = document.createDocumentFragment();
|
||||
var tagIndex = 0;
|
||||
var numTags = tags.length;
|
||||
var textPos = 0;
|
||||
var textLength = text.length;
|
||||
var currentNode = result;
|
||||
|
||||
// output one tag or text node every iteration
|
||||
while (textPos < textLength || tagIndex < numTags) {
|
||||
var tag;
|
||||
var tagPos;
|
||||
if (tagIndex < numTags) {
|
||||
tag = tags[tagIndex];
|
||||
tagPos = tag.pos;
|
||||
}
|
||||
else {
|
||||
tagPos = textLength;
|
||||
}
|
||||
|
||||
if (tagPos <= textPos) {
|
||||
// output the tag
|
||||
if (tag.node) {
|
||||
// start tag
|
||||
var newNode = tag.node;
|
||||
currentNode.appendChild(newNode);
|
||||
currentNode = newNode;
|
||||
}
|
||||
else {
|
||||
// end tag
|
||||
currentNode = currentNode.parentNode;
|
||||
}
|
||||
tagIndex++;
|
||||
}
|
||||
else {
|
||||
// output text
|
||||
currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));
|
||||
textPos = tagPos;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights an element containing source code. Upon completion of this function,
|
||||
the element will have been placed in the "sh_sourceCode" class.
|
||||
@param element a DOM <pre> element containing the source code to be highlighted
|
||||
@param language a language definition object
|
||||
*/
|
||||
function sh_highlightElement(element, language) {
|
||||
sh_addClass(element, 'sh_sourceCode');
|
||||
var originalTags = [];
|
||||
var inputString = sh_extractTags(element, originalTags);
|
||||
var highlightTags = sh_highlightString(inputString, language);
|
||||
var tags = sh_mergeTags(originalTags, highlightTags);
|
||||
var documentFragment = sh_insertTags(tags, inputString);
|
||||
while (element.hasChildNodes()) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
element.appendChild(documentFragment);
|
||||
}
|
||||
|
||||
function sh_getXMLHttpRequest() {
|
||||
if (window.ActiveXObject) {
|
||||
return new ActiveXObject('Msxml2.XMLHTTP');
|
||||
}
|
||||
else if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
throw 'No XMLHttpRequest implementation available';
|
||||
}
|
||||
|
||||
function sh_load(language, element, prefix, suffix) {
|
||||
if (language in sh_requests) {
|
||||
sh_requests[language].push(element);
|
||||
return;
|
||||
}
|
||||
sh_requests[language] = [element];
|
||||
var request = sh_getXMLHttpRequest();
|
||||
var url = prefix + 'sh_' + language + suffix;
|
||||
request.open('GET', url, true);
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4) {
|
||||
try {
|
||||
if (! request.status || request.status === 200) {
|
||||
eval(request.responseText);
|
||||
var elements = sh_requests[language];
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
sh_highlightElement(elements[i], sh_languages[language]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw 'HTTP error: status ' + request.status;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
request = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
request.send(null);
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights all elements containing source code on the current page. Elements
|
||||
containing source code must be "pre" elements with a "class" attribute of
|
||||
"sh_LANGUAGE", where LANGUAGE is a valid language identifier; e.g., "sh_java"
|
||||
identifies the element as containing "java" language source code.
|
||||
*/
|
||||
function sh_highlightDocument(prefix, suffix) {
|
||||
var nodeList = document.getElementsByTagName('pre');
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
var element = nodeList.item(i);
|
||||
var htmlClasses = sh_getClasses(element);
|
||||
for (var j = 0; j < htmlClasses.length; j++) {
|
||||
var htmlClass = htmlClasses[j].toLowerCase();
|
||||
if (htmlClass === 'sh_sourcecode') {
|
||||
continue;
|
||||
}
|
||||
if (htmlClass.substr(0, 3) === 'sh_') {
|
||||
var language = htmlClass.substring(3);
|
||||
if (language in sh_languages) {
|
||||
sh_highlightElement(element, sh_languages[language]);
|
||||
}
|
||||
else if (typeof(prefix) === 'string' && typeof(suffix) === 'string') {
|
||||
sh_load(language, element, prefix, suffix);
|
||||
}
|
||||
else {
|
||||
throw 'Found <pre> element with class="' + htmlClass + '", but no such language exists';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
115
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_xml.js
Normal file
115
doc/source/docbkx/quantum-api-1.0/js/shjs/sh_xml.js
Normal file
@ -0,0 +1,115 @@
|
||||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['xml'] = [
|
||||
[
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
1,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
3,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
4
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
5,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
4
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
]
|
||||
];
|
184
doc/source/docbkx/quantum-api-1.0/js/trc/schema/controller.js
Normal file
184
doc/source/docbkx/quantum-api-1.0/js/trc/schema/controller.js
Normal file
@ -0,0 +1,184 @@
|
||||
/**
|
||||
controller.js
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file definas a single object in global scope:
|
||||
|
||||
trc.schema.controller
|
||||
|
||||
The controller object is responsible for displaying a menu that
|
||||
allows users to view schema source and jump to various definitions
|
||||
in the schema.
|
||||
**/
|
||||
|
||||
|
||||
//
|
||||
// Initialization code...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// We use YUI to build our controller menu make sure we have the
|
||||
// proper dependecies loaded, call init when we do...
|
||||
//
|
||||
|
||||
function InitController()
|
||||
{
|
||||
trc.schema.controller._init();
|
||||
}
|
||||
|
||||
trc.util.yui.loadYUIDeps (["menu"], InitController);
|
||||
})();
|
||||
|
||||
|
||||
if (!trc.schema)
|
||||
{
|
||||
trc.schema = new Object();
|
||||
}
|
||||
|
||||
trc.schema.controller = {
|
||||
//
|
||||
// Internal and external links by type:
|
||||
//
|
||||
// type --> array of links
|
||||
//
|
||||
// possible types include: import, include, element,
|
||||
// attribute, complextype, simpleType
|
||||
//
|
||||
// each link contains the following properties:
|
||||
// name : the name of the link
|
||||
// href : the link itself
|
||||
// title : a description of the link
|
||||
links : new Object(),
|
||||
|
||||
//
|
||||
// A single link that points to the schema index document.
|
||||
//
|
||||
index : null,
|
||||
|
||||
//
|
||||
// Our initialization function
|
||||
//
|
||||
_init : function() {
|
||||
//
|
||||
// Load the menu...
|
||||
//
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
var mainMenu = this._menuMarkup("mainmenu");
|
||||
|
||||
for (var linkType in this.links)
|
||||
{
|
||||
var subItem = this._menuItemMarkup(mainMenu, linkType, "#", null);
|
||||
var subMenu = this._menuMarkup (linkType+"_subMenu");
|
||||
|
||||
var items = this.links[linkType];
|
||||
for (var i=0;i<items.length;i++)
|
||||
{
|
||||
this._menuItemMarkup (subMenu,
|
||||
items[i].name,
|
||||
items[i].href,
|
||||
items[i].title);
|
||||
}
|
||||
subItem.item.appendChild (subMenu.main);
|
||||
}
|
||||
|
||||
//
|
||||
// Toggle view source menu
|
||||
//
|
||||
this._menuItemMarkup (mainMenu, "toggle src view",
|
||||
"javascript:trc.schema.sampleManager.toggleSrcView()", null);
|
||||
|
||||
//
|
||||
// Index schema document
|
||||
//
|
||||
if (this.index != null)
|
||||
{
|
||||
this._menuItemMarkup (mainMenu, this.index.name,
|
||||
this.index.href, this.index.title);
|
||||
}
|
||||
|
||||
controllerDiv.appendChild (mainMenu.main);
|
||||
var oMenu = new YAHOO.widget.Menu("mainmenu", {position: "static"});
|
||||
oMenu.render();
|
||||
oMenu.show();
|
||||
},
|
||||
|
||||
//
|
||||
// Builds menu markup returns the associated divs in the
|
||||
// properties main, body, header, footer, and list
|
||||
//
|
||||
_menuMarkup : function(id /*Id for main part*/)
|
||||
{
|
||||
//
|
||||
// Build our menu div...
|
||||
//
|
||||
var mainDiv = document.createElement("div");
|
||||
var headerDiv = document.createElement("div");
|
||||
var bodyDiv = document.createElement("div");
|
||||
var footerDiv = document.createElement("div");
|
||||
var listDiv = document.createElement("ul");
|
||||
|
||||
mainDiv.setAttribute ("id", id);
|
||||
trc.util.dom.setClassName (mainDiv, "yuimenu");
|
||||
trc.util.dom.setClassName (headerDiv, "hd");
|
||||
trc.util.dom.setClassName (bodyDiv, "bd");
|
||||
trc.util.dom.setClassName (footerDiv, "ft");
|
||||
|
||||
mainDiv.appendChild (headerDiv);
|
||||
mainDiv.appendChild (bodyDiv);
|
||||
mainDiv.appendChild (footerDiv);
|
||||
bodyDiv.appendChild (listDiv);
|
||||
|
||||
return {
|
||||
main : mainDiv,
|
||||
body : bodyDiv,
|
||||
header : headerDiv,
|
||||
footer : footerDiv,
|
||||
list : listDiv
|
||||
};
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a menu item to existing markup.
|
||||
//
|
||||
_menuItemMarkup : function (menu, /*Markup returned from _menuMarkup*/
|
||||
name, /* String, menu item name */
|
||||
href, /* String, menu item href */
|
||||
title /* String, title (tool tip)*/
|
||||
)
|
||||
{
|
||||
var listItem = document.createElement ("li");
|
||||
var link = document.createElement ("a");
|
||||
|
||||
trc.util.dom.setClassName (listItem, "yuimenuitem");
|
||||
trc.util.dom.setClassName (link, "yuimenuitemlabel");
|
||||
|
||||
link.setAttribute ("href", href);
|
||||
|
||||
if (title != null)
|
||||
{
|
||||
link.setAttribute ("title", title);
|
||||
}
|
||||
|
||||
link.appendChild (document.createTextNode(name));
|
||||
|
||||
listItem.appendChild (link);
|
||||
menu.list.appendChild(listItem);
|
||||
|
||||
return {
|
||||
item : listItem,
|
||||
anchor : link
|
||||
};
|
||||
}
|
||||
};
|
137
doc/source/docbkx/quantum-api-1.0/js/trc/schema/layoutManager.js
Normal file
137
doc/source/docbkx/quantum-api-1.0/js/trc/schema/layoutManager.js
Normal file
@ -0,0 +1,137 @@
|
||||
/**
|
||||
layoutManager.js
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file contains code that adjusts the layout of a schema
|
||||
document after a dom has been loaded. It does not modify the
|
||||
global scope.
|
||||
**/
|
||||
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// This function should be called when the DOM is loaded so we
|
||||
// can get to work adjusting things.
|
||||
//
|
||||
function InitLayoutManager()
|
||||
{
|
||||
layoutManager._init();
|
||||
}
|
||||
trc.util.browser.addInitFunction (InitLayoutManager);
|
||||
|
||||
var layoutManager={
|
||||
//
|
||||
// Initialization function...
|
||||
//
|
||||
_init : function()
|
||||
{
|
||||
this._adjustMain();
|
||||
this._adjustSubElements();
|
||||
},
|
||||
|
||||
//
|
||||
// Applies appropriate styles to body and other main content
|
||||
// tags.
|
||||
//
|
||||
_adjustMain : function()
|
||||
{
|
||||
//
|
||||
// Change the class name for the correct YUI skin name.
|
||||
//
|
||||
var bodyTags = document.getElementsByTagName("body");
|
||||
if (bodyTags.length == 0)
|
||||
{
|
||||
throw new Error ("Couldn't find body element, bad DOM?");
|
||||
}
|
||||
else
|
||||
{
|
||||
trc.util.dom.setClassName(bodyTags[0], "yui-skin-sam");
|
||||
}
|
||||
|
||||
//
|
||||
// Setout the layout...
|
||||
//
|
||||
var docDiv = document.getElementById("doc");
|
||||
var mainDiv = document.getElementById("Main");
|
||||
|
||||
trc.util.dom.setClassName (docDiv, "yui-t1");
|
||||
docDiv.setAttribute ("id", "doc3");
|
||||
mainDiv.setAttribute ("id", "yui-main");
|
||||
|
||||
//
|
||||
// Old IE browser hacks...
|
||||
//
|
||||
switch (trc.util.browser.detectIEVersion())
|
||||
{
|
||||
//
|
||||
// IE 6 does not support fixed positioning. The
|
||||
// following is a little hack to get it to work.
|
||||
//
|
||||
//
|
||||
case 6:
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
controllerDiv.style.position="absolute";
|
||||
window.setInterval((function(){
|
||||
/* avoid leak by constantly querying for the
|
||||
* controller. */
|
||||
var ctrlDiv = document.getElementById("Controller");
|
||||
ctrlDiv.style.top = document.documentElement.scrollTop+10;
|
||||
}), 1000);
|
||||
break;
|
||||
|
||||
//
|
||||
// The controler doesn't work **at all** in IE 7
|
||||
// don't even show it.
|
||||
//
|
||||
case 7:
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
controllerDiv.style.display = "none";
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Adds appropriate classes for subElements...
|
||||
//
|
||||
_adjustSubElements : function()
|
||||
{
|
||||
var divs = document.getElementsByTagName("div");
|
||||
for (var i=0;i<divs.length;i++)
|
||||
{
|
||||
var currentClass = divs[i].getAttribute ("class");
|
||||
var newClassName = currentClass;
|
||||
switch (currentClass)
|
||||
{
|
||||
case "SubItem" :
|
||||
newClassName += " yui-gd";
|
||||
break;
|
||||
case "SubItemProps" :
|
||||
newClassName += " yui-gd first";
|
||||
break;
|
||||
case "SubName" :
|
||||
newClassName += " yui-u first";
|
||||
break;
|
||||
case "SubAttributes" :
|
||||
case "SubDocumentation" :
|
||||
newClassName += " yui-u";
|
||||
break;
|
||||
}
|
||||
if (currentClass != newClassName)
|
||||
{
|
||||
trc.util.dom.setClassName (divs[i], newClassName);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
342
doc/source/docbkx/quantum-api-1.0/js/trc/schema/sampleManager.js
Normal file
342
doc/source/docbkx/quantum-api-1.0/js/trc/schema/sampleManager.js
Normal file
@ -0,0 +1,342 @@
|
||||
/**
|
||||
schemaManager.js:
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file defines a single object in global scope:
|
||||
|
||||
trc.schema.sampleManager
|
||||
|
||||
The object is responsible for loading, formatting, and displaying
|
||||
samples in schema files. It expects trc.util to be defined which is
|
||||
provided in trc/util.js.
|
||||
|
||||
Code highlighting is provided by SHJS
|
||||
(http://shjs.sourceforge.net/). It should also be loaded before
|
||||
this code is initialized.
|
||||
|
||||
All methods/properties prepended with an underscore (_) are meant
|
||||
for internal use.
|
||||
**/
|
||||
|
||||
//
|
||||
// Initialization code...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure syntax highlighter scripts are loaded, if not then
|
||||
// load them.
|
||||
//
|
||||
if (!window.sh_highlightDocument)
|
||||
{
|
||||
trc.util.dom.addStyle ("../style/shjs/sh_darkblue.css");
|
||||
|
||||
trc.util.dom.addScript ("../js/shjs/sh_main.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_xml.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_javascript.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_java.js");
|
||||
}
|
||||
|
||||
function InitSchemaSampleManager()
|
||||
{
|
||||
trc.schema.sampleManager._init();
|
||||
}
|
||||
|
||||
trc.util.browser.addInitFunction(InitSchemaSampleManager);
|
||||
})();
|
||||
|
||||
//
|
||||
// Define trc.schema.sampleManager...
|
||||
//
|
||||
if (!trc.schema)
|
||||
{
|
||||
trc.schema = new Object();
|
||||
}
|
||||
trc.schema.sampleManager = {
|
||||
//
|
||||
// All sample data in an associative array:
|
||||
//
|
||||
// Select Element ID -> Array of sample ids.
|
||||
//
|
||||
samples : new Object(),
|
||||
|
||||
//
|
||||
// An array of code data..
|
||||
//
|
||||
// Code data is defined as an object with the following
|
||||
// properties:
|
||||
//
|
||||
// type: The mimetype of the code...href: The location of the code
|
||||
// or null if it's inline
|
||||
//
|
||||
// id: The id of the pre that contains the code.
|
||||
//
|
||||
// The initial object is the source code for the current document.
|
||||
//
|
||||
codes : new Array({
|
||||
id : "SrcContentCode",
|
||||
type : "application/xml",
|
||||
href : (function() {
|
||||
var ret = location.href;
|
||||
if (location.hash && (location.hash.length != 0))
|
||||
{
|
||||
ret = ret.replace (location.hash, "");
|
||||
}
|
||||
return ret;
|
||||
})()
|
||||
}),
|
||||
|
||||
//
|
||||
// Sets up the manager, begins the loading process...
|
||||
//
|
||||
_init : function() {
|
||||
//
|
||||
// Setup an array to hold data items to load, this is used by
|
||||
// the loadSample method.
|
||||
//
|
||||
this._toLoad = new Array();
|
||||
|
||||
for (var i=0;i<this.codes.length;i++)
|
||||
{
|
||||
if ((this.codes[i] != null) &&
|
||||
(this.codes[i].href != null))
|
||||
{
|
||||
this._toLoad.push (this.codes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Loads the code text
|
||||
//
|
||||
this._loadCode();
|
||||
},
|
||||
|
||||
//
|
||||
// Loads the next sample in the toLoad array.
|
||||
//
|
||||
_loadCode : function() {
|
||||
if (this._toLoad.length == 0)
|
||||
{
|
||||
//
|
||||
// All samples have been loaded, fire the loadComplete
|
||||
// method.
|
||||
//
|
||||
this._loadComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
var codeData = this._toLoad.pop();
|
||||
var request = trc.util.net.getHTTPRequest();
|
||||
var manager = this;
|
||||
|
||||
request.onreadystatechange = function() {
|
||||
if (request.readyState == 4 /* Ready */) {
|
||||
if (request.status == 200 /* OKAY */) {
|
||||
manager._setCodeText (codeData, request.responseText);
|
||||
}
|
||||
else
|
||||
{
|
||||
manager._setCodeText (codeData, "Could not load sample ("+request.status+") "+request.responseText);
|
||||
}
|
||||
manager._loadCode();
|
||||
}
|
||||
};
|
||||
|
||||
request.open ("GET", codeData.href);
|
||||
request.send(null);
|
||||
},
|
||||
|
||||
//
|
||||
// Called after all samples are loaded into the DOM.
|
||||
//
|
||||
_loadComplete : function()
|
||||
{
|
||||
//
|
||||
// Normalize all code samples..
|
||||
//
|
||||
this._normalizeCodeText(1, 1, 5);
|
||||
|
||||
//
|
||||
// Perform syntax highlighting...
|
||||
//
|
||||
sh_highlightDocument();
|
||||
|
||||
//
|
||||
// All samples are initially hidden, show the selected
|
||||
// samples...
|
||||
//
|
||||
for (var optionID in this.samples)
|
||||
{
|
||||
this.showSample(optionID);
|
||||
}
|
||||
|
||||
//
|
||||
// We've adjusted the document, we need to setup the view so
|
||||
// that we're still pointing to the hash target.
|
||||
//
|
||||
if (window.location.hash &&
|
||||
(window.location.hash.length != 0))
|
||||
{
|
||||
window.location.href = window.location.hash;
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Sets code text replacing any text already existing there.
|
||||
//
|
||||
_setCodeText : function ( codeData /* Info of the code to set (code object) */,
|
||||
code /* Code text to set (string) */)
|
||||
{
|
||||
//
|
||||
// Preprocess the txt if nessesary...
|
||||
//
|
||||
var ieVersion = trc.util.browser.detectIEVersion();
|
||||
if ((ieVersion > -1) &&
|
||||
(ieVersion < 8))
|
||||
{
|
||||
code = trc.util.text.unix2dos (code);
|
||||
}
|
||||
|
||||
var pre = document.getElementById(codeData.id);
|
||||
var preNodes = pre.childNodes;
|
||||
//
|
||||
// Remove placeholder data...
|
||||
//
|
||||
while (preNodes.length != 0)
|
||||
{
|
||||
pre.removeChild (preNodes[0]);
|
||||
}
|
||||
|
||||
//
|
||||
// Set the correct class type...
|
||||
//
|
||||
switch (codeData.type)
|
||||
{
|
||||
/*
|
||||
Javascript mimetypes
|
||||
*/
|
||||
case 'application/json':
|
||||
case 'application/javascript':
|
||||
case 'application/x-javascript':
|
||||
case 'application/ecmascript':
|
||||
case 'text/ecmascript':
|
||||
case 'text/javascript':
|
||||
trc.util.dom.setClassName (pre, "sh_javascript");
|
||||
break;
|
||||
/*
|
||||
Not real mimetypes but this is what we'll use for Java.
|
||||
*/
|
||||
case 'application/java':
|
||||
case 'text/java':
|
||||
trc.util.dom.setClassName (pre, "sh_java");
|
||||
break;
|
||||
default:
|
||||
trc.util.dom.setClassName (pre, "sh_xml");
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Add new code...
|
||||
//
|
||||
pre.appendChild (document.createTextNode (code));
|
||||
},
|
||||
|
||||
//
|
||||
// Retrives source code text
|
||||
//
|
||||
_getCodeText : function (codeData /* Info for the code to get*/)
|
||||
{
|
||||
var pre = document.getElementById(codeData.id);
|
||||
pre.normalize();
|
||||
//
|
||||
// Should be a single text node after pre...
|
||||
//
|
||||
return pre.firstChild.nodeValue;
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// Normalizes text by ensuring that top, bottom, right indent
|
||||
// levels are equal for all samples.
|
||||
//
|
||||
_normalizeCodeText : function (top, /* integer, top indent in lines */
|
||||
bottom, /* integer, bottom indent in lines */
|
||||
right /* integer, right indent in spaces */
|
||||
)
|
||||
{
|
||||
for (var i=0;i<this.codes.length;i++)
|
||||
{
|
||||
if (this.codes[i] != null)
|
||||
{
|
||||
var code = this._getCodeText (this.codes[i]);
|
||||
code = trc.util.text.setIndent (code, top, bottom, right);
|
||||
this._setCodeText (this.codes[i], code);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// This event handler shows the appropriate sample given an ID
|
||||
// to the select element.
|
||||
//
|
||||
showSample : function (selectID) /* ID of the Select element */
|
||||
{
|
||||
//
|
||||
// Get the selected value
|
||||
//
|
||||
var selected = document.getElementById(selectID);
|
||||
var selectedValue = selected.options[selected.selectedIndex].value;
|
||||
var samples = this.samples[selectID];
|
||||
|
||||
//
|
||||
// Undisplay old samples, display selected ones.
|
||||
//
|
||||
for (var i=0;i<samples.length;i++)
|
||||
{
|
||||
if (samples[i] != null)
|
||||
{
|
||||
var sample = document.getElementById (samples[i]);
|
||||
if (samples[i] == selectedValue)
|
||||
{
|
||||
sample.style.display = "block";
|
||||
}
|
||||
else
|
||||
{
|
||||
sample.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Toggles the current source view. If the source is displayed it
|
||||
// undisplays it and vice versa.
|
||||
//
|
||||
toggleSrcView : function()
|
||||
{
|
||||
var content = document.getElementById ("Content");
|
||||
var src = document.getElementById ("SrcContent");
|
||||
|
||||
if (content.style.display != "none")
|
||||
{
|
||||
content.style.display = "none";
|
||||
src.style.display = "block";
|
||||
}
|
||||
else
|
||||
{
|
||||
content.style.display = "block";
|
||||
src.style.display = "none";
|
||||
}
|
||||
}
|
||||
};
|
564
doc/source/docbkx/quantum-api-1.0/js/trc/util.js
Normal file
564
doc/source/docbkx/quantum-api-1.0/js/trc/util.js
Normal file
@ -0,0 +1,564 @@
|
||||
/**
|
||||
util.js:
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file defines a single object in global scope:
|
||||
|
||||
trc.util
|
||||
|
||||
The util object contains internal objects which contain useful
|
||||
utility properties and methods.
|
||||
|
||||
trc.util.browser: contains methods for browser detection.
|
||||
|
||||
trc.util.dom: contains methods for manipulating the DOM.
|
||||
|
||||
trc.util.text: contains methods and properties useful when working
|
||||
with plain text.
|
||||
|
||||
trc.util.net: contains methods for creating HTTP requests.
|
||||
|
||||
trc.util.yui : contains methods for working with the YUI toolkit.
|
||||
|
||||
All methods/properties prepended with an underscore (_) are meant
|
||||
for internal use.
|
||||
**/
|
||||
|
||||
//
|
||||
// Define TRC
|
||||
//
|
||||
if (!window.trc)
|
||||
{
|
||||
trc= new Object();
|
||||
}
|
||||
trc.util = new Object();
|
||||
trc.util.browser = {
|
||||
//
|
||||
// Returns the current version of IE, or -1 if it's not an IE
|
||||
// browser. This is one of the recommended ways of detecting IE
|
||||
// see:
|
||||
//
|
||||
// http://msdn.microsoft.com/en-us/library/ms537509%28VS.85%29.aspx
|
||||
//
|
||||
detectIEVersion : function() {
|
||||
var rv = -1; // Return value assumes failure.
|
||||
if (navigator.appName == 'Microsoft Internet Explorer')
|
||||
{
|
||||
var ua = navigator.userAgent;
|
||||
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
|
||||
if (re.exec(ua) != null)
|
||||
rv = parseFloat( RegExp.$1 );
|
||||
}
|
||||
return rv;
|
||||
},
|
||||
|
||||
//
|
||||
// A list of functions to execute on init.
|
||||
//
|
||||
_initFuns : new Array(),
|
||||
|
||||
//
|
||||
// Has the init function event been set?
|
||||
//
|
||||
_initFunSet: false,
|
||||
|
||||
//
|
||||
// Function called when the DOM has loaded. It launches all init
|
||||
// functions.
|
||||
//
|
||||
_onInit : function()
|
||||
{
|
||||
//
|
||||
// Sort by order...
|
||||
//
|
||||
this._initFuns.sort(function(a, b){ return a.order - b.order; });
|
||||
for (var i=0;i<this._initFuns.length;i++)
|
||||
{
|
||||
this._initFuns[i]();
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a function that should be executed when the dom is
|
||||
// loaded.
|
||||
//
|
||||
addInitFunction : function(init, /*Function to call after dom
|
||||
* is loaded*/
|
||||
|
||||
order /* An optional it specifing
|
||||
* order. The bigger the int the
|
||||
* later it will run. Default is
|
||||
* 1.*/
|
||||
) {
|
||||
if (arguments.length < 2)
|
||||
{
|
||||
init.order = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
init.order = order;
|
||||
}
|
||||
this._initFuns.push (init);
|
||||
|
||||
if (!this._initFunSet)
|
||||
{
|
||||
var butil = this;
|
||||
function initFun()
|
||||
{
|
||||
return (function(){ butil._onInit(); });
|
||||
}
|
||||
|
||||
//
|
||||
// Try event listeners, attachEvent and if that fails use
|
||||
// window.onload...
|
||||
//
|
||||
if (window.addEventListener)
|
||||
{
|
||||
window.addEventListener("load", initFun(), false);
|
||||
} else if (window.attachEvent)
|
||||
{
|
||||
window.attachEvent ("onload", initFun());
|
||||
} else
|
||||
{
|
||||
window.onload = initFun();
|
||||
}
|
||||
|
||||
this._initFunSet = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.dom = {
|
||||
//
|
||||
// Adds a new script tag to the current DOM.
|
||||
//
|
||||
addScript : function (src /* Script href */)
|
||||
{
|
||||
var scriptElement = document.createElement ("script");
|
||||
scriptElement.setAttribute ("type", "text/javascript");
|
||||
scriptElement.setAttribute ("src", src);
|
||||
|
||||
this.addToHead (scriptElement);
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a new stylesheet to the current DOM.
|
||||
//
|
||||
addStyle : function (src /* Stylesheet href */)
|
||||
{
|
||||
var linkElement = document.createElement ("link");
|
||||
linkElement.setAttribute ("rel", "stylesheet");
|
||||
linkElement.setAttribute ("type", "text/css");
|
||||
linkElement.setAttribute ("href", src);
|
||||
|
||||
this.addToHead (linkElement);
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a DOM node to the HTTP head element. The element is
|
||||
// always added as the last child an error is thrown if the
|
||||
// head element can't be found.
|
||||
//
|
||||
addToHead : function (node /* A DOM node */)
|
||||
{
|
||||
var headArray = document.getElementsByTagName("head");
|
||||
if (headArray.length == 0)
|
||||
{
|
||||
throw new Error("Couldn't find head element, bad DOM?");
|
||||
}
|
||||
else
|
||||
{
|
||||
headArray[0].appendChild (node);
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Dumb utility function for setting the class name of an
|
||||
// element. Eventually we'll move completely to XHTML, but
|
||||
// this will never work in IE 6, so for now we need this
|
||||
// method for setting the class name.
|
||||
//
|
||||
setClassName : function (element, /* DOM Element*/
|
||||
name /* Class name to use */
|
||||
)
|
||||
{
|
||||
var ieVersion = trc.util.browser.detectIEVersion();
|
||||
|
||||
if ((ieVersion > -1) &&
|
||||
(ieVersion < 7))
|
||||
{
|
||||
element.className = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
element.setAttribute ("class",name);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.text = {
|
||||
//
|
||||
// Useful RegExps
|
||||
//
|
||||
blank : new RegExp ("^\\s*$"), /* A blank string */
|
||||
indent : new RegExp ("^\\s+"), /* Line indent */
|
||||
lines : new RegExp ("$","m"), /* All lines */
|
||||
linechars : new RegExp ("(\n|\r)"), /* EOL line characters */
|
||||
tabs : new RegExp ("\t","g"), /* All tabs */
|
||||
|
||||
//
|
||||
// We need this because microsoft browsers before IE 7, connot
|
||||
// display pre-formatted text correctly win unix style line
|
||||
// endings.
|
||||
//
|
||||
unix2dos : function(txt /* String */) {
|
||||
//if already DOS...
|
||||
if (txt.search(/\r\n/) != -1)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
return txt.replace (/\n/g, "\r\n");
|
||||
},
|
||||
|
||||
//
|
||||
// Useful to normalize text.
|
||||
//
|
||||
dos2unix : function(txt /* String */) {
|
||||
//if already unix...
|
||||
if (txt.search(/\r\n/) == -1)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
return txt.replace(/\r/g, "");
|
||||
},
|
||||
|
||||
//
|
||||
// Create a string with a character repeated x times.
|
||||
//
|
||||
repString : function (length, /* integer, size of the string to create */
|
||||
ch /* string, The character to set the string to */
|
||||
)
|
||||
{
|
||||
var ret = new String();
|
||||
for (var i=0;i<length;i++) {ret=ret.concat(ch);}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
//
|
||||
// Replace tabs in a text with strings.
|
||||
//
|
||||
replaceTabs : function (txt, /* String to modify */
|
||||
length /* integer, tab length in spaces */
|
||||
)
|
||||
{
|
||||
var tabs = this.repString(length, " ");
|
||||
return txt.replace (this.tabs, tabs);
|
||||
},
|
||||
|
||||
//
|
||||
// Given multi-line text returns Adjust top and bottom indent
|
||||
// (in lines) and right indent (in spaces)
|
||||
//
|
||||
setIndent : function (txt, /* String */
|
||||
top, /* integer, top indent in lines */
|
||||
bottom, /* integer, bottom indent in lines */
|
||||
right /* integer, right indent in spaces */
|
||||
)
|
||||
{
|
||||
//
|
||||
// Can't indent an empty string..
|
||||
//
|
||||
if (txt.length == 0)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
//
|
||||
// If not 0, bottom will be off by one...
|
||||
//
|
||||
if (bottom != 0)
|
||||
{
|
||||
bottom++;
|
||||
}
|
||||
|
||||
var head=this.repString (top, "\n");
|
||||
var tail=this.repString (bottom, "\n");
|
||||
var marg=this.repString (right, " ");
|
||||
var ntxt = this.dos2unix(txt);
|
||||
var ntxt = this.replaceTabs (ntxt, 8);
|
||||
var lines = ntxt.split (this.lines);
|
||||
var origIndent=Number.MAX_VALUE;
|
||||
var origIndentStr;
|
||||
|
||||
//
|
||||
// Look up indent.
|
||||
//
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
//
|
||||
// Remove EOL characters...
|
||||
//
|
||||
lines[i] = lines[i].replace (this.linechars, "");
|
||||
|
||||
//
|
||||
// Ignore blank lines
|
||||
//
|
||||
if (lines[i].match(this.blank) != null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Detect the indent if any...
|
||||
//
|
||||
var result = lines[i].match(this.indent);
|
||||
if (result == null)
|
||||
{
|
||||
origIndent = 0;
|
||||
origIndentStr = "";
|
||||
}
|
||||
else if (result[0].length < origIndent)
|
||||
{
|
||||
origIndent = result[0].length;
|
||||
origIndentStr = result[0];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// This implys all line are blank...can't indent.
|
||||
//
|
||||
if (origIndent == Number.MAX_VALUE)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
if (origIndent != 0)
|
||||
{
|
||||
var regExStr = "^";
|
||||
for (var i=0;i<origIndent;i++)
|
||||
{
|
||||
regExStr=regExStr.concat("\\s");
|
||||
}
|
||||
var indent = new RegExp(regExStr);
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
lines[i] = lines[i].replace(indent,marg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
lines[i] = marg.concat (lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove top...
|
||||
//
|
||||
while (lines.length != 0)
|
||||
{
|
||||
if (lines[0].match(this.blank))
|
||||
{
|
||||
lines.shift();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove bottom...
|
||||
//
|
||||
while (lines.length != 0)
|
||||
{
|
||||
if (lines[lines.length-1].match(this.blank))
|
||||
{
|
||||
lines.pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var indented = lines.join("\n");
|
||||
indented=head.concat(indented, tail);
|
||||
|
||||
return indented;
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.net = {
|
||||
//
|
||||
// A list of possible factories for creating an XMLHTTPRequest
|
||||
//
|
||||
_HTTPReqFactories :
|
||||
[
|
||||
function() { return new XMLHttpRequest(); },
|
||||
function() { return new ActiveXObject("Msxml2.XMLHTTP"); },
|
||||
function() { return new ActiveXObject("Microsoft.XMLHTTP"); }
|
||||
],
|
||||
|
||||
//
|
||||
// A cached XMLHTTPRequest factory that we know works in this
|
||||
// browser
|
||||
//
|
||||
_HTTPReqFactory : null,
|
||||
|
||||
//
|
||||
// Provides a way of getting an HTTPRequest object in a
|
||||
// platform independent manner
|
||||
//
|
||||
getHTTPRequest : function()
|
||||
{
|
||||
//
|
||||
// Use cache if available..
|
||||
//
|
||||
if (this._HTTPReqFactory != null) return this._HTTPReqFactory();
|
||||
|
||||
//
|
||||
// Search for a factory..
|
||||
//
|
||||
for (var i=0; i< this._HTTPReqFactories.length; i++)
|
||||
{
|
||||
try {
|
||||
var factory = this._HTTPReqFactories[i];
|
||||
var request = factory();
|
||||
if (request != null)
|
||||
{
|
||||
this._HTTPReqFactory = factory;
|
||||
return request;
|
||||
}
|
||||
} catch (e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Looks like we don't have support for XMLHttpRequest...
|
||||
//
|
||||
this._HTTPReqFactory = function() {throw new Error("XMLHttpRequest not supported");}
|
||||
this._HTTPReqFactory();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Init code for trc.util.yui...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Menu make sure we have the YUI loader as it's used by our
|
||||
// init function to load YUI components.
|
||||
//
|
||||
if (!window.YAHOO)
|
||||
{
|
||||
//
|
||||
// We are currently using YUI on YAHOO!'s servers we may
|
||||
// want to change this.
|
||||
//
|
||||
var YUI_BASE="http://yui.yahooapis.com/2.7.0/";
|
||||
|
||||
trc.util.dom.addScript (YUI_BASE+"build/yuiloader/yuiloader-min.js");
|
||||
}
|
||||
|
||||
function InitYUIUtil()
|
||||
{
|
||||
trc.util.yui._init();
|
||||
}
|
||||
trc.util.browser.addInitFunction (InitYUIUtil);
|
||||
})();
|
||||
|
||||
trc.util.yui = {
|
||||
//
|
||||
// A list of dependecies to be passed to the YUI loader. This is
|
||||
// essentially a hash set: dep->dep.
|
||||
//
|
||||
_deps : new Object(),
|
||||
|
||||
//
|
||||
// An array of callback functions, these should be called when all
|
||||
// dependecies are loaded.
|
||||
//
|
||||
_callbacks : new Array(),
|
||||
|
||||
//
|
||||
// The init function simply calls the YUI loader...
|
||||
//
|
||||
_init : function() {
|
||||
var yuiUtil = this;
|
||||
|
||||
//
|
||||
// It takes safari a while to load the YUI Loader if it hasn't
|
||||
// loaded yet keep trying at 1/4 second intervals
|
||||
//
|
||||
if (!window.YAHOO)
|
||||
{
|
||||
window.setTimeout (function() {
|
||||
yuiUtil._init();
|
||||
}, 250);
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Collect requirements...
|
||||
//
|
||||
var required = new Array();
|
||||
for (var req in this._deps)
|
||||
{
|
||||
required.push (req);
|
||||
}
|
||||
|
||||
//
|
||||
// Load YUI dependecies...
|
||||
//
|
||||
var loader = new YAHOO.util.YUILoader({
|
||||
require: required,
|
||||
loadOptional: true,
|
||||
filter: "RAW",
|
||||
onSuccess: function() {
|
||||
yuiUtil._depsLoaded();
|
||||
},
|
||||
timeout: 10000,
|
||||
combine: true
|
||||
});
|
||||
loader.insert();
|
||||
},
|
||||
|
||||
//
|
||||
// Called after all dependecies have been loaded
|
||||
//
|
||||
_depsLoaded : function() {
|
||||
//
|
||||
// Dependecies are loaded let everyone know.
|
||||
//
|
||||
for (var i=0;i<this._callbacks.length;i++)
|
||||
{
|
||||
this._callbacks[i]();
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Request that one or more YUI dependecies are loaded.
|
||||
//
|
||||
loadYUIDeps : function (deps, /*An array of dep strings */
|
||||
callback /*A function to call when deps are loaded*/
|
||||
)
|
||||
{
|
||||
for (var i=0;i<deps.length;i++)
|
||||
{
|
||||
this._deps[deps[i]] = deps[i];
|
||||
}
|
||||
if (callback != null)
|
||||
{
|
||||
this._callbacks.push (callback);
|
||||
}
|
||||
}
|
||||
};
|
2011
doc/source/docbkx/quantum-api-1.0/quantum-api-guide.xml
Normal file
2011
doc/source/docbkx/quantum-api-1.0/quantum-api-guide.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
{
|
||||
"attachment": {}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<attachment />
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"attachment":
|
||||
{
|
||||
"id": "test_interface_identifier"
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<attachment id="test_interface_identifier"/>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"attachment":
|
||||
{
|
||||
"id": "test_interface_identifier"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<attachment
|
||||
id="test_interface_identifier"/>
|
19
doc/source/docbkx/quantum-api-1.0/samples/extensions.json
Normal file
19
doc/source/docbkx/quantum-api-1.0/samples/extensions.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"extensions": [
|
||||
{
|
||||
"name": "Cisco Port Profile",
|
||||
"namespace": "http://docs.ciscocloud.com/api/ext/portprofile/v1.0",
|
||||
"alias": "Cisco Port Profile",
|
||||
"updated": "2011-07-23T13:25:27-06:00",
|
||||
"description": "Portprofile include QoS information",
|
||||
},
|
||||
{
|
||||
"name": "Cisco qos",
|
||||
"namespace": "http://docs.ciscocloud.com/api/ext/qos/v1.0",
|
||||
"alias": "Cisco qos",
|
||||
"updated": "2011-07-25T13:25:27-06:00",
|
||||
"description": "qos include qos_name and qos_desc",
|
||||
},
|
||||
|
||||
]
|
||||
}
|
21
doc/source/docbkx/quantum-api-1.0/samples/extensions.xml
Normal file
21
doc/source/docbkx/quantum-api-1.0/samples/extensions.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<extensions>
|
||||
|
||||
<extension
|
||||
name="Cisco Port Profile"
|
||||
namespace="http://docs.ciscocloud.com/api/ext/portprofile/v1.0"
|
||||
alias="Cisco Port Profile"
|
||||
updated="2011-07-23T13:25:27-06:00">
|
||||
<description>Portprofile include QoS information</description>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
name="Cisco qos"
|
||||
namespace="http://docs.ciscocloud.com/api/ext/qos/v1.0"
|
||||
alias="Cisco qos"
|
||||
updated="2011-07-25T13:25:27-06:00">
|
||||
<description>qos include qos_name and qos_desc</description>
|
||||
</extension>
|
||||
|
||||
</extensions>
|
7
doc/source/docbkx/quantum-api-1.0/samples/fault.json
Normal file
7
doc/source/docbkx/quantum-api-1.0/samples/fault.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"networkNotFound": {
|
||||
"message": "Unable to find a network with the specified identifier.",
|
||||
"code": 420,
|
||||
"detail": "Network 8de6af7c-ef95-4ac1-9d37-172f8df33a1f could not be found"
|
||||
}
|
||||
}
|
8
doc/source/docbkx/quantum-api-1.0/samples/fault.xml
Normal file
8
doc/source/docbkx/quantum-api-1.0/samples/fault.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<networkNotFound code="420" xmlns="http://netstack.org/quantum/api/v1.0">
|
||||
<message>
|
||||
Unable to find a network with the specified identifier.
|
||||
</message>
|
||||
<detail>
|
||||
Network 8de6af7c-ef95-4ac1-9d37-172f8df33a1f could not be found
|
||||
</detail>
|
||||
</networkNotFound
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"network":
|
||||
{
|
||||
"id": "8bec1293-16bd-4568-ba75-1f58bec0b4c3",
|
||||
"name": "test_network"
|
||||
"ports":
|
||||
[
|
||||
{
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855",
|
||||
"state": "DOWN"
|
||||
},
|
||||
{
|
||||
"id": b832be00-6553-4f69-af33-acd554e36d08",
|
||||
"state": "ACTIVE",
|
||||
"attachment":
|
||||
{
|
||||
"id": "test_interface_identifier"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<network
|
||||
id="8bec1293-16bd-4568-ba75-1f58bec0b4c3"
|
||||
name="test_network">
|
||||
<ports>
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
status="DOWN"/>
|
||||
<port
|
||||
id="b832be00-6553-4f69-af33-acd554e36d08"
|
||||
status="ACTIVE">
|
||||
<attachment id="test_interface_identifier"/>
|
||||
</port>
|
||||
</ports>
|
||||
</network>
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"network":
|
||||
{
|
||||
"id": "8bec1293-16bd-4568-ba75-1f58bec0b4c3",
|
||||
"name": "test_network"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<network
|
||||
id="8bec1293-16bd-4568-ba75-1f58bec0b4c3"
|
||||
name="test_network"/>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"network":
|
||||
{
|
||||
"name": "test_create_network"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<network
|
||||
name="test_create_network"/>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"network":
|
||||
{
|
||||
"id": "158233b0-ca9a-40b4-8614-54a4a99d47d1",
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<network
|
||||
id="158233b0-ca9a-40b4-8614-54a4a99d47d1"/>
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"networks":
|
||||
[
|
||||
{
|
||||
"id": "8bec1293-16bd-4568-ba75-1f58bec0b4c3",
|
||||
"name": "network_1"
|
||||
},
|
||||
{
|
||||
"id": "2a39409c-7146-4501-8429-3579e03e9b56",
|
||||
"name": "network_2"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<networks>
|
||||
<network
|
||||
id="8bec1293-16bd-4568-ba75-1f58bec0b4c3"
|
||||
name="network_1"/>
|
||||
<network
|
||||
id="2a39409c-7146-4501-8429-3579e03e9b56"
|
||||
name="network_2"/>
|
||||
</networks>
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"networks":
|
||||
[
|
||||
{
|
||||
"id": "8bec1293-16bd-4568-ba75-1f58bec0b4c3"
|
||||
},
|
||||
{
|
||||
"id": "2a39409c-7146-4501-8429-3579e03e9b56"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<networks>
|
||||
<network id="8bec1293-16bd-4568-ba75-1f58bec0b4c3"/>
|
||||
<network id="2a39409c-7146-4501-8429-3579e03e9b56"/>
|
||||
</networks>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"network": {
|
||||
"name": "test"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<network name="test"/>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"network": {
|
||||
"id": "611851f2-df8b-4455-b84b-8c73b7ca5dec"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<network id="e1150d1c-e953-402d-aa75-e35d803d914b"/>
|
7
doc/source/docbkx/quantum-api-1.0/samples/notfound.json
Normal file
7
doc/source/docbkx/quantum-api-1.0/samples/notfound.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"itemNotFound" : {
|
||||
"code" : 404,
|
||||
"message" : "Not Found",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
7
doc/source/docbkx/quantum-api-1.0/samples/notfound.xml
Normal file
7
doc/source/docbkx/quantum-api-1.0/samples/notfound.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itemNotFound
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
code="404">
|
||||
<message>Not Found</message>
|
||||
<details>Error Details...</details>
|
||||
</itemNotFound>
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"notImplemented" : {
|
||||
"code" : 501,
|
||||
"message" : "Not Implemented",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<notImplemented xmlns="http://docs.openstack.org/compute/api/v1.1" code="501">
|
||||
<message>Not Implemented</message>
|
||||
<details>Error Details...</details>
|
||||
</notImplemented>
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"port":
|
||||
{
|
||||
"state": "DOWN",
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
"attachment":
|
||||
{
|
||||
"id": "test_interface_identifier"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
state="DOWN">
|
||||
<attachment
|
||||
id="test_interface_identifier"/>
|
||||
</port>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"port":
|
||||
{
|
||||
"state": "DOWN",
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
state="DOWN"/>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"port":
|
||||
{
|
||||
"state": "ACTIVE"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<port
|
||||
state="ACTIVE"/>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"port":
|
||||
{
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"/>
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ports": [
|
||||
{
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855",
|
||||
"state": "ACTIVE",
|
||||
},
|
||||
{
|
||||
"id": "b832be00-6553-4f69-af33-acd554e36d08",
|
||||
"state": "ACTIVE",
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<ports>
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
state="ACTIVE"/>
|
||||
<port
|
||||
id="b832be00-6553-4f69-af33-acd554e36d08"
|
||||
state="ACTIVE"/>
|
||||
</ports>
|
11
doc/source/docbkx/quantum-api-1.0/samples/ports-get-res.json
Normal file
11
doc/source/docbkx/quantum-api-1.0/samples/ports-get-res.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"ports":
|
||||
[
|
||||
{
|
||||
"id": "98017ddc-efc8-4c25-a915-774b2a633855"
|
||||
},
|
||||
{
|
||||
"id": "b832be00-6553-4f69-af33-acd554e36d08"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<ports>
|
||||
<port
|
||||
id="98017ddc-efc8-4c25-a915-774b2a633855"/>
|
||||
<port
|
||||
id="b832be00-6553-4f69-af33-acd554e36d08"/>
|
||||
</ports>
|
9
doc/source/docbkx/quantum-api-1.0/samples/private.json
Normal file
9
doc/source/docbkx/quantum-api-1.0/samples/private.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"network" {
|
||||
"id" : "private",
|
||||
"ip" : [
|
||||
{"version" : 4, "addr" : "10.176.42.16"},
|
||||
{"version" : 6, "addr" : "::babe:10.176.42.16"}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/source/docbkx/quantum-api-1.0/samples/private.xml
Normal file
6
doc/source/docbkx/quantum-api-1.0/samples/private.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
id="private">
|
||||
<ip version="4" addr="10.176.42.16"/>
|
||||
<ip version="6" addr="::babe:10.176.42.16"/>
|
||||
</network>
|
11
doc/source/docbkx/quantum-api-1.0/samples/public.json
Normal file
11
doc/source/docbkx/quantum-api-1.0/samples/public.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"network" {
|
||||
"id" : "public",
|
||||
"ip" : [
|
||||
{"version" : 4, "addr" : "67.23.10.132"},
|
||||
{"version" : 6, "addr" : "::babe:67.23.10.132"},
|
||||
{"version" : 4, "addr" : "67.23.10.131"},
|
||||
{"version" : 6, "addr" : "::babe:4317:0A83"}
|
||||
]
|
||||
}
|
||||
}
|
8
doc/source/docbkx/quantum-api-1.0/samples/public.xml
Normal file
8
doc/source/docbkx/quantum-api-1.0/samples/public.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
id="public">
|
||||
<ip version="4" addr="67.23.10.132"/>
|
||||
<ip version="6" addr="::babe:67.23.10.132"/>
|
||||
<ip version="4" addr="67.23.10.131"/>
|
||||
<ip version="6" addr="::babe:4317:0A83"/>
|
||||
</network>
|
22
doc/source/docbkx/quantum-api-1.0/samples/versions-atom.xml
Normal file
22
doc/source/docbkx/quantum-api-1.0/samples/versions-atom.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title type="text">Available API Versions</title>
|
||||
<updated>2010-12-12T18:30:02.25Z</updated>
|
||||
<id>http://servers.api.openstack.org/</id>
|
||||
<author><name>Rackspace</name><uri>http://www.rackspace.com/</uri></author>
|
||||
<link rel="self" href="http://servers.api.openstack.org/"/>
|
||||
<entry>
|
||||
<id>http://servers.api.openstack.org/v1.1/</id>
|
||||
<title type="text">Version v1.1</title>
|
||||
<updated>2010-12-12T18:30:02.25Z</updated>
|
||||
<link rel="self" href="http://servers.api.openstack.org/v1.1/"/>
|
||||
<content type="text">Version v1.1 CURRENT (2010-12-12T18:30:02.25Z)</content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>http://servers.api.openstack.org/v1.0/</id>
|
||||
<title type="text">Version v1.0</title>
|
||||
<updated>2009-10-09T11:30:00Z</updated>
|
||||
<link rel="self" href="http://servers.api.openstack.org/v1.0/"/>
|
||||
<content type="text">Version v1.0 DEPRECATED (2009-10-09T11:30:00Z)</content>
|
||||
</entry>
|
||||
</feed>
|
24
doc/source/docbkx/quantum-api-1.0/samples/versions.json
Normal file
24
doc/source/docbkx/quantum-api-1.0/samples/versions.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"status": "CURRENT",
|
||||
"id": "v1.0",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:9696/v1.0",
|
||||
"rel": "self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": "FUTURE",
|
||||
"id": "v1.1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:9696/v1.1",
|
||||
"rel": "self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
12
doc/source/docbkx/quantum-api-1.0/samples/versions.xml
Normal file
12
doc/source/docbkx/quantum-api-1.0/samples/versions.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<versions>
|
||||
<version id="v1.0" status="CURRENT">
|
||||
<links>
|
||||
<link href="http://127.0.0.1:9696/v1.0" rel="self"/>
|
||||
</links>
|
||||
</version>
|
||||
<version id="v1.1" status="FUTURE">
|
||||
<links>
|
||||
<link href="http://127.0.0.1:9696/v1.1" rel="self"/>
|
||||
</links>
|
||||
</version>
|
||||
</versions>
|
82
doc/source/docbkx/quantum-api-1.0/style/schema.css
Normal file
82
doc/source/docbkx/quantum-api-1.0/style/schema.css
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* (C) 2009 Rackspace Hosting, All Rights Reserved.
|
||||
*/
|
||||
body, div, dl, dt, dd, ul, ol, li, h2, h3,
|
||||
h4, h5, h6, pre, code, form, fieldset, legend,
|
||||
input, button, textarea, p, blockquote, th, td {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 350%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#Content {
|
||||
border: 1px solid;
|
||||
padding: 0px 40px 40px;
|
||||
margin-left: 155px;
|
||||
}
|
||||
|
||||
#SrcContent {
|
||||
padding: 0px 40px 40px;
|
||||
display: none;
|
||||
margin-left: 155px;
|
||||
}
|
||||
|
||||
#Controller {
|
||||
position: fixed;
|
||||
width: 145px;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.Sample {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.EnumValue{
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
.EnumDoc{
|
||||
padding: 10px 10px 10px 0px;
|
||||
}
|
||||
|
||||
.ExternHref{
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.ExternDoc{
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0px 0px 0px 10px;
|
||||
width: 50%;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #000090;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #000090;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user