mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 08:10:50 +01:00
29 lines
890 B
JavaScript
29 lines
890 B
JavaScript
define(['app'], function (app) {
|
|
app.registerFactory('Host', ['$http', function ($http) {
|
|
var Host = function (id) {
|
|
if (!id) {
|
|
return;
|
|
}
|
|
|
|
this.id = id;
|
|
}
|
|
|
|
Host.prototype.save = function (playbook, hostgroup) {
|
|
return $http.put('/playbook/'+playbook.data._id+'/hostgroup/'+hostgroup.data._id+'/host/'+this.data._id, this.data);
|
|
}
|
|
|
|
Host.prototype.add = function (playbook, hostgroup) {
|
|
return $http.post('/playbook/'+playbook.data._id+'/hostgroup/'+hostgroup.data._id+'/hosts', this.data);
|
|
}
|
|
|
|
Host.prototype.delete = function (playbook, hostgroup) {
|
|
return $http.delete('/playbook/'+playbook.data._id+'/hostgroup/'+hostgroup.data._id+'/host/'+this.data._id);
|
|
}
|
|
|
|
Host.prototype.get = function (playbook, hostgroup) {
|
|
return $http.get('/playbook/'+playbook.data._id+'/hostgroup/'+hostgroup.data._id+'/host/'+this.id);
|
|
}
|
|
|
|
return Host;
|
|
}])
|
|
}) |