.. 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