REST API for pseudowire addition / deletion.
Refactored pseudowire code to use REST in order
to add or delete pseudowires individually. Previous implementation
used the network configuration, which is now completely
removed from the code. Further, I re-organized the code
and create a utility class that holds all the necessary
functionality for verifying pseudowires.
Further, I removed all mastership checks in the pw code
since now a specific pseudowire creation is sent to a single
instance, which will handle the call.
Change-Id: I1eb5e7cc7730ad792ea84dd389475768153e2b68
diff --git a/apps/segmentrouting/web/src/main/resources/definitions/PseudowireCreate.json b/apps/segmentrouting/web/src/main/resources/definitions/PseudowireCreate.json
new file mode 100644
index 0000000..feddd18
--- /dev/null
+++ b/apps/segmentrouting/web/src/main/resources/definitions/PseudowireCreate.json
@@ -0,0 +1,68 @@
+{
+ "type": "object",
+ "title": "pseudowire-creation",
+ "required": [
+ "pwId",
+ "cP1",
+ "cP2",
+ "cP1InnerTag",
+ "cP1OuterTag",
+ "cP2InnerTag",
+ "cP2OuterTag",
+ "mode",
+ "sdTag",
+ "pwLabel"
+ ],
+ "properties": {
+ "pwId": {
+ "type": "string",
+ "example": "42",
+ "description": "Id of pseudowire to create."
+ },
+ "cP1": {
+ "type": "string",
+ "example": "of:0000000000000227/25",
+ "description": "Pseudowire connection point 1."
+ },
+ "cP2": {
+ "type": "string",
+ "example": "of:0000000000000226/25",
+ "description": "Pseudowire connection point 2."
+ },
+ "cP1InnerTag": {
+ "type": "string",
+ "example": "101",
+ "description": "Inner vlan for pseudowire connection point 1."
+ },
+ "cP1OuterTag": {
+ "type": "string",
+ "example": "",
+ "description": "Outer vlan for pseudowire connection point 1."
+ },
+ "cP2InnerTag": {
+ "type": "string",
+ "example": "101",
+ "description": "Inner vlan for pseudowire connection point 2."
+ },
+ "cP2OuterTag": {
+ "type": "string",
+ "example": "",
+ "description": "Outer vlan for pseudowire connection point 2."
+ },
+ "mode": {
+ "type": "string",
+ "example": "RAW",
+ "description": "Working mode of pseudowire."
+ },
+ "sDTag": {
+ "type": "string",
+ "example": "",
+ "description": "Service delimiting tag of the pseudowire"
+ },
+ "pwLabel": {
+ "type": "256",
+ "example": "",
+ "description": "Pseudowire label."
+ }
+ }
+}
\ No newline at end of file