Merge "Add API documentation"

This commit is contained in:
Zuul 2019-06-17 14:53:49 +00:00 committed by Gerrit Code Review
commit bca6ba1798
79 changed files with 3754 additions and 3 deletions

View File

@ -12,6 +12,7 @@
- ^doc/.*
- ^qinling/tests/unit/.*$
- ^releasenotes/.*$
- ^api-ref/.*$
pre-run: playbooks/pre.yaml
post-run: playbooks/post.yaml
vars:

265
api-ref/source/aliases.inc Normal file
View File

@ -0,0 +1,265 @@
.. -*- rst -*-
========
Aliases
========
Lists, creates, updates, shows details and deletes aliases.
Function aliases are like pointers to the specific function versions.
By using aliases, you can access the specific version of a function an
alias is pointing to without having to know the specific version the alias
is pointing to.
Create an alias
===============
.. rest_method:: POST /v1/aliases
Create ana alias.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: function_id
- version: alias_version
- description: alias_description
Request Example
---------------
.. literalinclude:: samples/aliases/create-alias-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: alias_name
- description: alias_description
- function_id: function_id
- version_number: alias_version
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/aliases/create-alias-response.json
:language: javascript
List aliases
============
.. rest_method:: GET /v1/aliases
List aliases.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: alias_name
- description: alias_description
- function_id: function_id
- version_number: alias_version
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/aliases/list-aliases-response.json
:language: javascript
Show an alias
=============
.. rest_method:: GET /v1/aliases/{name}
Show an alias.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: path_alias_name
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: alias_name
- description: alias_description
- function_id: function_id
- version_number: alias_version
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/aliases/show-alias-response.json
:language: javascript
Update an alias
===============
.. rest_method:: PUT /v1/aliases/{name}
Update an alias.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: path_alias_name
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: alias_name
- description: alias_description
- function_id: function_id
- version_number: alias_version
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Request Example
---------------
.. literalinclude:: samples/aliases/update-alias-request.json
:language: javascript
Response Example
----------------
.. literalinclude:: samples/aliases/update-alias-response.json
:language: text
Delete an alias
===============
.. rest_method:: DELETE /v1/aliases/{name}
Delete an alias.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: path_alias_name
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/aliases/delete-alias-response.text
:language: text

View File

@ -0,0 +1,31 @@
============
API Versions
============
Show all enabled API versions
List all API versions
=====================
.. rest_method:: GET /
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
No parameters needed
Response Example
----------------
.. literalinclude:: samples/api-versions/get-versions-response.json
:language: javascript

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

@ -0,0 +1,223 @@
# -*- 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.
#
# Qinling documentation build configuration file
#
# 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 sys
extensions = [
'os_api_ref',
'openstackdocstheme',
]
html_theme = 'openstackdocs'
html_theme_options = {
"sidebar_mode": "toc",
}
# 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'Function Engine 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 qinling.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'
# openstackdocstheme options
repository_name = 'openstack/qinling'
bug_project = 'qinling'
bug_tag = 'api-ref'
# -- 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'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# 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 = 'qinlingdoc'
# -- 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', 'Qinling.tex',
u'OpenStack Function Engine 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

View File

@ -0,0 +1,304 @@
.. -*- rst -*-
===========
Executions
===========
Lists, creates, shows details for, and deletes function executions.
An execution runs the function and stores the return of the function.
The execution gets the returns and the prints.
Create an execution
====================
.. rest_method:: POST /v1/executions
Create an execution.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: function_id
- input: execution_input
- description: execution_description
- function_version: execution_version
- sync: execution_sync
Request Example
---------------
.. literalinclude:: samples/executions/create-execution-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- function_id: function_id
- input: execution_input
- description: execution_description
- function_version: execution_version
- sync: execution_sync
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/executions/create-execution-response.json
:language: javascript
List executions
===============
.. rest_method:: GET /v1/executions
List executions.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- function_id: function_id
- input: execution_input
- description: execution_description
- function_version: execution_version
- sync: execution_sync
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/executions/list-executions-response.json
:language: javascript
List executions by filters
==========================
.. rest_method:: GET /v1/executions?{filter}={function_id}
List executions by filters..
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- filter: path_execution_filter
- function_id: path_function_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- function_id: function_id
- input: execution_input
- description: execution_description
- function_version: execution_version
- sync: execution_sync
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/executions/list-executions-filters-response.json
:language: javascript
Show an execution
=================
.. rest_method:: GET /v1/executions/{execution_id}
Show an execution.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- execution_id: path_execution_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- function_id: function_id
- input: execution_input
- description: execution_description
- function_version: execution_version
- sync: execution_sync
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/executions/show-execution-response.json
:language: javascript
Show an execution log
=====================
.. rest_method:: GET /v1/executions/{execution_id}/log
Show an execution log.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- execution_id: path_execution_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/executions/show-execution-log-response.json
:language: javascript
Delete an execution
===================
.. rest_method:: DELETE /v1/executions/{execution_id}
Delete an execution.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- execution_id: path_execution_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/executions/delete-execution-response.text
:language: text

View File

@ -0,0 +1,524 @@
.. -*- rst -*-
==========
Functions
==========
Lists, creates, shows details for, downloads, detaches, updates,
scales and deletes functions.
Function contains the source code that will be executed into the runtime.
The source code langage within the function should match the runtime.
Create a function
=================
.. rest_method:: POST /v1/functions
Create a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: function_name
- description: function_description
- runtime_id: function_runtime_id
- code: function_code
- entry: function_entry
- cpu: function_cpu
- memory: function_memory
- timeout: function_timeout
- package: function_package
Request Example
---------------
Package
#######
.. literalinclude:: samples/functions/create-function-package-request.json
:language: javascript
.. literalinclude:: samples/functions/create-function-package-curl-request.text
:language: text
Swift
#####
.. literalinclude:: samples/functions/create-function-swift-request.json
:language: javascript
Image
#####
.. literalinclude:: samples/functions/create-function-image-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: function_name
- description: function_description
- runtime_id: function_runtime_id
- code: function_code
- entry: function_entry
- cpu: function_cpu
- memory: function_memory
- timeout: function_timeout
- package: function_package
- latest_version: function_latest_version
- count: function_count
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
Package
#######
.. literalinclude:: samples/functions/create-function-package-response.json
:language: javascript
Swift
#####
.. literalinclude:: samples/functions/create-function-swift-response.json
:language: javascript
Image
#####
.. literalinclude:: samples/functions/create-function-image-response.json
:language: javascript
List functions
==============
.. rest_method:: GET /v1/functions
List functions.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: function_name
- description: function_description
- runtime_id: function_runtime_id
- code: function_code
- count: function_count
- cpu: function_cpu
- memory: function_memory
- entry: function_entry
- timeout: function_timeout
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/functions/list-functions-response.json
:language: javascript
Show a function
===============
.. rest_method:: GET /v1/functions/{function_id}
Show a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: function_name
- description: function_description
- runtime_id: function_runtime_id
- code: function_code
- count: function_count
- cpu: function_cpu
- memory: function_memory
- entry: function_entry
- timeout: function_timeout
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/functions/show-function-response.json
:language: javascript
Update a function
=================
.. rest_method:: PUT /v1/functions/{function_id}
Update a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- name: function_name_update
- description: function_description
- runtime_id: function_runtime_id_update
- code: function_code_update
- entry: function_entry_update
- cpu: function_cpu
- memory: function_memory
- timeout: function_timeout
- package: function_package
- count: function_count
Request Example
---------------
Package
#######
.. literalinclude:: samples/functions/update-function-package-request.json
:language: javascript
.. literalinclude:: samples/functions/update-function-package-curl-request.text
:language: text
Swift
#####
.. literalinclude:: samples/functions/update-function-swift-request.json
:language: javascript
Image
#####
It is not possible to update an ``image`` function.
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: function_name
- description: function_description
- runtime_id: function_runtime_id
- code: function_code
- count: function_count
- cpu: function_cpu
- memory: function_memory
- entry: function_entry
- timeout: function_timeout
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
Package
#######
.. literalinclude:: samples/functions/update-function-package-response.json
:language: javascript
Swift
#####
.. literalinclude:: samples/functions/update-function-swift-response.json
:language: javascript
Image
#####
None
Download a function
===================
.. rest_method:: GET /v1/functions/{function_id}?download=true
Download a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/functions/download-function-response.text
:language: text
Detach a function from a worker
===============================
.. rest_method:: POST /v1/functions/{function_id}/detach
Detach a function from a worker.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/functions/detach-function-response.text
:language: text
Scale up a function
===================
.. rest_method:: POST /v1/functions/{function_id}/scale_up
Scale up a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- count: function_scale_count_up
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/functions/scaleup-function-response.text
:language: text
Scale down a function
=====================
.. rest_method:: POST /v1/functions/{function_id}/scale_down
Scale down a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- count: function_scale_count_down
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/functions/scaledown-function-response.text
:language: text
Delete a function
=================
.. rest_method:: DELETE /v1/functions/{function_id}
Delete a function.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/functions/delete-function-response.text
:language: text

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

@ -0,0 +1,17 @@
:tocdepth: 2
====================
Function Engine API
====================
.. rest_expand_all::
.. include:: urls.inc
.. include:: api-versions.inc
.. include:: runtimes.inc
.. include:: functions.inc
.. include:: executions.inc
.. include:: versions.inc
.. include:: aliases.inc
.. include:: webhooks.inc
.. include:: jobs.inc

275
api-ref/source/jobs.inc Normal file
View File

@ -0,0 +1,275 @@
.. -*- rst -*-
=====
Jobs
=====
Lists, creates, updates, shows details and deletes jobs.
Jobs allows to run periodically functions based on time period.
Time period is based on cron syntax.
Create a job
============
.. rest_method:: POST /v1/jobs
Create a job.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: job_name
- function_id: function_id
- function_version: job_version
- function_input: job_input
- pattern: job_pattern
- count: job_count
Request Example
---------------
.. literalinclude:: samples/jobs/create-job-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: job_name
- function_id: function_id
- function_version: job_version
- function_input: job_input
- pattern: job_pattern
- count: job_count
- first_execution_time: job_first_execution
- next_execution_time: job_next_execution
- status: status
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/jobs/create-job-response.json
:language: javascript
List jobs
=========
.. rest_method:: GET /v1/jobs
List jobs.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: job_name
- function_id: function_id
- function_version: job_version
- function_input: job_input
- pattern: job_pattern
- count: job_count
- first_execution_time: job_first_execution
- next_execution_time: job_next_execution
- status: status
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/jobs/list-jobs-response.json
:language: javascript
Show a job
==========
.. rest_method:: GET /v1/jobs/{job_id}
Show a job.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- job_id: path_job_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: job_name
- function_id: function_id
- function_version: job_version
- function_input: job_input
- pattern: job_pattern
- count: job_count
- first_execution_time: job_first_execution
- next_execution_time: job_next_execution
- status: status
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/jobs/show-job-response.json
:language: javascript
Update a job
============
.. rest_method:: PUT /v1/jobs/{job_id}
Update a job.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- job_id: path_job_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: job_name
- function_input: job_input
- pattern: job_pattern_update
- next_execution_time: job_next_execution_update
- status: job_status_update
Request Example
---------------
.. literalinclude:: samples/jobs/update-job-request.json
:language: javascript
Response Example
----------------
.. literalinclude:: samples/jobs/update-job-response.json
:language: javascript
Delete a job
============
.. rest_method:: DELETE /v1/jobs/{job_id}
Delete a job.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- job_id: path_job_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/jobs/delete-job-response.text
:language: text

View File

@ -0,0 +1,472 @@
####################
# Header Variables #
####################
x-auth-token:
description: |
Token used to identify the user from Keystone
in: header
required: false
type: string
####################
# Path Variables #
####################
path_alias_name:
description: |
Name of the alias
in: path
required: true
type: string
path_execution_filter:
description: |
Execution filter, e.g. "``function_id``, ``function_version``, etc..."
in: path
required: true
type: string
path_execution_id:
description: |
ID for the execution
in: path
required: true
type: uuid
path_function_id:
description: |
ID for the function
in: path
required: true
type: uuid
path_job_id:
description: |
ID for the job
in: path
required: true
type: uuid
path_runtime_id:
description: |
ID for the runtime
in: path
required: true
type: uuid
path_version_number:
description: |
Version number
in: path
required: true
type: integer
path_webhook_id:
description: |
ID for the webhook
in: path
required: true
type: uuid
####################
# Body Variables #
####################
alias_description:
description: |
Description for the alias
in: body
required: false
type: string
alias_name:
description: |
Name of the alias
in: body
required: true
type: string
alias_version:
description: |
Version of the function to point the alias
in: body
required: true
type: integer
created_at:
description: |
Date / Time when resource was created
in: body
required: false
type: datestamp
execution_description:
description: |
Description for the execution
in: body
required: false
type: string
execution_input:
description: |
Input data to pass to the function, e.g. ``{"name": "foo"}``
in: body
required: false
type: JSON
execution_sync:
description: |
Execution is sync or async, default is ``true``
in: body
required: false
type: bool
execution_version:
description: |
Version of the function to execute, default is ``0``
in: body
required: false
type: integer
function_code:
description: |
Source code type, e.g. "``package``", "``swift``", "``image``"
in: body
required: true
type: JSON
function_code_update:
description: |
Source code type, e.g. "``package``", "``swift``", "``image``"
Package function can't have this value updated.
in: body
required: false
type: JSON
function_count:
description: |
Total of time the function has been executed
in: body
required: true
type: integer
function_cpu:
description: |
Max CPU usage during the execution
in: body
required: false
type: integer
function_description:
description: |
Description for the function
in: body
required: false
type: string
function_entry:
description: |
Function entry point, e.g. "``hello_world.main``"
Not required if the source is "``image``"
in: body
required: true
type: string
function_entry_update:
description: |
Function entry point, e.g. "``hello_world.main``"
in: body
required: false
type: string
function_id:
description: |
ID for the function
in: body
required: true
type: uuid
function_latest_version:
description: |
Latest version created based on this function
in: body
required: false
type: integer
function_memory:
description: |
Max memory usage during the execution
in: body
required: false
type: integer
function_name:
description: |
Function name
in: body
required: true
type: string
function_name_update:
description: |
Function name
in: body
required: false
type: string
function_package:
description: |
Package to upload, e.g. "``package=@./hello_world.zip``"
Required only if '``"code": {"source": "package"}``'
in: body
required: false
type: string
function_runtime_id:
description: |
Runtime ID used by the function
in: body
required: true
type: uuid
function_runtime_id_update:
description: |
Runtime ID used by the function
in: body
required: false
type: uuid
function_scale_count_down:
description: |
Number of workers to scale down a function, default is ``1``
in: body
required: false
type: integer
function_scale_count_up:
description: |
Number of workers to scale up a function, default is ``1``
in: body
required: false
type: integer
function_timeout:
description: |
Timeout in second before the execution fails
in: body
required: false
type: integer
id:
description: |
ID for the resource
in: body
required: true
type: uuid
job_count:
description: |
Number of time the function should be executed, default is ``unlimited``
in: body
required: false
type: integer
job_first_execution:
description: |
First time the function will be executed
in: body
required: true
type: string
job_input:
description: |
Input data to pass to the function, e.g. ``{"name": "foo"}``
in: body
required: false
type: JSON
job_name:
description: |
Name of the job
in: body
required: true
type: string
job_next_execution:
description: |
Next time the function will be executed
in: body
required: true
type: string
job_next_execution_update:
description: |
Next time the function will be executed, e.g. "``2019-06-07 22:41:00``"
in: body
required: true
type: string
job_pattern:
description: |
Cron pattern, e.g. "``* * * * *``" is equal to every minutes
in: body
required: true
type: string
job_pattern_update:
description: |
Cron pattern, e.g. "``* * * * *``" is equal to every minutes
in: body
required: false
type: string
job_status_update:
description: |
Status of the job, e.g. "``paused``, ``running``, ``canceled``, ``done``"
in: body
required: false
type: string
job_version:
description: |
Version of the function to execute, default is ``0``
in: body
required: false
type: integer
project_id:
description: |
ID for the project that owns the resource
in: body
required: true
type: uuid
runtime_capacity:
description: |
Number of workers available and currently used
in: body
required: false
type: string
runtime_description:
description: |
Description for the runtime
in: body
required: false
type: string
runtime_id:
description: |
ID for the runtime
in: body
required: true
type: uuid
runtime_image:
description: |
Docker image used to build the runtime, e.g. "openstackqinling/python3-runtime"
in: body
required: true
type: string
runtime_image_update:
description: |
Docker image used to build the runtime, e.g. "openstackqinling/python3-runtime"
in: body
required: false
type: string
runtime_is_public:
description: |
Make the runtime public or not, if public then the runtime will be
available for all the tenant.
The runtime is public by default.
in: body
required: false
type: bool
runtime_name:
description: |
Runtime name
in: body
required: true
type: string
runtime_name_update:
description: |
Runtime name
in: body
required: false
type: string
runtime_trusted:
description: |
Define the runtime as trusted or not, depending the value Kubernetes
will apply some annotations like ``io.kubernetes.cri-o.TrustedSandbox``
in the pod specification to choose the underlying container runtime.
The runtime is trusted by default.
in: body
required: false
type: bool
status:
description: |
Status of the resource
in: body
required: true
type: enum
updated_at:
description: |
Date / Time when resource last updated
in: body
required: false
type: datestamp
version_count:
description: |
Total of time the version has been executed
in: body
required: false
type: integer
version_description:
description: |
Description for the version
in: body
required: false
type: string
version_number:
description: |
Version of the function
in: body
required: false
type: integer
webhook_description:
description: |
Description for the webhook
in: body
required: false
type: string
webhook_url:
description: |
Webhook URL
in: body
required: true
type: string
webhook_version:
description: |
Version of the function
in: body
required: false
type: integer

317
api-ref/source/runtimes.inc Normal file
View File

@ -0,0 +1,317 @@
.. -*- rst -*-
=========
Runtimes
=========
Lists, creates, updates, shows details and deletes runtimes.
The runtime is programming language support. Each runtime is encapsulated
in a container image which is used for creating the runtime container.
Qinling communicates with the container by sending HTTP requests and runs
user function inside.
Create a runtime
================
.. rest_method:: POST /v1/runtimes
Create a runtime.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- name: runtime_name
- image: runtime_image
- description: runtime_description
- is_public: runtime_is_public
- trusted: runtime_trusted
Request Example
---------------
.. literalinclude:: samples/runtimes/create-runtime-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: runtime_name
- image: runtime_image
- description: runtime_description
- is_public: runtime_is_public
- trusted: runtime_trusted
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/runtimes/create-runtime-response.json
:language: javascript
List runtimes
=============
.. rest_method:: GET /v1/runtimes
List runtimes.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: runtime_name
- image: runtime_image
- description: runtime_description
- is_public: runtime_is_public
- trusted: runtime_trusted
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/runtimes/list-runtimes-response.json
:language: javascript
Show a runtime
==============
.. rest_method:: GET /v1/runtimes/{runtime_id}
Show a runtime.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- runtime_id: path_runtime_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: runtime_name
- image: runtime_image
- description: runtime_description
- is_public: runtime_is_public
- trusted: runtime_trusted
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/runtimes/show-runtime-response.json
:language: javascript
Show a runtime pool
===================
.. rest_method:: GET /v1/runtimes/{runtime_id}/pool
Show a runtime pool.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- runtime_id: runtime_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- name: id
- capacity: runtime_capacity
Response Example
----------------
.. literalinclude:: samples/runtimes/show-runtime-pool-response.json
:language: javascript
Update a runtime
================
.. rest_method:: PUT /v1/runtimes/{runtime_id}
Update a runtime.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- runtime_id: path_runtime_id
- name: runtime_name_update
- image: runtime_image_update
- description: runtime_description
Request Example
---------------
.. literalinclude:: samples/runtimes/update-runtime-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- name: runtime_name
- image: runtime_image
- description: runtime_description
- is_public: runtime_is_public
- trusted: runtime_trusted
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/runtimes/update-runtime-response.json
:language: javascript
Delete a runtime
================
.. rest_method:: DELETE /v1/runtimes/{runtime_id}
Delete a runtime.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- runtime_id: path_runtime_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/runtimes/delete-runtime-response.text
:language: text

View File

@ -0,0 +1,6 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"name": "hw-v2",
"function_version": 2,
"description": "Hello World, version 2"
}

View File

@ -0,0 +1,9 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"name": "hw-v2",
"created_at": "2019-06-07 02:07:06.572982",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"function_version": 2,
"description": "Hello World, version 2"
}

View File

@ -0,0 +1 @@
Request to delete function_alias hw-v2 has been accepted.

View File

@ -0,0 +1,20 @@
[
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"name": "hw-v2",
"created_at": "2019-06-07 02:07:06",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"function_version": 2,
"description": "Hello World, version 2"
},
{
"function_id": "ab003f7a-402a-4a2e-8f00-2f848bde800d",
"name": "hq-v1",
"created_at": "2019-06-07 02:15:16",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"function_version": 37,
"description": "Hello Qinling, version 37"
}
]

View File

@ -0,0 +1,9 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"name": "hw-v2",
"created_at": "2019-06-07 02:07:06",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"function_version": 2,
"description": "Hello World, version 2"
}

View File

@ -0,0 +1,6 @@
{
"function_id": "ab003f7a-402a-4a2e-8f00-2f848bde800d",
"name": "hq-v1",
"function_version": 38,
"description": "Hello Qinling, version 38"
}

View File

@ -0,0 +1,9 @@
{
"function_id": "ab003f7a-402a-4a2e-8f00-2f848bde800d",
"name": "hq-v1",
"created_at": "2019-06-07 02:15:16",
"updated_at": "2019-06-07 02:32:14.097418",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"function_version": 38,
"description": "Hello Qinling, version 38"
}

View File

@ -0,0 +1,15 @@
{
"versions": [
{
"status": "CURRENT",
"id": "v1.0",
"links": [
{
"href": "http://api-uat.ormuco.com:7070/v1",
"target": "v1",
"rel": "self"
}
]
}
]
}

View File

@ -0,0 +1,7 @@
{
"description": "The world should know Foo!",
"sync": true,
"function_version": 0,
"input": "{\"name\": \"foo\"}",
"function_id": "3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46"
}

View File

@ -0,0 +1,13 @@
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": "The world should know Foo!",
"updated_at": "2019-06-06 23:13:37",
"created_at": "2019-06-06 23:13:37",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.044, \"output\": \"Hello, bar\"}",
"input": "{\"name\": \"foo\"}",
"function_id": "3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46",
"id": "62033613-6f02-4a6d-b569-7ba7fd18f8f7"
}

View File

@ -0,0 +1 @@
Request to delete execution 9b6d0e80-7c4b-49d1-bf11-f16999433337 has been accepted.

View File

@ -0,0 +1,28 @@
[
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": null,
"created_at": "2019-06-06 21:05:39",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.074, \"output\": \"Hello, World\"}",
"input": null,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"updated_at": "2019-06-06 21:05:41",
"id": "7dbb2ebc-9096-4e8e-9ded-0af8cd6cef60"
},
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": null,
"created_at": "2019-06-06 23:50:41",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.183, \"output\": \"Hello, bar\"}",
"input": "{\"name\": \"bar\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"updated_at": "2019-06-06 23:50:42",
"id": "9b6d0e80-7c4b-49d1-bf11-f16999433337"
}
]

View File

@ -0,0 +1,28 @@
[
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": null,
"created_at": "2019-06-06 21:05:39",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.074, \"output\": \"Hello, World\"}",
"input": null,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"updated_at": "2019-06-06 21:05:41",
"id": "7dbb2ebc-9096-4e8e-9ded-0af8cd6cef60"
},
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": "The world should know Foo!",
"created_at": "2019-06-06 23:15:30",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.032, \"output\": \"Hello, bar\"}",
"input": "{\"name\": \"bar\"}",
"function_id": "3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46",
"updated_at": "2019-06-06 23:15:30",
"id": "347bb366-95c9-49ab-8179-424c7b707124"
}
]

View File

@ -0,0 +1,3 @@
Start execution: 347bb366-95c9-49ab-8179-424c7b707124
Hello, World!
Finished execution: 347bb366-95c9-49ab-8179-424c7b707124

View File

@ -0,0 +1,13 @@
{
"status": "success",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": "The world should know Foo!",
"created_at": "2019-06-06 23:15:30",
"sync": true,
"function_version": 0,
"result": "{\"duration\": 0.032, \"output\": \"Hello, bar\"}",
"input": "{\"name\": \"bar\"}",
"function_id": "3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46",
"updated_at": "2019-06-06 23:15:30",
"id": "347bb366-95c9-49ab-8179-424c7b707124"
}

View File

@ -0,0 +1,12 @@
{
"code": {
"source": "image",
"image": "docker-registry/hello-world"
},
"description": "Hello World from Docker image",
"memory_size": 33554432,
"timeout": 15,
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,19 @@
{
"count": 0,
"code": {
"source": "image",
"image": "docker-registry/hello-world"
},
"description": "Hello World from Docker image",
"created_at": "2019-06-10 01:51:29.515424",
"updated_at": null,
"latest_version": 0,
"id": "28de9573-2397-4fa1-b627-60124395d1ff",
"memory_size": 33554432,
"timeout": 15,
"entry": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,11 @@
curl -X POST http://127.0.0.1:7070/v1/functions \
-H "X-Auth-Token: gAAAAAB..." \
-F name=hello_world \
-F runtime_id=cbd9e85f-a1b2-4120-a2c7-57c90809ce7d \
-F code='{"source": "package"}' \
-F entry=hello_world.main \
-F cpu=200 \
-F memory=33000000 \
-F description="Hello World function based on a package" \
-F timeout=15 \
-F package=@/home/dev/hello_world.zip

View File

@ -0,0 +1,12 @@
{
"code": {
"source": "package"
},
"description": "Hello World function from local package archive",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,19 @@
{
"count": 0,
"code": {
"source": "package",
"md5sum": "e439d00bab001d7ad7d1e0e451567699"
},
"description": "Hello World function from local package archive",
"created_at": "2019-06-10 01:15:02.108208",
"updated_at": null,
"latest_version": 0,
"id": "00f3b8ef-e794-4897-8a34-fa6a489d4ede",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,16 @@
{
"code": {
"source": "swift",
"swift": {
"object": "hello_world.py",
"container": "functions"
}
},
"description": "Hello World function from Swift",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,22 @@
{
"count": 0,
"code": {
"source": "swift",
"swift": {
"object": "hello_world.py",
"container": "functions"
}
},
"description": "Hello World function from Swift",
"created_at": "2019-06-10 01:43:53.909146",
"updated_at": null,
"latest_version": 0,
"id": "1127cb1a-938e-4262-b22f-d88f182624f6",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1 @@
Request to delete function ff64180b-d41b-420e-9846-ee706c1548b0 has been accepted.

View File

@ -0,0 +1 @@
Request to detach function f8e7357f-af4a-4448-87d8-6fed4c7db5b5 has been accepted.

View File

@ -0,0 +1 @@
Code package downloaded to /root/f8e7357f-af4a-4448-87d8-6fed4c7db5b5.zip

View File

@ -0,0 +1,32 @@
[
{
"count": 7,
"code": "{\"source\": \"package\", \"md5sum\": \"648926b8a9705d3bd77cefdeca46a254\"}",
"description": "Function Hello World :)",
"created_at": "2019-06-06 18:59:02",
"timeout": 10,
"updated_at": null,
"cpu": 250,
"memory_size": 134217728,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "22f62e09-e361-4481-b2da-22e3a4ed9a43",
"name": "hello_world"
},
{
"count": 0,
"code": "{\"source\": \"package\", \"md5sum\": \"e0309c12d355352cc92b5433bf293210\"}",
"description": "Function Goodbye World :(",
"created_at": "2019-06-06 19:04:30",
"timeout": 5,
"updated_at": "2019-06-06 19:04:30",
"cpu": 100,
"memory_size": 33554432,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"entry": "goodbye_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "2324a256-a249-4cec-968b-6ca7f99d805b",
"name": "goodbye_world"
}
]

View File

@ -0,0 +1,3 @@
{
"count": 6
}

View File

@ -0,0 +1 @@
Request to scale down function 3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46 has been accepted.

View File

@ -0,0 +1,3 @@
{
"count": 6
}

View File

@ -0,0 +1 @@
Request to scale up function 3e0e5bf8-ee7a-4fc8-9641-d1cbd9c60f46 has been accepted.

View File

@ -0,0 +1,15 @@
{
"count": 7,
"code": "{\"source\": \"package\", \"md5sum\": \"648926b8a9705d3bd77cefdeca46a254\"}",
"description": "Function Hello World :)",
"created_at": "2019-06-06 18:59:02",
"timeout": 10,
"updated_at": null,
"cpu": 250,
"memory_size": 134217728,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "22f62e09-e361-4481-b2da-22e3a4ed9a43",
"name": "hello_world"
}

View File

@ -0,0 +1,10 @@
curl -X PUT http://127.0.0.1:7070/v1/functions/{function_id} \
-H "X-Auth-Token: gAAAAAB..." \
-F name=hello_world \
-F runtime_id=cbd9e85f-a1b2-4120-a2c7-57c90809ce7d \
-F entry=hello_world.main \
-F cpu=200 \
-F memory=33000000 \
-F description="Hello World function based on a package" \
-F timeout=15 \
-F package=@/home/dev/hello_world.zip

View File

@ -0,0 +1,9 @@
{
"description": "Hello World function from local package archive",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,19 @@
{
"count": 0,
"code": {
"source": "package",
"md5sum": "e439d00bab001d7ad7d1e0e451567699"
},
"description": "Hello World function from local package archive",
"created_at": "2019-06-10 01:15:02.108208",
"updated_at": "2019-06-10 01:15:02.115438",
"latest_version": 0,
"id": "00f3b8ef-e794-4897-8a34-fa6a489d4ede",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,16 @@
{
"code": {
"source": "swift",
"swift": {
"object": "hello_world.py",
"container": "functions"
}
},
"description": "Hello World function from Swift",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,22 @@
{
"count": 0,
"code": {
"source": "swift",
"swift": {
"object": "hello_world.py",
"container": "functions"
}
},
"description": "Hello World function from Swift",
"created_at": "2019-06-10 01:28:38",
"updated_at": "2019-06-10 02:22:27.663257",
"latest_version": 0,
"id": "ecdf3b0c-ac37-4ba8-a02c-5d60cf86cc8b",
"memory_size": 33554432,
"timeout": 15,
"entry": "hello_world.main",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"cpu": 200,
"runtime_id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"name": "hello_world"
}

View File

@ -0,0 +1,8 @@
{
"count": 5,
"name": "every-minute",
"pattern": "* * * * *",
"function_version": 2,
"function_input": "{\"name\": \"Foo\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5"
}

View File

@ -0,0 +1,15 @@
{
"count": 5,
"status": "running",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"name": "every-minute",
"pattern": "* * * * *",
"created_at": "2019-06-07 19:11:08.375646",
"updated_at": null,
"function_version": 2,
"first_execution_time": "2019-06-07 19:12:00",
"function_input": "{\"name\": \"Foo\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"id": "dc7ef571-1f8d-4dc8-a659-fc86f80dd44c",
"next_execution_time": "2019-06-07 19:12:00"
}

View File

@ -0,0 +1 @@
Request to delete job 697546a1-090c-48de-8ecd-ef4cdb9da7a9 has been accepted.

View File

@ -0,0 +1,32 @@
[
{
"count": null,
"status": "running",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"name": "every-minute",
"pattern": "0 0 * * SUN",
"created_at": "2019-06-07 19:18:50",
"updated_at": "2019-06-07 19:29:59",
"id": "697546a1-090c-48de-8ecd-ef4cdb9da7a9",
"first_execution_time": "2019-06-07 19:19:00",
"function_input": null,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"function_version": 2,
"next_execution_time": "2019-06-07 19:31:00"
},
{
"count": 0,
"status": "done",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"name": "every-minute",
"pattern": "* * * * *",
"created_at": "2019-06-07 19:21:33",
"updated_at": "2019-06-07 19:25:59",
"id": "4e435c84-ab06-4ff5-8f05-b7ffe25c1224",
"first_execution_time": "2019-06-07 19:22:00",
"function_input": "{\"name\": \"Foo\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"function_version": 0,
"next_execution_time": "2019-06-07 19:26:00"
}
]

View File

@ -0,0 +1,15 @@
{
"count": 0,
"status": "done",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"name": "every-minute",
"pattern": "* * * * *",
"created_at": "2019-06-07 19:21:33",
"updated_at": "2019-06-07 19:25:59",
"id": "4e435c84-ab06-4ff5-8f05-b7ffe25c1224",
"first_execution_time": "2019-06-07 19:22:00",
"function_input": "{\"name\": \"Foo\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"function_version": 0,
"next_execution_time": "2019-06-07 19:26:00"
}

View File

@ -0,0 +1,7 @@
{
"status": "paused",
"name": "every-minute",
"pattern": "* * * * *",
"function_input": "{\"name\": \"Foo\"}",
"next_execution_time": "2019-06-07 22:41:00"
}

View File

@ -0,0 +1,15 @@
{
"count": null,
"status": "paused",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"name": "every-minute",
"pattern": "* * * * *",
"created_at": "2019-06-07 19:18:50",
"updated_at": "2019-06-07 19:41:20.108254",
"function_version": 2,
"first_execution_time": "2019-06-07 19:19:00",
"function_input": "{\"name\": \"Foo\"}",
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"id": "697546a1-090c-48de-8ecd-ef4cdb9da7a9",
"next_execution_time": "2019-06-07 22:41:00"
}

View File

@ -0,0 +1,7 @@
{
"name": "python3",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime",
"is_public:": true,
"trusted": true
}

View File

@ -0,0 +1,12 @@
{
"status": "creating",
"created_at": "2019-06-06 15:33:23.178645",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime",
"updated_at": null,
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "b351d3b6-8ccb-4f5b-b70f-58c72298a2ac",
"trusted": true,
"name": "python3"
}

View File

@ -0,0 +1 @@
Request to delete runtime 63f8f51d-7270-4545-abdd-f767ef8b1882 has been accepted.

View File

@ -0,0 +1,38 @@
[
{
"status": "available",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime",
"updated_at": "2019-05-30 14:40:50",
"created_at": "2019-05-30 14:40:41",
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"trusted": true,
"name": "python3"
},
{
"status": "available",
"description": "Runtime Python2.7 ready for production.",
"image": "openstackqinling/python2-runtime",
"updated_at": "2019-06-03 19:01:37",
"created_at": "2019-06-03 19:00:33",
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "c4682a12-1a82-424d-b299-9b238fb6b694",
"trusted": true,
"name": "python2.7"
},
{
"status": "available",
"description": "Runtime Node.js 8.10 ready for production.",
"image": "openstackqinling/nodejs-runtime",
"updated_at": "2019-06-03 19:30:31",
"created_at": "2019-06-03 19:30:06",
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "d3780197-d3a8-4961-8228-354ac7592e48",
"trusted": true,
"name": "nodejs8.10"
}
]

View File

@ -0,0 +1,7 @@
{
"capacity": {
"available": 3,
"total": 3
},
"name": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d"
}

View File

@ -0,0 +1,12 @@
{
"status": "available",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime",
"updated_at": "2019-05-30 14:40:50",
"created_at": "2019-05-30 14:40:41",
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"trusted": true,
"name": "python3"
}

View File

@ -0,0 +1,5 @@
{
"name": "python3",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime"
}

View File

@ -0,0 +1,12 @@
{
"status": "available",
"description": "Runtime Python3.7 ready for production.",
"image": "openstackqinling/python3-runtime",
"updated_at": "2019-05-30 14:40:50",
"created_at": "2019-06-06 16:40:31",
"is_public": true,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "cbd9e85f-a1b2-4120-a2c7-57c90809ce7d",
"trusted": true,
"name": "python3"
}

View File

@ -0,0 +1,3 @@
{
"description": "This version is ready for production"
}

View File

@ -0,0 +1,10 @@
{
"count": 0,
"version_number": 1,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "This version is ready for production",
"created_at": "2019-06-07 01:23:16.278205",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "45ebdcbf-6e2f-46c9-bd58-7f6ae01ecfcc"
}

View File

@ -0,0 +1 @@
Request to detach function f8e7357f-af4a-4448-87d8-6fed4c7db5b5(version 1) has been accepted.

View File

@ -0,0 +1,22 @@
[
{
"count": 0,
"version_number": 1,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": "This version is ready for production",
"created_at": "2019-06-07 01:23:16",
"updated_at": null,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"id": "45ebdcbf-6e2f-46c9-bd58-7f6ae01ecfcc"
},
{
"count": 0,
"version_number": 2,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"description": "This version has not been tested yet",
"created_at": "2019-06-07 01:34:10",
"updated_at": null,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"id": "9490f863-020b-4746-8f30-9324cff31678"
}
]

View File

@ -0,0 +1,10 @@
{
"count": 0,
"version_number": 1,
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "This version is ready for production",
"created_at": "2019-06-07 01:23:16",
"updated_at": null,
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "45ebdcbf-6e2f-46c9-bd58-7f6ae01ecfcc"
}

View File

@ -0,0 +1,5 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Jenkins",
"function_version": 2
}

View File

@ -0,0 +1,10 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Jenkins",
"created_at": "2019-06-07 14:53:22.989283",
"updated_at": null,
"function_version": 2,
"webhook_url": "http://127.0.0.1:7070/v1/webhooks/2aac6d93-c4d3-4fc6-9d3b-8852be0c8c89/invoke",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "2aac6d93-c4d3-4fc6-9d3b-8852be0c8c89"
}

View File

@ -0,0 +1 @@
Request to delete webhook 2aac6d93-c4d3-4fc6-9d3b-8852be0c8c89 has been accepted.

View File

@ -0,0 +1,22 @@
[
{
"function_id": "e47ca07c-b0cc-4501-901f-1c2e3df46724",
"description": "Webhook Hello World",
"created_at": "2019-06-07 02:48:16",
"updated_at": null,
"function_version": 0,
"webhook_url": "http://127.0.0.1:7070/v1/webhooks/726779f2-227f-43af-a891-4de85e8dadd5/invoke",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "726779f2-227f-43af-a891-4de85e8dadd5"
},
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Jenkins",
"created_at": "2019-06-07 14:52:19",
"updated_at": null,
"function_version": 2,
"webhook_url": "http://127.0.0.1:7070/v1/webhooks/e3f34707-8fea-4d36-b558-e39b00b99105/invoke",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "e3f34707-8fea-4d36-b558-e39b00b99105"
}
]

View File

@ -0,0 +1,10 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Jenkins",
"created_at": "2019-06-07 14:52:19",
"updated_at": null,
"function_version": 2,
"webhook_url": "http://127.0.0.1:7070/v1/webhooks/e3f34707-8fea-4d36-b558-e39b00b99105/invoke",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "e3f34707-8fea-4d36-b558-e39b00b99105"
}

View File

@ -0,0 +1,5 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Gitlab",
"function_version": 2
}

View File

@ -0,0 +1,10 @@
{
"function_id": "f8e7357f-af4a-4448-87d8-6fed4c7db5b5",
"description": "Webhook triggered by Gitlab",
"created_at": "2019-06-07 14:53:22",
"updated_at": "2019-06-07 18:06:42",
"function_version": 2,
"webhook_url": "http://127.0.0.1:7070/v1/webhooks/2aac6d93-c4d3-4fc6-9d3b-8852be0c8c89/invoke",
"project_id": "5eeb5916ae4b43699f06ea422e581b83",
"id": "2aac6d93-c4d3-4fc6-9d3b-8852be0c8c89"
}

View File

@ -0,0 +1,61 @@
#################
# Success Codes #
#################
200:
default: |
Request was successful.
201:
default: |
Resource was created and is ready to use.
202:
default: |
Request was accepted for processing, but the processing has not been
completed. A 'location' header is included in the response which contains
a link to check the progress of the request.
204:
default: |
The server has fulfilled the request by deleting the resource.
300:
default: |
There are multiple choices for resources. The request has to be more
specific to successfully retrieve one of these resources.
302:
default: |
The response is about a redirection hint. The header of the response
usually contains a 'location' value where requesters can check to track
the real location of the resource.
#################
# Error Codes #
#################
400:
default: |
Some content in the request was invalid.
resource_signal: |
The target resource doesn't support receiving a signal.
401:
default: |
User must authenticate before making a request.
403:
default: |
Policy does not allow current user to do this operation.
404:
default: |
The requested resource could not be found.
405:
default: |
Method is not valid for this endpoint.
409:
default: |
This operation conflicted with another operation on this resource.
duplicate_zone: |
There is already a zone with this name.
500:
default: |
Something went wrong inside the service. This should not happen usually.
If it does happen, it means the server has experienced some serious
problems.
503:
default: |
Service is not available. This is mostly caused by service configuration
errors which prevents the service from successful start up.

31
api-ref/source/urls.inc Normal file
View File

@ -0,0 +1,31 @@
.. -*- rst -*-
==================
Qinling Base URLs
==================
All API calls through the rest of this document require authentication
with the OpenStack Identity service. They also required a ``url`` that
is extracted from the Identity token of type
``function-engine``. This will be the root url that every call below will be
added to build a full path.
Note that if using OpenStack Identity service API v2, ``url`` can be
represented via ``adminURL``, ``internalURL`` or ``publicURL`` in endpoint
catalog. In Identity service API v3, ``url`` is represented with field
``interface`` including ``admin``, ``internal`` and ``public``.
For instance, if the ``url`` is
``http://my-qinling-url.org/qinling/v1`` then the full API call for
``/functions`` is ``http://my-qinling-url.org/qinling/v1/functions``.
Depending on the deployment the function engine url might be http or https,
a custom port, a custom path, and include your project id. The only way to
know the urls for your deployment is by using the service catalog.
The containers service 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 /functions`` really means
``GET {your_qinling_url}/functions``.

255
api-ref/source/versions.inc Normal file
View File

@ -0,0 +1,255 @@
.. -*- rst -*-
=========
Versions
=========
Lists, creates, detaches, shows details and deletes versions.
Function versions are like git commits, theyre snapshots of your
project history. Each version has a number that serves as its ID,
starting with 1 and incrementing up, and never reused. The code for
a published version of a function is immutable (i.e. cannot be changed).
So, a version number corresponds to a specific set of function code with
certainty.
Create a version
================
.. rest_method:: POST /v1/functions/{function_id}/versions
Create a version.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- description: version_description
Request Example
---------------
.. literalinclude:: samples/versions/create-version-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: version_description
- function_id: function_id
- count: version_count
- version_number: version_number
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/versions/create-version-response.json
:language: javascript
List versions
=============
.. rest_method:: GET /v1/functions/{function_id}/versions
List versions.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: version_description
- function_id: function_id
- count: version_count
- version_number: version_number
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/versions/list-versions-response.json
:language: javascript
Show a version
==============
.. rest_method:: GET /v1/functions/{function_id}/versions/{version_number}
Show a version.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- version_number: path_version_number
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: version_description
- function_id: function_id
- count: version_count
- version_number: version_number
- project_id: project_id
- status: status
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/versions/show-version-response.json
:language: javascript
Detach a version
================
.. rest_method:: POST /v1/functions/{function_id}/versions/{version_number}/detach
Detach a version.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- version_number: path_version_number
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/versions/detach-version-response.text
:language: text
Delete a version
================
.. rest_method:: DELETE /v1/functions/{function_id}/versions/{version_number}
Delete a version.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: path_function_id
- version_number: path_version_number
Response Parameters
-------------------
None
Response Example
----------------
None

261
api-ref/source/webhooks.inc Normal file
View File

@ -0,0 +1,261 @@
.. -*- rst -*-
=========
Webhooks
=========
Lists, creates, updates, shows details and deletes webhooks.
Webhooks are a low-effort way to invoke the functions. They do not
require a bot user or authentication to use.
Create a webhook
================
.. rest_method:: POST /v1/webhooks
Create a webhook.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- function_id: function_id
- function_version: webhook_version
- description: webhook_description
Request Example
---------------
.. literalinclude:: samples/webhooks/create-webhook-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: webhook_description
- function_id: function_id
- version_number: webhook_version
- webhook_url: webhook_url
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/webhooks/create-webhook-response.json
:language: javascript
List webhooks
=============
.. rest_method:: GET /v1/webhooks
List webhooks.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: webhook_description
- function_id: function_id
- version_number: webhook_version
- webhook_url: webhook_url
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/webhooks/list-webhooks-response.json
:language: javascript
Show a webhook
==============
.. rest_method:: GET /v1/webhooks/{webhook_id}
Show a webhook.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- webhook_id: path_webhook_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: webhook_description
- function_id: function_id
- version_number: webhook_version
- webhook_url: webhook_url
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Response Example
----------------
.. literalinclude:: samples/webhooks/show-webhook-response.json
:language: javascript
Update a webhook
================
.. rest_method:: PUT /v1/webhooks/{webhook_id}
Update a webhook.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- webhook_id: path_webhook_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: id
- description: webhook_description
- function_id: function_id
- version_number: webhook_version
- webhook_url: webhook_url
- project_id: project_id
- created_at: created_at
- updated_at: updated_at
Request Example
---------------
.. literalinclude:: samples/webhooks/update-webhook-request.json
:language: javascript
Response Example
----------------
.. literalinclude:: samples/webhooks/update-webhook-response.json
:language: javascript
Delete a webhook
================
.. rest_method:: DELETE /v1/webhooks/{webhook_id}
Delete a webhook.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- webhook_id: path_webhook_id
Response Parameters
-------------------
None
Response Example
----------------
.. literalinclude:: samples/webhooks/delete-webhook-response.text
:language: text

View File

@ -52,6 +52,7 @@ msgpack==0.5.6
netaddr==0.7.19
netifaces==0.10.6
oauthlib==2.0.6
os-api-ref==1.4.0
os-client-config==1.29.0
oslo.cache==1.29.0
oslo.concurrency==3.26.0
@ -67,7 +68,6 @@ oslo.serialization==2.18.0
oslo.service==1.24.0
oslo.upgradecheck==0.1.0
oslo.utils==3.33.0
oslosphinx==4.7.0
oslotest==3.2.0
paramiko==2.4.1
Paste==2.0.3
@ -108,8 +108,6 @@ setuptools==21.0.0
simplegeneric==0.8.1
six==1.10.0
Sphinx==1.6.2
sphinxcontrib-httpdomain==1.3.0
sphinxcontrib-pecanwsme==0.10.0
sphinxcontrib-websupport==1.0.1
SQLAlchemy==1.0.10
sqlalchemy-migrate==0.11.0

View File

@ -77,3 +77,10 @@ deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:api-ref]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html