mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-23 00:00:02 +01:00
37 lines
857 B
JavaScript
37 lines
857 B
JavaScript
import DS from 'ember-data';
|
|
|
|
export default DS.RESTAdapter.extend({
|
|
host: 'http://46.101.131.212:80',
|
|
namespace: '/api/ngsi10',
|
|
headers: {
|
|
Accept: 'application/json'
|
|
},
|
|
|
|
findAll: function(store, type, sinceToken) {
|
|
var requestBody = {
|
|
entities: [
|
|
{
|
|
type: 'ElectricalGridMonitoring',
|
|
isPattern: true,
|
|
id: 'S?_ElectricalGrid'
|
|
}
|
|
]
|
|
};
|
|
|
|
return this.ajax(this.host + '/' + this.namespace + '/queryContext', 'POST', { data: requestBody });
|
|
},
|
|
|
|
findRecord: function(store, type, id, snapshot) {
|
|
var requestBody = {
|
|
entities: [
|
|
{
|
|
type: 'ElectricalGridMonitoring',
|
|
isPattern: false,
|
|
id: id
|
|
}
|
|
]
|
|
};
|
|
|
|
return this.ajax(this.host + '/' + this.namespace + '/queryContext', 'POST', { data: requestBody });
|
|
},
|
|
});
|