support all cluster update option
[escalator.git] / api / escalator / api / v1 / router.py
index 54b09c4..24d254c 100644 (file)
@@ -13,6 +13,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 from escalator.common import wsgi
+from escalator.api.v1 import versions
+from escalator.api.v1 import clusters
+from escalator.api.v1 import install
 
 
 class API(wsgi.Router):
@@ -22,4 +25,23 @@ class API(wsgi.Router):
     def __init__(self, mapper):
         wsgi.Resource(wsgi.RejectMethodController())
 
+        versions_resource = versions.create_resource()
+        clusters_resource = clusters.create_resource()
+
+        mapper.connect("/clusters",
+                       controller=clusters_resource,
+                       action='detail',
+                       conditions={'method': ['GET']})
+
+        mapper.connect("/versions",
+                       controller=versions_resource,
+                       action='version',
+                       conditions={'method': ['POST']})
+
+        install_resource = install.create_resource()
+        mapper.connect("/update/{cluster_id}",
+                       controller=install_resource,
+                       action='update_progress',
+                       conditions={'method': ['GET']})
+
         super(API, self).__init__(mapper)