Merge histories

This commit is contained in:
Davanum Srinivas 2017-09-21 21:41:28 -04:00
commit 37a0d84116
348 changed files with 30749 additions and 8024 deletions

7
.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = mogan
omit = mogan/tests/*
[report]
ignore_errors = True

62
.gitignore vendored Normal file
View File

@ -0,0 +1,62 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg*
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
cover/
.coverage*
!.coveragerc
.tox
nosetests.xml
.testrepository
.venv
# Translations
*.mo
# Mr Developer
.idea
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
etc/mogan/mogan.conf.sample
# Sphinx
doc/build
doc/source/_static/mogan.conf.sample
doc/source/_static/mogan.policy.yaml.sample
# pbr generates these
AUTHORS
ChangeLog
# Editors
*~
.*.swp
.*sw?
# Files created by releasenotes build
releasenotes/build

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/mogan.git

3
.mailmap Normal file
View File

@ -0,0 +1,3 @@
# Format is:
# <preferred e-mail> <other e-mail 1>
# <preferred e-mail> <other e-mail 2>

7
.testr.conf Normal file
View File

@ -0,0 +1,7 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./mogan/tests} -t . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

17
CONTRIBUTING.rst Normal file
View File

@ -0,0 +1,17 @@
If you would like to contribute to the development of OpenStack, you must
follow the steps in this page:
https://docs.openstack.org/infra/manual/developers.html
If you already have a good understanding of how the system works and your
OpenStack accounts are set up, you can skip to the development workflow
section of this documentation to learn how changes to OpenStack should be
submitted for review via the Gerrit tool:
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/mogan

4
HACKING.rst Normal file
View File

@ -0,0 +1,4 @@
Mogan Style Commandments
========================
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

176
LICENSE Normal file
View 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.

29
README.rst Normal file
View File

@ -0,0 +1,29 @@
=====
Mogan
=====
Mogan is an OpenStack project which offers bare metals as first class resources
to users, supporting variety of bare metal provisioning drivers including Ironic.
OpenStack Mogan is distributed under the terms of the Apache License, Version 2.0.
The full terms and conditions of this license are detailed in the LICENSE file.
-----------------
Project Resources
-----------------
* Free software: Apache license
* Documentation: http://mogan.readthedocs.io/en/latest/
* Source: https://git.openstack.org/cgit/openstack/mogan
* Bugs: https://bugs.launchpad.net/mogan
* Wiki: https://wiki.openstack.org/wiki/Mogan
* APIs: http://mogan.readthedocs.io/projects/api-ref/en/latest/
Project status, bugs and BPs are tracked on Launchpad:
https://launchpad.net/mogan
Anyone wishing to contribute to an OpenStack project should
find a good reference here:
https://docs.openstack.org/infra/manual/developers.html

232
api-ref/source/conf.py Normal file
View File

@ -0,0 +1,232 @@
#
# 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.
#
# mogan documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# This file is execfile()d with the current directory set to
# its 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 subprocess
import sys
import warnings
import openstackdocstheme # noqa
import os_api_ref # noqa
extensions = [
'os_api_ref',
]
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme_options = {
"sidebar_mode": "toc",
}
html_context = {'bug_project': 'mogan', 'bug_tag': 'api-ref'}
# End temporary block
# 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.
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('./'))
# -- 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.
# 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'Baremetal-Compute API Reference'
copyright = u'2010-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.
#
from mogan.version import version_info
# The full version, including alpha/beta/rc tags.
release = version_info.release_string()
# The short X.Y version.
version = version_info.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'
# The reST default role (used 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 = False
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for man page output ----------------------------------------------
# Grouping the document tree for man pages.
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
# -- 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 = []
# 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"]
try:
html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
except Exception:
warnings.warn('Cannot get last updated time from git repository. '
'Not setting "html_last_updated_fmt".')
# 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 = 'mogandoc'
# -- 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', 'Mogan.tex', u'OpenStack Baremetal-Compute API Documentation',
u'OpenStack Foundation', '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

17
api-ref/source/index.rst Normal file
View File

@ -0,0 +1,17 @@
======================
Baremetal Compute API
======================
Contents:
.. toctree::
:maxdepth: 1
v1/index
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`

View File

@ -0,0 +1,270 @@
.. -*- rst -*-
============
Aggregates
============
Creates and manages node aggregates. An aggregate assigns metadata to
groups of compute nodes. Aggregates are only visible to the cloud provider.
List Aggregates
===============
.. rest_method:: GET /aggregates
Lists all aggregates.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Response
--------
.. rest_parameters:: parameters.yaml
- aggregates: aggregates
- name: aggregate_name
- links: links
- metadata: aggregate_metadata
- uuid: aggregate_uuid
- created_at: created_at
- updated_at: updated_at
**Example List aggregates: JSON response**
.. literalinclude:: samples/aggregates/aggregates-list-resp.json
:language: javascript
Create Aggregate
================
.. rest_method:: POST /aggregates
Creates an aggregate.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- name: aggregate_name
- metadata: aggregate_metadata
**Example Create Aggregatei: JSON request**
.. literalinclude:: samples/aggregates/aggregate-create-post-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: aggregate_name
- links: links
- metadata: aggregate_metadata
- uuid: aggregate_uuid
- created_at: created_at
- updated_at: updated_at
**Example Create Aggregate: JSON response**
.. literalinclude:: samples/aggregates/aggregate-create-post-resp.json
:language: javascript
Update Aggregate
================
.. rest_method:: PATCH /aggregates/{aggregate_uuid}
Updates an aggregate.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
The BODY of the PATCH request must be a JSON PATCH document, adhering to
`RFC 6902 <https://tools.ietf.org/html/rfc6902>`_.
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
**Example Update Aggregate: JSON request**
.. literalinclude:: samples/aggregates/aggregate-update-put-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: aggregate_name
- links: links
- metadata: aggregate_metadata
- uuid: aggregate_uuid
- created_at: created_at
- updated_at: updated_at
**Example Update Aggregate: JSON response**
.. literalinclude:: samples/aggregates/aggregate-update-put-resp.json
:language: javascript
Show Aggregate Details
======================
.. rest_method:: GET /aggregates/{aggregate_uuid}
Shows details for an aggregate.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- name: aggregate_name
- links: links
- metadata: aggregate_metadata
- uuid: aggregate_uuid
- created_at: created_at
- updated_at: updated_at
**Example Show Aggregate Details**
.. literalinclude:: samples/aggregates/aggregate-get-resp.json
:language: javascript
Delete Aggregate
================
.. rest_method:: DELETE /aggregates/{aggregate_uuid}
Deletes an aggregate.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
Response
--------
No body content is returned on a successful DELETE.
List Aggregate Nodes
====================
.. rest_method:: GET /aggregates/{aggregate_uuid}/nodes
Lists nodes for the specified aggregate.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- nodes: aggregate_nodes
**Example List aggregates: JSON response**
.. literalinclude:: samples/aggregates/aggregates-list-nodes-resp.json
:language: javascript
Add Aggregate Node
==================
.. rest_method:: POST /aggregates/{aggregate_uuid}/nodes
Adds a node to an aggregate.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
- node: aggregate_node
**Example Add Aggregate Node: JSON request**
.. literalinclude:: samples/aggregates/aggregate-add-node-req.json
:language: javascript
Response
--------
If successful, this method does not return content in the response body.
Remove Aggregate Node
=====================
.. rest_method:: DELETE /aggregates/{aggregate_uuid}/nodes/{node}
Removes a node to an aggregate.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- aggregate_uuid: aggregate_uuid_path
- node: aggregate_node_path
Response
--------
If successful, this method does not return content in the response body.

View File

@ -0,0 +1,32 @@
.. -*- rst -*-
====================
Availability Zones
====================
Lists availability zones.
List Availability Zone information
==================================
.. rest_method:: GET /availability_zones
Lists availability zone information.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Response
--------
.. rest_parameters:: parameters.yaml
- availability_zones: availability_zones
|
**Example List availability zone information**
.. literalinclude:: samples/availability_zones/availability-zone-list-resp.json
:language: javascript

View File

@ -0,0 +1,98 @@
.. -*- rst -*-
================
Flavors access
================
Lists tenants who have access to a private flavor and adds private
flavor access to and removes private flavor access from tenants. By
default, only administrators can manage private flavor access. A private
flavor has ``is_public`` set to ``false`` while a public flavor has
``is_public`` set to ``true``.
List Flavor Access Information For Given Flavor
===============================================
.. rest_method:: GET /flavors/{flavor_uuid}/access
Lists flavor access information.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- flavor_access: flavor_access
**Example List Flavor Access Information For Given Flavor: JSON response**
.. literalinclude:: samples/flavor_access/flavor-access-list-resp.json
:language: javascript
Add Flavor Access To Tenant
===========================
.. rest_method:: POST /flavors/{flavor_uuid}/access
Adds flavor access to a tenant and flavor.
Specify the ``tenant_id`` in the request body.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
- tenant_id: tenant_id_body
**Example Add Flavor Access To Tenant: JSON response**
.. literalinclude:: samples/flavor_access/flavor-access-add-tenant-req.json
:language: javascript
Response
--------
If successful, this method does not return content in the response body.
Remove Flavor Access From Tenant
================================
.. rest_method:: DELETE /flavors/{flavor_uuid}/access/{tenant_id}
Removes flavor access from a tenant and flavor.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
- tenant_id: tenant_id_path
Response
--------
If successful, this method does not return content in the response body.

View File

@ -0,0 +1,215 @@
.. -*- rst -*-
=========
Flavors
=========
Show and manage server flavors.
Flavors are a way to describe the basic dimensions of a server to be
created including how much ``cpu``, ``ram``, and ``disk space`` are
allocated to a server built with this flavor.
List Flavors
============
.. rest_method:: GET /flavors
Lists all flavors accessible to your project.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Response
--------
.. rest_parameters:: parameters.yaml
- flavors: flavors
- name: flavor_name
- links: links
- description: flavor_description
- resources: flavor_resources
- resource_aggregates: flavor_aggregates
- uuid: flavor_uuid
- created_at: created_at
- updated_at: updated_at
- is_public: flavor_is_public
- disabled: flavor_disabled
**Example List flavors**
.. literalinclude:: samples/flavors/flavors-list-resp.json
:language: javascript
Create Flavor
=============
.. rest_method:: POST /flavors
Creates a flavor.
Creating a flavor is typically only available to administrators of a
cloud because this has implications for scheduling efficiently in the cloud.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- name: flavor_name
- description: flavor_description
- resources: flavor_resources
- resource_aggregates: flavor_aggregates
- is_public: flavor_is_public_not_required
- disabled: flavor_disabled
**Example Create Flavor**
.. literalinclude:: samples/flavors/flavor-create-post-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: flavor_name
- links: links
- description: flavor_description
- resources: flavor_resources
- resource_aggregates: flavor_aggregates
- uuid: flavor_uuid
- created_at: created_at
- updated_at: updated_at
- is_public: flavor_is_public
- disabled: flavor_disabled
**Example Create flavor**
.. literalinclude:: samples/flavors/flavor-create-post-resp.json
:language: javascript
Update Flavor
=============
.. rest_method:: PATCH /flavors/{flavor_uuid}
Updates a flavor.
Updating a flavor is typically only available to administrators of a
cloud because this has implications for scheduling efficiently in the cloud.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
The BODY of the PATCH request must be a JSON PATCH document, adhering to
`RFC 6902 <https://tools.ietf.org/html/rfc6902>`_.
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
**Example Update Flavor: JSON request**
.. literalinclude:: samples/flavors/flavor-update-put-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: flavor_name
- links: links
- description: flavor_description
- resources: flavor_resources
- resource_aggregates: flavor_aggregates
- uuid: flavor_uuid
- created_at: created_at
- updated_at: updated_at
- is_public: flavor_is_public
- disabled: flavor_disabled
**Example Update flavor**
.. literalinclude:: samples/flavors/flavor-update-put-resp.json
:language: javascript
Show Server Flavor Details
==========================
.. rest_method:: GET /flavors/{flavor_uuid}
Shows details for a flavor.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- name: flavor_name
- links: links
- description: flavor_description
- resources: flavor_resources
- resource_aggregates: flavor_aggregates
- uuid: flavor_uuid
- created_at: created_at
- updated_at: updated_at
- is_public: flavor_is_public
- disabled: flavor_disabled
**Example Show Flavor Details**
.. literalinclude:: samples/flavors/flavor-get-resp.json
:language: javascript
Delete Flavor
=============
.. rest_method:: DELETE /flavors/{flavor_uuid}
Deletes a flavor.
This is typically an admin only action. Deleting a flavor that is in use by
existing servers is not recommended as it can cause incorrect data to
be returned to the user under some operations.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- flavor_uuid: flavor_uuid_path
Response
--------
No body content is returned on a successful DELETE.

View File

@ -0,0 +1,19 @@
:tocdepth: 2
==================================
Baremetal Compute API V1 (CURRENT)
==================================
.. rest_expand_all::
.. include:: urls.inc
.. include:: servers.inc
.. include:: server_states.inc
.. include:: server_networks.inc
.. include:: server_remote_consoles.inc
.. include:: flavors.inc
.. include:: flavor_access.inc
.. include:: availability_zones.inc
.. include:: aggregates.inc
.. include:: server_groups.inc
.. include:: manageable_servers.inc

View File

@ -0,0 +1,155 @@
.. -*- rst -*-
=====================
Keypairs (keypairs)
=====================
Generates, imports, and deletes SSH keys.
List Keypairs
=============
.. rest_method:: GET /keypairs
Lists keypairs that are associated with the account.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- user_id: keypair_user
Response
--------
.. rest_parameters:: parameters.yaml
- created_at: created_at
- updated_at: created_at
- keypairs: keypairs
- user_id: keypair_userid_in
- name: keypair_name
- public_key: keypair_public_key
- fingerprint: keypair_fingerprint
- type: keypair_type
- links: links
**Example List Keypairs: JSON response**
.. literalinclude:: samples/keypairs/keypairs-list-resp.json
:language: javascript
Create Or Import Keypair
========================
.. rest_method:: POST /keypairs
Generates or imports a keypair.
Normal response codes: 200, 201
.. note::
The success status code was changed from 200 to 201 in version 2.2
Error response codes: badRequest(400), unauthorized(401), forbidden(403), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- name: keypair_name
- public_key: keypair_public_key_in
- type: keypair_type_in
- user_id: keypair_userid_in
**Example Create Or Import Keypair: JSON request**
.. literalinclude:: samples/keypairs/keypairs-import-post-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- created_at: created_at
- updated_at: created_at
- name: keypair_name
- public_key: keypair_public_key
- fingerprint: keypair_fingerprint
- user_id: keypair_userid
- private_key: keypair_private_key
- type: keypair_type
**Example Create Or Import Keypair: JSON response**
.. literalinclude:: samples/keypairs/keypairs-import-post-resp.json
:language: javascript
Show Keypair Details
====================
.. rest_method:: GET /keypairs/{keypair_name}
Shows details for a keypair that is associated with the account.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- keypair_name: keypair_name_path
- user_id: keypair_user
Response
--------
.. rest_parameters:: parameters.yaml
- created_at: created_at
- updated_at: created_at
- fingerprint: keypair_fingerprint
- name: keypair_name
- public_key: keypair_public_key
- user_id: keypair_userid
- type: keypair_type
**Example Show Keypair Details: JSON response**
.. literalinclude:: samples/keypairs/keypairs-get-resp.json
:language: javascript
Delete Keypair
==============
.. rest_method:: DELETE /keypairs/{keypair_name}
Deletes a keypair.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- keypair_name: keypair_name_path
- user_id: keypair_user
Response
--------
There is no body content for the response of a successful DELETE query

View File

@ -0,0 +1,98 @@
.. -*- rst -*-
===================
Manageable Servers
===================
Lists, manages manageable servers.
List manageable servers information
===================================
.. rest_method:: GET /manageable_servers
Lists manageable servers information.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Response
--------
.. rest_parameters:: parameters.yaml
- manageable_servers: manageable_servers
- uuid: manageable_servers_uuid
- name: manageable_servers_name
- resource_class: manageable_servers_resource_class
- power_state: manageable_servers_power_state
- provision_state: manageable_servers_provision_state
- ports: manageable_servers_ports
- portgroups: manageable_servers_portgroups
- image_source: manageable_servers_image_source
**Example List manageable servers information**
.. literalinclude:: samples/manageable_servers/manageable-servers-list-resp.json
:language: javascript
Manage an existing server
=========================
.. rest_method:: POST /manageable_servers
Manage a server.
Manage nodes in active which migrated by operators.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- node_uuid: manageable_servers_uuid
- metadata: metadata
**Example Manage Server: JSON request**
.. literalinclude:: samples/manageable_servers/server-manage-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- addresses: addresses
- links: links
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- launched_at: launched_at
- metadata: metadata
- affinity_zone: affinity_zone
- key_name: key_name
- node_uuid: manageable_servers_uuid
- partitions: partitions
**Example Manage Server: JSON response**
.. literalinclude:: samples/manageable_servers/server-manage-resp.json
:language: javascript

View File

@ -0,0 +1,32 @@
.. -*- rst -*-
===============
Compute Nodes
===============
Lists compute nodes.
List Compute Node information
=============================
.. rest_method:: GET /nodes
Lists compute nodes, including name.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Response
--------
.. rest_parameters:: parameters.yaml
- nodes: nodes
|
**Example List compute node information**
.. literalinclude:: samples/nodes/node-list-resp.json
:language: javascript

View File

@ -0,0 +1,741 @@
# variables in header
openstack-request-id:
description: >
A unique ID for tracking the request. The request ID associated with the request
appears in the log lines for that request. By default, the middleware configuration
ensures that the request ID appears in the log files.
in: header
required: true
type: string
# variables in path
address_path:
description: |
The floating IP address.
in: path
required: true
type: string
aggregate_node_path:
description: |
The name of the node.
in: path
required: true
type: string
aggregate_uuid_path:
description: |
The UUID of the aggregate.
in: path
required: true
type: string
api_version:
in: path
required: true
type: string
description: >
The API version as returned in the links from the ``GET /`` call.
flavor_uuid_path:
description: |
The UUID of the flavor.
in: path
required: true
type: string
port_ident:
description: |
The UUID of a network port.
in: path
required: true
type: string
server_group_uuid_path:
description: |
The UUID of the server group.
in: path
required: true
type: string
server_ident:
description: |
The UUID of the server.
in: path
required: true
type: string
spec_key_path:
description: |
The key of the extra spec.
in: path
required: true
type: string
tenant_id_path:
description: |
The UUID of the tenant in a multi-tenancy cloud.
in: path
required: true
type: string
# variables in query
all_tenants:
description: |
Specify the ``all_tenants=1`` query parameter to list all servers
for all projects. By default this is only allowed by admin users.
in: query
required: false
type: integer
fields:
description: |
One or more fields to be returned in the response.
For example, the following request returns only the ``uuid``
and ``name`` fields for each server:
::
GET /v1/servers?fields=uuid,name
in: query
required: false
type: array
fixed_ip_query:
description: |
Filters the server list result by fixed ip. Users can filter by prefix of ip address.
in: query
required: false
type: string
flavor_name_query:
description: |
Filters the server list by flavor's name.
in: query
required: false
type: string
flavor_query:
description: |
Filters the server list by flavor's UUID.
in: query
required: false
type: string
group_all_tenants:
description: |
Specify the ``all_tenants=1`` query parameter to list server groups
for all projects. By default this is only allowed by admin users.
in: query
required: false
type: integer
image_query:
description: |
Filters the server list by image's UUID.
in: query
required: false
type: string
server_name_query:
description: |
Filters the server list by name. Users can filter by prefix of server's name.
in: query
required: false
type: string
status_query:
description: |
Filters the server list by the server's status.
in: query
required: false
type: string
user_id:
description: |
Filters the response by a user, by ID.
in: query
required: false
type: string
# variables in body
address:
description: |
The floating IP address.
in: body
required: true
type: string
addresses:
description: |
The addresses for the server.
in: body
required: true
type: object
affinity_zone:
description: |
The affinity zone which the server belongs to.
in: body
required: false
type: string
aggregate_metadata:
description: |
Metadata key and value pairs associate with the aggregate.
in: body
required: true
type: object
aggregate_name:
description: |
The name of the node aggregate.
in: body
required: true
type: string
aggregate_node:
description: |
The name of the node.
in: body
required: true
type: string
aggregate_nodes:
description: |
An array of node information.
in: body
required: true
type: array
aggregate_uuid:
description: |
The UUID of the node aggregate.
in: body
required: true
type: string
aggregates:
description: |
The list of existing aggregates.
in: body
required: true
type: array
availability_zone:
description: |
The availability zone from which to launch the server. When you provision resources,
you specify from which availability zone you want your server to be built. Typically,
you use availability zones to arrange bare metal nodes into logical groups.
An availability zone provides a form of physical isolation and redundancy from
other availability zones. For server, if some racks in your data center are
on a separate power source, you can put servers in those racks in their own availability
zone. Availability zones can also help separate different classes of hardware. By
segregating resources into availability zones, you can ensure that your application
resources are spread across disparate machines to achieve high availability in
the event of hardware or other failure.
in: body
required: false
type: string
availability_zones:
description: |
An array of availability zone name.
in: body
required: true
type: array
console_info:
description: |
The remote console object.
in: body
required: true
type: object
console_url:
description: |
The URL is used to connect the console.
in: body
required: true
type: string
created_at:
description: |
The date and time when the resource was created. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
fixed_address:
description: |
The fixed IP address with which you want to associate the floating IP address.
in: body
required: false
type: string
flavor_access:
description: |
A list of tenants.
in: body
required: true
type: array
flavor_aggregates:
description: |
A dict of key and value pairs associate with the flavor including the resources
aggregate metadata.
in: body
required: true
type: object
flavor_description:
description: |
The description of the flavor.
in: body
required: true
type: string
flavor_disabled:
description: |
Whether or not the flavor has been administratively disabled.
in: body
required: false
type: boolean
flavor_is_public:
description: |
Whether the flavor is public (available to all projects) or scoped
to a set of projects. Default is True if not specified.
in: body
required: true
type: boolean
flavor_is_public_not_required:
description: |
Whether the flavor is public (available to all projects) or scoped
to a set of projects. Default is True if not specified.
in: body
required: false
type: boolean
flavor_name:
description: |
The name of the flavor.
in: body
required: true
type: string
flavor_resources:
description: |
A dict of key and value pairs associate with the flavor including the resource
name and the quantity.
in: body
required: true
type: object
flavor_uuid:
description: |
The UUID of the flavor.
in: body
required: true
type: string
flavorRef:
description: |
The flavor reference, as a UUID for the flavor for your server server.
in: body
required: true
type: string
flavors:
description: |
An array of flavor objects.
in: body
required: true
type: array
image_ident:
description: |
The UUID of the image to apply to rebuild your server.
in: body
required: false
type: string
imageRef:
description: |
The UUID of the image to use for your server.
in: body
required: true
type: string
key_name:
description: |
Key pair name.
in: body
required: false
type: string
keypair_fingerprint:
in: body
required: true
type: string
description: |
The fingerprint for the keypair.
keypair_name:
in: body
required: true
type: string
description: |
A name for the keypair which will be used to reference it later.
keypair_private_key:
description: |
If you do not provide a public key on create, a new keypair will
be built for you, and the private key will be returned during the
initial create call. Make sure to save this, as there is no way to
get this private key again in the future.
in: body
required: false
type: string
keypair_public_key:
description: |
The keypair public key.
in: body
required: true
type: string
keypair_public_key_in:
description: |
The public ssh key to import. If you omit this value, a keypair is
generated for you.
in: body
required: false
type: string
keypair_type:
in: body
required: true
type: string
description: |
The type of the keypair. Allowed values are ``ssh`` or ``x509``.
keypair_type_in:
in: body
required: false
type: string
description: |
The type of the keypair. Allowed values are ``ssh`` or ``x509``.
keypair_userid:
in: body
required: true
type: string
description: |
The user_id for a keypair.
keypair_userid_in:
in: body
required: false
type: string
description: |
The user_id for a keypair. This allows administrative users to
upload keys for other users than themselves.
keypairs:
in: body
type: array
required: true
description: |
Array of Keypair objects
launched_at:
description: |
The date and time when the server was launched. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
links:
description: |
A list of relative links. Includes the self and bookmark links.
in: body
required: true
type: array
lock_state:
description: |
The lock state of a server.
in: body
required: true
type: boolean
manageable_servers:
description: |
An array of manageable servers information.
in: body
required: true
type: array
manageable_servers_image_source:
description: |
Image source uuid of manageable server.
in: body
required: true
type: string
manageable_servers_name:
description: |
Name of manageable server.
in: body
required: true
type: string
manageable_servers_portgroups:
description: |
The portgroups of manageable server.
in: body
required: true
type: array
manageable_servers_ports:
description: |
The ports of manageable server.
in: body
required: true
type: array
manageable_servers_power_state:
description: |
The power state of manageable server.
in: body
required: true
type: string
manageable_servers_provision_state:
description: |
The provision state of manageable server.
in: body
required: true
type: string
manageable_servers_resource_class:
description: |
Resource class of manageable server.
in: body
required: true
type: string
manageable_servers_uuid:
description: |
UUID of manageable server.
in: body
required: true
type: string
max_count_body:
description: |
The max number of servers to be created. Defaults to the value of ``min_count``.
in: body
required: false
type: integer
metadata:
description: |
Metadata key and value pairs. The maximum size of the metadata key and value is
255 bytes each.
in: body
required: false
type: object
min_count_body:
description: |
The min number of servers to be created. Defaults to 1.
in: body
required: false
type: integer
multi_server_name_body:
description: |
A base name for creating unique names during multiple create. A unique
string will be appended to the end of this base name for every instacne
created.
in: body
required: true
type: string
network_uuid:
description: |
To provision the server with a NIC for a network, specify the UUID of
the network with the ``net_id`` key in a dict in ``networks`` list.
in: body
required: false
type: string
networks:
description: |
A list of networks of the tenant. Optionally, you can create one or more NICs on the server.
To provision the server with a NIC for a network, specify the UUID of the network
with the ``net_id`` key in a dict in ``networks`` list. To provision the server with a
specified type of NIC, specify the port-type key in a dict in a ``networks`` list.
To provision the server with a NIC for an already existing port, specify the port_id in
a ``networks`` list. Now net_id and port_id are exclusive, so you should use only one of
them at one time.
in: body
required: true
type: array
nics:
description: |
The port info in the requested network for the server, with fixed_ip, mac_address, and
network uuid
in: body
required: true
type: object
node:
description: |
The node which our server associated with. Only visible for admin users.
in: body
required: false
type: string
nodes:
description: |
The compute node name list.
in: body
required: true
type: object
partitions:
description: |
The partitions info for root disk, this is only allowed when using partition images
with root_gb(required), ephemeral_gb, and swap_mb.
in: body
required: false
type: object
personality:
description: |
The file path and contents, text only, to inject into the server at launch. The
maximum size of the file path data is 255 bytes. The maximum limit is the number
of allowed bytes in the decoded, rather than encoded, data.
in: body
required: false
type: string
port_uuid:
description: |
To provision the server with a NIC for an already existing port,
specify the port_id in a ``networks`` list.
in: body
required: false
type: string
power_state_target:
description: |
This field represents the requested state either "on", "off", "soft_off",
"reboot", or "soft_reboot".
in: body
required: true
type: string
preserve_ephemeral:
description: |
Indicates whether the server is rebuilt with the preservation of the ephemeral
partition (``true``).
in: body
required: false
type: boolean
project_id_body:
description: |
The UUID of the project in a multi-tenancy cloud.
in: body
required: true
type: string
provision_state:
description: |
One of the provisioning verbs, currently only support rebuild.
in: body
required: true
type: string
remote_console_protocol:
description: |
The protocol of remote console. The valid value is ``serial`` now.
in: body
required: true
type: string
remote_console_type:
description: |
The type of remote console. The valid values are ``socat``, and
``shellinabox``.
in: body
required: true
type: string
remote_console_url:
description: |
The URL is used to connect the console.
in: body
required: true
type: string
scheduler_hints:
description: |
The dictionary of data send to the scheduler, it represents scheduling
options will be passed to scheduler.
in: body
required: false
type: object
server:
description: |
The dictionary of data represent a server creation request.
in: body
required: true
type: object
server_description:
description: |
A free form description of the server. Limited to 255 characters
in length.
in: body
required: false
type: string
server_fault:
description: |
A fault object. Only displayed in the failed response.
Default keys are ``code``, ``message``, and ``detail``
(response code, message, and detail respectively).
in: body
required: false
type: object
server_group_members:
description: |
A list of uuids of servers which belong to this server group.
in: body
required: false
type: array
server_group_name:
description: |
The server group name.
in: body
required: true
type: string
server_group_policies:
description: |
A list of exactly one policy name to associate with the server group. The
current valid policy names are:
- ``anti-affinity`` - servers in this group must be scheduled to
different affinity-zones.
- ``affinity`` - servers in this group must be scheduled to the same
affinity-zone.
in: body
required: true
type: array
server_group_uuid:
description: |
The UUID of the server group.
in: body
required: true
type: string
server_groups:
description: |
The list of existing server groups.
in: body
required: true
type: array
server_name:
description: |
The server name.
in: body
required: true
type: string
server_power_state:
description: |
The current power state of this server. Usually, “power on” or “power off”, but may be “None”
if Mogan is unable to determine the power state (eg, due to hardware failure)
in: body
required: true
type: string
server_status:
description: |
The status of this server. Usually, "building", "active", "error", or "None".
in: body
required: true
type: string
server_uuid:
description: |
The UUID of the server
in: body
required: true
type: string
tenant_id_body:
description: |
The UUID of the tenant in a multi-tenancy cloud.
in: body
required: true
type: string
updated_at:
description: |
The date and time when the resource was updated. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
user_data:
description: |
Configuration information or scripts to use upon launch. Must be Base64 encoded.
in: body
required: false
type: string
user_id_body:
description: |
The user ID of the user who owns the server.
in: body
required: true
type: string

View File

@ -0,0 +1,3 @@
{
"node": "fake_node"
}

View File

@ -0,0 +1,6 @@
{
"name": "test_aggregate",
"metadata": {
"k1": "v1"
}
}

View File

@ -0,0 +1,19 @@
{
"name": "test_aggregate",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"links": [
{
"href": "http://10.3.150.17:6688/v1/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"metadata": {
"k1": "v1"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"updated_at": null
}

View File

@ -0,0 +1,19 @@
{
"name": "test_aggregate",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"links": [
{
"href": "http://10.3.150.17:6688/v1/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"metadata": {
"k1": "v1"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"updated_at": null
}

View File

@ -0,0 +1,12 @@
[
{
"op": "replace",
"path": "/metadata/k1",
"value": "v2"
},
{
"op": "add",
"path": "/metadata/k2",
"value": "v2"
}
]

View File

@ -0,0 +1,20 @@
{
"name": "test_aggregate",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"links": [
{
"href": "http://10.3.150.17:6688/v1/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"metadata": {
"k1": "v2",
"k2": "v2"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"updated_at": null
}

View File

@ -0,0 +1,7 @@
{
"nodes": [
"node1",
"node2",
"node3"
]
}

View File

@ -0,0 +1,42 @@
{
"aggregates": [
{
"name": "test_aggregate1",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"links": [
{
"href": "http://10.3.150.17:6688/v1/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"metadata": {
"k1": "v1"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"updated_at": null
},
{
"name": "test_aggregate2",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"links": [
{
"href": "http://10.3.150.17:6688/v1/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/aggregates/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"metadata": {
"k2": "v2"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"updated_at": null
}
]
}

View File

@ -0,0 +1,7 @@
{
"availability_zones": [
"az1",
"az2",
"az3"
]
}

View File

@ -0,0 +1,3 @@
{
"tenant_id": "fake_tenant"
}

View File

@ -0,0 +1,7 @@
{
"flavor_access": [
"tenant1",
"tenant2",
"tenant3"
]
}

View File

@ -0,0 +1,12 @@
{
"name": "test_flavor",
"description": "this is a test flavor",
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"is_public": true,
"disabled": true
}

View File

@ -0,0 +1,25 @@
{
"description": "this is a test flavor",
"links": [
{
"href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"updated_at": null,
"is_public": true,
"disabled": true,
"name": "test_flavor"
}

View File

@ -0,0 +1,25 @@
{
"description": "this is a test flavor",
"links": [
{
"href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"updated_at": null,
"is_public": true,
"disabled": false,
"name": "test_flavor"
}

View File

@ -0,0 +1,12 @@
[
{
"op": "replace",
"path": "/name",
"value": "updated_flavor"
},
{
"op": "replace",
"path": "/is_public",
"value": false
}
]

View File

@ -0,0 +1,25 @@
{
"description": "this is a flavor to be updated",
"links": [
{
"href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"created_at": "2016-09-27T02:37:21.966342+00:00",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"updated_at": null,
"is_public": false,
"disabled": false,
"name": "updated_flavor"
}

View File

@ -0,0 +1,54 @@
{
"flavors": [
{
"description": "this is a test flavor1",
"links": [
{
"href": "http://10.3.150.17:6688/v1/flavors/2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/flavors/2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
"rel": "bookmark"
}
],
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"created_at": "2016-09-22T03:21:57+00:00",
"uuid": "2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
"updated_at": null,
"is_public": true,
"disabled": false,
"name": "new_test1"
},
{
"description": "this is a test flavor2",
"links": [
{
"href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"resources": {
"CUSTOM_BAREMETAL_GOLD": 1
},
"resource_aggregates": {
"high_mem": "true"
},
"created_at": "2016-09-27T02:37:21+00:00",
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"updated_at": null,
"is_public": true,
"disabled": false,
"name": "new_test2"
}
]
}

View File

@ -0,0 +1,19 @@
{
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCw10TR9arvKrQlleazdUe46FBDaixQa6DArb177nYzKTr/dLnHZo1xjLu9bHNgv8dBSs4fgnMbY1+qugCIfvq7DRnKH4jMGP6g+vf+xELa8BnA/wo+rY4Ei1IOoSOCo0pTMbMh0IZTv4a4GBCWsYBab97xGEytSaH4ysoWdayiOCuYsH7KVWvSZyZgV6SWbprYEJS4mFl7ZH6Yd4zSKMMR11xqYwcuRHf/+0kJV1cFci6mBSMLWha2UO7WS5hwOkSuiveQbGbbemQr1HRwF2xCupp3fB/3RSOjY9tXyODeHdKfWzOxL9T5KWuCuT3n7y5Dsweigya1gMNuo9X1ecXh Generated-by-Mogan",
"user_id": "4c1ea1d7a518420ca5fba507fdb38067",
"name": "test3",
"links": [
{
"href": "http://10.229.40.107:6688/v1/keypairs/test3",
"rel": "self"
},
{
"href": "http://10.229.40.107:6688/keypairs/test3",
"rel": "bookmark"
}
],
"created_at": "2017-04-18T09:02:06+00:00",
"updated_at": null,
"fingerprint": "00:61:8b:1d:18:c6:73:8d:d0:02:75:8b:8e:b7:f7:ae",
"type": "ssh"
}

View File

@ -0,0 +1,4 @@
{
"name": "keypair-d20a3d59-9433-4b79-8726-20b431d89c78",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated-by-Nova"
}

View File

@ -0,0 +1,19 @@
{
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated-by-Nova",
"user_id": "4c1ea1d7a518420ca5fba507fdb38067",
"name": "keypair-test",
"links": [
{
"href": "http://10.229.40.107:6688/v1/keypairs/keypair-test",
"rel": "self"
},
{
"href": "http://10.229.40.107:6688/keypairs/keypair-test",
"rel": "bookmark"
}
],
"created_at": "2017-04-18T09:16:18.182631+00:00",
"updated_at": null,
"fingerprint": "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c",
"type": "ssh"
}

View File

@ -0,0 +1,23 @@
{
"keypairs": [
{
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCw10TR9arvKrQlleazdUe46FBDaixQa6DArb177nYzKTr/dLnHZo1xjLu9bHNgv8dBSs4fgnMbY1+qugCIfvq7DRnKH4jMGP6g+vf+xELa8BnA/wo+rY4Ei1IOoSOCo0pTMbMh0IZTv4a4GBCWsYBab97xGEytSaH4ysoWdayiOCuYsH7KVWvSZyZgV6SWbprYEJS4mFl7ZH6Yd4zSKMMR11xqYwcuRHf/+0kJV1cFci6mBSMLWha2UO7WS5hwOkSuiveQbGbbemQr1HRwF2xCupp3fB/3RSOjY9tXyODeHdKfWzOxL9T5KWuCuT3n7y5Dsweigya1gMNuo9X1ecXh Generated-by-Mogan",
"user_id": "4c1ea1d7a518420ca5fba507fdb38067",
"name": "test3",
"links": [
{
"href": "http://10.229.40.107:6688/v1/keypairs/test3",
"rel": "self"
},
{
"href": "http://10.229.40.107:6688/keypairs/test3",
"rel": "bookmark"
}
],
"created_at": "2017-04-18T09:02:06+00:00",
"updated_at": null,
"fingerprint": "00:61:8b:1d:18:c6:73:8d:d0:02:75:8b:8e:b7:f7:ae",
"type": "ssh"
}
]
}

View File

@ -0,0 +1,5 @@
{
"user_id": "15e4229548a64fa9b1ccb67423144252",
"type": "ssh",
"name": "test2"
}

View File

@ -0,0 +1,20 @@
{
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyCfP9RwNBG6BFvl8sWLRNRAC6QtTmYKflE7XPVAJZxceiouZ+5QbuDa8RPBorzfnlytAgwM/g9KyNvzX5NmH40cwP9h4uKoXZke3dK7UxCDv/ab+1UpONgbGOBN23gj6JRtlOCl7iRxSpgmKxiirbxKkpwFO1MI1dXYE7FHmrHsxy6FA4rKgM+U2aY8tPf80MHkMhO7P9nHf1YjLaHuRHmehKQgIAMUbb527PXW7JE3Q9qPjl5L4fpuP/dtx/hqfj3tEnQHY/8dyDtWLmi1U+7E7D8kbMh0PoMFfKUpwJ1e43MvvnOLuvIz8tTpOnN17pVpM1Yg5a7604Yb8LyOo/ Generated-by-Mogan",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA8gnz/UcDQRugRb5fLFi0TUQAukLU5mCn5RO1z1QCWcXHoqLm\nfuUG7g2vETwaK8355crQIMDP4PSsjb81+TZh+NHMD/YeLiqF2ZHt3Su1MQg7/2m/\ntVKTjYGxjgTdt4I+iUbZTgpe4kcUqYJisYoq28SpKcBTtTCNXV2BOxR5qx7McuhQ\nOKyoDPlNmmPLT3/NDB5DITuz/Zx39WIy2h7kR5noSkICADFG2+duz11uyRN0Paj4\n5eS+H6bj/3bcf4an497RJ0B2P/Hcg7Vi5otVPuxOw/JGzIdD6DBXylKcCdXuNzL7\n5zi7ryM/LU6Tpzde6VaTNWIOWu+tOGG/C8jqPwIDAQABAoIBAEgZEucFekCwvANK\nfAs3uS2y7gyNz+F4NUsVnfjOa4zWT2tw3vw5uOC8jsOxhZI63w/GZEz9Ym7+M1Bd\n/vPncTOvOvweMktKO2jeAV76oBSlAUpJ8+NNX8qtMXi+llUNpRc7VYvbpvv8dHkx\n77g3EiE46bMYKVc1yUZgjhhNNxjzlVyt3Hq5mo+LfrXKLxsr0WwH3pPivmEQ6USw\neyRGuqDQGdl4KbNg7UyeBMyKJ/YXwk1zzeAc/WSek/tRfEhrxnPwU/2fOKQl6pSS\nPE2XfNCCCH/yh6Wr8w/GO3Ob0S7i4zwQfptC+xfQJ/7P49OwtlHefGNwnpg04RWd\nWex8zEECgYEA/W9ek9IQ3HqA43UdXdebkEqzPEPcO+YLDjjHUzghyk/Hprao7W+M\nVvQMQ1PlUMMqeWayOQw5yQDETc94LTj6LV7enDkHmaAY+IHYXe+ScsLP+G23Hkw9\nn2IrxZI6zI+28+CmrAaCh+e3jLMrfEQbi3yOSxydHC2YZ7b53O7NXXECgYEA9H0O\nnK9VnyD8dpzbkVrmF3aGCE937201OKvtkaaHEaJJPRI4jN+a4iSAYVhJWSlLMbC5\nSFXyAy7vsTPUuhvFpEAKThUt5ULkXlKhmqtxE6+2xhbuqO5kpYzLK7oOdpyA4YqP\nNuMGbOq0ovAoxjHE24wxBzZrK9AV0ZOTRLppqq8CgYB50OdH7CfYojWDn05vRexr\nTcybQg8A55EW0+nTMV7kjLZthszp2708KnAeiJvn1vd6hQdTbnH0EJ9Ku1eLfSCb\nYEdmFe92Q0LdaCQk+ruM1+D5C1uCf6j7DEf33lLO8qFA1hGnDDX/tzw9r/1N7LrE\nsCkBJ47I9Y2VBJlTPaGOsQKBgQCAIvsBi7NoTzWCRPue1vE44tmkiWHmjmoSZamB\naLHpwBB6fY495wOZ+l9+pXLr1ASg6mpxSvooSPU+/ldDo0KWrym3esovGjvuY4hn\nM+tz0egNMf+rciY1zfC93imuaJ/zlVcyARJhCzHZI9164qK2HmejzBWnRMvqp1nL\n75dp6QKBgAmDdeINSwAOCGgB/byq8V4IcOrKxPLQUcwb5VcwQRH1CsyHAOmQv4I1\nv6gw5S7FeorVBwtyj+en6O98P27TCQUv6JxDD0c5Eh6KBjWzLNAxk7hwsHVCNT0k\nDhQ6pYuF8E7jaiHsk6aIcu1ADxIpCoPNqkmhLuL86XMAEuh07jV3\n-----END RSA PRIVATE KEY-----\n",
"user_id": "4c1ea1d7a518420ca5fba507fdb38067",
"name": "test16",
"links": [
{
"href": "http://10.229.40.107:6688/v1/keypairs/test16",
"rel": "self"
},
{
"href": "http://10.229.40.107:6688/keypairs/test16",
"rel": "bookmark"
}
],
"created_at": "2017-04-19T03:01:34.398162+00:00",
"updated_at": null,
"fingerprint": "ab:11:7d:ef:6f:26:76:49:5c:cc:e9:be:6a:55:68:b3",
"type": "ssh"
}

View File

@ -0,0 +1,26 @@
{
"manageable_servers": [
{
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"name": "test_node",
"resource_class": "gold",
"power_state": "power on",
"provision_state": "active",
"ports": [
{
"address": "a4:dc:be:0e:82:a5",
"uuid": "1ec01153-685a-49b5-a6d3-45a4e7dddf53",
"neutron_port_id": "a9b94592-1d8e-46bb-836b-c7ba935b0136"
}
],
"portgroups": [
{
"address": "a4:dc:be:0e:82:a6",
"uuid": "1ec01153-685a-49b5-a6d3-45a4e7dddf54",
"neutron_port_id": "a9b94592-1d8e-46bb-836b-c7ba935b0137"
}
],
"image_source": "03239419-e588-42b6-a70f-94f23ed0c9e2"
}
]
}

View File

@ -0,0 +1,8 @@
{
"name": "test_manageable_server",
"description": "This is a manageable server",
"metadata": {
"My Server Name": "Apache1"
},
"node_uuid": "aacdbd78-d670-409e-95aa-ecfcfb94fee2"
}

View File

@ -0,0 +1,33 @@
{
"name": "test_manageable_server",
"description": "This is a manageable server",
"flavor_uuid": null,
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": null,
"status": "active",
"power_state": "on",
"links": [
{
"href": "http://10.3.150.17:6688/v1/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"created_at": "2016-09-27T02:37:21.966342+00:00",
"launched_at": "2016-09-27T02:39:21.966342+00:00",
"updated_at": null,
"affinity_zone": null,
"project_id": "2f15c3524826465a9afbd150478b3b76",
"user_id": "a6205fcab03d4a289251f420456b1289",
"addresses": [],
"metadata": {
"My Server Name": "Apache1"
},
"key_name": null,
"node_uuid": "aacdbd78-d670-409e-95aa-ecfcfb94fee2",
"partitions": null
}

View File

@ -0,0 +1,7 @@
{
"nodes": [
"node-0",
"node-1",
"node-2"
]
}

View File

@ -0,0 +1,4 @@
{
"protocol": "serial",
"type": "shellinabox"
}

View File

@ -0,0 +1,5 @@
{
"protocol": "serial",
"type": "shellinabox",
"url": "http://127.0.0.1:8866/?token=b4f5cb4a-8b01-40ea-ae46-67f0db4969b3"
}

View File

@ -0,0 +1,22 @@
{
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"links": [
{
"href": "http://10.229.40.107/v1/server_groups/73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"rel": "self"
},
{
"href": "http://10.229.40.107/server_groups/73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"rel": "bookmark"
}
],
"created_at": "2017-08-02T09:18:24+00:00",
"updated_at": null,
"members": [],
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"policies": [
"anti-affinity"
],
"name": "test"
}

View File

@ -0,0 +1,48 @@
{
"server_groups": [
{
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"links": [
{
"href": "http://10.229.40.107/v1/server_groups/73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"rel": "self"
},
{
"href": "http://10.229.40.107/server_groups/73f9f8be-2e4e-4de8-b3f9-e1bf6618c1b1",
"rel": "bookmark"
}
],
"created_at": "2017-08-02T09:18:24+00:00",
"updated_at": null,
"members": [],
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"policies": [
"anti-affinity"
],
"name": "test"
},
{
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "fd2dab04-ab3e-4893-9ee4-837cc0ea2d9c",
"links": [
{
"href": "http://10.229.40.107/v1/server_groups/fd2dab04-ab3e-4893-9ee4-837cc0ea2d9c",
"rel": "self"
},
{
"href": "http://10.229.40.107/server_groups/fd2dab04-ab3e-4893-9ee4-837cc0ea2d9c",
"rel": "bookmark"
}
],
"created_at": "2017-08-02T09:20:24+00:00",
"updated_at": null,
"members": [],
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"policies": [
"affinity"
],
"name": "test2"
}
]
}

View File

@ -0,0 +1,7 @@
{
"name": "test",
"policies": [
"anti-affinity"
]
}

View File

@ -0,0 +1,22 @@
{
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "159628a2-2f07-42cf-aebf-83bb5eb0ff3c",
"links": [
{
"href": "http://10.229.40.107/v1/server_groups/159628a2-2f07-42cf-aebf-83bb5eb0ff3c",
"rel": "self"
},
{
"href": "http://10.229.40.107/server_groups/159628a2-2f07-42cf-aebf-83bb5eb0ff3c",
"rel": "bookmark"
}
],
"created_at": "2017-08-02T09:15:36+00:00",
"updated_at": null,
"members": [],
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"policies": [
"anti-affinity"
],
"name": "test"
}

View File

@ -0,0 +1,4 @@
{
"address": "172.24.4.10",
"fixed_address": "11.0.0.5"
}

View File

@ -0,0 +1,3 @@
{
"port_id": "6cefb080-77bb-4bf9-8695-c10401e86c05"
}

View File

@ -0,0 +1,20 @@
{
"nics": [
{
"network_id": "f31af5a2-f14d-4007-b2e5-abeb82429b87",
"port_id": "99845c22-6268-46c1-b068-1dbcb8adaf68",
"floating_ip": null,
"mac_address": "52:54:00:cc:ed:87",
"fixed_ips": [
{
"subnet_id": "5a324b29-9aca-43d8-a6c3-31986dda95b5",
"ip_address": "11.0.0.6"
},
{
"subnet_id": "9baceab1-40ec-4c53-ad83-530a625bddb1",
"ip_address": "fdaa:67c7:e09e:0:5054:ff:fecc:ed87"
}
]
}
]
}

View File

@ -0,0 +1,3 @@
{
"target": true
}

View File

@ -0,0 +1,5 @@
{
"target": "rebuild",
"image_uuid": "9145be5b-38d0-4a05-8dd6-837a8ec15281",
"preserve_ephemeral": true
}

View File

@ -0,0 +1,3 @@
{
"target": "off"
}

View File

@ -0,0 +1,3 @@
{
"target": false
}

View File

@ -0,0 +1,16 @@
{
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"networks": [
{
"net_id": "c1940655-8b8e-4370-b8f9-03ba1daeca31"
},
{
"net_id": "8e8ceb07-4641-4188-9b22-840755e92ee2"
}
],
"min_count": 2,
"max_count": 3
}

View File

@ -0,0 +1,36 @@
{
"server": {
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": "mogan",
"networks": [
{
"net_id": "c1940655-8b8e-4370-b8f9-03ba1daeca31"
},
{
"net_id": "8e8ceb07-4641-4188-9b22-840755e92ee2"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"personality": [
{
"path": "/etc/banner.txt",
"contents": "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
}
],
"user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"key_name": "test_key"
},
"scheduler_hints": {
"group": "group1"
}
}

View File

@ -0,0 +1,36 @@
{
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": "Beijing-01",
"status": "active",
"power_state": "on",
"links": [
{
"href": "http://10.3.150.17:6688/v1/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"locked": false,
"created_at": "2016-09-27T02:37:21.966342+00:00",
"launched_at": "2016-09-27T02:39:21.966342+00:00",
"updated_at": null,
"affinity_zone": null,
"project_id": "2f15c3524826465a9afbd150478b3b76",
"user_id": "a6205fcab03d4a289251f420456b1289",
"addresses": {},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"metadata": {
"My Server Name": "Apache1"
}
}

View File

@ -0,0 +1,31 @@
{
"availability_zone": null,
"created_at": "2016-10-17T04:12:41+00:00",
"description": "this is a test server",
"image_uuid": "ac3b2291-b9ef-45f6-8eeb-21ac568a64a5",
"server_type_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"name": "test_server",
"addresses": {},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"power_state": "power on",
"project_id": "c18e8a1a870d4c08a0b51ced6e0b6459",
"status": "error",
"locked": false,
"fault": {
"code": 500,
"message": "fault message",
"detail": "fault detail"
},
"launched_at": null,
"affinity_zone": null,
"updated_at": "2016-10-17T04:12:44+00:00",
"user_id": "cdbf77d47f1d4d04ad9b7ff62b672467",
"uuid": "f978ef48-d4af-4dad-beec-e6174309bc71",
"metadata": {
"My Server Name": "Apache1"
}
}

View File

@ -0,0 +1,43 @@
{
"availability_zone": null,
"created_at": "2016-10-17T04:12:41+00:00",
"description": "this is a test server",
"image_uuid": "ac3b2291-b9ef-45f6-8eeb-21ac568a64a5",
"flavor_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"links": [
{
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_server",
"addresses": {
"bcaebdc4-da29-46c2-8f85-ac22ecacec3c": [
{
"type": "fixed",
"addr": "192.168.0.3"
}
]
},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"power_state": "power on",
"locked": false,
"project_id": "c18e8a1a870d4c08a0b51ced6e0b6459",
"status": "building",
"launched_at": null,
"affinity_zone": null,
"updated_at": "2016-10-17T04:12:44+00:00",
"user_id": "cdbf77d47f1d4d04ad9b7ff62b672467",
"uuid": "f978ef48-d4af-4dad-beec-e6174309bc71",
"metadata": {
"My Server Name": "Apache1"
}
}

View File

@ -0,0 +1,47 @@
{
"servers": [
{
"availability_zone": null,
"created_at": "2016-10-17T04:12:41+00:00",
"description": "this is a test server",
"image_uuid": "ac3b2291-b9ef-45f6-8eeb-21ac568a64a5",
"flavor_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"links": [
{
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_server",
"addresses": {
"bcaebdc4-da29-46c2-8f85-ac22ecacec3c": [
{
"type": "fixed",
"addr": "192.168.0.3"
}
]
},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"power_state": "power on",
"locked": false,
"project_id": "c18e8a1a870d4c08a0b51ced6e0b6459",
"status": "building",
"updated_at": "2016-10-17T04:12:44+00:00",
"launched_at": null,
"affinity_zone": null,
"user_id": "cdbf77d47f1d4d04ad9b7ff62b672467",
"uuid": "f978ef48-d4af-4dad-beec-e6174309bc71",
"metadata": {
"My Server Name": "Apache1"
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"servers": [
{
"description": "this is a test server",
"links": [
{
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_server",
"status": "building",
"power_state": "power on",
"uuid": "f978ef48-d4af-4dad-beec-e6174309bc71"
}
]
}

View File

@ -0,0 +1,12 @@
[
{
"op": "replace",
"path": "/metadata/k1",
"value": "v1"
},
{
"op": "add",
"path": "/metadata/k2",
"value": "v2"
}
]

View File

@ -0,0 +1,44 @@
{
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": "Beijing-01",
"status": "active",
"power_state": "on",
"links": [
{
"href": "http://10.3.150.17:6688/v1/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],
"uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"locked": false,
"created_at": "2016-09-27T02:37:21.966342+00:00",
"launched_at": "2016-09-27T02:39:21.966342+00:00",
"updated_at": null,
"affinity_zone": null,
"project_id": "2f15c3524826465a9afbd150478b3b76",
"user_id": "a6205fcab03d4a289251f420456b1289",
"addresses": {
"bcaebdc4-da29-46c2-8f85-ac22ecacec3c": [
{
"type": "fixed",
"addr": "192.168.0.3"
}
]
},
"partitions": {
"root_gb": 100,
"ephemeral_gb": 400,
"swap_mb": 40960
},
"metadata": {
"k1": "v1",
"k2": "v2"
}
}

View File

@ -0,0 +1,154 @@
.. -*- rst -*-
=============
ServerGroups
=============
Lists, creates, shows and deletes server groups.
List ServerGroups
=================
.. rest_method:: GET /server_groups
Lists server groups.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- all_tenants: group_all_tenants
Response
--------
.. rest_parameters:: parameters.yaml
- server_groups: server_groups
- name: server_group_name
- links: links
- uuid: server_group_uuid
- policies: server_group_policies
- members: server_group_members
- project_id: project_id_body
- user_id: user_id_body
- created_at: created_at
- updated_at: updated_at
**Example List server groups: JSON response**
.. literalinclude:: samples/server_groups/server-group-list-resp.json
:language: javascript
Create ServerGroup
==================
.. rest_method:: POST /server_groups
Creates a server group.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- name: server_group_name
- policies: server_group_policies
**Example Create a ServerGroup: JSON request**
.. literalinclude:: samples/server_groups/server-group-post-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_group_name
- links: links
- uuid: server_group_uuid
- policies: server_group_policies
- members: server_group_members
- project_id: project_id_body
- user_id: user_id_body
- created_at: created_at
- updated_at: updated_at
**Example Create ServerGroup: JSON response**
.. literalinclude:: samples/server_groups/server-group-post-resp.json
:language: javascript
Show ServerGroup Details
========================
.. rest_method:: GET /server_groups/{server_group_uuid}
Shows details for a server group.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_group_uuid: server_group_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_group_name
- links: links
- uuid: server_group_uuid
- policies: server_group_policies
- members: server_group_members
- project_id: project_id_body
- user_id: user_id_body
- created_at: created_at
- updated_at: updated_at
**Example Show ServerGroup Details**
.. literalinclude:: samples/server_groups/server-group-get-resp.json
:language: javascript
Delete a ServerGroup
====================
.. rest_method:: DELETE /server_groups/{server_group_uuid}
Deletes a server group.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_group_uuid: server_group_uuid_path
Response
--------
No body content is returned on a successful DELETE.

View File

@ -0,0 +1,155 @@
.. -*- rst -*-
===================
Server Networks
===================
Servers Networks can be managed through networks sub-resource.
A Server can be associated or dissociated with a floating IP by requesting
the floatingip sub-resource.
Server Network Summary
========================
.. rest_method:: GET /v1/servers/{server_uuid}/networks
Get a summary of the Server's networks.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
Response
--------
.. rest_parameters:: parameters.yaml
- nics: nics
**Example server network:**
.. literalinclude:: samples/server_networks/server-get-network-response.json
Add (Associate) Floating IP
===========================
.. rest_method:: POST /v1/servers/{server_uuid}/networks/floatingips
Adds a floating IP address to a server, which associates
that address with the server.
If a server is connected to multiple networks, you can associate a
floating IP address with a specific fixed IP address by using the
optional ``fixed_address`` parameter.
Normal response code: 204
Error codes: 400,401,403,404,409
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- address: address
- fixed_address: fixed_address
**Example request to Add (Associate) Floating IP to a server:**
.. literalinclude:: samples/server_networks/server-associate-fip-req.json
Response
--------
If successful, this method does not return content in the response body.
Remove (Disassociate) Floating IP
=================================
.. rest_method:: DELETE /v1/servers/{server_uuid}/networks/floatingips/{fip_address}
Removes, or disassociates, a floating IP address from a server.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- fip_address: address_path
Response
--------
If successful, this method does not return content in the response body.
Add (Associate) Interface
=========================
.. rest_method:: POST /v1/servers/{server_uuid}/networks/interfaces
Adds an interface to a server.
Normal response code: 204
Error codes: 400,401,403,404,409
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- net_id: network_uuid
- port_id: port_uuid
**Example request to Add (Associate) Interface to a server:**
.. literalinclude:: samples/server_networks/server-attach-interface-req.json
Response
--------
If successful, this method does not return content in the response body.
Detach a network interface.
=================================
.. rest_method:: DELETE /v1/servers/{server_uuid}/networks/interfaces/{port_id}
Detach a network interface from a server.
Normal response codes: 204
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- port_id: port_ident
Response
--------
If successful, this method does not return content in the response body.

View File

@ -0,0 +1,51 @@
.. -*- rst -*-
========================
Server Remote Consoles
========================
Create server remote console.
Create Remote Console
=====================
.. rest_method:: POST /v1/servers/{server_uuid}/remote_consoles
The API provides a unified request for creating a remote console. The user can
get a URL to connect the console from this API. The URL includes the token
which is used to get permission to access the console. Servers may support
different console protocols. To return a remote console using a specific
protocol, such as serial, set the ``protocol`` parameter to ``serial``. For the
same protocol, there may be different connection types such as ``serial protocol
and socat type`` or ``serial protocol and shellinabox type``.
Normal response code: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404),
conflict(409), notImplemented(501)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- protocol: remote_console_protocol
- type: remote_console_type
**Example Create Remote Socat Console: JSON request**
.. literalinclude:: samples/remote_consoles/create-shellinabox-console-req.json
Response
--------
.. rest_parameters:: parameters.yaml
- protocol: remote_console_protocol
- type: remote_console_type
- url: remote_console_url
**Example Create Remote Socat Console: JSON response**
.. literalinclude:: samples/remote_consoles/create-shellinabox-console-resp.json

View File

@ -0,0 +1,112 @@
.. -*- rst -*-
=================
Server States
=================
Servers States can be managed through states sub-resource.
A Server can be rebooted, turned on, or turned off by requesting a change to
its power state.
Change Server Power State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/power
Request a change to the Server's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: power_state_target
**Example request to power off a Server:**
.. literalinclude:: samples/server_states/server-set-power-off.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Lock State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/lock
Request a change to the Server's lockstate.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: lock_state
**Example request to lock a Server:**
.. literalinclude:: samples/server_states/lock-server.json
**Example request to unlock a Server:**
.. literalinclude:: samples/server_states/unlock-server.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Provision State
===============================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/provision
Request a change to the Server's provision state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: provision_state
- image_uuid: image_ident
- preserve_ephemeral: preserve_ephemeral
**Example request to rebuild a Server:**
.. literalinclude:: samples/server_states/rebuild-server.json
Response
--------
If successful, this method does not return content in the response body.

View File

@ -0,0 +1,386 @@
.. -*- rst -*-
===========
Servers
===========
Lists, creates, shows details for, updates, and deletes servers.
Create Server
===============
.. rest_method:: POST /servers
Creates a server.
The progress of this operation depends on the location of the
requested image, network I/O, selected type, and other factors.
The ``Location`` header returns the full URL to the newly created
server and is available as a ``self`` and ``bookmark`` link in the
server representation.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server: server
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- networks: networks
- networks.net_id: network_uuid
- networks.port_id: port_uuid
- metadata: metadata
- user_data: user_data
- personality: personality
- key_name: key_name
- partitions: partitions
- scheduler_hints: scheduler_hints
**Example Create Server: JSON request**
.. literalinclude:: samples/servers/server-create-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- addresses: addresses
- node: node
- links: links
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- metadata: metadata
- affinity_zone: affinity_zone
- key_name: key_name
- partitions: partitions
- locked: lock_state
**Example Create Server: JSON response**
.. literalinclude:: samples/servers/server-create-resp.json
:language: javascript
Create Multiple Servers
=========================
.. rest_method:: POST /servers
Create Multiple Servers.
There is a second kind of create call which can create multiple servers
at once. This supports all the same parameters as create with a few additional
attributes specific to multiple create.
Error handling for multiple create is not as consistent as for single server
create, and there is no guarantee that all the servers will be created
successfully.
Normal response codes: 201
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), conflict(409)
Request (Additional Parameters)
-------------------------------
These are the parameters beyond single create that are supported.
.. rest_parameters:: parameters.yaml
- name: multi_server_name_body
- min_count: min_count_body
- max_count: max_count_body
**Example Create Multiple Server: JSON request**
.. literalinclude:: samples/servers/multi-server-create-req.json
:language: javascript
Response
--------
The first server will be returned. The returned parameters is same to creating
a single server's.
**Example Create Multiple Server: JSON response**
.. literalinclude:: samples/servers/server-create-resp.json
:language: javascript
List Servers
===============
.. rest_method:: GET /servers
Return a list of bare metal Servers, with some useful information about each
Server.
By default, this query will return the name, server uuid, server status
and description for each Server.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- name: server_name_query
- status: status_query
- flavor_uuid: flavor_query
- flavor_name: flavor_name_query
- image_uuid: image_query
- ip: fixed_ip_query
- all_tenants: all_tenants
- fields: fields
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- links: links
**Example List of Servers: JSON response**
.. literalinclude:: samples/servers/server-list-resp.json
:language: javascript
List Servers Detailed
=======================
.. rest_method:: GET /servers/detail
Return a list of bare metal Servers with complete details. We can also apply
filters to show more precisely the servers.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- name: server_name_query
- status: status_query
- flavor_uuid: flavor_query
- flavor_name: flavor_name_query
- image_uuid: image_query
- ip: fixed_ip_query
- all_tenants: all_tenants
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- addresses: addresses
- node: node
- links: links
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- launched_at: launched_at
- metadata: metadata
- affinity_zone: affinity_zone
- key_name: key_name
- partitions: partitions
- locked: lock_state
**Example Detailed list of Servers: JSON response**
.. literalinclude:: samples/servers/server-list-detail-resp.json
:language: javascript
Show Server Details
=====================
.. rest_method:: GET /servers/{server_uuid}
Shows details of a server. By default, this will return the full
representation of the resource; an optional fields parameter can be supplied to
return only the specified set.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- fields: fields
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- addresses: addresses
- node: node
- links: links
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- fault: server_fault
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- launched_at: launched_at
- metadata: metadata
- affinity_zone: affinity_zone
- key_name: key_name
- partitions: partitions
- locked: lock_state
**Example Server Details: JSON response**
.. literalinclude:: samples/servers/server-detail-resp.json
:language: javascript
**Example Server Details With Fault: JSON response**
.. literalinclude:: samples/servers/server-detail-resp-when-error.json
:language: javascript
Update Server
===============
.. rest_method:: PATCH /servers/{server_uuid}
Updates the information stored about a server.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), conflict(409)
Request
-------
The BODY of the PATCH request must be a JSON PATCH document, adhering to
`RFC 6902 <https://tools.ietf.org/html/rfc6902>`_.
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
**Example Update Server: JSON request**
.. literalinclude:: samples/servers/server-update-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- addresses: addresses
- node: node
- links: links
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- metadata: metadata
- affinity_zone: affinity_zone
- key_name: key_name
- partitions: partitions
- locked: lock_state
**Example Update Server: JSON response**
.. literalinclude:: samples/servers/server-update-resp.json
:language: javascript
Delete Server
===============
.. rest_method:: DELETE /servers/{server_uuid}
Deletes a server.
Preconditions
- The server must exist.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
Response
--------
No body content is returned on a successful DELETE.

View File

@ -0,0 +1,27 @@
.. -*- rst -*-
==============
Service URLs
==============
All API calls through the rest of this document require authentication
with the OpenStack Identity service. They also required a base
``service url`` that is extracted from the Identity token of type
``baremetal-compute``. This will be the root url that every call below
will be added to build a full path.
For instance, if the ``service url`` is
``http://mycompute.pvt/mogan/v1`` then the full API call for
``/servers`` is ``http://mycompute.pvt/mogan/v1/servers``.
Depending on the deployment the baremetal compute service url might
be http or https, a custom port, a custom path, and include your
tenant id. The only way to know the urls for your deployment is by
using the service catalog. The baremetal compute servic URL should
never be hard coded in applications, even if they are only expected
to work at a single site. It should always be discovered from the
Identity token.
As such, for the rest of this document we will be using short hand
where ``GET /servers`` really means ``GET
{your_service_url}/servers``.

2
babel.cfg Normal file
View File

@ -0,0 +1,2 @@
[python: **.py]

16
devstack/README.rst Normal file
View File

@ -0,0 +1,16 @@
====================
Enabling in Devstack
====================
1. Download DevStack::
git clone https://git.openstack.org/openstack-dev/devstack.git
cd devstack
2. Add this repo as an external repository::
> cat local.conf
[[local|localrc]]
enable_plugin mogan https://git.openstack.org/openstack/mogan
3. run ``stack.sh``

242
devstack/placement Normal file
View File

@ -0,0 +1,242 @@
#!/bin/bash
#
# Functions to control the configuration and operation of the **Placement** service
# Dependencies:
#
# - ``functions`` file
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
# - ``FILES``
# ``stack.sh`` calls the entry points in this order:
#
# - install_placement
# - cleanup_placement
# - configure_placement
# - init_placement
# - start_placement
# - stop_placement
# Defaults
# --------
PLACEMENT_REPO=${PLACEMENT_REPO:-${GIT_BASE}/openstack/nova.git}
PLACEMENT_BRANCH=${PLACEMENT_BRANCH:-master}
PLACEMENT_DIR=$DEST/nova
PLACEMENT_CONF_DIR=/etc/nova
PLACEMENT_CONF=$PLACEMENT_CONF_DIR/nova.conf
PLACEMENT_AUTH_STRATEGY=${PLACEMENT_AUTH_STRATEGY:-placement}
PLACEMENT_BIN_DIR=$(get_python_exec_prefix)
PLACEMENT_UWSGI=$PLACEMENT_BIN_DIR/nova-placement-api
PLACEMENT_UWSGI_CONF=$PLACEMENT_CONF_DIR/placement-uwsgi.ini
# The placement service can optionally use a separate database
# connection. Set PLACEMENT_DB_ENABLED to True to use it.
# NOTE(cdent): This functionality depends on some code that is not
# yet merged in nova but is coming soon.
PLACEMENT_DB_ENABLED=$(trueorfalse False PLACEMENT_DB_ENABLED)
if is_service_enabled tls-proxy; then
PLACEMENT_SERVICE_PROTOCOL="https"
fi
# Public facing bits
PLACEMENT_SERVICE_PROTOCOL=${PLACEMENT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
PLACEMENT_SERVICE_HOST=${PLACEMENT_SERVICE_HOST:-$SERVICE_HOST}
# Functions
# ---------
# cleanup_placement() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_placement {
sudo rm -f $(apache_site_config_for nova-placement-api)
sudo rm -f $(apache_site_config_for placement-api)
}
# _config_placement_apache_wsgi() - Set WSGI config files
function _config_placement_apache_wsgi {
local placement_api_apache_conf
local venv_path=""
local nova_bin_dir=""
nova_bin_dir=$(get_python_exec_prefix)
placement_api_apache_conf=$(apache_site_config_for placement-api)
sudo cp $FILES/apache-placement-api.template $placement_api_apache_conf
sudo sed -e "
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%PUBLICWSGI%|$nova_bin_dir/nova-placement-api|g;
s|%SSLENGINE%|$placement_ssl|g;
s|%SSLCERTFILE%|$placement_certfile|g;
s|%SSLKEYFILE%|$placement_keyfile|g;
s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g
s|%APIWORKERS%|$API_WORKERS|g
" -i $placement_api_apache_conf
}
# configure_placement() - Set config files, create data dirs, etc
function configure_placement {
sudo install -d -o $STACK_USER $PLACEMENT_CONF_DIR
if [ "$PLACEMENT_DB_ENABLED" != False ]; then
iniset $PLACEMENT_CONF placement_database connection `database_connection_url placement`
else
iniset $PLACEMENT_CONF api_database connection `database_connection_url nova_api`
fi
# Setup keystone_authtoken section
iniset ${PLACEMENT_CONF} keystone_authtoken auth_uri ${KEYSTONE_SERVICE_URI}
iniset ${PLACEMENT_CONF} keystone_authtoken project_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${PLACEMENT_CONF} keystone_authtoken project_name ${SERVICE_PROJECT_NAME}
iniset ${PLACEMENT_CONF} keystone_authtoken user_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${PLACEMENT_CONF} keystone_authtoken username "placement"
iniset ${PLACEMENT_CONF} keystone_authtoken password ${SERVICE_PASSWORD}
iniset ${PLACEMENT_CONF} keystone_authtoken auth_url ${KEYSTONE_AUTH_URI}
iniset ${PLACEMENT_CONF} keystone_authtoken auth_type "password"
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
write_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI" "/placement"
else
_config_placement_apache_wsgi
fi
}
# create_placement_accounts() - Set up required placement accounts
# and service and endpoints.
function create_placement_accounts {
create_service_user "placement" "admin"
local placement_api_url="$PLACEMENT_SERVICE_PROTOCOL://$PLACEMENT_SERVICE_HOST/placement"
get_or_create_service "placement" "placement" "Placement Service"
get_or_create_endpoint \
"placement" \
"$REGION_NAME" \
"$placement_api_url"
}
# init_placement() - Create service user and endpoints
# If PLACEMENT_DB_ENABLED is true, create the separate placement db
# using, for now, the api_db migrations.
function init_placement {
if [ "$PLACEMENT_DB_ENABLED" != False ]; then
recreate_database placement
time_start "dbsync"
$MOGAN_BIN_DIR/nova-manage --config-file $PLACEMENT_CONF placement sync
time_stop "dbsync"
else
recreate_database $NOVA_API_DB
time_start "dbsync"
$MOGAN_BIN_DIR/nova-manage --config-file $PLACEMENT_CONF api_db sync
time_stop "dbsync"
fi
create_placement_accounts
}
# install_placement() - Collect source and prepare
function install_placement {
git_clone ${PLACEMENT_REPO} ${PLACEMENT_DIR} ${PLACEMENT_BRANCH}
setup_develop ${PLACEMENT_DIR}
install_apache_wsgi
}
# devstack run_process will only run enabled services, so before placement
# is started as a separated service, we call our own run process.
function run_placement_process {
local service=$1
local command="$2"
local group=$3
local user=$4
local name=$service
time_start "run_process"
if [[ "$USE_SYSTEMD" = "True" ]]; then
_run_under_systemd "$name" "$command" "$group" "$user"
elif [[ "$USE_SCREEN" = "True" ]]; then
if [[ "$user" == "root" ]]; then
command="sudo $command"
fi
screen_process "$name" "$command" "$group"
else
# Spawn directly without screen
if [[ "$user" == "root" ]]; then
command="sudo $command"
fi
_run_process "$name" "$command" "$group" &
fi
time_stop "run_process"
}
# stop_placement_process service
function stop_placement_process {
local service=$1
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
if $SYSTEMCTL is-enabled devstack@$service.service; then
$SYSTEMCTL stop devstack@$service.service
$SYSTEMCTL disable devstack@$service.service
fi
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$service.pid ]]; then
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid)
# oslo.service tends to stop actually shutting down
# reliably in between releases because someone believes it
# is dying too early due to some inflight work they
# have. This is a tension. It happens often enough we're
# going to just account for it in devstack and assume it
# doesn't work.
#
# Set OSLO_SERVICE_WORKS=True to skip this block
if [[ -z "$OSLO_SERVICE_WORKS" ]]; then
# TODO(danms): Remove this double-kill when we have
# this fixed in all services:
# https://bugs.launchpad.net/oslo-incubator/+bug/1446583
sleep 1
# /bin/true because pkill on a non existent process returns an error
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid) || /bin/true
fi
rm $SERVICE_DIR/$SCREEN_NAME/$service.pid
fi
if [[ "$USE_SCREEN" = "True" ]]; then
# Clean up the screen window
screen_stop_service $service
fi
}
# start_placement_api() - Start the API processes ahead of other things
function start_placement_api {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
run_placement_process "placement-api" "$PLACEMENT_BIN_DIR/uwsgi --ini $PLACEMENT_UWSGI_CONF"
else
enable_apache_site placement-api
restart_apache_server
tail_log placement-api /var/log/$APACHE_NAME/placement-api.log
fi
echo "Waiting for placement-api to start..."
if ! wait_for_service $SERVICE_TIMEOUT $PLACEMENT_SERVICE_PROTOCOL://$PLACEMENT_SERVICE_HOST/placement; then
die $LINENO "placement-api did not start"
fi
}
function start_placement {
start_placement_api
}
# stop_placement() - Disable the api service and stop it.
function stop_placement {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
stop_placement_process "placement-api"
remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI"
else
disable_apache_site placement-api
restart_apache_server
fi
}
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End:

264
devstack/plugin.sh Normal file
View File

@ -0,0 +1,264 @@
# ``stack.sh`` calls the entry points in this order:
#
# install_mogan
# install_python_moganclient
# configure_mogan
# start_mogan
# stop_mogan
# cleanup_mogan
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set -o xtrace
# TODO(zhenguo): Remove this when placement is started as a separate service
if ! is_service_enabled placement; then
source $MOGAN_DIR/devstack/placement
fi
# Defaults
# --------
# create_mogan_accounts - Set up common required mogan accounts
#
# Project User Roles
# ------------------------------
# service mogan admin
function create_mogan_accounts {
create_service_user "mogan" "admin"
get_or_create_service "mogan" "baremetal_compute" "Baremetal Compute"
get_or_create_endpoint "baremetal_compute" \
"$REGION_NAME" \
"${MOGAN_SERVICE_PROTOCOL}://${MOGAN_SERVICE_HOST}/baremetal_compute/v1" \
"${MOGAN_SERVICE_PROTOCOL}://${MOGAN_SERVICE_HOST}/baremetal_compute/v1" \
"${MOGAN_SERVICE_PROTOCOL}://${MOGAN_SERVICE_HOST}/baremetal_compute/v1"
}
function mkdir_chown_stack {
if [[ ! -d "$1" ]]; then
sudo mkdir -p "$1"
fi
sudo chown $STACK_USER "$1"
}
# Entry points
# ------------
# configure_mogan - Set config files, create data dirs, etc
function configure_mogan {
mkdir_chown_stack "${MOGAN_CONF_DIR}"
iniset ${MOGAN_CONF_FILE} DEFAULT debug ${MOGAN_DEBUG}
MOGAN_POLICY_FILE=${MOGAN_CONF_DIR}/policy.json
# Mogan Configuration
#-------------------------
# Setup keystone_authtoken section
iniset ${MOGAN_CONF_FILE} keystone_authtoken auth_uri ${KEYSTONE_SERVICE_URI}
iniset ${MOGAN_CONF_FILE} keystone_authtoken project_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} keystone_authtoken project_name ${SERVICE_PROJECT_NAME}
iniset ${MOGAN_CONF_FILE} keystone_authtoken user_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} keystone_authtoken username ${MOGAN_ADMIN_USER}
iniset ${MOGAN_CONF_FILE} keystone_authtoken password ${SERVICE_PASSWORD}
iniset ${MOGAN_CONF_FILE} keystone_authtoken auth_url ${KEYSTONE_AUTH_URI}
iniset ${MOGAN_CONF_FILE} keystone_authtoken auth_type "password"
# Config the transport url
iniset_rpc_backend mogan $MOGAN_CONF_FILE
# Configure the database.
iniset ${MOGAN_CONF_FILE} database connection `database_connection_url mogan`
# Setup ironic section
iniset ${MOGAN_CONF_FILE} ironic project_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} ironic project_name ${SERVICE_PROJECT_NAME}
iniset ${MOGAN_CONF_FILE} ironic user_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} ironic username "ironic"
iniset ${MOGAN_CONF_FILE} ironic password ${SERVICE_PASSWORD}
iniset ${MOGAN_CONF_FILE} ironic auth_url ${KEYSTONE_AUTH_URI}
iniset ${MOGAN_CONF_FILE} ironic auth_type "password"
iniset ${MOGAN_CONF_FILE} ironic api_endpoint "${KEYSTONE_AUTH_PROTOCOL}://${SERVICE_HOST}:${IRONIC_SERVICE_PORT}"
# Setup placement section
iniset ${MOGAN_CONF_FILE} placement os_region_name ${REGION_NAME}
iniset ${MOGAN_CONF_FILE} placement project_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} placement project_name ${SERVICE_PROJECT_NAME}
iniset ${MOGAN_CONF_FILE} placement user_domain_name ${SERVICE_DOMAIN_NAME}
iniset ${MOGAN_CONF_FILE} placement username "placement"
iniset ${MOGAN_CONF_FILE} placement password ${SERVICE_PASSWORD}
iniset ${MOGAN_CONF_FILE} placement auth_url ${KEYSTONE_AUTH_URI}
iniset ${MOGAN_CONF_FILE} placement auth_type "password"
# Setup neutron section
iniset ${MOGAN_CONF_FILE} neutron url "${NEUTRON_SERVICE_PROTOCOL}://${SERVICE_HOST}:${NEUTRON_SERVICE_PORT}"
# Setup glance section
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
glance_url="$GLANCE_SERVICE_PROTOCOL://$GLANCE_SERVICE_HOST/image"
else
glance_url="$GLANCE_SERVICE_PROTOCOL://${SERVICE_HOST}:$GLANCE_HOSTPORT"
fi
iniset ${MOGAN_CONF_FILE} glance glance_api_servers ${glance_url}
# Setup keystone section
iniset ${MOGAN_CONF_FILE} keystone region_name ${REGION_NAME}
# Set shellinbox console url.
if is_service_enabled mogan-shellinaboxproxy; then
iniset ${MOGAN_CONF_FILE} shellinabox_console shellinabox_base_url "http://$SERVICE_HOST:8866/"
fi
# Path of policy.json file.
iniset ${MOGAN_CONF_FILE} oslo_policy policy_file ${MOGAN_POLICY_FILE}
if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
setup_colorized_logging ${MOGAN_CONF_FILE} DEFAULT tenant user
fi
# uWSGI configuration
write_uwsgi_config "$MOGAN_UWSGI_CONF" "$MOGAN_UWSGI_APP" "/baremetal_compute"
}
# init_mogan - Initialize the database
function init_mogan {
# (re)create Mogan database
recreate_database mogan utf8
${MOGAN_BIN_DIR}/mogan-dbsync --config-file ${MOGAN_CONF_FILE} upgrade
}
# install_mogan - Collect source and prepare
function install_mogan {
# make sure all needed service were enabled
local req_services="key glance neutron ironic"
for srv in $req_services; do
if ! is_service_enabled "$srv"; then
die $LINENO "$srv should be enabled for Mogan."
fi
done
pip_install uwsgi
setup_develop ${MOGAN_DIR}
}
function install_mogan_pythonclient {
echo_summary "Installing python-moganclient"
git_clone ${MOGAN_PYTHONCLIENT_REPO} ${MOGAN_PYTHONCLIENT_DIR} ${MOGAN_PYTHONCLIENT_BRANCH}
setup_develop ${MOGAN_PYTHONCLIENT_DIR}
}
# start_mogan - Start running processes, including screen
function start_mogan {
if is_service_enabled mogan-api && is_service_enabled mogan-engine && is_service_enabled mogan-scheduler; then
echo_summary "Installing all mogan services in separate processes"
run_process mogan-api "$MOGAN_BIN_DIR/uwsgi --ini $MOGAN_UWSGI_CONF"
if ! wait_for_service ${SERVICE_TIMEOUT} ${MOGAN_SERVICE_PROTOCOL}://${MOGAN_SERVICE_HOST}/baremetal_compute; then
die $LINENO "mogan-api did not start"
fi
run_process mogan-engine "${MOGAN_BIN_DIR}/mogan-engine --config-file ${MOGAN_CONF_DIR}/mogan.conf"
run_process mogan-scheduler "${MOGAN_BIN_DIR}/mogan-scheduler --config-file ${MOGAN_CONF_DIR}/mogan.conf"
fi
run_process mogan-consoleauth "${MOGAN_BIN_DIR}/mogan-consoleauth --config-file ${MOGAN_CONF_DIR}/mogan.conf"
run_process mogan-shellinaboxproxy "${MOGAN_BIN_DIR}/mogan-shellinaboxproxy --config-file ${MOGAN_CONF_DIR}/mogan.conf"
}
# stop_mogan - Stop running processes
function stop_mogan {
# Kill the Mogan screen windows
for serv in mogan-api mogan-engine mogan-scheduler mogan-consoleauth mogan-shellinaboxproxy; do
stop_process $serv
done
remove_uwsgi_config "$MOGAN_UWSGI_CONF" "$MOGAN_UWSGI_APP"
}
function cleanup_mogan {
echo_summary "Cleanup mogan"
}
function create_flavor {
if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then
local ironic_node_cpu=$IRONIC_VM_SPECS_CPU
local ironic_node_ram=$IRONIC_VM_SPECS_RAM
local ironic_node_disk=$IRONIC_VM_SPECS_DISK
else
local ironic_node_cpu=$IRONIC_HW_NODE_CPU
local ironic_node_ram=$IRONIC_HW_NODE_RAM
local ironic_node_disk=$IRONIC_HW_NODE_DISK
fi
name="baremetal_${ironic_node_cpu}cpu_${ironic_node_ram}mbram_${ironic_node_disk}gbdisk"
description="CPU: ${ironic_node_cpu}, RAM: ${ironic_node_ram}MB, DISK: ${ironic_node_disk}GB"
openstack baremetalcompute flavor create ${name} --description "${description}" --resource $IRONIC_DEFAULT_RESOURCE_CLASS=1
}
if is_service_enabled mogan; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing mogan"
if [[ "$IRONIC_USE_RESOURCE_CLASSES" == "False" ]]; then
die "Ironic node resource class is required for Mogan"
fi
install_mogan
install_mogan_pythonclient
# TODO(zhenguo): Remove this when placement is started as a separated service
if ! is_service_enabled placement; then
install_placement
fi
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring mogan"
if is_service_enabled tempest; then
iniset $TEMPESTCONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
fi
configure_mogan
create_mogan_accounts
# TODO(zhenguo): Remove this when placement is started as a separated service
if ! is_service_enabled placement; then
configure_placement
fi
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# TODO(zhenguo): Remove this when placement is started as a separated service
if ! is_service_enabled placement; then
init_placement
start_placement
fi
echo_summary "Initializing mogan"
init_mogan
start_mogan
echo_summary "Creating flavor"
create_flavor
fi
if [[ "$1" == "unstack" ]]; then
echo_summary "Shutting down mogan"
stop_mogan
# TODO(zhenguo): Remove this when placement is started as a separated service
if ! is_service_enabled placement; then
stop_placement
fi
fi
if [[ "$1" == "clean" ]]; then
echo_summary "Cleaning mogan"
# TODO(zhenguo): Remove this when placement is started as a separated service
if ! is_service_enabled placement; then
cleanup_placement
fi
fi
fi
# Restore xtrace
$XTRACE
# Local variables:
# mode: shell-script
# End:

35
devstack/settings Normal file
View File

@ -0,0 +1,35 @@
# Devstack settings
# We have to add Mogan to enabled services for run_process to work
# Now we just support to run services in separate processes and screens:
# enable_service mogan mogan-api mogan-engine mogan-scheduler mogan-consoleauth mogan-shellinaboxproxy
enable_service mogan mogan-api mogan-engine mogan-scheduler mogan-consoleauth mogan-shellinaboxproxy
# Set up default repos
MOGAN_REPO=${MOGAN_REPO:-${GIT_BASE}/openstack/mogan.git}
MOGAN_BRANCH=${MOGAN_BRANCH:-master}
MOGAN_PYTHONCLIENT_REPO=${MOGAN_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-moganclient.git}
MOGAN_PYTHONCLIENT_BRANCH=${MOGAN_PYTHONCLIENT_BRANCH:-master}
MOGAN_PYTHONCLIENT_DIR=${DEST}/python-moganclient
# Set up default directories
MOGAN_DIR=$DEST/mogan
MOGAN_DASHBOARD_DIR=$DEST/mogan-dashboard
MOGAN_CONF_DIR=${MOGAN_CONF_DIR:-/etc/mogan}
MOGAN_CONF_FILE=${MOGAN_CONF_DIR}/mogan.conf
MOGAN_DEBUG=${MOGAN_DEBUG:-True}
MOGAN_SERVICE_HOST=${MOGAN_SERVICE_HOST:-$SERVICE_HOST}
MOGAN_SERVICE_PROTOCOL=${MOGAN_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
MOGAN_ADMIN_USER=${MOGAN_ADMIN_USER:-mogan}
if [[ -d ${MOGAN_DIR}/bin ]]; then
MOGAN_BIN_DIR=${MOGAN_DIR}/bin
else
MOGAN_BIN_DIR=$(get_python_exec_prefix)
fi
MOGAN_UWSGI_CONF=$MOGAN_CONF_DIR/mogan-uwsgi.ini
MOGAN_UWSGI_APP=$MOGAN_BIN_DIR/mogan-api-wsgi

View File

@ -0,0 +1,43 @@
{
"event_type": "server.create.error",
"payload": {
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"status": "error",
"node": "node-0",
"locked": false,
"uuid": "c6e12c34-8917-4b95-938e-e146faf1de97",
"availability_zone": null,
"fault": {
"mogan_object.name": "ExceptionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"module_name": "mogan.engine.manager",
"exception": "ServerDeployAborted",
"exception_message": "Server c6e12c34-8917-4b95-938e-e146faf1de97 provisioning was aborted",
"function_name": "_create_server"
}
},
"created_at": "2017-09-14T01:31:48Z",
"locked_by": null,
"updated_at": null,
"description": null,
"metadata": {},
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"affinity_zone": null,
"power_state": null,
"flavor_uuid": "737ea130-153b-4599-b7b2-dc4c82480a31",
"image_uuid": "91d3f6fd-012d-4d19-8140-abfe39d1c332",
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"partitions": {},
"launched_at": null,
"key_name": null,
"name": "test"
}
},
"priority": "ERROR",
"publisher_id": "mogan-engine:localhost"
}

View File

@ -0,0 +1,53 @@
{
"event_type": "server.create.end",
"payload": {
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"node": "node-0",
"addresses": [{
"mogan_object.name": "ServerAddressesPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"preserve_on_delete": false,
"network_id": "dc7f826c-c11a-4f6c-99c5-b755184666b9",
"fixed_ips": [{
"subnet_id": "b102f49a-c602-4626-b605-03f1401e2ffb",
"ip_address": "11.0.0.3"
},
{
"subnet_id": "56d77d46-6ff2-4d2e-9400-35f7cb2760ea",
"ip_address": "fdfd:dac2:5dc9:0:f816:3eff:fe78:f889"
}],
"floating_ip": null,
"mac_address": "52:54:00:bc:f0:fe",
"port_id": "55edcf52-6423-49e6-909c-20459fd5cba2"
}
}],
"availability_zone": null,
"updated_at": "2017-09-13T08:36:07Z",
"image_uuid": "91d3f6fd-012d-4d19-8140-abfe39d1c332",
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "692ee038-a963-4308-b596-60b0338649fd",
"affinity_zone": null,
"power_state": "power on",
"flavor_uuid": "737ea130-153b-4599-b7b2-dc4c82480a31",
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"launched_at": "2017-09-13T08:38:42Z",
"metadata": {},
"status": "active",
"description": null,
"key_name": null,
"partitions": {},
"locked": false,
"name": "test",
"fault": null,
"created_at": "2017-09-13T08:36:06Z",
"locked_by": null
}
},
"priority": "INFO",
"publisher_id": "mogan-engine:localhost"
}

View File

@ -0,0 +1,34 @@
{
"event_type": "server.create.start",
"payload": {
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"node": "node-0",
"addresses": [],
"availability_zone": null,
"updated_at": null,
"image_uuid": "91d3f6fd-012d-4d19-8140-abfe39d1c332",
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "692ee038-a963-4308-b596-60b0338649fd",
"affinity_zone": null,
"power_state": null,
"flavor_uuid": "737ea130-153b-4599-b7b2-dc4c82480a31",
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"launched_at": null,
"metadata": {},
"status": "building",
"description": null,
"key_name": null,
"partitions": {},
"locked": false,
"name": "test",
"fault": null,
"created_at": "2017-09-13T08:36:06Z",
"locked_by": null
}
},
"priority": "INFO",
"publisher_id": "mogan-engine:localhost"
}

View File

@ -0,0 +1,53 @@
{
"event_type": "server.delete.end",
"payload": {
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"node": "node-0",
"addresses": [{
"mogan_object.name": "ServerAddressesPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"preserve_on_delete": false,
"network_id": "dc7f826c-c11a-4f6c-99c5-b755184666b9",
"fixed_ips": [{
"subnet_id": "b102f49a-c602-4626-b605-03f1401e2ffb",
"ip_address": "11.0.0.7"
},
{
"subnet_id": "56d77d46-6ff2-4d2e-9400-35f7cb2760ea",
"ip_address": "fdfd:dac2:5dc9:0:f816:3eff:fe8c:c903"
}],
"floating_ip": null,
"mac_address": "52:54:00:bc:f0:fe",
"port_id": "3931233a-cf89-4282-9726-1fb98e417f4d"
}
}],
"availability_zone": null,
"updated_at": "2017-09-13T08:18:00Z",
"image_uuid": "91d3f6fd-012d-4d19-8140-abfe39d1c332",
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "e3cf7edd-8b24-4022-8567-ef2d779458c1",
"affinity_zone": null,
"power_state": null,
"flavor_uuid": "737ea130-153b-4599-b7b2-dc4c82480a31",
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"launched_at": "2017-09-13T08:18:00Z",
"metadata": {},
"status": "deleted",
"description": null,
"key_name": null,
"partitions": {},
"locked": false,
"name": "test",
"fault": null,
"created_at": "2017-09-13T08:15:21Z",
"locked_by": null
}
},
"priority": "INFO",
"publisher_id": "mogan-engine:localhost"
}

View File

@ -0,0 +1,53 @@
{
"event_type": "server.delete.start",
"payload": {
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"node": "node-0",
"addresses": [{
"mogan_object.name": "ServerAddressesPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"preserve_on_delete": false,
"network_id": "dc7f826c-c11a-4f6c-99c5-b755184666b9",
"fixed_ips": [{
"subnet_id": "b102f49a-c602-4626-b605-03f1401e2ffb",
"ip_address": "11.0.0.7"
},
{
"subnet_id": "56d77d46-6ff2-4d2e-9400-35f7cb2760ea",
"ip_address": "fdfd:dac2:5dc9:0:f816:3eff:fe8c:c903"
}],
"floating_ip": null,
"mac_address": "52:54:00:bc:f0:fe",
"port_id": "3931233a-cf89-4282-9726-1fb98e417f4d"
}
}],
"availability_zone": null,
"updated_at": "2017-09-13T08:18:00Z",
"image_uuid": "91d3f6fd-012d-4d19-8140-abfe39d1c332",
"user_id": "9851baf53c75452dad7951bca7b3dbac",
"uuid": "e3cf7edd-8b24-4022-8567-ef2d779458c1",
"affinity_zone": null,
"power_state": "power on",
"flavor_uuid": "737ea130-153b-4599-b7b2-dc4c82480a31",
"project_id": "b5f8b7e5429449a8a1366088abede8d1",
"launched_at": "2017-09-13T08:18:00Z",
"metadata": {},
"status": "deleting",
"description": null,
"key_name": null,
"partitions": {},
"locked": false,
"name": "test",
"fault": null,
"created_at": "2017-09-13T08:15:21Z",
"locked_by": null
}
},
"priority": "INFO",
"publisher_id": "mogan-engine:localhost"
}

View File

@ -0,0 +1,59 @@
..
Copyright 2012 OpenStack Foundation
Copyright 2012 Citrix Systems, Inc.
Copyright 2012, The Cloudscaling Group, Inc.
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.
Node Aggregates
===============
Node aggregates, like nova's host aggregates for VMs, can be regarded as a mechanism
to further partition an availability zone; while availability zones are visible to
users, node aggregates are only visible to administrators. Allow administrators to
assign key-value pairs to groups of bare metal nodes. Each node can have multiple
aggregates, each aggregate can have multiple key-value pairs, and the same key-value
pair can be assigned to multiple aggregates. This information can be used in the
scheduler to enable advanced scheduling by setting key-value pairs to flavor resource
aggregates field.
Admin users can use the :command:`openstack baremetalcompute aggregate` command to
create, delete and manage aggregates. To see information for this command, run:
.. code-block:: console
$ openstack baremetalcompute aggregate [TAB]
add create delete list list_node remove set show unset
Availability Zones (AZs)
------------------------
Like Nova, the availability zone is actually a specific metadata attached to
an aggregate. Adding that specific metadata to an aggregate makes the aggregate
visible from an end-user perspective and consequently allows to schedule upon a
specific set of nodes (the ones belonging to the aggregate).
.. note:: One node can be in multiple aggregates, but it can only be in one
availability zone
Affinity Zones
--------------
The affinity zone is also a specific metadata attached to an aggregate, which
makes server group affinity and anti-affinity happen. You may define it as
failure domains(e.g., by power circuit, rack, room, etc).
.. note:: One node can be in multiple aggregates, but it can only be in one
affinity zone

View File

@ -0,0 +1,54 @@
=======
Flavors
=======
Admin users can use the :command:`openstack baremetalcompute flavor` command to
customize and manage flavors. To see information for this command, run:
.. code-block:: console
$ openstack baremetalcompute flavor [TAB]
create delete list set show unset
Flavors define these elements:
+---------------------+-------------------------------------------------------+
| Element | Description |
+=====================+=======================================================+
| Name | A descriptive name. |
+---------------------+-------------------------------------------------------+
| Description | Typically used to put hardware specs and aggregates |
| | informations. |
+---------------------+-------------------------------------------------------+
| Resources | Key and value pairs that corresponds to placement |
| | resource classes and amounts, like ``baremetal=1``. |
+---------------------+-------------------------------------------------------+
| Resource Aggregates | Key and value pairs that corresponds to node |
| | aggregates metadata. |
+---------------------+-------------------------------------------------------+
| Is Public | Boolean value, whether flavor is available to all |
| | users or private to the project it was created in. |
| | Defaults to ``True``. |
+---------------------+-------------------------------------------------------+
| Disabled | Boolean value, whether flavor is available for new |
| | servers creation. It is intended to be used when |
| | phasing out flavors. Defaults to ``False``. |
+---------------------+-------------------------------------------------------+
.. note::
Flavors are not allowed to be deleted if there are still live servers
associated with it. You should disable it instead in such situation.
Is Public
~~~~~~~~~
Flavors can be assigned to particular projects. By default, a flavor is public
and available to all projects. Private flavors are only accessible to those on
the access list and are invisible to other projects. To create and assign a
private flavor to a project, run this command:
.. code-block:: console
$ openstack baremetalcompute flavor create --private p1.gold --description "gold" \
--resources gold=1

89
doc/source/admin/gmr.rst Normal file
View File

@ -0,0 +1,89 @@
..
Copyright (c) 2017 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.
=======================
Guru Meditation Reports
=======================
Mogan contains a mechanism whereby developers and system administrators can
generate a report about the state of a running Mogan executable.
This report is called a *Guru Meditation Report* (*GMR* for short).
Generating a GMR
----------------
A *GMR* can be generated by sending the *USR2* signal to any Mogan process
with support (see below).
The *GMR* will then output to standard error for that particular process.
For example, suppose that ``mogan-api`` has process id ``8675``, and was run
with ``2>/var/log/mogan/mogan-api-err.log``.
Then, ``kill -USR2 8675`` will trigger the Guru Meditation report to be printed
to ``/var/log/mogan/mogan-api-err.log``.
There is other way to trigger a generation of report, user should add
a configuration in Mogan's conf file::
[oslo_reports]
file_event_handler=['The path to a file to watch for changes to trigger '
'the reports, instead of signals. Setting this option '
'disables the signal trigger for the reports.']
file_event_handler_interval=['How many seconds to wait between polls when '
'file_event_handler is set, default value '
'is 1']
a *GMR* can be generated by "touch"ing the file which was specified in
file_event_handler. The *GMR* will then output to standard error for
that particular process.
For example, suppose that ``mogan-api`` was run with
``2>/var/log/mogan/mogan-api-err.log``, and the file path is
``/tmp/guru_report``.
Then, ``touch /tmp/guru_report`` will trigger the Guru Meditation report to be
printed to ``/var/log/mogan/mogan-api-err.log``.
For uwsgi mode, Guru is only working in second way, so user should use the
'touch' file to generate the Guru report.
Structure of a GMR
------------------
The *GMR* is designed to be extensible; any particular executable may add
its own sections. However, the base *GMR* consists of several sections:
Package
Shows information about the package to which this process belongs,
including version information
Threads
Shows stack traces and thread ids for each of the threads within this process
Green Threads
Shows stack traces for each of the green threads within this process
(green threads don't have thread ids)
Configuration
Lists all the configuration options currently accessible via the CONF object
for the current process
Extending the GMR
-----------------
As mentioned above, additional sections can be added to the GMR for a
particular executable. For more information, see the inline documentation
about oslo.reports:
`oslo.reports <https://docs.openstack.org/oslo.reports/latest/>`_

View File

@ -0,0 +1,187 @@
============
mogan-dbsync
============
The :command:`mogan-dbsync` utility is used to create the database schema
tables that the mogan services will use for storage. It can also be used to
upgrade existing database tables when migrating between
different versions of mogan.
The `Alembic library <http://alembic.readthedocs.org>`_ is used to perform
the database migrations.
Options
=======
This is a partial list of the most useful options. To see the full list,
run the following::
mogan-dbsync --help
.. program:: mogan-dbsync
.. option:: -h, --help
Show help message and exit.
.. option:: --config-dir <DIR>
Path to a config directory with configuration files.
.. option:: --config-file <PATH>
Path to a configuration file to use.
.. option:: -d, --debug
Print debugging output.
.. option:: --version
Show the program's version number and exit.
.. option:: upgrade, stamp, revision, version, create_schema
The :ref:`command <dbsync_cmds>` to run.
Usage
=====
Options for the various :ref:`commands <dbsync_cmds>` for
:command:`mogan-dbsync` are listed when the :option:`-h` or :option:`--help`
option is used after the command.
For example::
mogan-dbsync create_schema --help
Information about the database is read from the mogan configuration file
used by the API server and conductor services. This file must be specified
with the :option:`--config-file` option::
mogan-dbsync --config-file /path/to/mogan.conf create_schema
The configuration file defines the database backend to use with the
*connection* database option::
[database]
connection=mysql+pymysql://root@localhost/mogan
If no configuration file is specified with the :option:`--config-file` option,
:command:`mogan-dbsync` assumes an SQLite database.
.. _dbsync_cmds:
Command Options
===============
:command:`mogan-dbsync` is given a command that tells the utility what actions
to perform. These commands can take arguments. Several commands are available:
.. _create_schema:
create_schema
-------------
.. program:: create_schema
.. option:: -h, --help
Show help for create_schema and exit.
This command will create database tables based on the most current version.
It assumes that there are no existing tables.
An example of creating database tables with the most recent version::
mogan-dbsync --config-file=/etc/mogan/mogan.conf create_schema
revision
--------
.. program:: revision
.. option:: -h, --help
Show help for revision and exit.
.. option:: -m <MESSAGE>, --message <MESSAGE>
The message to use with the revision file.
.. option:: --autogenerate
Compares table metadata in the application with the status of the database
and generates migrations based on this comparison.
This command will create a new revision file. You can use the
:option:`--message` option to comment the revision.
This is really only useful for mogan developers making changes that require
database changes. This revision file is used during database migration and
will specify the changes that need to be made to the database tables. Further
discussion is beyond the scope of this document.
stamp
-----
.. program:: stamp
.. option:: -h, --help
Show help for stamp and exit.
.. option:: --revision <REVISION>
The revision number.
This command will 'stamp' the revision table with the version specified with
the :option:`--revision` option. It will not run any migrations.
upgrade
-------
.. program:: upgrade
.. option:: -h, --help
Show help for upgrade and exit.
.. option:: --revision <REVISION>
The revision number to upgrade to.
This command will upgrade existing database tables to the most recent version,
or to the version specified with the :option:`--revision` option.
If there are no existing tables, then new tables are created, beginning
with the oldest known version, and successively upgraded using all of the
database migration files, until they are at the specified version. Note
that this behavior is different from the :ref:`create_schema` command
that creates the tables based on the most recent version.
An example of upgrading to the most recent table versions::
mogan-dbsync --config-file=/etc/mogan/mogan.conf upgrade
.. note::
This command is the default if no command is given to
:command:`mogan-dbsync`.
.. warning::
The upgrade command is not compatible with SQLite databases since it uses
ALTER TABLE commands to upgrade the database tables. SQLite supports only
a limited subset of ALTER TABLE.
version
-------
.. program:: version
.. option:: -h, --help
Show help for version and exit.
This command will output the current database version.

90
doc/source/conf.py Executable file
View File

@ -0,0 +1,90 @@
# 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.
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- 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',
'openstackdocstheme',
'oslo_config.sphinxconfiggen',
'oslo_policy.sphinxpolicygen',
'sphinx.ext.graphviz',
]
# openstackdocstheme options
repository_name = 'openstack/mogan'
bug_project = 'mogan'
bug_tag = 'doc'
config_generator_config_file = '../../tools/config/mogan-config-generator.conf'
sample_config_basename = '_static/mogan'
policy_generator_config_file = '../../tools/config/mogan-policy-generator.conf'
sample_policy_basename = '_static/mogan'
# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'mogan'
copyright = u'2016, OpenStack Foundation'
# 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
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- 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'
html_theme = 'openstackdocs'
# html_static_path = ['static']
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}

View File

@ -0,0 +1,10 @@
===========================
Mogan Configuration Options
===========================
The following is a sample Mogan configuration for adaptation and use. It is
auto-generated from Mogan when this documentation is built, so if you are
having issues with an option, please compare your version of Mogan with the
version of this documentation.
.. literalinclude:: /_static/mogan.conf.sample

View File

@ -0,0 +1,9 @@
============
Mogan Policy
============
The following is a sample Mogan policy file, autogenerated from Mogan when this
documentation is built. To prevent conflicts, ensure your version of Mogan
aligns with the version of this documentation.
.. literalinclude:: /_static/mogan.policy.yaml.sample

View File

@ -0,0 +1,99 @@
.. _code-contribution-guide:
=======================
Code Contribution Guide
=======================
This document provides some necessary points for developers to consider when
writing and reviewing Mogan code. The checklist will help developers get
things right.
Getting Started
===============
If you're completely new to OpenStack and want to contribute to the mogan
project, please start by familiarizing yourself with the `Infra Team's Developer
Guide <https://docs.openstack.org/infra/manual/developers.html>`_. This will help
you get your accounts set up in Launchpad and Gerrit, familiarize you with the
workflow for the OpenStack continuous integration and testing systems, and help
you with your first commit.
LaunchPad Project
-----------------
Most of the tools used for OpenStack require a launchpad.net ID for
authentication.
.. seealso::
* https://launchpad.net
* https://launchpad.net/mogan
Related Projects
----------------
There are several projects that are tightly integrated with mogan and which are
developed by the same community.
.. seealso::
* https://launchpad.net/python-moganclient
Project Hosting Details
-----------------------
Bug tracker
https://launchpad.net/mogan
Mailing list (prefix Subject line with ``[mogan]``)
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Wiki
https://wiki.openstack.org/Mogan
Code Hosting
https://git.openstack.org/cgit/openstack/mogan
Code Review
https://review.openstack.org/#/q/status:open+project:openstack/mogan,n,z
Mogan API RPC Versions
----------------------
* When the signature(arguments) of an RPC method is changed, the following things
need to be considered:
- The RPC version must be incremented and be the same value for both the client
(engine/rpcapi.py, used by mogan-api) and the server (engine/manager.py,
used by mogan-engine).
- New arguments of the method can only be added as optional. Existing arguments cannot be
removed or changed in incompatible ways (with the method in older RPC versions).
- Client-side can pin a version cap by passing ``version_cap`` to the constructor
of oslo_messaging.RPCClient. Methods which change arguments should run
client.can_send_version() to see if the version of the request is compatible with the
version cap of RPC Client, otherwise the request needs to be created to work with a
previous version that is supported.
- Server-side should tolerate the older version of requests in order to keep
working during the progress of live upgrade. The behavior of server-side should
depend on the input parameters passed from the client-side.
Object Versions
---------------
* When Object classes (subclasses of mogan.objects.base.MoganObject) are modified, the
following things need to be considered:
- The change of fields and the signature of remotable method needs a bump of object
version.
- The arguments of methods can only be added as optional, they cannot be
removed or changed in an incompatible way.
- Fields types cannot be changed. If it is a must, create a new field and
deprecate the old one.
- When new version objects communicate with old version objects,
obj_make_compatible() will be called to convert objects to the target version during
serialization. So objects should implement their own obj_make_compatible() to
remove/alter attributes which was added/changed after the target version.
- There is a test (object/test_objects.py) to generate the hash of object fields and the
signatures of remotable methods, which helps developers to check if the change of
objects need a version bump. The object fingerprint should only be updated with a
version bump.

View File

@ -0,0 +1,363 @@
.. _dev-quickstart:
=====================
Developer Quick-Start
=====================
This is a quick walkthrough to get you started developing code for Mogan.
This assumes you are already familiar with submitting code reviews to
an OpenStack project.
The gate currently runs the unit tests under Python 2.7, Python 3.4
and Python 3.5. It is strongly encouraged to run the unit tests locally prior
to submitting a patch.
.. note::
Do not run unit tests on the same environment as devstack due to
conflicting configuration with system dependencies.
.. note::
This document is compatible with Python (3.5), Ubuntu (16.04) and Fedora (23).
When referring to different versions of Python and OS distributions, this
is explicitly stated.
.. seealso::
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Preparing Development System
============================
System Prerequisites
--------------------
The following packages cover the prerequisites for a local development
environment on most current distributions. Instructions for getting set up with
non-default versions of Python and on older distributions are included below as
well.
- Ubuntu/Debian::
sudo apt-get install build-essential python-dev libssl-dev python-pip libmysqlclient-dev libxml2-dev libxslt-dev libpq-dev git git-review libffi-dev gettext ipmitool psmisc graphviz libjpeg-dev xinetd tftpd tftp
- Fedora 21/RHEL7/CentOS7::
sudo yum install python-devel openssl-devel python-pip mysql-devel libxml2-devel libxslt-devel postgresql-devel git git-review libffi-devel gettext ipmitool psmisc graphviz gcc libjpeg-turbo-devel
If using RHEL and yum reports "No package python-pip available" and "No
package git-review available", use the EPEL software repository.
Instructions can be found at `<https://fedoraproject.org/wiki/EPEL/FAQ#howtouse>`_.
- Fedora 22 or higher::
sudo dnf install python-devel openssl-devel python-pip mysql-devel libxml2-devel libxslt-devel postgresql-devel git git-review libffi-devel gettext ipmitool psmisc graphviz gcc libjpeg-turbo-devel
Additionally, if using Fedora 23, ``redhat-rpm-config`` package should be
installed so that development virtualenv can be built successfully.
- openSUSE/SLE 12::
sudo zypper install git git-review libffi-devel libmysqlclient-devel libopenssl-devel libxml2-devel libxslt-devel postgresql-devel python-devel python-nose python-pip gettext-runtime psmisc
Graphviz is only needed for generating the state machine diagram. To install it
on openSUSE or SLE 12, see
`<https://software.opensuse.org/download.html?project=graphics&package=graphviz-plugins>`_.
(Optional) Installing Py34 requirements
---------------------------------------
If you need Python 3.4, follow the instructions above to install prerequisites
and *additionally* install the following packages:
- On Ubuntu 14.x/Debian::
sudo apt-get install python3-dev
- On Ubuntu 16.04::
wget https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz
sudo tar xzf Python-3.4.4.tgz
cd Python-3.4.4
sudo ./configure
sudo make altinstall
# This will install Python 3.4 without replacing 3.5. To check if 3.4 was installed properly
run this command:
python3.4 -V
- On Fedora 21/RHEL7/CentOS7::
sudo yum install python3-devel
- On Fedora 22 and higher::
sudo dnf install python3-devel
(Optional) Installing Py35 requirements
---------------------------------------
If you need Python 3.5 support on an older distro that does not already have
it, follow the instructions for installing prerequisites above and
*additionally* run the following commands.
- On Ubuntu 14.04::
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
sudo tar xzf Python-3.5.2.tgz
cd Python-3.5.2
sudo ./configure
sudo make altinstall
# This will install Python 3.5 without replacing 3.4. To check if 3.5 was installed properly
run this command:
python3.5 -V
- On Fedora 23::
sudo dnf install -y dnf-plugins-core
sudo dnf copr enable -y mstuchli/Python3.5
dnf install -y python35-python3
Python Prerequisites
--------------------
If your distro has at least tox 1.8, use similar command to install
``python-tox`` package. Otherwise install this on all distros::
sudo pip install -U tox
You may need to explicitly upgrade virtualenv if you've installed the one
from your OS distribution and it is too old (tox will complain). You can
upgrade it individually, if you need to::
sudo pip install -U virtualenv
Running Unit Tests Locally
==========================
If you haven't already, Mogan source code should be pulled directly from git::
# from your home or source directory
cd ~
git clone https://git.openstack.org/openstack/mogan
cd mogan
Running Unit and Style Tests
----------------------------
All unit tests should be run using tox. To run Mogan's entire test suite::
# to run the py27, py34, py35 unit tests, and the style tests
tox
To run a specific test or tests, use the "-e" option followed by the tox target
name. For example::
# run the unit tests under py27 and also run the pep8 tests
tox -epy27 -epep8
.. note::
If tests are run under py27 and then run under py34 or py35 the following error may occur::
db type could not be determined
ERROR: InvocationError: '/home/ubuntu/mogan/.tox/py35/bin/ostestr'
To overcome this error remove the file `.testrepository/times.dbm`
and then run the py34 or py35 test.
You may pass options to the test programs using positional arguments.
To run a specific unit test, this passes the -r option and desired test
(regex string) to `os-testr <https://pypi.python.org/pypi/os-testr>`_::
# run a specific test for Python 2.7
tox -epy27 -- -r test_name
Debugging unit tests
--------------------
In order to break into the debugger from a unit test we need to insert
a breaking point to the code:
.. code-block:: python
import pdb; pdb.set_trace()
Then run ``tox`` with the debug environment as one of the following::
tox -e debug
tox -e debug test_file_name
tox -e debug test_file_name.TestClass
tox -e debug test_file_name.TestClass.test_name
For more information see the `oslotest documentation
<https://docs.openstack.org/oslotest/latest/user/features.html#debugging-with-oslo-debug-helper>`_.
Additional Tox Targets
----------------------
There are several additional tox targets not included in the default list, such
as the target which builds the documentation site. See the ``tox.ini`` file
for a complete listing of tox targets. These can be run directly by specifying
the target name::
# generate the documentation pages locally
tox -edocs
# generate the sample configuration file
tox -egenconfig
Deploying Mogan with DevStack
=============================
DevStack may be configured to deploy Mogan, It is easy to develop Mogan
with the devstack environment. Mogan depends on Ironic, Neutron, and Glance
to create and schedule virtual machines to simulate bare metal servers.
It is highly recommended to deploy on an expendable virtual machine and not
on your personal work station. Deploying Mogan with DevStack requires a
machine running Ubuntu 14.04 (or later) or Fedora 20 (or later). Make sure
your machine is fully up to date and has the latest packages installed before
beginning this process.
.. seealso::
https://docs.openstack.org/devstack/latest/
Devstack will no longer create the user 'stack' with the desired
permissions, but does provide a script to perform the task::
git clone https://git.openstack.org/openstack-dev/devstack.git devstack
sudo ./devstack/tools/create-stack-user.sh
Switch to the stack user and clone DevStack::
sudo su - stack
git clone https://git.openstack.org/openstack-dev/devstack.git devstack
Create devstack/local.conf with minimal settings required to enable Mogan::
cd devstack
cat >local.conf <<END
[[local|localrc]]
# Credentials
ADMIN_PASSWORD=password
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
SWIFT_HASH=password
SWIFT_TEMPURL_KEY=password
# Enable Ironic plugin
enable_plugin ironic git://git.openstack.org/openstack/ironic
# Enable Mogan plugin
enable_plugin mogan git://git.openstack.org/openstack/mogan
ENABLED_SERVICES=g-api,g-reg,q-agt,q-dhcp,q-l3,q-svc,key,mysql,rabbit,ir-api,ir-cond,s-account,s-container,s-object,s-proxy,tempest
# Swift temp URL's are required for agent_* drivers.
SWIFT_ENABLE_TEMPURLS=True
# Set resource_classes for nodes to use placement service
IRONIC_USE_RESOURCE_CLASSES=True
# Create 3 virtual machines to pose as Ironic's baremetal nodes.
IRONIC_VM_COUNT=3
IRONIC_VM_SSH_PORT=22
IRONIC_BAREMETAL_BASIC_OPS=True
# Enable Ironic drivers.
IRONIC_ENABLED_DRIVERS=fake,agent_ipmitool,pxe_ipmitool
# Change this to alter the default driver for nodes created by devstack.
# This driver should be in the enabled list above.
IRONIC_DEPLOY_DRIVER=agent_ipmitool
# Using Ironic agent deploy driver by default, so don't use whole disk
# image in tempest.
IRONIC_TEMPEST_WHOLE_DISK_IMAGE=False
# The parameters below represent the minimum possible values to create
# functional nodes.
IRONIC_VM_SPECS_RAM=1280
IRONIC_VM_SPECS_DISK=10
# To build your own IPA ramdisk from source, set this to True
IRONIC_BUILD_DEPLOY_RAMDISK=False
# Log all output to files
LOGFILE=$HOME/devstack.log
LOGDIR=$HOME/logs
IRONIC_VM_LOG_DIR=$HOME/ironic-bm-logs
END
.. note::
Git protocol requires access to port 9418, which is not a standard port that
corporate firewalls always allow. If you are behind a firewall or on a proxy that
blocks Git protocol, modify the ``enable_plugin`` line to use ``https://`` instead
of ``git://`` and add ``GIT_BASE=https://git.openstack.org`` to the credentials::
GIT_BASE=https://git.openstack.org
# Enable Mogan plugin
enable_plugin mogan https://git.openstack.org/openstack/mogan
Run stack.sh::
./stack.sh
Source credentials, and spawn a server as the ``demo`` user::
source ~/devstack/openrc
# query the image id of the default cirros image
image=$(openstack image show $DEFAULT_IMAGE_NAME -f value -c id)
# query the private network id
net=$(openstack network show private -f value -c id)
# spawn a server
openstack baremetal server create --flavor $MOGAN_DEFAULT_FLAVOR --nic net-id=$net --image $image test
Building developer documentation
================================
If you would like to build the documentation locally, eg. to test your
documentation changes before uploading them for review, run these
commands to build the documentation set:
- On your local machine::
# activate your development virtualenv
source .tox/venv/bin/activate
# build the docs
tox -edocs
#Now use your browser to open the top-level index.html located at:
mogan/doc/build/html/index.html
- On a remote machine::
# Go to the directory that contains the docs
cd ~/mogan/doc/source/
# Build the docs
tox -edocs
# Change directory to the newly built HTML files
cd ~/mogan/doc/build/html/
# Create a server using python on port 8000
python -m SimpleHTTPServer 8000
#Now use your browser to open the top-level index.html located at:
http://host_ip:8000

View File

@ -0,0 +1,45 @@
==============================
Making changes to the database
==============================
In order to make a change to the mogan database you must update the database
models and then create a migration to reflect that change.
There are two ways to create a migration which are described below, both of
these generate a new migration file. In this file there is only one function:
* ``upgrade`` - The function to run when
``mogan-dbsync upgrade`` is run, and should be populated with
code to bring the database up to its new state from the state it was in
after the last migration.
For further information on creating a migration, refer to
`Create a Migration Script`_ from the alembic documentation.
Autogenerate
------------
This is the simplest way to create a migration. Alembic will compare the models
to an up to date database, and then attempt to write a migration based on the
differences. This should generate correct migrations in most cases however
there are some cases when it can not detect some changes and may require
manual modification, see `What does Autogenerate Detect (and what does it not
detect?)`_ from the alembic documentation.
::
mogan-dbsync upgrade
mogan-dbsync revision -m "A short description" --autogenerate
Manual
------
This will generate an empty migration file, with the correct revision
information already included. However the upgrade function is left empty
and must be manually populated in order to perform the correct actions on
the database::
mogan-dbsync revision -m "A short description"
.. _Create a Migration Script: http://alembic.zzzcomputing.com/en/latest/tutorial.html#create-a-migration-script
.. _What does Autogenerate Detect (and what does it not detect?): http://alembic.zzzcomputing.com/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect

View File

@ -0,0 +1,105 @@
..
Copyright (c) 2017 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.
=================
Running the Tests
=================
Mogan includes an extensive set of automated unit tests which are
run through tox_.
Install tox
-----------
Install ``tox`` using pip::
$ sudo pip install tox
Python Guideline Enforcement
----------------------------
All code has to pass the pep8 style guideline to merge into OpenStack, to
validate the code against these guidelines you can run::
$ tox -e pep8
Unit Testing
------------
It is strongly encouraged to run the unit tests locally under one or more
test environments prior to submitting a patch. To run all the recommended
environments sequentially and pep8 style guideline run::
$ tox
You can also selectively pick specific test environments by listing your
chosen environments after a -e flag::
$ tox -e py35,py27,pep8,pypy
As tox is a wrapper around testr, it also accepts the same flags as testr.
See the `testr documentation`_ for details about these additional flags.
.. _testr documentation: https://testrepository.readthedocs.org/en/latest/MANUAL.html
Use a double hyphen to pass options to testr. For example, to run only tests
under tests/unit/api/::
$ tox -e py27 -- mogan.tests.unit.api
.. note::
Tox sets up virtual environment and installs all necessary dependencies.
Sharing the environment with devstack testing is not recommended due to
conflicting configuration with system dependencies.
Debug tests
-----------
To debug tests (ie. break into pdb debugger), you can use ''debug'' tox
environment. Here's an example, passing the name of a test since you'll
normally only want to run the test that hits your breakpoint::
$ tox -e debug mogan.tests.unit.cmd.test_dbsync.DbSyncTestCase
For reference, the ``debug`` tox environment implements the instructions
here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
Functional tests
----------------
To run functional tests, you can specify the *functional* as test environment::
$ tox -e functional
Tempest tests
-------------
Tempest is a set of integration tests to be run against a live OpenStack
environment, to run tempest of mogan part, you need to enable tempest
installed and configured correctly. In devstack installation, you need to
enable tempest and mogan in `local.conf` and run `stack.sh`. Then you can
run mogan tempest tests with `tempest run` command, see::
$ ./stack.sh
$ cd /opt/stack/tempest/
$ tempest run -t --regex "^mogan\."
For more details, you can see `tempest documentation`_
.. _tempest documentation: https://docs.openstack.org/tempest/latest/
.. seealso::
* tox_
.. _tox: https://tox.readthedocs.io/en/latest/

101
doc/source/index.rst Normal file
View File

@ -0,0 +1,101 @@
..
Copyright 2010-2012 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.
====================================
OpenStack Bare Metal Compute (mogan)
====================================
Introduction
============
Mogan is an OpenStack project which offers bare metals as first class
resources to users, supporting variety of bare metal provisioning drivers
including Ironic.
Contributor Guide
=================
If you are new to mogan, this section contains information that should help
you get started as a developer working on the project or contributing to the
project.
.. toctree::
:maxdepth: 1
contributor/code-contribution-guide
contributor/dev-quickstart
contributor/make-changes-to-database
contributor/testing
Installation Guide
==================
.. toctree::
:maxdepth: 1
installation/configure-mogan-api-uwsgi
installation/build-user-images
User Guide
==========
.. toctree::
:maxdepth: 1
user/states
user/availability-zones
user/root-disk-partitions
user/server-groups
Administrator Guide
===================
.. toctree::
:maxdepth: 1
admin/flavors
admin/aggregates
admin/gmr
Configuration Guide
===================
.. toctree::
:maxdepth: 1
configuration/sample_config
configuration/sample_policy
Command References
==================
Here are references for commands not elsewhere documented.
.. toctree::
:maxdepth: 1
cmds/mogan-dbsync
Indices and tables
==================
* :ref:`search`

View File

@ -0,0 +1,45 @@
Build user images
=================
Mogan bare metal provisioning supports two types of images, partition
images and whole disk images.
But we only support local boot, so it's important to note that in order
for this to work, the partition image being deployed with Mogan **must**
contain ``grub2`` installed within it.
Config Drive
************
The configuration drive is used to store server specific metadata.
``Cloud-init`` has a collection of data source modules, so when building the
image with `disk-image-builder`_ we have to define ``DIB_CLOUD_INIT_DATASOURCES``
environment variable and set the appropriate sources to enable the configuration
drive, for example::
DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, OpenStack" disk-image-create -o fedora-cloud-image fedora baremetal grub2
For more information see `how to configure cloud-init data sources
<https://docs.openstack.org/diskimage-builder/latest/elements/cloud-init-datasources/README.html>`_.
Build images with disk-image-builder
************************************
The `disk-image-builder`_ can be used to create user images required for
deployment and the actual OS which the user is going to run.
.. _disk-image-builder: https://docs.openstack.org/diskimage-builder/latest/
#. Partition images
.. code-block:: console
$ DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, OpenStack" disk-image-create ubuntu baremetal grub2 dhcp-all-interfaces cloud-init-datasources -o my-image
#. Whole disk images
.. code-block:: console
$ DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, OpenStack" disk-image-create ubuntu vm dhcp-all-interfaces cloud-init-datasources -o my-image
.. _disk-image-builder: https://docs.openstack.org/diskimage-builder/latest/

View File

@ -0,0 +1,79 @@
..
Copyright (c) 2017 Intel Corporation
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.
Configure Mogan API with uWSGI
==============================
The recommended way to deploy Mogan is have a web server such as Apache
or nginx to handle http requests and proxy these requests to Mogan WSGI
app running in uWSGI. Mogan comes with some configuration templates on
how to deploy the api service with Apache and uWSGI.
app.wsgi
********
The ``mogan/api/app.wsgi`` file contains a WSGI application of
Mogan API service. This file is installed with Mogan application
code.
apache-mogan.template
*********************
The ``mogan/etc/apache-mogan.template`` file contains a copy
of Apache configuration file for Mogan API used by devstack.
mogan-uwsgi.ini.sample
**********************
The ``mogan/etc/mogan-uwsgi.ini.sample`` file is a sample
configuration file for uWSGI server. Update the file to match your
system configuration.
Steps to use these sample configuration files:
1. Enable mod_proxy_uwsgi module
* On Ubuntu install required uwsgi package
``sudo apt-get install libapache2-mod-proxy-uwsgi``; enable using
``sudo a2enmod proxy``, ``sudo a2enmod proxy_uwsgi``.
* On Fedora the required package is mod_proxy_uwsgi; enable by creating a file
``/etc/httpd/conf.modules.d/11-proxy_uwsgi.conf`` containing
``LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so``
2. On deb-based systems copy or symlink the file ``apache-mogan.template`` to
``/etc/apache2/sites-available/mogan.conf``. For rpm-based systems the file
should go into ``/etc/httpd/conf.d/mogan.conf``.
uWSGI need a socket file to connect between apache proxy and uWSGI web
server, it usually is under ``/var/run/uwsgi``, but ``/var/run`` will be
empty on after system reboot, so we can use systemd-temptiles to
automatically create a socket dir::
$ sudo mkdir -p /etc/tmpfiles.d/
$ echo "d /var/run/uwsgi 0755 <STACK_USER> root" | sudo tee /etc/tmpfiles.d/uwsgi.conf
$ sudo systemd-tmpfiles --create /etc/tmpfiles.d/uwsgi.conf
3. Enable Mogan site. On deb-based systems::
$ a2ensite mogan
$ service apache2 reload
On rpm-based systems::
$ service httpd reload
4. Copy mogan/etc/mogan-uwsgi.ini.sample to /etc/mogan/mogan-uwsgi.ini.
5. Start Mogan api using uWSGI::
$ sudo pip install uwsgi
$ uwsgi --ini /etc/mogan/mogan-uwsgi.ini

View File

@ -0,0 +1,30 @@
====================================================
Select availability zones where servers are launched
====================================================
You can select which availability zone servers are launched on.
#. To select the availabiilty zone where servers are launched, use the
``--availability-zone ZONE`` parameter on the :command:`openstack
baremetalcompute server create` command.
For example:
.. code-block:: console
$ openstack baremetalcompute server create --image IMAGE --flavor m1.tiny \
--key-name KEY --availability-zone ZONE --nic net-id=UUID \
--partition ephemeral_gb=500 SERVER
#. To view the list of valid zones, use the :command:`openstack baremetalcompute
availability zone list` command.
.. code-block:: console
$ openstack baremetalcompute availability zone list
+-----------+
| Zone Name |
+-----------+
| zone1 |
| zone2 |
+-----------+

Some files were not shown because too many files have changed in this diff Show More