Pass the selector/treatment set by CLI to the HostToHostIntent
NOTE:
During PathIntent compilation, the ethSrc and ethDst in the selector will be overridden by the MAC of the end-points.
Also, an output action will be appended to the treatment.
Change-Id: Ie2e621b91203a49237e7466b919abedceb3e697d
diff --git a/cli/src/main/java/org/onosproject/cli/net/AddHostToHostIntentCommand.java b/cli/src/main/java/org/onosproject/cli/net/AddHostToHostIntentCommand.java
index 17d9729..cabf0b3 100644
--- a/cli/src/main/java/org/onosproject/cli/net/AddHostToHostIntentCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/AddHostToHostIntentCommand.java
@@ -20,6 +20,8 @@
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.onosproject.net.HostId;
+import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.intent.Constraint;
import org.onosproject.net.intent.HostToHostIntent;
import org.onosproject.net.intent.IntentService;
@@ -46,6 +48,8 @@
HostId oneId = HostId.hostId(one);
HostId twoId = HostId.hostId(two);
+ TrafficSelector selector = buildTrafficSelector();
+ TrafficTreatment treatment = buildTrafficTreatment();
List<Constraint> constraints = buildConstraints();
HostToHostIntent intent = HostToHostIntent.builder()
@@ -53,6 +57,8 @@
.key(key())
.one(oneId)
.two(twoId)
+ .selector(selector)
+ .treatment(treatment)
.constraints(constraints)
.priority(priority())
.build();