Inital Spec - API

Change-Id: I10257d311a7218bd2d9cca3a5d8ca3f0b4c3105c
This commit is contained in:
Graham Hayes 2015-08-26 15:26:38 -07:00
parent 68efa29e49
commit 2e72a70820
2 changed files with 279 additions and 163 deletions

279
specs/liberty/api.rst Normal file
View File

@ -0,0 +1,279 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
http://creativecommons.org/licenses/by/3.0/legalcode
..
This template should be in ReSTructured text. The filename in the git
repository should match the launchpad URL, for example a URL of
https://blueprints.launchpad.net/gslb/+spec/awesome-thing should be named
awesome-thing.rst . Please do not delete any of the sections in this
template. If you have nothing to say for a whole section, just write: None
For help with syntax, see http://sphinx-doc.org/rest.html
To test out your formatting, see http://www.tele3.cz/jbar/rest/rest.html
=====
API
=====
https://blueprints.launchpad.net/kosmos/+spec/api
We need an API, so defining it is a good start.
Example JSON Snippets
=====================
Load Balancer JSON Snippet
--------------------------
.. code-block:: json
{
"id": "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"name": "Main Website",
"fqdn": "www.gslb.example.com.",
"domain_name": "example.com.",
"flavor": "example_1",
"status": "ACTIVE",
"links": {
"self": "http://example.gslb.openstack.org/v0.1/gslbs/f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"pools": "http://example.gslb.openstack.org/v0.1/gslbs/f9fc6210-8efa-4492-9b4f-d87ba98f35b8/pools",
"status": "http://example.gslb.openstack.org/v0.1/gslbs/f9fc6210-8efa-4492-9b4f-d87ba98f35b8/status"
}
}
Pool JSON Snippet
-----------------
.. code-block:: json
{
"id": "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"name": "Main Website Pool",
"flavor": "example_1",
"status": "ACTIVE",
"members":["SEE MEMBER SNIPPETS BELOW"],
"links": {
"self": "http://example.gslb.openstack.org/v0.1/pools/f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"pool_members": "http://example.gslb.openstack.org/v0.1/pools/f9fc6210-8efa-4492-9b4f-d87ba98f35b8/pool_members",
"status": "http://example.gslb.openstack.org/v0.1/pools/f9fc6210-8efa-4492-9b4f-d87ba98f35b8/status"
}
}
Pool Member JSON Snippet - Neutron LBaaS
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id": "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"name": "Main Website",
"type": "neutron_lbaas_v2",
"region": "RegionTwo",
"neutron_id": "df40954c-982a-4778-a1b2-32b93cf75af9",
"status": "ACTIVE",
"endpoints": [
"10.10.0.1"
]
}
Pool Member JSON Snippet - Neutron Port
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id": "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"name": "Main Website",
"type": "neutron_port",
"region": "RegionTwo",
"neutron_id": "78fa9c7f-f200-49df-912b-ae4679fd21e9",
"status": "ACTIVE",
"endpoints": [
"10.10.0.1"
]
}
Pool Member JSON Snippet - IP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id": "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"name": "Main Website",
"type": "IP",
"status": "ACTIVE",
"endpoints": [
"10.10.0.1"
]
}
Monitor JSON Snippet - TCP Basic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id" : "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"type" : "TCP",
"delay" : 20,
"timeout": 10,
"max_retries": 3,
"port" : 22,
"name": "ssh_generic"
}
Monitor JSON Snippet - Ping Basic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id" : "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"type" : "PING",
"delay" : 20,
"timeout": 10,
"max_retries": 3,
"name": "ping_generic"
}
Monitor JSON Snippet - HTTP
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id" : "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"delay": 20,
"timeout": 10,
"max_retries": 3,
"type": "HTTP",
"http_method": "GET",
"url_path": "/healthchecks",
"receive_string": "SUCCESS",
"expected_codes": [
200,
202
],
"name": "http-generic",
"port" : 80
}
Monitor JSON Snippet - HTTPS
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: json
{
"id" : "f9fc6210-8efa-4492-9b4f-d87ba98f35b8",
"delay": 20,
"timeout": 10,
"max_retries": 3,
"type": "HTTPS",
"insecure": false,
"http_method": "POST",
"payload": {
"content_type" : "application/json",
"content": "{'demo': 'JSON', 'Blob': 'of data'}"
},
"ca_cert": "<CA_CERT_BLOB>",
"url_path": "/healthchecks",
"receive_string" "SUCCESS",
"expected_codes": [
200,
202
],
"name": "https-generic",
"port" : 443
}
Endpoints
=========
All of these endpoints will have the usual CRUD methods available
/v0.1/gslbs
-----------
Returns a list of GLSBs
/v0.1/gslbs/<uuid>
------------------
Returns a GLSB
/v0.1/gslbs/<uuid>/pools
------------------------
Returns GLSB's list of pools
/v0.1/gslbs/<uuid>/history
--------------------------
Returns GLSB's history (up/down/degraded etc)
.. note:: This may or may not make MVP. This should only be a limited history, and for MVP my just be a "last updated" field
/v0.1/pools
-----------
Returns a list of Pools
/v0.1/pools/<uuid>
------------------
Returns a pool
/v0.1/pools/<uuid>/monitors
---------------------------
Returns a pool's list of monitors
/v0.1/pools/<uuid>/pool_members
-------------------------------
Returns a pool's list of members
/v0.1/pools/<uuid>/pool_members/<uuid>
--------------------------------------
Returns a pool member
/v0.1/pools/<uuid>/pool_members/<uuid>/status
---------------------------------------------
Returns a pool members status (Up/Down etc)
/v0.1/pools/<uuid>/pool_members/<uuid>/monitors
-----------------------------------------------
Returns a members list of monitors
/v0.1/pools/<uuid>/status
-------------------------
Returns the status of a pool
/v0.1/monitors
--------------
Returns a list of health monitors
/v0.1/monitors/<uuid>
---------------------
Returns a monitor
Implementation
==============
Assignee(s)
-----------
Primary assignee:
gslb-core

View File

@ -1,163 +0,0 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
http://creativecommons.org/licenses/by/3.0/legalcode
..
This template should be in ReSTructured text. The filename in the git
repository should match the launchpad URL, for example a URL of
https://blueprints.launchpad.net/gslb/+spec/awesome-thing should be named
awesome-thing.rst . Please do not delete any of the sections in this
template. If you have nothing to say for a whole section, just write: None
For help with syntax, see http://sphinx-doc.org/rest.html
To test out your formatting, see http://www.tele3.cz/jbar/rest/rest.html
=============================
The title of your blueprint
=============================
Include the URL of your launchpad blueprint:
https://blueprints.launchpad.net/kosmos/+spec/example
Introduction paragraph -- why are we doing anything?
Problem description
===================
A detailed description of the problem.
Proposed change
===============
Here is where you cover the change you propose to make in detail. How do you
propose to solve this problem?
If this is one part of a larger effort make it clear where this piece ends. In
other words, what's the scope of this effort?
Include where in the designate tree hierarchy this will reside.
API Changes
-----------
Include API Changes here. If you are adding endpoints / add major modifications
please ensure you have examples for calls / results - eg:
POST /v2/doohickey
^^^^^^^^^^^^^^^^^^
This creates a doohicky.
It returns an ID and the doohickey
.. code-block:: http
POST /v2/doohickey HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"doohickey":{
"foo":"bar"
}
}
HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: /v2/doohickey/cddda8f0-f558-11e3-a3ac-0800200c9a66
{
"doohickey":{
"id":"cddda8f0-f558-11e3-a3ac-0800200c9a66",
"foo":"bar",
"links":{
"self" : "/v2/doohickey/cddda8f0-f558-11e3-a3ac-0800200c9a66"
}
}
}
It may be usefull to add a table with the parameters, and a info about them
+-----------+--------------------------------+----------+
| Parameter | Description | Required |
+===========+================================+==========+
| foo | the foo value for the doohicky | Yes |
+-----------+--------------------------------+----------+
Central Changes
---------------
Any changes to the central service
Storage Changes
---------------
Any changes to the DB. This should be a table (if creating a new table)
eg:
New Table - DooHickey
^^^^^^^^^^^^^^^^^^^^^
+-----+---------+-----------+---------+
| Row | Type | Nullable? | Unique? |
+=====+=========+===========+=========+
| id | uuid | No | Yes |
+-----+---------+-----------+---------+
| foo | VARCHAR | No | No |
+-----+---------+-----------+---------+
Other Changes
-------------
Any other changes to Designate, broken down by which sub system is being
changed
Alternatives
------------
This is an optional section, where it does apply we'd just like a demonstration
that some thought has been put into why the proposed approach is the best one.
Implementation
==============
Assignee(s)
-----------
Who is leading the writing of the code? Or is this a blueprint where you're
throwing it out there to see who picks it up?
If more than one person is working on the implementation, please designate the
primary author and contact.
Primary assignee:
<launchpad-id or None>
Can optionally can list additional ids if they intend on doing
substantial implementation work on this blueprint.
Milestones
----------
Target Milestone for completion:
Juno-1
Work Items
----------
Work items or tasks -- break the feature up into the things that need to be
done to implement it. Those parts might end up being done by different people,
but we're mostly trying to understand the timeline for implementation.
Dependencies
============
- Include specific references to specs and/or blueprints in designate, or in other
projects, that this one either depends on or is related to.
- Does this feature require any new library dependencies or code otherwise not
included in OpenStack? Or does it depend on a specific version of library?