Browse Source

Migrate API documentations into the Heat tree

For more information, see:
http://lists.openstack.org/pipermail/openstack-dev/2016-May/093765.html

This is the initial port from api-site. The includes in
source/v1/index.rst are alphabetized, but we may want to revisit that
and reorder them according to importance.

Change-Id: I6f578107e17d3a97e667f645a05493da12ae2048
Implements: blueprint api-doc-migration
changes/12/312712/2
Jay Dobies 6 years ago
parent
commit
4170566618
  1. 0
      api-ref/ext/__init__.py
  2. 377
      api-ref/ext/rest_parameters.py
  3. 224
      api-ref/source/conf.py
  4. 24
      api-ref/source/index.rst
  5. 39
      api-ref/source/v1/build-info.inc
  6. 13
      api-ref/source/v1/general-info.inc
  7. 38
      api-ref/source/v1/heat-versions.inc
  8. 32
      api-ref/source/v1/index.rst
  9. 1580
      api-ref/source/v1/parameters.yaml
  10. 8
      api-ref/source/v1/samples/build-info-response.json
  11. 28
      api-ref/source/v1/samples/config-create-request.json
  12. 32
      api-ref/source/v1/samples/config-create-response.json
  13. 32
      api-ref/source/v1/samples/config-show-response.json
  14. 8
      api-ref/source/v1/samples/deployment-create-request.json
  15. 14
      api-ref/source/v1/samples/deployment-create-response.json
  16. 130
      api-ref/source/v1/samples/deployment-metadata-response.json
  17. 14
      api-ref/source/v1/samples/deployment-show-response.json
  18. 10
      api-ref/source/v1/samples/deployment-update-request.json
  19. 19
      api-ref/source/v1/samples/deployment-update-response.json
  20. 21
      api-ref/source/v1/samples/deployments-list-response.json
  21. 33
      api-ref/source/v1/samples/event-show-response.json
  22. 50
      api-ref/source/v1/samples/events-list-response.json
  23. 14
      api-ref/source/v1/samples/heat-versions-response.json
  24. 6
      api-ref/source/v1/samples/resource-metadata-response.json
  25. 30
      api-ref/source/v1/samples/resource-schema-response.json
  26. 27
      api-ref/source/v1/samples/resource-show-response.json
  27. 50
      api-ref/source/v1/samples/resource-type-template-response.json
  28. 61
      api-ref/source/v1/samples/resource-types-list-response.json
  29. 25
      api-ref/source/v1/samples/resources-list-response.json
  30. 30
      api-ref/source/v1/samples/services-list-response.json
  31. 69
      api-ref/source/v1/samples/stack-abandon-response.json
  32. 3
      api-ref/source/v1/samples/stack-action-cancel-update-request.json
  33. 3
      api-ref/source/v1/samples/stack-action-check-request.json
  34. 3
      api-ref/source/v1/samples/stack-action-resume-request.json
  35. 3
      api-ref/source/v1/samples/stack-action-suspend-request.json
  36. 33
      api-ref/source/v1/samples/stack-adopt-request.json
  37. 32
      api-ref/source/v1/samples/stack-create-request.json
  38. 11
      api-ref/source/v1/samples/stack-create-response.json
  39. 27
      api-ref/source/v1/samples/stack-find-response.json
  40. 10
      api-ref/source/v1/samples/stack-outputs-list-response.json
  41. 168
      api-ref/source/v1/samples/stack-preview-response.json
  42. 8
      api-ref/source/v1/samples/stack-show-output-response.json
  43. 32
      api-ref/source/v1/samples/stack-show-response.json
  44. 47
      api-ref/source/v1/samples/stack-show-snapshot-response.json
  45. 3
      api-ref/source/v1/samples/stack-snapshot-request.json
  46. 8
      api-ref/source/v1/samples/stack-snapshot-response.json
  47. 12
      api-ref/source/v1/samples/stack-snapshots-list-response.json
  48. 67
      api-ref/source/v1/samples/stack-update-preview-response.json
  49. 28
      api-ref/source/v1/samples/stack-update-request.json
  50. 20
      api-ref/source/v1/samples/stacks-list-response.json
  51. 28
      api-ref/source/v1/samples/template-show-response.json
  52. 3
      api-ref/source/v1/samples/template-validate-request.json
  53. 41
      api-ref/source/v1/samples/template-validate-response.json
  54. 32
      api-ref/source/v1/samples/template-versions-response.json
  55. 67
      api-ref/source/v1/service-status.inc
  56. 416
      api-ref/source/v1/software-config.inc
  57. 173
      api-ref/source/v1/stack-actions.inc
  58. 155
      api-ref/source/v1/stack-events.inc
  59. 191
      api-ref/source/v1/stack-resources.inc
  60. 300
      api-ref/source/v1/stack-templates.inc
  61. 818
      api-ref/source/v1/stacks.inc
  62. 18
      tox.ini

0
api-ref/ext/__init__.py

377
api-ref/ext/rest_parameters.py

@ -0,0 +1,377 @@
# 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.
"""This provides a sphinx extension able to create the HTML needed
for the api-ref website.
It contains 2 new stanzas.
.. rest_method:: GET /foo/bar
Which is designed to be used as the first stanza in a new section to
state that section is about that REST method. During processing the
rest stanza will be reparented to be before the section in question,
and used as a show/hide selector for it's details.
.. rest_parameters:: file.yaml
- name1: name_in_file1
- name2: name_in_file2
- name3: name_in_file3
Which is designed to build structured tables for either response or
request parameters. The stanza takes a value which is a file to lookup
details about the parameters in question.
The contents of the stanza are a yaml list of key / value pairs. The
key is the name of the parameter to be shown in the table. The value
is the key in the file.yaml where all other metadata about the
parameter will be extracted. This allows for reusing parameter
definitions widely in API definitions, but still providing for control
in both naming and ordering of parameters at every declaration.
"""
from docutils import nodes
from docutils.parsers.rst.directives.tables import Table
from docutils.statemachine import ViewList
from sphinx.util.compat import Directive
import yaml
def full_name(cls):
return cls.__module__ + '.' + cls.__name__
class rest_method(nodes.Part, nodes.Element):
"""rest_method custom node type
We specify a custom node type for rest_method so that we can
accumulate all the data about the rest method, but not render as
part of the normal rendering process. This means that we need a
renderer for every format we wish to support with this.
"""
pass
class rest_expand_all(nodes.Part, nodes.Element):
pass
class RestExpandAllDirective(Directive):
has_content = True
def run(self):
return [rest_expand_all()]
class RestMethodDirective(Directive):
# this enables content in the directive
has_content = True
def run(self):
lineno = self.state_machine.abs_line_number()
target = nodes.target()
section = nodes.section(classes=["detail-control"])
# env = self.state.document.settings.env
# env.app.info("Parent %s" % self.state.parent.attributes)
node = rest_method()
# TODO(sdague): this is a super simplistic parser, should be
# more robust.
method, sep, url = self.content[0].partition(' ')
node['method'] = method
node['url'] = url
node['target'] = self.state.parent.attributes['ids'][0]
# We need to build a temporary target that we can replace
# later in the processing to get the TOC to resolve correctly.
temp_target = "%s-selector" % node['target']
target = nodes.target(ids=[temp_target])
self.state.add_target(temp_target, '', target, lineno)
section += node
return [target, section]
class RestParametersDirective(Table):
headers = ["Name", "In", "Type", "Description"]
def yaml_from_file(self, fpath):
"""Collect Parameter stanzas from inline + file.
This allows use to reference an external file for the actual
parameter definitions.
"""
# self.app.info("Fpath: %s" % fpath)
try:
with open(fpath, 'r') as stream:
lookup = yaml.load(stream)
except IOError:
self.env.warn(
self.env.docname,
"Parameters file %s not found" % fpath)
return
except yaml.YAMLError as exc:
self.app.warn(exc)
raise
content = "\n".join(self.content)
parsed = yaml.load(content)
# self.app.info("Params loaded is %s" % parsed)
# self.app.info("Lookup table looks like %s" % lookup)
new_content = list()
for paramlist in parsed:
for name, ref in paramlist.items():
if ref in lookup:
new_content.append((name, lookup[ref]))
else:
# TODO(sdague): this provides a kind of confusing
# error message because env.warn isn't meant to be
# used this way, however it does provide a way to
# track down where the parameters list is that is
# wrong. So it's good enough for now.
self.env.warn(
"%s:%s " % (
self.state_machine.node.source,
self.state_machine.node.line),
("No field definition for ``%s`` found in ``%s``. "
" Skipping." % (ref, fpath)))
# self.app.info("New content %s" % new_content)
self.yaml = new_content
def run(self):
self.env = self.state.document.settings.env
self.app = self.env.app
# Make sure we have some content, which should be yaml that
# defines some parameters.
if not self.content:
error = self.state_machine.reporter.error(
'No parameters defined',
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
return [error]
if not len(self.arguments) >= 1:
self.state_machine.reporter.error(
'No reference file defined',
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
return [error]
# NOTE(sdague): it's important that we pop the arg otherwise
# we end up putting the filename as the table caption.
rel_fpath, fpath = self.env.relfn2path(self.arguments.pop())
self.yaml_file = fpath
self.yaml_from_file(self.yaml_file)
self.max_cols = len(self.headers)
# TODO(sdague): it would be good to dynamically set column
# widths (or basically make the colwidth thing go away
# entirely)
self.options['widths'] = (20, 10, 10, 60)
self.col_widths = self.get_column_widths(self.max_cols)
# Actually convert the yaml
title, messages = self.make_title()
# self.app.info("Title %s, messages %s" % (title, messages))
table_node = self.build_table()
self.add_name(table_node)
if title:
table_node.insert(0, title)
return [table_node] + messages
def get_rows(self, table_data):
rows = []
groups = []
trow = nodes.row()
entry = nodes.entry()
para = nodes.paragraph(text=unicode(table_data))
entry += para
trow += entry
rows.append(trow)
return rows, groups
# Add a column for a field. In order to have the RST inside
# these fields get rendered, we need to use the
# ViewList. Note, ViewList expects a list of lines, so chunk
# up our content as a list to make it happy.
def add_col(self, value):
entry = nodes.entry()
result = ViewList(value.split('\n'))
self.state.nested_parse(result, 0, entry)
return entry
def show_no_yaml_error(self):
trow = nodes.row(classes=["no_yaml"])
trow += self.add_col("No yaml found %s" % self.yaml_file)
trow += self.add_col("")
trow += self.add_col("")
trow += self.add_col("")
return trow
def collect_rows(self):
rows = []
groups = []
try:
# self.app.info("Parsed content is: %s" % self.yaml)
for key, values in self.yaml:
min_version = values.get('min_version', '')
desc = values.get('description', '')
classes = []
if min_version:
desc += ("\n\n**New in version %s**\n" % min_version)
min_ver_css_name = ("rp_min_ver_" +
str(min_version).replace('.', '_'))
classes.append(min_ver_css_name)
trow = nodes.row(classes=classes)
name = key
if values.get('required', False) is False:
name += " (Optional)"
trow += self.add_col(name)
trow += self.add_col(values.get('in'))
trow += self.add_col(values.get('type'))
trow += self.add_col(desc)
rows.append(trow)
except AttributeError as exc:
if 'key' in locals():
self.app.warn("Failure on key: %s, values: %s. %s" %
(key, values, exc))
else:
rows.append(self.show_no_yaml_error())
return rows, groups
def build_table(self):
table = nodes.table()
tgroup = nodes.tgroup(cols=len(self.headers))
table += tgroup
# TODO(sdague): it would be really nice to figure out how not
# to have this stanza, it kind of messes up all of the table
# formatting because it doesn't let tables just be the right
# size.
tgroup.extend(
nodes.colspec(colwidth=col_width, colname='c' + str(idx))
for idx, col_width in enumerate(self.col_widths)
)
thead = nodes.thead()
tgroup += thead
row_node = nodes.row()
thead += row_node
row_node.extend(nodes.entry(h, nodes.paragraph(text=h))
for h in self.headers)
tbody = nodes.tbody()
tgroup += tbody
rows, groups = self.collect_rows()
tbody.extend(rows)
table.extend(groups)
return table
def rest_method_html(self, node):
tmpl = """
<div class="row operation-grp">
<div class="col-md-1 operation">
<a name="%(target)s" class="operation-anchor" href="#%(target)s">
<span class="glyphicon glyphicon-link"></span></a>
<span class="label label-success">%(method)s</span>
</div>
<div class="col-md-5">%(url)s</div>
<div class="col-md-5">%(desc)s</div>
<div class="col-md-1">
<button
class="btn btn-info btn-sm btn-detail"
data-target="#%(target)s-detail"
data-toggle="collapse"
id="%(target)s-detail-btn"
>detail</button>
</div>
</div>"""
self.body.append(tmpl % node)
raise nodes.SkipNode
def rest_expand_all_html(self, node):
tmpl = """
<div>
<div class=col-md-11></div>
<div class=col-md-1>
<button id="expand-all"
data-toggle="collapse"
class="btn btn-info btn-sm btn-expand-all"
>Show All</button>
</div>
</div>"""
self.body.append(tmpl % node)
raise nodes.SkipNode
def resolve_rest_references(app, doctree):
for node in doctree.traverse():
if isinstance(node, rest_method):
rest_node = node
rest_method_section = node.parent
rest_section = rest_method_section.parent
gp = rest_section.parent
# Added required classes to the top section
rest_section.attributes['classes'].append('api-detail')
rest_section.attributes['classes'].append('collapse')
# Pop the title off the collapsed section
title = rest_section.children.pop(0)
rest_node['desc'] = title.children[0]
# In order to get the links in the sidebar to be right, we
# have to do some id flipping here late in the game. The
# rest_method_section has basically had a dummy id up
# until this point just to keep it from colliding with
# it's parent.
rest_section.attributes['ids'][0] = (
"%s-detail" % rest_section.attributes['ids'][0])
rest_method_section.attributes['ids'][0] = rest_node['target']
# Pop the overall section into it's grand parent,
# right before where the current parent lives
idx = gp.children.index(rest_section)
rest_section.remove(rest_method_section)
gp.insert(idx, rest_method_section)
def setup(app):
app.add_node(rest_method,
html=(rest_method_html, None))
app.add_node(rest_expand_all,
html=(rest_expand_all_html, None))
app.add_directive('rest_parameters', RestParametersDirective)
app.add_directive('rest_method', RestMethodDirective)
app.add_directive('rest_expand_all', RestExpandAllDirective)
app.add_stylesheet('bootstrap.min.css')
app.add_stylesheet('api-site.css')
app.add_javascript('bootstrap.min.js')
app.add_javascript('api-site.js')
app.connect('doctree-read', resolve_rest_references)
return {'version': '0.1'}

224
api-ref/source/conf.py

@ -0,0 +1,224 @@
# -*- coding: utf-8 -*-
#
# 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.
#
# heat documentation build config file, copied from:
# nova 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
# 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.
extensions = [
'ext.rest_parameters',
'oslosphinx',
]
# 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'Orchestration 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 heat.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.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0]
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 = 'heatdoc'
# -- 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', 'Heat.tex', u'OpenStack Orchestration 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

24
api-ref/source/index.rst

@ -0,0 +1,24 @@
..
Copyright 2010 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.
==========================
Orchestration Service APIs
==========================
.. toctree::
:maxdepth: 1
v1/index

39
api-ref/source/v1/build-info.inc

@ -0,0 +1,39 @@
.. -*- rst -*-
==========
Build info
==========
Show build information
======================
.. rest_method:: GET /v1/{tenant_id}/build_info
Shows build information for an Orchestration deployment.
Normal response codes: 200
Error response codes:
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
Response Example
----------------
.. literalinclude:: samples/build-info-response.json
:language: javascript

13
api-ref/source/v1/general-info.inc

@ -0,0 +1,13 @@
.. -*- rst -*-
=======================
General API information
=======================
Authenticated calls that target a known URI but that use an HTTP
method that the implementation does not support return a ``405
Method Not Allowed`` error code. In addition, the HTTP ``OPTIONS``
method is supported for each known URI. In both cases, the
``Allow`` response header indicates the HTTP methods that are
supported for the resource.

38
api-ref/source/v1/heat-versions.inc

@ -0,0 +1,38 @@
.. -*- rst -*-
============
API versions
============
List versions
=============
.. rest_method:: GET /
Lists all Orchestration API versions.
Normal response codes: 200
Error response codes:
Request
-------
.. rest_parameters:: parameters.yaml
Response Example
----------------
.. literalinclude:: samples/heat-versions-response.json
:language: javascript

32
api-ref/source/v1/index.rst

@ -0,0 +1,32 @@
..
Copyright 2010 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.
:tocdepth: 2
============================
Orchestration Service API v1
============================
.. include:: build-info.inc
.. include:: general-info.inc
.. include:: heat-versions.inc
.. include:: service-status.inc
.. include:: software-config.inc
.. include:: stack-actions.inc
.. include:: stack-events.inc
.. include:: stack-resources.inc
.. include:: stack-templates.inc
.. include:: stacks.inc

1580
api-ref/source/v1/parameters.yaml

File diff suppressed because it is too large Load Diff

8
api-ref/source/v1/samples/build-info-response.json

@ -0,0 +1,8 @@
{
"api": {
"revision": "{api_build_revision}"
},
"engine": {
"revision": "{engine_build_revision}"
}
}

28
api-ref/source/v1/samples/config-create-request.json

@ -0,0 +1,28 @@
{
"inputs": [
{
"default": null,
"type": "String",
"name": "foo",
"description": null
},
{
"default": null,
"type": "String",
"name": "bar",
"description": null
}
],
"group": "script",
"name": "a-config-we5zpvyu7b5o",
"outputs": [
{
"type": "String",
"name": "result",
"error_output": false,
"description": null
}
],
"config": "#!/bin/sh -x\necho \"Writing to /tmp/$bar\"\necho $foo > /tmp/$bar\necho -n \"The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action\" > $heat_outputs_path.result\necho \"Written to /tmp/$bar\"\necho \"Output to stderr\" 1>&2",
"options": null
}

32
api-ref/source/v1/samples/config-create-response.json

@ -0,0 +1,32 @@
{
"software_config": {
"creation_time": "2015-01-31T15:12:36Z",
"inputs": [
{
"default": null,
"type": "String",
"name": "foo",
"description": null
},
{
"default": null,
"type": "String",
"name": "bar",
"description": null
}
],
"group": "script",
"name": "a-config-we5zpvyu7b5o",
"outputs": [
{
"type": "String",
"name": "result",
"error_output": false,
"description": null
}
],
"options": null,
"config": "#!/bin/sh -x\necho \"Writing to /tmp/$bar\"\necho $foo > /tmp/$bar\necho -n \"The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action\" > $heat_outputs_path.result\necho \"Written to /tmp/$bar\"\necho \"Output to stderr\" 1>&2",
"id": "ddee7aca-aa32-4335-8265-d436b20db4f1"
}
}

32
api-ref/source/v1/samples/config-show-response.json

@ -0,0 +1,32 @@
{
"software_config": {
"inputs": [
{
"default": null,
"type": "String",
"name": "foo",
"description": null
},
{
"default": null,
"type": "String",
"name": "bar",
"description": null
}
],
"group": "script",
"name": "a-config-we5zpvyu7b5o",
"outputs": [
{
"type": "String",
"name": "result",
"error_output": false,
"description": null
}
],
"creation_time": "2015-01-31T15:12:36Z",
"id": "ddee7aca-aa32-4335-8265-d436b20db4f1",
"config": "#!/bin/sh -x\necho \"Writing to /tmp/$bar\"\necho $foo > /tmp/$bar\necho -n \"The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action\" > $heat_outputs_path.result\necho \"Written to /tmp/$bar\"\necho \"Output to stderr\" 1>&2",
"options": null
}
}

8
api-ref/source/v1/samples/deployment-create-request.json

@ -0,0 +1,8 @@
{
"status": "IN_PROGRESS",
"server_id": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"config_id": "8da95794-2ad9-4979-8ae5-739ce314c5cd",
"stack_user_project_id": "c024bfada67845ddb17d2b0c0be8cd79",
"action": "CREATE",
"status_reason": "Deploy data available"
}

14
api-ref/source/v1/samples/deployment-create-response.json

@ -0,0 +1,14 @@
{
"software_deployment": {
"status": "IN_PROGRESS",
"server_id": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"config_id": "8da95794-2ad9-4979-8ae5-739ce314c5cd",
"output_values": null,
"input_values": null,
"action": "CREATE",
"status_reason": "Deploy data available",
"id": "ef422fa5-719a-419e-a10c-72e3a367b0b8",
"creation_time": "2015-01-31T15:12:36Z",
"updated_time": "2015-01-31T15:18:21Z"
}
}

130
api-ref/source/v1/samples/deployment-metadata-response.json

@ -0,0 +1,130 @@
{
"metadata": [
{
"inputs": [
{
"default": null,
"type": "String",
"name": "foo",
"value": "fooooo",
"description": null
},
{
"default": null,
"type": "String",
"name": "bar",
"value": "baaaaa",
"description": null
},
{
"type": "String",
"name": "deploy_server_id",
"value": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"description": "ID of the server being deployed to"
},
{
"type": "String",
"name": "deploy_action",
"value": "CREATE",
"description": "Name of the current action being deployed"
},
{
"type": "String",
"name": "deploy_stack_id",
"value": "a/9bd57090-8954-48ab-bab9-adf9e1ac70fc",
"description": "ID of the stack this deployment belongs to"
},
{
"type": "String",
"name": "deploy_resource_name",
"value": "deployment",
"description": "Name of this deployment resource in the stack"
},
{
"type": "String",
"name": "deploy_signal_id",
"value": "http://192.168.20.103:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3Ae2a84fbdaeb047ae8da4b503f3b69f1f%3Astacks%2Fa%2F9bd57090-8954-48ab-bab9-adf9e1ac70fc%2Fresources%2Fdeployment?Timestamp=2014-03-19T20%3A30%3A59Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=ca3571413e4a49998d580215517b3685&SignatureVersion=2&Signature=w6Iu%2BNbg86mqwSOUf1GLuKPO7KaD82PiGpL4ig9Q1l4%3D",
"description": "ID of signal to use for signalling output values"
}
],
"group": "script",
"name": "a-config-we5zpvyu7b5o",
"outputs": [
{
"type": "String",
"name": "result",
"error_output": false,
"description": null
}
],
"options": null,
"creation_time": "2015-01-31T15:12:36Z",
"updated_time": "2015-01-31T15:18:21Z",
"config": "#!/bin/sh -x\necho \"Writing to /tmp/$bar\"\necho $foo > /tmp/$bar\necho -n \"The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action\" > $heat_outputs_path.result\necho \"Written to /tmp/$bar\"\necho \"Output to stderr\" 1>&2",
"id": "3d5ec2a8-7004-43b6-a7f6-542bdbe9d434"
},
{
"inputs": [
{
"default": null,
"type": "String",
"name": "foo",
"value": "fu",
"description": null
},
{
"default": null,
"type": "String",
"name": "bar",
"value": "barmy",
"description": null
},
{
"type": "String",
"name": "deploy_server_id",
"value": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"description": "ID of the server being deployed to"
},
{
"type": "String",
"name": "deploy_action",
"value": "CREATE",
"description": "Name of the current action being deployed"
},
{
"type": "String",
"name": "deploy_stack_id",
"value": "a/9bd57090-8954-48ab-bab9-adf9e1ac70fc",
"description": "ID of the stack this deployment belongs to"
},
{
"type": "String",
"name": "deploy_resource_name",
"value": "other_deployment",
"description": "Name of this deployment resource in the stack"
},
{
"type": "String",
"name": "deploy_signal_id",
"value": "http://192.168.20.103:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3Ae2a84fbdaeb047ae8da4b503f3b69f1f%3Astacks%2Fa%2F9bd57090-8954-48ab-bab9-adf9e1ac70fc%2Fresources%2Fother_deployment?Timestamp=2014-03-19T20%3A30%3A59Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=7b761482f8254946bcd3d5ccb36fe939&SignatureVersion=2&Signature=giMfv%2BhrAw6y%2FCMKQIQz2IhO5PkAj5%2BfP5YsL6rul3o%3D",
"description": "ID of signal to use for signalling output values"
}
],
"group": "script",
"name": "a-config-we5zpvyu7b5o",
"outputs": [
{
"type": "String",
"name": "result",
"error_output": false,
"description": null
}
],
"options": null,
"creation_time": "2015-01-31T16:14:13Z",
"updated_time": "2015-01-31T16:18:19Z",
"config": "#!/bin/sh -x\necho \"Writing to /tmp/$bar\"\necho $foo > /tmp/$bar\necho -n \"The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action\" > $heat_outputs_path.result\necho \"Written to /tmp/$bar\"\necho \"Output to stderr\" 1>&2",
"id": "8da95794-2ad9-4979-8ae5-739ce314c5cd"
}
]
}

14
api-ref/source/v1/samples/deployment-show-response.json

@ -0,0 +1,14 @@
{
"software_deployment": {
"status": "IN_PROGRESS",
"server_id": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"config_id": "3d5ec2a8-7004-43b6-a7f6-542bdbe9d434",
"output_values": null,
"input_values": null,
"action": "CREATE",
"status_reason": "Deploy data available",
"id": "06e87bcc-33a2-4bce-aebd-533e698282d3",
"creation_time": "2015-01-31T15:12:36Z",
"updated_time": "2015-01-31T15:18:21Z"
}
}

10
api-ref/source/v1/samples/deployment-update-request.json

@ -0,0 +1,10 @@
{
"status": "COMPLETE",
"output_values": {
"deploy_stdout": "Writing to /tmp/baaaaa\nWritten to /tmp/baaaaa\n",
"deploy_stderr": "+ echo Writing to /tmp/baaaaa\n+ echo fooooo\n+ cat /tmp/baaaaa\n+ echo -n The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE\n+ echo Written to /tmp/baaaaa\n+ echo Output to stderr\nOutput to stderr\n",
"deploy_status_code": 0,
"result": "The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE"
},
"status_reason": "Outputs received"
}

19
api-ref/source/v1/samples/deployment-update-response.json

@ -0,0 +1,19 @@
{
"software_deployment": {
"status": "COMPLETE",
"server_id": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"config_id": "3d5ec2a8-7004-43b6-a7f6-542bdbe9d434",
"output_values": {
"deploy_stdout": "Writing to /tmp/baaaaa\nWritten to /tmp/baaaaa\n",
"deploy_stderr": "+ echo Writing to /tmp/baaaaa\n+ echo fooooo\n+ cat /tmp/baaaaa\n+ echo -n The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE\n+ echo Written to /tmp/baaaaa\n+ echo Output to stderr\nOutput to stderr\n",
"deploy_status_code": 0,
"result": "The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE"
},
"input_values": null,
"action": "CREATE",
"status_reason": "Outputs received",
"id": "06e87bcc-33a2-4bce-aebd-533e698282d3",
"creation_time": "2015-01-31T15:12:36Z",
"updated_time": "2015-01-31T15:18:21Z"
}
}

21
api-ref/source/v1/samples/deployments-list-response.json

@ -0,0 +1,21 @@
{
"software_deployments": [
{
"status": "COMPLETE",
"server_id": "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5",
"config_id": "8da95794-2ad9-4979-8ae5-739ce314c5cd",
"output_values": {
"deploy_stdout": "Writing to /tmp/barmy\nWritten to /tmp/barmy\n",
"deploy_stderr": "+ echo Writing to /tmp/barmy\n+ echo fu\n+ cat /tmp/barmy\n+ echo -n The file /tmp/barmy contains fu for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE\n+ echo Written to /tmp/barmy\n+ echo Output to stderr\nOutput to stderr\n",
"deploy_status_code": 0,
"result": "The file /tmp/barmy contains fu for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE"
},
"input_values": null,
"action": "CREATE",
"status_reason": "Outputs received",
"id": "ef422fa5-719a-419e-a10c-72e3a367b0b8",
"creation_time": "2015-01-31T15:12:36Z",
"updated_time": "2015-01-31T15:18:21Z"
}
]
}

33
api-ref/source/v1/samples/event-show-response.json

@ -0,0 +1,33 @@
{
"event": {
"event_time": "2015-06-25T14:59:53",
"id": "8db23e2e-72b2-47a2-9ed9-b52417f56e50",
"links": [
{
"href": "http://hostname/v1/1234/stacks/mystack/56789/resources/random_key_name/events/8db23e2e-72b2-47a2-9ed9-b52417f56e50",
"rel": "self"
},
{
"href": "http://hostname/v1/1234/stacks/mystack/56789/resources/random_key_name",
"rel": "resource"
},
{
"href": "http://hostname/v1/1234/stacks/mystack/56789",
"rel": "stack"
}
],
"logical_resource_id": "random_key_name",
"physical_resource_id": null,
"resource_name": "random_key_name",
"resource_properties": {
"character_classes": null,
"character_sequences": null,
"length": 8,
"salt": null,
"sequence": null
},
"resource_status": "CREATE_IN_PROGRESS",
"resource_status_reason": "state changed",
"resource_type": "OS::Heat::RandomString"
}
}

50
api-ref/source/v1/samples/events-list-response.json

@ -0,0 +1,50 @@
{
"events": [
{
"resource_name": "port",
"event_time": "2014-07-23T08:14:47Z",
"links": [
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5/resources/port/events/474bfdf0-a450-46ec-a78a-0c7faa404073",
"rel": "self"
},
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5/resources/port",
"rel": "resource"
},
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5",
"rel": "stack"
}
],
"logical_resource_id": "port",
"resource_status": "CREATE_FAILED",
"resource_status_reason": "NotFound: Subnet f8a699d0-3537-429e-87a5-6b5a8d0c2bf0 could not be found",
"physical_resource_id": null,
"id": "474bfdf0-a450-46ec-a78a-0c7faa404073"
},
{
"resource_name": "port",
"event_time": "2014-07-23T08:14:47Z",
"links": [
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5/resources/port/events/66fa95b6-e6f8-4f05-b1af-e828f5aba04c",
"rel": "self"
},
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5/resources/port",
"rel": "resource"
},
{
"href": "http://192.168.123.200:8004/v1/dc4b074874244f7693dd65583733a758/stacks/aws_port/db467ed1-50b5-4a3e-aeb1-396ff1d151c5",
"rel": "stack"
}
],
"logical_resource_id": "port",
"resource_status": "CREATE_IN_PROGRESS",
"resource_status_reason": "state changed",
"physical_resource_id": null,
"id": "66fa95b6-e6f8-4f05-b1af-e828f5aba04c"
}
]
}

14
api-ref/source/v1/samples/heat-versions-response.json

@ -0,0 +1,14 @@
{
"versions": [
{
"status": "CURRENT",
"id": "v1.0",
"links": [
{
"href": "http://23.253.228.211:8000/v1/",
"rel": "self"
}
]
}
]
}

6
api-ref/source/v1/samples/resource-metadata-response.json

@ -0,0 +1,6 @@
{
"metadata": {
"some_key": "some_value",
"some_other_key": "some_other_value"
}
}

30
api-ref/source/v1/samples/resource-schema-response.json

@ -0,0 +1,30 @@
{
"attributes": {
"an_attribute": {
"description": "A runtime value of the resource."
}
},
"properties": {
"a_property": {
"constraints": [
{
"description": "Must be between 1 and 255 characters",
"length": {
"max": 255,
"min": 1
}
}
],
"description": "A resource description.",
"required": true,
"type": "string",
"update_allowed": false
}
},
"resource_type": "OS::Heat::AResourceName",
"support_status": {
"message": "A status message",
"status": "SUPPORTED",
"version": "2014.1"
}
}

27
api-ref/source/v1/samples/resource-show-response.json

@ -0,0 +1,27 @@
{
"resource": {
"attributes": {
"value": "I9S20uIp"
},
"creation_time": "2015-06-25T14:59:53",
"description": "",
"links": [
{
"href": "http://hostname/v1/1234/stacks/mystack/629a32d0-ac4f-4f63-b58d-f0d047b1ba4c/resources/random_key_name",
"rel": "self"
},
{
"href": "http://hostname/v1/1234/stacks/mystack/629a32d0-ac4f-4f63-b58d-f0d047b1ba4c",
"rel": "stack"
}
],
"logical_resource_id": "random_key_name",
"physical_resource_id": "mystack-random_key_name-pmjmy5pks735",
"required_by": [],
"resource_name": "random_key_name",
"resource_status": "CREATE_COMPLETE",
"resource_status_reason": "state changed",
"resource_type": "OS::Heat::RandomString",
"updated_time": "2015-06-25T14:59:53"
}
}

50
api-ref/source/v1/samples/resource-type-template-response.json

@ -0,0 +1,50 @@
{
"HeatTemplateFormatVersion": "2012-12-12",
"Outputs": {
"private_key": {
"Description": "The private key if it has been saved.",
"Value": "{\"Fn::GetAtt\": [\"KeyPair\", \"private_key\"]}"
},
"public_key": {
"Description": "The public key.",
"Value": "{\"Fn::GetAtt\": [\"KeyPair\", \"public_key\"]}"
}
},
"Parameters": {
"name": {
"Description": "The name of the key pair.",
"Type": "String"
},
"public_key": {
"Description": "The optional public key. This allows users to supply the public key from a pre-existing key pair. If not supplied, a new key pair will be generated.",
"Type": "String"
},
"save_private_key": {
"AllowedValues": [
true,
"true",
false,
"false"
],
"Default": false,
"Description": "true if the system should remember a generated private key; false otherwise.",
"Type": "String"
}
},
"Resources": {
"KeyPair": {
"Properties": {
"name": {
"Ref": "name"
},
"public_key": {
"Ref": "public_key"
},
"save_private_key": {
"Ref": "save_private_key"
}
},
"Type": "OS::Nova::KeyPair"
}
}
}

61
api-ref/source/v1/samples/resource-types-list-response.json

@ -0,0 +1,61 @@
{
"resource_types": [
"AWS::EC2::Instance",
"OS::Heat::ScalingPolicy",
"AWS::CloudFormation::Stack",
"OS::Keystone::Group",
"OS::Glance::Image",
"AWS::EC2::Volume",
"OS::Heat::SoftwareDeployment",
"AWS::AutoScaling::ScalingPolicy",
"AWS::EC2::InternetGateway",
"OS::Heat::SoftwareDeployments",
"AWS::EC2::VolumeAttachment",
"AWS::CloudFormation::WaitConditionHandle",
"OS::Cinder::VolumeAttachment",
"OS::Cinder::EncryptedVolumeType",
"OS::Heat::AutoScalingGroup",
"OS::Nova::FloatingIP",
"OS::Heat::HARestarter",
"OS::Keystone::Project",
"OS::Keystone::Endpoint",
"OS::Heat::InstanceGroup",
"AWS::CloudWatch::Alarm",
"AWS::AutoScaling::AutoScalingGroup",
"OS::Heat::CloudConfig",
"OS::Heat::SoftwareComponent",
"OS::Cinder::Volume",
"OS::Keystone::Service",
"OS::Heat::WaitConditionHandle",
"OS::Heat::SoftwareConfig",
"AWS::CloudFormation::WaitCondition",
"OS::Heat::StructuredDeploymentGroup",
"OS::Heat::RandomString",
"OS::Heat::SoftwareDeploymentGroup",
"OS::Nova::KeyPair",
"OS::Heat::MultipartMime",
"OS::Heat::UpdateWaitConditionHandle",
"OS::Nova::Server",
"AWS::IAM::AccessKey",
"AWS::EC2::SecurityGroup",
"AWS::EC2::EIPAssociation",
"AWS::EC2::EIP",
"OS::Heat::AccessPolicy",
"AWS::IAM::User",
"OS::Heat::WaitCondition",
"OS::Heat::StructuredDeployment",
"AWS::RDS::DBInstance",
"AWS::AutoScaling::LaunchConfiguration",
"OS::Heat::Stack",
"OS::Nova::FloatingIPAssociation",
"OS::Heat::ResourceGroup",
"OS::Heat::StructuredConfig",
"OS::Nova::ServerGroup",
"OS::Heat::StructuredDeployments",
"OS::Keystone::Role",
"OS::Keystone::User",
"AWS::ElasticLoadBalancing::LoadBalancer",
"OS::Nova::Flavor",
"OS::Cinder::VolumeType"
]
}

25
api-ref/source/v1/samples/resources-list-response.json

@ -0,0 +1,25 @@
{
"resources": [
{
"creation_time": "2015-06-25T14:59:53",
"links": [
{
"href": "http://hostname/v1/1234/stacks/mystack/629a32d0-ac4f-4f63-b58d-f0d047b1ba4c/resources/random_key_name",
"rel": "self"
},
{
"href": "http://hostname/v1/1234/stacks/mystack/629a32d0-ac4f-4f63-b58d-f0d047b1ba4c",
"rel": "stack"
}
],
"logical_resource_id": "random_key_name",
"physical_resource_id": "mystack-random_key_name-pmjmy5pks735",
"required_by": [],
"resource_name": "random_key_name",
"resource_status": "CREATE_COMPLETE",
"resource_status_reason": "state changed",
"resource_type": "OS::Heat::RandomString",
"updated_time": "2015-06-25T14:59:53"
}
]
}

30
api-ref/source/v1/samples/services-list-response.json

@ -0,0 +1,30 @@
{
"services": [
{
"status": "up",
"binary": "heat-engine",
"report_interval": 60,
"engine_id": "9d9242c3-4b9e-45e1-9e74-7615fbf20e5d",
"created_at": "2015-02-03T05:55:59.000000",
"hostname": "mrkanag",
"updated_at": "2015-02-03T05:57:59.000000",
"topic": "engine",
"host": "engine-1",
"deleted_at": null,
"id": "e1908f44-42f9-483f-b778-bc814072c33d"
},
{
"status": "down",
"binary": "heat-engine",
"report_interval": 60,
"engine_id": "2d2434bf-adb6-4453-9c6b-b22fb8bd2306",
"created_at": "2015-02-03T06:03:14.000000",
"hostname": "mrkanag",
"updated_at": "2015-02-03T06:09:55.000000",