diff --git a/specs/newton/template-list-api.rst b/specs/newton/template-list-api.rst new file mode 100644 index 0000000..a8e1a8a --- /dev/null +++ b/specs/newton/template-list-api.rst @@ -0,0 +1,188 @@ +.. + This work is licensed under a Creative Commons Attribution 3.0 Unported + License. + + http://creativecommons.org/licenses/by/3.0/legalcode + +============================= +Vitrage Get Template List API +============================= + +https://blueprints.launchpad.net/vitrage/+spec/template-list-api + +An API for list all templates loaded from templates lib, both those that passed validation and those that did not + +Problem description +=================== + +We would like to be able to list all templates loaded from /etc/vitrage/templates, +both those that passed validation and those that did not before uploading it to Vitrage. + +Proposed change +=============== +Create API to list all Vitrage loaded templates. + +#. Valid template - template that passed validation and loaded into Scenario Repository. +#. Invalid template = template that did not pass validation. + +The template list API returns a table with the following columns: + +#. uuid - a unique id generated by Vitrage +#. name - template's name +#. status - pass validation or not +#. status details +#. date - when template validation occurred (before template loading is executed) + +Alternatives +------------ + +None + +Data model impact +----------------- + +None + +REST API impact +--------------- + +Template List +^^^^^^^^^^^^^ + +Returns template list + +GET / +~~~~~ + +Headers +^^^^^^^ + +- X-Auth-Token (string, required) - Keystone auth token +- Accept (string) - application/json +- User-Agent (String) + +Path Parameters +^^^^^^^^^^^^^^^ + +None. + +Query Parameters +^^^^^^^^^^^^^^^^ + +None + + +Request Body +^^^^^^^^^^^^ + +None. + +Request Examples +^^^^^^^^^^^^^^^^ +:: + + GET /v1/template/ + Host: 135.248.18.122:8999 + User-Agent: keystoneauth1/2.3.0 python-requests/2.9.1 CPython/2.7.6 + Accept: application/json + X-Auth-Token: 2b8882ba2ec44295bf300aecb2caa4f7 + +Response +~~~~~~~~ + +Status code +^^^^^^^^^^^ + +- 200 - OK +- 400 - Bad request + +Response Body +^^^^^^^^^^^^^ + +Returns a table that is a list of all templates. +Each row describes a template and its status. + +Response Examples +^^^^^^^^^^^^^^^^^ + +:: + +--------------------------------------+---------------------------------------+--------+--------------------------------------------------+----------------------+ + | uuid | name | status | status details | date | + +--------------------------------------+---------------------------------------+--------+--------------------------------------------------+----------------------+ + | 67bebcb4-53b1-4240-ad05-451f34db2438 | vm_down_causes_suboptimal_application | failed | Entity definition must contain template_id field | 2016-06-29T12:24:16Z | + | 4cc899e6-f6cb-43d8-94a0-6fa937e41ae2 | host_cpu_load_causes_vm_problem | pass | Template validation is OK | 2016-06-29T12:24:16Z | + | 0548367e-711a-4c08-9bdb-cb61f96fed04 | switch_connectivity_issues | pass | Template validation is OK | 2016-06-29T12:24:16Z | + | 33cb4400-f846-4c64-b168-530824d38f3e | host_nic_down | pass | Template validation is OK | 2016-06-29T12:24:16Z | + | a04cd155-0fcf-4409-a27c-c83ba8b20a3c | disconnected_storage_problems | pass | Template validation is OK | 2016-06-29T12:24:16Z | + +--------------------------------------+---------------------------------------+--------+--------------------------------------------------+----------------------+ + +Security impact +--------------- + +None + +Pipeline impact +--------------- + +None + +Other end user impact +--------------------- + +None + +Performance/Scalability Impacts +------------------------------- + +None + + +Other deployer impact +--------------------- + +None + +Developer impact +---------------- + +None + + +Implementation +============== + +Assignee(s) +----------- + +liat har-tal + + +Work Items +---------- + +None + +Future lifecycle +================ + +None + +Dependencies +============ + +None + +Testing +======= + +Tempest tests also need to be added in order to test: + +#. Get template list + +Documentation Impact +==================== +The new api should be documented + +References +========== +None diff --git a/specs/newton/template-validate-api.rst b/specs/newton/template-validate-api.rst index 13b3213..cc78e4a 100644 --- a/specs/newton/template-validate-api.rst +++ b/specs/newton/template-validate-api.rst @@ -4,9 +4,9 @@ http://creativecommons.org/licenses/by/3.0/legalcode -======================== -Vitrage Get Topology API -======================== +=============================== +Vitrage Template Validation API +=============================== https://blueprints.launchpad.net/vitrage/+spec/template-validate-api @@ -47,7 +47,7 @@ REST API impact --------------- Template Validate -^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^ Validate Vitrage template(s) @@ -107,25 +107,24 @@ Response Examples ^^^^^^^^^^^^^^^^^ :: - -{ - "results": [ { - "status": "validation failed", - "file path": "/tmp/templates/basic_no_meta.yaml", - "description": "Template syntax validation", - "message": "metadata is a mandatory section.", - "status code": 62 - }, - { - "status": "validation OK", - "file path": "/tmp/templates/basic.yaml", - "description": "Template validation", - "message": "Template validation is OK", - "status code": 4 + "results": [ + { + "status": "validation failed", + "file path": "/tmp/templates/basic_no_meta.yaml", + "description": "Template syntax validation", + "message": "metadata is a mandatory section.", + "status code": 62 + }, + { + "status": "validation OK", + "file path": "/tmp/templates/basic.yaml", + "description": "Template validation", + "message": "Template validation is OK", + "status code": 4 + } + ] } - ] -} Security impact ---------------