ONOS-6106 Adding Missing Fields in the " get flows and get devices" rest api
Change-Id: I6657b8d75388e850acaa53fe4f5be261e45a9bca
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/DevicesWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/DevicesWebResource.java
index 76641da..b16846e 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/DevicesWebResource.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/DevicesWebResource.java
@@ -88,8 +88,9 @@
public Response removeDevice(@PathParam("id") String id) {
Device device = nullIsNotFound(get(DeviceService.class).getDevice(deviceId(id)),
DEVICE_NOT_FOUND);
+ ObjectNode result = codec(Device.class).encode(device, this);
get(DeviceAdminService.class).removeDevice(deviceId(id));
- return ok(codec(Device.class).encode(device, this)).build();
+ return ok(result).build();
}
/**
diff --git a/web/api/src/main/resources/definitions/DeviceGet.json b/web/api/src/main/resources/definitions/DeviceGet.json
index 03e67d5..5573359 100644
--- a/web/api/src/main/resources/definitions/DeviceGet.json
+++ b/web/api/src/main/resources/definitions/DeviceGet.json
@@ -10,6 +10,7 @@
"hw",
"sw",
"serial",
+ "driver",
"chassisId",
"annotations"
],
@@ -46,6 +47,10 @@
"type": "string",
"example": "123"
},
+ "driver": {
+ "type": "string",
+ "example": "ovs"
+ },
"chassisId": {
"type": "string",
"example": "1"
@@ -67,6 +72,10 @@
"type": "string",
"example": "OF_13"
},
+ "driver": {
+ "type": "string",
+ "example": "ovs"
+ },
"channelId": {
"type": "string",
"example": "10.128.12.4:34689"
diff --git a/web/api/src/main/resources/definitions/DeviceGetPorts.json b/web/api/src/main/resources/definitions/DeviceGetPorts.json
index 3a5230c..9193e4a 100644
--- a/web/api/src/main/resources/definitions/DeviceGetPorts.json
+++ b/web/api/src/main/resources/definitions/DeviceGetPorts.json
@@ -10,6 +10,7 @@
"hw",
"sw",
"serial",
+ "driver",
"chassisId",
"annotations"
],
@@ -46,6 +47,10 @@
"type": "string",
"example": "123"
},
+ "driver": {
+ "type": "string",
+ "example": "ovs"
+ },
"chassisId": {
"type": "string",
"example": "1"
@@ -129,4 +134,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/web/api/src/main/resources/definitions/DevicesGet.json b/web/api/src/main/resources/definitions/DevicesGet.json
index 4cf4d9d..937c684 100644
--- a/web/api/src/main/resources/definitions/DevicesGet.json
+++ b/web/api/src/main/resources/definitions/DevicesGet.json
@@ -23,6 +23,7 @@
"hw",
"sw",
"serial",
+ "driver",
"chassisId",
"annotations"
],
@@ -59,6 +60,10 @@
"type": "string",
"example": "123"
},
+ "driver": {
+ "type": "string",
+ "example": "ovs"
+ },
"chassisId": {
"type": "string",
"example": "1"
diff --git a/web/api/src/main/resources/definitions/FlowEntries.json b/web/api/src/main/resources/definitions/FlowEntries.json
index 15f8628..edc4070 100644
--- a/web/api/src/main/resources/definitions/FlowEntries.json
+++ b/web/api/src/main/resources/definitions/FlowEntries.json
@@ -27,6 +27,7 @@
"life",
"packets",
"bytes",
+ "liveType",
"lastSeen"
],
"properties": {
@@ -85,6 +86,10 @@
"format": "int64",
"example": 1826226
},
+ "liveType": {
+ "type": "string",
+ "example": "UNKNOWN"
+ },
"lastSeen": {
"type": "integer",
"format": "int64",
diff --git a/web/api/src/main/resources/definitions/FlowRules.json b/web/api/src/main/resources/definitions/FlowRules.json
index 026b726..acdbe7c 100644
--- a/web/api/src/main/resources/definitions/FlowRules.json
+++ b/web/api/src/main/resources/definitions/FlowRules.json
@@ -22,7 +22,8 @@
"priority",
"timeout",
"isPermanent",
- "deviceId"
+ "deviceId",
+ "liveType"
],
"properties": {
"id": {
@@ -61,6 +62,10 @@
"type": "string",
"example": "of:0000000000000003"
},
+ "liveType": {
+ "type": "string",
+ "example": "UNKNOWN"
+ },
"treatment": {
"type": "object",
"title": "treatment",