Commit de5880aa authored by Pablo Armingol's avatar Pablo Armingol
Browse files

pre merge code cleanup

parent f541c4eb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json, logging
import logging
from flask import request
from flask.json import jsonify
from flask_restful import Resource
@@ -61,4 +61,3 @@ class Networks(Resource):
            response = jsonify({'error': str(e)})
            response.status_code = HTTP_SERVERERROR
        return response
    
 No newline at end of file
+11 −2
Original line number Diff line number Diff line
@@ -259,7 +259,16 @@ class Devices(_Resource):

class Device(_Resource):
    def get(self, device_uuid : str):
        return format_grpc_to_json(self.client.GetDevice(grpc_device_id(device_uuid)))
        return format_grpc_to_json(self.context_client.GetDevice(grpc_device_id(device_uuid)))

    def put(self, device_uuid : str):
        device = request.get_json()
        if device_uuid != device['device_id']['device_uuid']['uuid']:
            raise BadRequest('Mismatching device_uuid')
        return format_grpc_to_json(self.device_client.ConfigureDevice(grpc_device(device)))

    def delete(self, device_uuid : str):
        return format_grpc_to_json(self.device_client.DeleteDevice(grpc_device_id(device_uuid)))

class LinkIds(_Resource):
    def get(self):
+2 −3
Original line number Diff line number Diff line
@@ -50,9 +50,8 @@ RESOURCES = [
    ('api.slice',          Slice,         '/context/<path:context_uuid>/slice/<path:slice_uuid>'),

    ('api.device_ids',     DeviceIds,     '/device_ids'),

    ('api.devices',        HardwareMultipleDevices,       '/devices'),
    ('api.device',         Hardware,        '/device/<path:device_uuid>'),
    ('api.devices',        Devices,       '/devices'),
    ('api.device',         Device,        '/device/<path:device_uuid>'),

    ('api.link_ids',       LinkIds,       '/link_ids'),
    ('api.links',          Links,         '/links'),
+1 −1

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.