diff --git a/README.md b/README.md index 321649bb..b97df8b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# drydock +# helm_drydock A python REST orchestrator to translate a YAML host topology to a provisioned set of hosts and provide a set of cloud-init post-provisioning instructions. ## Modular service @@ -9,7 +9,7 @@ aka ingester Pluggable service to ingest a inventory/design specification, convert it to a standard internal representaion, and persist it to the Design State API. Initial implementation -is the consumer of AIC YAML schema. +is the consumer of YAML schema. ### Design State API ### @@ -38,10 +38,6 @@ aka maasdriver Pluggable provisioner for server bootstrapping. Initial implementation is MaaS client. -### Network Driver ### - -Pluggable provisioner for network provisioning. Initial implementation is Noop. - ### Introspection API ### aka introspection diff --git a/helm_drydock/control/__init__.py b/helm_drydock/control/__init__.py new file mode 100644 index 00000000..2a385a45 --- /dev/null +++ b/helm_drydock/control/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2017 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. \ No newline at end of file diff --git a/helm_drydock/control/root.py b/helm_drydock/control/root.py new file mode 100644 index 00000000..eb4bb8af --- /dev/null +++ b/helm_drydock/control/root.py @@ -0,0 +1,35 @@ +# Copyright 2017 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pecan import expose +from webob.exc import status_map + +class RootController(object): + + @expose(generic=True, template='index.html') + def index(self): + return dict() + + @index.when(method='POST') + def index_post(self, q): + redirect('https://pecan.readthedocs.io/en/latest/search.html?q=%s' % q) + + @expose('error.html') + def error(self, status): + try: + status = int(status) + except ValueError: + status = 0 + message = getattr(status_map.get(status), 'explanation', '') + return dict(status=status, message=message) \ No newline at end of file diff --git a/setup.py b/setup.py index adc96bd7..c065e7eb 100644 --- a/setup.py +++ b/setup.py @@ -44,14 +44,16 @@ setup(name='helm_drydock', 'helm_drydock.ingester', 'helm_drydock.ingester.plugins', 'helm_drydock.statemgmt', - 'helm_drydock.orchestrator'], + 'helm_drydock.orchestrator', + 'helm_drydock.control'], install_requires=[ 'PyYAML', 'oauth', 'requests-oauthlib', 'pyipmi', 'netaddr', - 'pecan' + 'pecan', + 'webob' ], dependency_link=[ 'git+https://github.com/maas/python-libmaas.git'