Committed by
Gerrit Code Review
Protocol annotation for REST and NETCONF device providers.
Change-Id: Ib68011c1c88ab7325df329933ca94b865530d1b4
Showing
2 changed files
with
8 additions
and
2 deletions
... | @@ -26,6 +26,7 @@ import org.onlab.packet.ChassisId; | ... | @@ -26,6 +26,7 @@ import org.onlab.packet.ChassisId; |
26 | import org.onosproject.core.ApplicationId; | 26 | import org.onosproject.core.ApplicationId; |
27 | import org.onosproject.core.CoreService; | 27 | import org.onosproject.core.CoreService; |
28 | import org.onosproject.incubator.net.config.basics.ConfigException; | 28 | import org.onosproject.incubator.net.config.basics.ConfigException; |
29 | +import org.onosproject.net.AnnotationKeys; | ||
29 | import org.onosproject.net.DefaultAnnotations; | 30 | import org.onosproject.net.DefaultAnnotations; |
30 | import org.onosproject.net.Device; | 31 | import org.onosproject.net.Device; |
31 | import org.onosproject.net.DeviceId; | 32 | import org.onosproject.net.DeviceId; |
... | @@ -171,7 +172,9 @@ public class NetconfDeviceProvider extends AbstractProvider | ... | @@ -171,7 +172,9 @@ public class NetconfDeviceProvider extends AbstractProvider |
171 | ChassisId cid = new ChassisId(); | 172 | ChassisId cid = new ChassisId(); |
172 | String ipAddress = nodeId.ip().toString(); | 173 | String ipAddress = nodeId.ip().toString(); |
173 | SparseAnnotations annotations = DefaultAnnotations.builder() | 174 | SparseAnnotations annotations = DefaultAnnotations.builder() |
174 | - .set(IPADDRESS, ipAddress).build(); | 175 | + .set(IPADDRESS, ipAddress) |
176 | + .set(AnnotationKeys.PROTOCOL, SCHEME_NAME.toUpperCase()) | ||
177 | + .build(); | ||
175 | DeviceDescription deviceDescription = new DefaultDeviceDescription( | 178 | DeviceDescription deviceDescription = new DefaultDeviceDescription( |
176 | deviceId.uri(), | 179 | deviceId.uri(), |
177 | Device.Type.SWITCH, | 180 | Device.Type.SWITCH, | ... | ... |
... | @@ -26,6 +26,7 @@ import org.onlab.packet.ChassisId; | ... | @@ -26,6 +26,7 @@ import org.onlab.packet.ChassisId; |
26 | import org.onosproject.core.ApplicationId; | 26 | import org.onosproject.core.ApplicationId; |
27 | import org.onosproject.core.CoreService; | 27 | import org.onosproject.core.CoreService; |
28 | import org.onosproject.incubator.net.config.basics.ConfigException; | 28 | import org.onosproject.incubator.net.config.basics.ConfigException; |
29 | +import org.onosproject.net.AnnotationKeys; | ||
29 | import org.onosproject.net.DefaultAnnotations; | 30 | import org.onosproject.net.DefaultAnnotations; |
30 | import org.onosproject.net.Device; | 31 | import org.onosproject.net.Device; |
31 | import org.onosproject.net.DeviceId; | 32 | import org.onosproject.net.DeviceId; |
... | @@ -178,7 +179,9 @@ public class RestDeviceProvider extends AbstractProvider | ... | @@ -178,7 +179,9 @@ public class RestDeviceProvider extends AbstractProvider |
178 | ChassisId cid = new ChassisId(); | 179 | ChassisId cid = new ChassisId(); |
179 | String ipAddress = nodeId.ip().toString(); | 180 | String ipAddress = nodeId.ip().toString(); |
180 | SparseAnnotations annotations = DefaultAnnotations.builder() | 181 | SparseAnnotations annotations = DefaultAnnotations.builder() |
181 | - .set(IPADDRESS, ipAddress).build(); | 182 | + .set(IPADDRESS, ipAddress) |
183 | + .set(AnnotationKeys.PROTOCOL, REST.toUpperCase()) | ||
184 | + .build(); | ||
182 | DeviceDescription deviceDescription = new DefaultDeviceDescription( | 185 | DeviceDescription deviceDescription = new DefaultDeviceDescription( |
183 | deviceId.uri(), | 186 | deviceId.uri(), |
184 | Device.Type.SWITCH, | 187 | Device.Type.SWITCH, | ... | ... |
-
Please register or login to post a comment