[SDFAB-90] Implement priority mechanism in the Policy framework.
Change-Id: I738956566bfcf1bd5e2d4fcd9bfef153b5fb674a
diff --git a/web/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java b/web/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
index 5a24ca5..f876f18 100644
--- a/web/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
+++ b/web/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
@@ -252,7 +252,7 @@
}
policyService.addOrUpdateTrafficMatch(trafficMatch);
root.put(TRAFFIC_MATCH_ID, trafficMatch.trafficMatchId().toString());
- } catch (IOException ex) {
+ } catch (IOException | IllegalArgumentException ex) {
throw new IllegalArgumentException(ex);
}
diff --git a/web/src/main/resources/definitions/TrafficMatchCreate.json b/web/src/main/resources/definitions/TrafficMatchCreate.json
index 3ab1022..f901e33 100644
--- a/web/src/main/resources/definitions/TrafficMatchCreate.json
+++ b/web/src/main/resources/definitions/TrafficMatchCreate.json
@@ -3,6 +3,7 @@
"title": "traffic-match-creation",
"required": [
"policy_id",
+ "priority",
"selector"
],
"properties": {
@@ -11,6 +12,11 @@
"example": "DROP",
"description": "ID of associated policy"
},
+ "priority": {
+ "type": "int",
+ "example": "60000",
+ "description": "Priority of the TrafficMatch"
+ },
"selector": {
"type": "object",
"title": "selector",