USER_API = "/plstackapi/users/";
DEPLOYMENT_API = "/plstackapi/deployments";
+SLICEPLUS_API = "/xoslib/slicesplus/";
+
XOSModel = Backbone.Model.extend({
/* from backbone-tastypie.js */
//idAttribute: 'resource_uri',
return this.models.map(function(element) { return element.attributes; });
},
+ startPolling: function() {
+ if (!this._polling) {
+ collection=this;
+ setInterval(function() { console.log(collection); collection.fetch(); }, 10000);
+ this._polling=true;
+ this.fetch();
+ }
+ },
+
maybeFetch: function(options){
// Helper function to fetch only if this collection has not been fetched before.
if(this._fetched){
});
function xoslib() {
+ // basic REST
this.sliver = XOSModel.extend({ urlRoot: SLIVER_API });
this.sliverCollection = XOSCollection.extend({ urlRoot: SLIVER_API,
model: this.sliver});
model: this.deployment});
this.deployments = new this.deploymentCollection();
+ // enhanced REST
+ this.slicePlus = XOSModel.extend({ urlRoot: SLICEPLUS_API });
+ this.slicePlusCollection = XOSCollection.extend({ urlRoot: SLICEPLUS_API,
+ model: this.slicePlus});
+ this.slicesPlus = new this.slicePlusCollection();
+
this.listObjects = function() { return ["slivers", "slices", "nodes", "sites", "users", "deployments"]; };
};