Browse Source

Merge "Add API documentation"

changes/47/665047/3
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
bca6ba1798
79 changed files with 3754 additions and 3 deletions
  1. +1
    -0
      .zuul.yaml
  2. +265
    -0
      api-ref/source/aliases.inc
  3. +31
    -0
      api-ref/source/api-versions.inc
  4. +223
    -0
      api-ref/source/conf.py
  5. +304
    -0
      api-ref/source/executions.inc
  6. +524
    -0
      api-ref/source/functions.inc
  7. +17
    -0
      api-ref/source/index.rst
  8. +275
    -0
      api-ref/source/jobs.inc
  9. +472
    -0
      api-ref/source/parameters.yaml
  10. +317
    -0
      api-ref/source/runtimes.inc
  11. +6
    -0
      api-ref/source/samples/aliases/create-alias-request.json
  12. +9
    -0
      api-ref/source/samples/aliases/create-alias-response.json
  13. +1
    -0
      api-ref/source/samples/aliases/delete-alias-response.text
  14. +20
    -0
      api-ref/source/samples/aliases/list-aliases-response.json
  15. +9
    -0
      api-ref/source/samples/aliases/show-alias-response.json
  16. +6
    -0
      api-ref/source/samples/aliases/update-alias-request.json
  17. +9
    -0
      api-ref/source/samples/aliases/update-alias-response.json
  18. +15
    -0
      api-ref/source/samples/api-versions/get-versions-response.json
  19. +7
    -0
      api-ref/source/samples/executions/create-execution-request.json
  20. +13
    -0
      api-ref/source/samples/executions/create-execution-response.json
  21. +1
    -0
      api-ref/source/samples/executions/delete-execution-response.text
  22. +28
    -0
      api-ref/source/samples/executions/list-executions-filters-response.json
  23. +28
    -0
      api-ref/source/samples/executions/list-executions-response.json
  24. +3
    -0
      api-ref/source/samples/executions/show-execution-log-response.json
  25. +13
    -0
      api-ref/source/samples/executions/show-execution-response.json
  26. +12
    -0
      api-ref/source/samples/functions/create-function-image-request.json
  27. +19
    -0
      api-ref/source/samples/functions/create-function-image-response.json
  28. +11
    -0
      api-ref/source/samples/functions/create-function-package-curl-request.text
  29. +12
    -0
      api-ref/source/samples/functions/create-function-package-request.json
  30. +19
    -0
      api-ref/source/samples/functions/create-function-package-response.json
  31. +16
    -0
      api-ref/source/samples/functions/create-function-swift-request.json
  32. +22
    -0
      api-ref/source/samples/functions/create-function-swift-response.json
  33. +1
    -0
      api-ref/source/samples/functions/delete-function-response.text
  34. +1
    -0
      api-ref/source/samples/functions/detach-function-response.text
  35. +1
    -0
      api-ref/source/samples/functions/download-function-response.text
  36. +32
    -0
      api-ref/source/samples/functions/list-functions-response.json
  37. +3
    -0
      api-ref/source/samples/functions/scaledown-function-request.json
  38. +1
    -0
      api-ref/source/samples/functions/scaledown-function-response.text
  39. +3
    -0
      api-ref/source/samples/functions/scaleup-function-request.json
  40. +1
    -0
      api-ref/source/samples/functions/scaleup-function-response.text
  41. +15
    -0
      api-ref/source/samples/functions/show-function-response.json
  42. +10
    -0
      api-ref/source/samples/functions/update-function-package-curl-request.text
  43. +9
    -0
      api-ref/source/samples/functions/update-function-package-request.json
  44. +19
    -0
      api-ref/source/samples/functions/update-function-package-response.json
  45. +16
    -0
      api-ref/source/samples/functions/update-function-swift-request.json
  46. +22
    -0
      api-ref/source/samples/functions/update-function-swift-response.json
  47. +8
    -0
      api-ref/source/samples/jobs/create-job-request.json
  48. +15
    -0
      api-ref/source/samples/jobs/create-job-response.json
  49. +1
    -0
      api-ref/source/samples/jobs/delete-job-response.text
  50. +32
    -0
      api-ref/source/samples/jobs/list-jobs-response.json
  51. +15
    -0
      api-ref/source/samples/jobs/show-job-response.json
  52. +7
    -0
      api-ref/source/samples/jobs/update-job-request.json
  53. +15
    -0
      api-ref/source/samples/jobs/update-job-response.json
  54. +7
    -0
      api-ref/source/samples/runtimes/create-runtime-request.json
  55. +12
    -0
      api-ref/source/samples/runtimes/create-runtime-response.json
  56. +1
    -0
      api-ref/source/samples/runtimes/delete-runtime-response.text
  57. +38
    -0
      api-ref/source/samples/runtimes/list-runtimes-response.json
  58. +7
    -0
      api-ref/source/samples/runtimes/show-runtime-pool-response.json
  59. +12
    -0
      api-ref/source/samples/runtimes/show-runtime-response.json
  60. +5
    -0
      api-ref/source/samples/runtimes/update-runtime-request.json
  61. +12
    -0
      api-ref/source/samples/runtimes/update-runtime-response.json
  62. +3
    -0
      api-ref/source/samples/versions/create-version-request.json
  63. +10
    -0
      api-ref/source/samples/versions/create-version-response.json
  64. +1
    -0
      api-ref/source/samples/versions/detach-version-response.text
  65. +22
    -0
      api-ref/source/samples/versions/list-versions-response.json
  66. +10
    -0
      api-ref/source/samples/versions/show-version-response.json
  67. +5
    -0
      api-ref/source/samples/webhooks/create-webhook-request.json
  68. +10
    -0
      api-ref/source/samples/webhooks/create-webhook-response.json
  69. +1
    -0
      api-ref/source/samples/webhooks/delete-webhook-response.text
  70. +22
    -0
      api-ref/source/samples/webhooks/list-webhooks-response.json
  71. +10
    -0
      api-ref/source/samples/webhooks/show-webhook-response.json
  72. +5
    -0
      api-ref/source/samples/webhooks/update-webhook-request.json
  73. +10
    -0
      api-ref/source/samples/webhooks/update-webhook-response.json
  74. +61
    -0
      api-ref/source/status.yaml
  75. +31
    -0
      api-ref/source/urls.inc
  76. +255
    -0
      api-ref/source/versions.inc
  77. +261
    -0
      api-ref/source/webhooks.inc
  78. +1
    -3
      lower-constraints.txt
  79. +7
    -0
      tox.ini

+ 1
- 0
.zuul.yaml 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
- 0
api-ref/source/aliases.inc 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

+ 31
- 0
api-ref/source/api-versions.inc 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
- 0
api-ref/source/conf.py 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

+ 304
- 0
api-ref/source/executions.inc 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

+ 524
- 0
api-ref/source/functions.inc 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
- 0
api-ref/source/index.rst 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
- 0
api-ref/source/jobs.inc 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

+ 472
- 0
api-ref/source/parameters.yaml 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: