woodpecker/cmd/drone-server/static/scripts/services/agents.js

32 lines
531 B
JavaScript
Raw Normal View History

2015-04-30 21:41:52 +00:00
'use strict';
(function () {
/**
* The Agent provides access to build agent
* data and management using REST API calls.
*/
function AgentService($http) {
/**
* Gets an agent list.
2015-04-30 21:41:52 +00:00
*/
this.getAgents = function() {
return $http.get('/api/agents');
2015-04-30 21:41:52 +00:00
};
this.deleteAgent = function(agent) {
return $http.delete('/api/agents/'+agent.id);
};
this.postAgent = function(agent) {
return $http.post('/api/agents', agent);
};
2015-04-30 21:41:52 +00:00
}
angular
.module('drone')
.service('agents', AgentService);
})();