summaryrefslogtreecommitdiff
path: root/openstack_dashboard/api/rest/heat.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/api/rest/heat.py')
-rw-r--r--openstack_dashboard/api/rest/heat.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/openstack_dashboard/api/rest/heat.py b/openstack_dashboard/api/rest/heat.py
deleted file mode 100644
index df8752f..0000000
--- a/openstack_dashboard/api/rest/heat.py
+++ /dev/null
@@ -1,51 +0,0 @@
1# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12"""API for the heat service."""
13
14from django.views import generic
15
16from openstack_dashboard import api
17from openstack_dashboard.api.rest import urls
18from openstack_dashboard.api.rest import utils as rest_utils
19
20
21@urls.register
22class Validate(generic.View):
23 """API for validating a template"""
24 url_regex = r'heat/validate/$'
25
26 @rest_utils.ajax(data_required=True)
27 def post(self, request):
28 """Validate a template
29
30 The following parameters may be passed in the POST
31 application/json object. The parameters are:
32 request:
33
34 :param template_url: The template to validate
35 """
36 return api.heat.template_validate(request, **(request.DATA))
37
38
39@urls.register
40class Services(generic.View):
41 """API for heat services."""
42 url_regex = r'heat/services/$'
43
44 @rest_utils.ajax()
45 def get(self, request):
46 """Get a list of heat services."""
47 if api.base.is_service_enabled(request, 'orchestration'):
48 result = api.heat.service_list(request)
49 return {'items': [u.to_dict() for u in result]}
50 else:
51 raise rest_utils.AjaxError(501, '')