Merge branch 'develop'
commit
6e4a697d99
|
@ -1,7 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.controller('SensorController', function($scope, $translate, $uibModal, SensorService, toaster, SweetAlert) {
|
app.controller('SensorController', function(
|
||||||
|
$scope,
|
||||||
|
$window,
|
||||||
|
$translate,
|
||||||
|
$uibModal,
|
||||||
|
SensorService,
|
||||||
|
toaster,
|
||||||
|
SweetAlert) {
|
||||||
|
$scope.cur_user = JSON.parse($window.localStorage.getItem("myems_admin_ui_current_user"));
|
||||||
$scope.getAllSensors = function() {
|
$scope.getAllSensors = function() {
|
||||||
SensorService.getAllSensors(function (response) {
|
SensorService.getAllSensors(function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 200) {
|
if (angular.isDefined(response.status) && response.status === 200) {
|
||||||
|
@ -27,7 +34,8 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
modalInstance.result.then(function(sensor) {
|
modalInstance.result.then(function(sensor) {
|
||||||
SensorService.addSensor(sensor, function (response) {
|
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
|
||||||
|
SensorService.addSensor(sensor, headers, function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 201) {
|
if (angular.isDefined(response.status) && response.status === 201) {
|
||||||
toaster.pop({
|
toaster.pop({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
@ -67,7 +75,8 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
|
||||||
});
|
});
|
||||||
|
|
||||||
modalInstance.result.then(function(modifiedSensor) {
|
modalInstance.result.then(function(modifiedSensor) {
|
||||||
SensorService.editSensor(modifiedSensor, function (response) {
|
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
|
||||||
|
SensorService.editSensor(modifiedSensor, headers, function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 200) {
|
if (angular.isDefined(response.status) && response.status === 200) {
|
||||||
toaster.pop({
|
toaster.pop({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
@ -105,7 +114,8 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
|
||||||
},
|
},
|
||||||
function(isConfirm) {
|
function(isConfirm) {
|
||||||
if (isConfirm) {
|
if (isConfirm) {
|
||||||
SensorService.deleteSensor(sensor, function (response) {
|
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
|
||||||
|
SensorService.deleteSensor(sensor, headers, function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 204) {
|
if (angular.isDefined(response.status) && response.status === 204) {
|
||||||
toaster.pop({
|
toaster.pop({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
|
|
@ -52,11 +52,11 @@ app.controller('SensorPointController', function (
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.changeSensor=function(item,model){
|
$scope.changeSensor=function(item,model){
|
||||||
$scope.currentSensor=item;
|
$scope.currentSensor=item;
|
||||||
$scope.currentSensor.selected=model;
|
$scope.currentSensor.selected=model;
|
||||||
$scope.getPointsBySensorID($scope.currentSensor.id);
|
$scope.getPointsBySensorID($scope.currentSensor.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.changeDataSource = function (item, model) {
|
$scope.changeDataSource = function (item, model) {
|
||||||
$scope.currentDataSource = model;
|
$scope.currentDataSource = model;
|
||||||
|
@ -80,7 +80,8 @@ app.controller('SensorPointController', function (
|
||||||
$scope.pairPoint = function (dragEl, dropEl) {
|
$scope.pairPoint = function (dragEl, dropEl) {
|
||||||
var pointid = angular.element('#' + dragEl).scope().point.id;
|
var pointid = angular.element('#' + dragEl).scope().point.id;
|
||||||
var sensorid = $scope.currentSensor.id;
|
var sensorid = $scope.currentSensor.id;
|
||||||
SensorPointService.addPair(sensorid, pointid, function (response) {
|
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
|
||||||
|
SensorPointService.addPair(sensorid, pointid, headers, function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 201) {
|
if (angular.isDefined(response.status) && response.status === 201) {
|
||||||
toaster.pop({
|
toaster.pop({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
@ -106,7 +107,8 @@ app.controller('SensorPointController', function (
|
||||||
}
|
}
|
||||||
var sensorpointid = angular.element('#' + dragEl).scope().sensorpoint.id;
|
var sensorpointid = angular.element('#' + dragEl).scope().sensorpoint.id;
|
||||||
var sensorid = $scope.currentSensor.id;
|
var sensorid = $scope.currentSensor.id;
|
||||||
SensorPointService.deletePair(sensorid, sensorpointid, function (response) {
|
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
|
||||||
|
SensorPointService.deletePair(sensorid, sensorpointid, headers, function (response) {
|
||||||
if (angular.isDefined(response.status) && response.status === 204) {
|
if (angular.isDefined(response.status) && response.status === 204) {
|
||||||
toaster.pop({
|
toaster.pop({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
|
|
@ -17,24 +17,24 @@ app.factory('SensorService', function($http) {
|
||||||
callback(response);
|
callback(response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addSensor: function(sensor, callback) {
|
addSensor: function(sensor, headers, callback) {
|
||||||
$http.post(getAPI()+'sensors',{data:sensor})
|
$http.post(getAPI()+'sensors',{data:sensor}, {headers})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editSensor: function(sensor, callback) {
|
editSensor: function(sensor, headers, callback) {
|
||||||
$http.put(getAPI()+'sensors/'+sensor.id,{data:sensor})
|
$http.put(getAPI()+'sensors/'+sensor.id,{data:sensor}, {headers})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteSensor: function(sensor, callback) {
|
deleteSensor: function(sensor, headers, callback) {
|
||||||
$http.delete(getAPI()+'sensors/'+sensor.id)
|
$http.delete(getAPI()+'sensors/'+sensor.id, {headers})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
app.factory('SensorPointService', function($http) {
|
app.factory('SensorPointService', function($http) {
|
||||||
return {
|
return {
|
||||||
addPair: function(sensorID,pointID,callback) {
|
addPair: function(sensorID,pointID, headers, callback) {
|
||||||
$http.post(getAPI()+'sensors/'+sensorID+'/points',{data:{'point_id':pointID}})
|
$http.post(getAPI()+'sensors/'+sensorID+'/points',{data:{'point_id':pointID}}, {headers})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
|
@ -10,8 +10,8 @@ app.factory('SensorPointService', function($http) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deletePair: function(sensorID,pointID, callback) {
|
deletePair: function(sensorID,pointID, headers, callback) {
|
||||||
$http.delete(getAPI()+'sensors/'+sensorID+'/points/'+pointID)
|
$http.delete(getAPI()+'sensors/'+sensorID+'/points/'+pointID, {headers})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
callback(response);
|
callback(response);
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
|
|
|
@ -4647,7 +4647,18 @@
|
||||||
"name": "POST Create New Sensor",
|
"name": "POST Create New Sensor",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
"header": [],
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "User-UUID",
|
||||||
|
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Token",
|
||||||
|
"value": "e713a4845a2f936eef1dca4314e7fad875b898854c56b4c5176d219f5ee19a0831d2ee67c63b17c2f2a49474d090cccb024f98a797d96571bc61027cbe1995af",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": "{\"data\":{\"name\":\"Sensor10\", \"description\":\"sensor description\"}}"
|
"raw": "{\"data\":{\"name\":\"Sensor10\", \"description\":\"sensor description\"}}"
|
||||||
|
@ -4668,19 +4679,30 @@
|
||||||
"name": "PUT Update a Sensor",
|
"name": "PUT Update a Sensor",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "PUT",
|
"method": "PUT",
|
||||||
"header": [],
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "User-UUID",
|
||||||
|
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Token",
|
||||||
|
"value": "e713a4845a2f936eef1dca4314e7fad875b898854c56b4c5176d219f5ee19a0831d2ee67c63b17c2f2a49474d090cccb024f98a797d96571bc61027cbe1995af",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": "{\"data\":{\"name\":\"Sensor10\", \"description\":\"sensor description\"}}"
|
"raw": "{\"data\":{\"name\":\"Sensor10\", \"description\":\"sensor description\"}}"
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{base_url}}/sensors/5",
|
"raw": "{{base_url}}/sensors/3",
|
||||||
"host": [
|
"host": [
|
||||||
"{{base_url}}"
|
"{{base_url}}"
|
||||||
],
|
],
|
||||||
"path": [
|
"path": [
|
||||||
"sensors",
|
"sensors",
|
||||||
"5"
|
"3"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -4690,28 +4712,50 @@
|
||||||
"name": "DELETE Sensor by ID",
|
"name": "DELETE Sensor by ID",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "DELETE",
|
"method": "DELETE",
|
||||||
"header": [],
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "User-UUID",
|
||||||
|
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Token",
|
||||||
|
"value": "e713a4845a2f936eef1dca4314e7fad875b898854c56b4c5176d219f5ee19a0831d2ee67c63b17c2f2a49474d090cccb024f98a797d96571bc61027cbe1995af",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{base_url}}/sensors/2",
|
"raw": "{{base_url}}/sensors/3",
|
||||||
"host": [
|
"host": [
|
||||||
"{{base_url}}"
|
"{{base_url}}"
|
||||||
],
|
],
|
||||||
"path": [
|
"path": [
|
||||||
"sensors",
|
"sensors",
|
||||||
"2"
|
"3"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "POST Sensor Point Relation",
|
"name": "POST Bind Point to Sensor",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
"header": [],
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "User-UUID",
|
||||||
|
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Token",
|
||||||
|
"value": "e713a4845a2f936eef1dca4314e7fad875b898854c56b4c5176d219f5ee19a0831d2ee67c63b17c2f2a49474d090cccb024f98a797d96571bc61027cbe1995af",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": "{\"data\":{\"point_id\":\"2686\"}}"
|
"raw": "{\"data\":{\"point_id\":\"2\"}}"
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{base_url}}/sensors/1/points",
|
"raw": "{{base_url}}/sensors/1/points",
|
||||||
|
@ -4728,7 +4772,7 @@
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GET All Points associated with Sensor ID",
|
"name": "GET All Points associated with Sensor by ID",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"header": [],
|
"header": [],
|
||||||
|
@ -4747,12 +4791,23 @@
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "DELETE Sensor Point Relation",
|
"name": "DELETE Unbind Point from Sensor",
|
||||||
"request": {
|
"request": {
|
||||||
"method": "DELETE",
|
"method": "DELETE",
|
||||||
"header": [],
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "User-UUID",
|
||||||
|
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Token",
|
||||||
|
"value": "e713a4845a2f936eef1dca4314e7fad875b898854c56b4c5176d219f5ee19a0831d2ee67c63b17c2f2a49474d090cccb024f98a797d96571bc61027cbe1995af",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{base_url}}/sensors/1/points/2686",
|
"raw": "{{base_url}}/sensors/1/points/2",
|
||||||
"host": [
|
"host": [
|
||||||
"{{base_url}}"
|
"{{base_url}}"
|
||||||
],
|
],
|
||||||
|
@ -4760,7 +4815,7 @@
|
||||||
"sensors",
|
"sensors",
|
||||||
"1",
|
"1",
|
||||||
"points",
|
"points",
|
||||||
"2686"
|
"2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1321,10 +1321,6 @@ Result
|
||||||
```bash
|
```bash
|
||||||
curl -i -X GET {{base_url}}/sensors
|
curl -i -X GET {{base_url}}/sensors
|
||||||
```
|
```
|
||||||
* DELETE a Sensor by ID
|
|
||||||
```bash
|
|
||||||
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -X DELETE {{base_url}}/sensors/{id}
|
|
||||||
```
|
|
||||||
* POST Create New Sensor
|
* POST Create New Sensor
|
||||||
```bash
|
```bash
|
||||||
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X POST -d '{"data":{"name":"Sensor10", "description":"sensor description"}}' {{base_url}}/sensors
|
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X POST -d '{"data":{"name":"Sensor10", "description":"sensor description"}}' {{base_url}}/sensors
|
||||||
|
@ -1333,15 +1329,19 @@ curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKE
|
||||||
```bash
|
```bash
|
||||||
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X PUT -d '{"data":{"name":"Sensor10", "description":"sensor description"}}' {{base_url}}/sensors/{id}
|
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X PUT -d '{"data":{"name":"Sensor10", "description":"sensor description"}}' {{base_url}}/sensors/{id}
|
||||||
```
|
```
|
||||||
* GET All Points associated with Sensor ID
|
* DELETE Sensor by ID
|
||||||
|
```bash
|
||||||
|
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -X DELETE {{base_url}}/sensors/{id}
|
||||||
|
```
|
||||||
|
* POST Bind Point to Sensor
|
||||||
|
```bash
|
||||||
|
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X POST -d '{"data":{"point_id":"2"}}' {{base_url}}/sensors/{id}/points
|
||||||
|
```
|
||||||
|
* GET All Points associated with Sensor by ID
|
||||||
```bash
|
```bash
|
||||||
curl -i -X GET {{base_url}}/sensors/{id}/points
|
curl -i -X GET {{base_url}}/sensors/{id}/points
|
||||||
```
|
```
|
||||||
* POST Sensor Point Relation
|
* DELETE Unbind Point from Sensor
|
||||||
```bash
|
|
||||||
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -H "Content-Type: application/json" -X POST -d '{"data":{"point_id":"3"}}' {{base_url}}/sensors/{id}/points
|
|
||||||
```
|
|
||||||
* DELETE Sensor Point Relation
|
|
||||||
```bash
|
```bash
|
||||||
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -X DELETE {{base_url}}/sensors/{id}/points/{pid}
|
curl -i -H "User-UUID: 793f1bb4-6e25-4242-8cdc-2f662b25484f" -H "Token: GET-TOKEN-AFTER-LOGIN" -X DELETE {{base_url}}/sensors/{id}/points/{pid}
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,7 +3,7 @@ import simplejson as json
|
||||||
import mysql.connector
|
import mysql.connector
|
||||||
import config
|
import config
|
||||||
import uuid
|
import uuid
|
||||||
from core.useractivity import user_logger
|
from core.useractivity import user_logger, access_control
|
||||||
|
|
||||||
|
|
||||||
class SensorCollection:
|
class SensorCollection:
|
||||||
|
@ -44,6 +44,7 @@ class SensorCollection:
|
||||||
@user_logger
|
@user_logger
|
||||||
def on_post(req, resp):
|
def on_post(req, resp):
|
||||||
"""Handles POST requests"""
|
"""Handles POST requests"""
|
||||||
|
access_control(req)
|
||||||
try:
|
try:
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
raw_json = req.stream.read().decode('utf-8')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
@ -133,6 +134,7 @@ class SensorItem:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@user_logger
|
@user_logger
|
||||||
def on_delete(req, resp, id_):
|
def on_delete(req, resp, id_):
|
||||||
|
access_control(req)
|
||||||
if not id_.isdigit() or int(id_) <= 0:
|
if not id_.isdigit() or int(id_) <= 0:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||||
description='API.INVALID_SENSOR_ID')
|
description='API.INVALID_SENSOR_ID')
|
||||||
|
@ -209,6 +211,7 @@ class SensorItem:
|
||||||
@user_logger
|
@user_logger
|
||||||
def on_put(req, resp, id_):
|
def on_put(req, resp, id_):
|
||||||
"""Handles PUT requests"""
|
"""Handles PUT requests"""
|
||||||
|
access_control(req)
|
||||||
try:
|
try:
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
raw_json = req.stream.read().decode('utf-8')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
@ -320,6 +323,7 @@ class SensorPointCollection:
|
||||||
@user_logger
|
@user_logger
|
||||||
def on_post(req, resp, id_):
|
def on_post(req, resp, id_):
|
||||||
"""Handles POST requests"""
|
"""Handles POST requests"""
|
||||||
|
access_control(req)
|
||||||
try:
|
try:
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
raw_json = req.stream.read().decode('utf-8')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
@ -387,6 +391,7 @@ class SensorPointItem:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@user_logger
|
@user_logger
|
||||||
def on_delete(req, resp, id_, pid):
|
def on_delete(req, resp, id_, pid):
|
||||||
|
access_control(req)
|
||||||
if not id_.isdigit() or int(id_) <= 0:
|
if not id_.isdigit() or int(id_) <= 0:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||||
description='API.INVALID_SENSOR_ID')
|
description='API.INVALID_SENSOR_ID')
|
||||||
|
|
Loading…
Reference in New Issue