commit | 0b481125006b39e1aee50a11eb66308f5ac49d66 | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Sun Jan 17 04:26:18 2021 +0900 |
committer | Jian Li <pyguni@gmail.com> | Wed Jan 20 10:55:52 2021 +0000 |
tree | 3c47d0e77008f2c2137af60129412195012c8d83 | |
parent | ac31f6527f72403d427d4f9fd3412f6240f3036c [diff] |
Support to store and monitor kubevirt port resource Change-Id: Id1d8c7a9eb2c351ccb9ae27e5f0730aa37a8a720
diff --git a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/DefaultKubevirtPort.java b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/DefaultKubevirtPort.java index 410c098..4fe0125 100644 --- a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/DefaultKubevirtPort.java +++ b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/DefaultKubevirtPort.java
@@ -83,12 +83,24 @@ @Override public KubevirtPort updatePortNumber(PortNumber portNumber) { - return null; + return new Builder() + .networkId(networkId) + .macAddress(macAddress) + .ipAddress(ipAddress) + .deviceId(deviceId) + .portNumber(portNumber) + .build(); } @Override public KubevirtPort updateDeviceId(DeviceId deviceId) { - return null; + return new Builder() + .networkId(networkId) + .macAddress(macAddress) + .ipAddress(ipAddress) + .deviceId(deviceId) + .portNumber(portNumber) + .build(); } @Override
diff --git a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortService.java b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortService.java index 7861bb3..61b6338 100644 --- a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortService.java +++ b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortService.java
@@ -35,6 +35,14 @@ KubevirtPort port(MacAddress mac); /** + * Returns the kubevirt ports belongs to the given network. + * + * @param networkId network identifier + * @return kubevirt ports + */ + Set<KubevirtPort> ports(String networkId); + + /** * Returns all kubevirt ports registered. * * @return set of kubevirt ports
diff --git a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortStore.java b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortStore.java index 0daf301..d08f3b5 100644 --- a/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortStore.java +++ b/apps/kubevirt-networking/api/src/main/java/org/onosproject/kubevirtnetworking/api/KubevirtPortStore.java
@@ -38,7 +38,7 @@ * * @param port kubevirt port */ - void updatedPort(KubevirtPort port); + void updatePort(KubevirtPort port); /** * Removes the kubevirt port with the given MAC address.