X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fswitchmanager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fswitchmanager%2Fnorthbound%2FSwitchNorthbound.java;h=662af723ed4861aa339ff99c3cacedb00af20cf2;hb=c0ed4d565d180c360f7506b2577c4b2d732e173c;hp=1777f1a8edcfc0f991acd65ccce6bda77b673ae3;hpb=c7df154d0ab6ab8222e46adefd82aea620b825aa;p=controller.git diff --git a/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java b/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java index 1777f1a8ed..662af723ed 100644 --- a/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java +++ b/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java @@ -117,10 +117,10 @@ public class SwitchNorthbound { * * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/nodes * - * Response in XML: + * Response body in XML: * <?xml version="1.0" encoding="UTF-8" standalone="yes"?> * <list> * <nodeProperties> @@ -155,10 +155,41 @@ public class SwitchNorthbound { * </nodeProperties> * </list> * - * Response in JSON: - * {"nodeProperties":[{"node":{"id":"00:00:00:00:00:00:00:02","type":"OF"},"properties":{"tables":{"value":"-1"}, - * "description":{"value":"None"},"actions":{"value":"4095"},"macAddress":{"value":"00:00:00:00:00:02"},"capabilities" - * :{"value":"199"},"timeStamp":{"value":"1377291227877","name":"connectedSince"},"buffers":{"value":"256"}}}]} + * Response body in JSON: + * { + * "nodeProperties":[ + * { + * "node":{ + * "id":"00:00:00:00:00:00:00:02", + * "type":"OF" + * }, + * "properties":{ + * "tables":{ + * "value":"-1" + * }, + * "description":{ + * "value":"None" + * }, + * "actions":{ + * "value":"4095" + * }, + * "macAddress":{ + * "value":"00:00:00:00:00:02" + * }, + * "capabilities":{ + * "value":"199" + * }, + * "timeStamp":{ + * "value":"1377291227877", + * "name":"connectedSince" + * }, + * "buffers":{ + * "value":"256" + * } + * } + * } + * ] + * } * * */ @@ -233,7 +264,7 @@ public class SwitchNorthbound { * * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/node/OF/00:00:00:00:00:00:00:03/property/description/Switch3 * * @@ -308,7 +339,7 @@ public class SwitchNorthbound { * * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/node/OF/00:00:00:00:00:00:00:03/property/forwarding * * @@ -385,14 +416,14 @@ public class SwitchNorthbound { * {@link org.opendaylight.controller.sal.core.Property} attached to * it. * - *
+ ** * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/node/OF/00:00:00:00:00:00:00:01 * - * Response in XML: + * Response body in XML: * <?xml version="1.0" encoding="UTF-8" standalone="yes"?> * <list> * <nodeConnectorProperties> @@ -418,9 +449,32 @@ public class SwitchNorthbound { * </nodeConnectorProperties> * </list> * - * Response in JSON: - * {"nodeConnectorProperties":[{"nodeconnector":{"node":{"id":"00:00:00:00:00:00:00:01","type":"OF"},"id":"2","type":"OF"}, - * "properties":{"state":{"value":"1"},"config":{"value":"1"},"name":{"value":"L1_2-C2_1"}}}]} + * Response body in JSON: + * { + * "nodeConnectorProperties":[ + * { + * "nodeconnector":{ + * "node":{ + * "id":"00:00:00:00:00:00:00:01", + * "type":"OF" + * }, + * "id":"2", + * "type":"OF" + * }, + * "properties":{ + * "state":{ + * "value":"1" + * }, + * "config":{ + * "value":"1" + * }, + * "name":{ + * "value":"L1_2-C2_1" + * } + * } + * } + * ] + * } * **/ @@ -486,8 +540,10 @@ public class SwitchNorthbound { * Type of the node connector being programmed (Eg. 'OF') * @param nodeConnectorId * NodeConnector Identifier as specified by - * {@link org.opendaylight.controller.sal.core.NodeConnector} - * (Eg. '2') + * {@link org.opendaylight.controller.sal.core.NodeConnector}. + * (Eg. '2'). If nodeConnecterId contains forward slash(/), + * replace forward slash with underscore(_) in the URL. (Eg. for + * Ethernet1/2, use Ethernet1_2) * @param propertyName * Name of the Property specified by * {@link org.opendaylight.controller.sal.core.Property} and its @@ -498,11 +554,11 @@ public class SwitchNorthbound { * extended classes * @return Response as dictated by the HTTP Response Status code * - *+ ** * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/nodeconnector/OF/00:00:00:00:00:00:00:01/OF/2/property/bandwidth/1 * *@@ -538,6 +594,10 @@ public class SwitchNorthbound { handleNodeAvailability(containerName, nodeType, nodeId); Node node = Node.fromString(nodeType, nodeId); + if (nodeConnectorId.contains("_")) { + nodeConnectorId = nodeConnectorId.replace("_", "/"); + } + handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId); NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node); @@ -571,18 +631,20 @@ public class SwitchNorthbound { * @param nodeConnectorId * NodeConnector Identifier as specified by * {@link org.opendaylight.controller.sal.core.NodeConnector} - * (Eg. '1') + * (Eg. '1'). If nodeConnecterId contains forward slash(/), + * replace forward slash with underscore(_) in the URL. (Eg. for + * Ethernet1/2, use Ethernet1_2) * @param propertyName * Name of the Property specified by * {@link org.opendaylight.controller.sal.core.Property} and its * extended classes. Property that can be deleted is bandwidth * @return Response as dictated by the HTTP Response Status code * - *+ ** * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/nodeconnector/OF/00:00:00:00:00:00:00:01/OF/2/property/bandwidth * *@@ -616,6 +678,10 @@ public class SwitchNorthbound { handleNodeAvailability(containerName, nodeType, nodeId); Node node = Node.fromString(nodeType, nodeId); + if (nodeConnectorId.contains("_")) { + nodeConnectorId = nodeConnectorId.replace("_", "/"); + } + handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId); NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node); Status ret = switchManager.removeNodeConnectorProp(nc, propertyName); @@ -638,7 +704,7 @@ public class SwitchNorthbound { * * Example: * - * RequestURL: + * Request URL: * http://localhost:8080/controller/nb/v2/switchmanager/default/save * *