3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
15 class Url(object): # pylint: disable=too-few-public-methods
18 def __init__(self, url, target):
19 super(Url, self).__init__()
25 # GET /api/v1/functest/envs => GET environment
26 Url('/api/v1/functest/envs', 'v1_envs'),
28 # POST /api/v1/functest/envs/action
29 # {"action":"update_hosts", "args": {}} => Update hosts info
30 Url('/api/v1/functest/envs/action', 'v1_envs'),
32 # GET /api/v1/functest/openstack/credentials => GET credentials
33 Url('/api/v1/functest/openstack/credentials', 'v1_creds'),
35 # POST /api/v1/functest/openstack/action
36 # {"action":"update_openrc", "args": {"openrc": {}}} => Update openrc
37 Url('/api/v1/functest/openstack/action', 'v1_creds'),
39 # GET /api/v1/functest/testcases => GET all testcases
40 Url('/api/v1/functest/testcases', 'v1_test_cases'),
42 # GET /api/v1/functest/testcases/<testcase_name>
43 # => GET the info of one testcase
44 Url('/api/v1/functest/testcases/<testcase_name>', 'v1_testcase'),
46 # POST /api/v1/functest/testcases/action
47 # {"action":"run_test_case", "args": {"opts": {}, "testcase": "vping_ssh"}}
49 Url('/api/v1/functest/testcases/action', 'v1_testcase'),
51 # GET /api/v1/functest/testcases => GET all tiers
52 Url('/api/v1/functest/tiers', 'v1_tiers'),
54 # GET /api/v1/functest/tiers/<tier_name>
55 # => GET the info of one tier
56 Url('/api/v1/functest/tiers/<tier_name>', 'v1_tier'),
58 # GET /api/v1/functest/tiers/<tier_name>/testcases
59 # => GET all testcases within given tier
60 Url('/api/v1/functest/tiers/<tier_name>/testcases',
61 'v1_testcases_in_tier'),
63 # GET /api/v1/functest/tasks/<task_id>
64 # => GET the result of the task id
65 Url('/api/v1/functest/tasks/<task_id>', 'v1_task'),
67 # GET /api/v1/functest/tasks/<task_id>/log
68 # => GET the log of the task
69 Url('/api/v1/functest/tasks/<task_id>/log', 'v1_task_log')