add slice, node, site, deployment, user
[plstackapi.git] / planetstack / core / xoslib / static / js / xos-backbone.js
index 1633768..0f6c1e4 100644 (file)
@@ -1,4 +1,9 @@
 SLIVER_API = "/plstackapi/slivers/";
+SLICE_API = "/plstackapi/slices/";
+NODE_API = "/plstackapi/nodes/";
+SITE_API = "/plstackapi/sites/";
+USER_API = "/plstackapi/users/";
+DEPLOYMENT_API = "/plstackapi/deployments";
 
 XOSModel = Backbone.Model.extend({
     /* from backbone-tastypie.js */
@@ -93,6 +98,32 @@ function xoslib() {
     this.sliverCollection = XOSCollection.extend({ urlRoot: SLIVER_API,
                                                    model: this.sliver});
     this.slivers = new this.sliverCollection();
+
+    this.slice = XOSModel.extend({ urlRoot: SLICE_API });
+    this.sliceCollection = XOSCollection.extend({ urlRoot: SLICE_API,
+                                                   model: this.slice});
+    this.slices = new this.sliceCollection();
+
+    this.node = XOSModel.extend({ urlRoot: NODE_API });
+    this.nodeCollection = XOSCollection.extend({ urlRoot: NODE_API,
+                                                   model: this.node});
+    this.nodes = new this.nodeCollection();
+
+    this.site = XOSModel.extend({ urlRoot: SITE_API });
+    this.siteCollection = XOSCollection.extend({ urlRoot: SITE_API,
+                                                   model: this.site});
+    this.sites = new this.siteCollection();
+
+    this.user = XOSModel.extend({ urlRoot: USER_API });
+    this.userCollection = XOSCollection.extend({ urlRoot: USER_API,
+                                                   model: this.user});
+    this.users = new this.userCollection();
+
+    this.deployment = XOSModel.extend({ urlRoot: DEPLOYMENT_API });
+    this.deploymentCollection = XOSCollection.extend({ urlRoot: DEPLOYMENT_API,
+                                                       model: this.deployment});
+    this.deployments = new this.deploymentCollection();
 };
 
-XOSLib = new xoslib();
+xos = new xoslib();
+