Committed by
Gerrit Code Review
random demo intent installer
Change-Id: I1ac2f5a6b7efbc7c940c6d7c371af4f5befcd676 using a timer to pace ourselves Change-Id: Ia58698f950bbbc958ad002ed56dfe54b90f317ab all good blasts intents Change-Id: Ia85df5ad211c01d22d4088403d789b3d6a2292f7 clean up Change-Id: I1a6dde05f57d0e4866d3255fc28836dfa7e7c190
Showing
5 changed files
with
12 additions
and
3 deletions
... | @@ -109,7 +109,9 @@ | ... | @@ -109,7 +109,9 @@ |
109 | com.google.common.*, | 109 | com.google.common.*, |
110 | org.onlab.packet.*, | 110 | org.onlab.packet.*, |
111 | org.onlab.rest.*, | 111 | org.onlab.rest.*, |
112 | - org.onlab.onos.* | 112 | + org.onlab.onos.*, |
113 | + org.onlab.util.*, | ||
114 | + org.jboss.netty.util.* | ||
113 | </Import-Package> | 115 | </Import-Package> |
114 | <Web-ContextPath>${web.context}</Web-ContextPath> | 116 | <Web-ContextPath>${web.context}</Web-ContextPath> |
115 | </instructions> | 117 | </instructions> | ... | ... |
1 | package org.onlab.onos.demo; | 1 | package org.onlab.onos.demo; |
2 | 2 | ||
3 | +import com.fasterxml.jackson.databind.JsonNode; | ||
4 | + | ||
5 | +import java.util.Optional; | ||
6 | + | ||
3 | /** | 7 | /** |
4 | * Simple demo api interface. | 8 | * Simple demo api interface. |
5 | */ | 9 | */ |
... | @@ -11,7 +15,7 @@ public interface DemoAPI { | ... | @@ -11,7 +15,7 @@ public interface DemoAPI { |
11 | * Installs intents based on the installation type. | 15 | * Installs intents based on the installation type. |
12 | * @param type the installation type. | 16 | * @param type the installation type. |
13 | */ | 17 | */ |
14 | - void setup(InstallType type); | 18 | + void setup(InstallType type, Optional<JsonNode> runParams); |
15 | 19 | ||
16 | /** | 20 | /** |
17 | * Uninstalls all existing intents. | 21 | * Uninstalls all existing intents. | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -13,6 +13,7 @@ import javax.ws.rs.core.MediaType; | ... | @@ -13,6 +13,7 @@ import javax.ws.rs.core.MediaType; |
13 | import javax.ws.rs.core.Response; | 13 | import javax.ws.rs.core.Response; |
14 | import java.io.IOException; | 14 | import java.io.IOException; |
15 | import java.io.InputStream; | 15 | import java.io.InputStream; |
16 | +import java.util.Optional; | ||
16 | 17 | ||
17 | /** | 18 | /** |
18 | * Rest API for demos. | 19 | * Rest API for demos. |
... | @@ -33,10 +34,11 @@ public class DemoResource extends BaseResource { | ... | @@ -33,10 +34,11 @@ public class DemoResource extends BaseResource { |
33 | .entity("Expected type field containing either mesh or random.").build(); | 34 | .entity("Expected type field containing either mesh or random.").build(); |
34 | } | 35 | } |
35 | 36 | ||
37 | + | ||
36 | DemoAPI.InstallType type = DemoAPI.InstallType.valueOf( | 38 | DemoAPI.InstallType type = DemoAPI.InstallType.valueOf( |
37 | cfg.get("type").asText().toUpperCase()); | 39 | cfg.get("type").asText().toUpperCase()); |
38 | DemoAPI demo = get(DemoAPI.class); | 40 | DemoAPI demo = get(DemoAPI.class); |
39 | - demo.setup(type); | 41 | + demo.setup(type, Optional.ofNullable(cfg.get("runParams"))); |
40 | 42 | ||
41 | return Response.ok(mapper.createObjectNode().toString()).build(); | 43 | return Response.ok(mapper.createObjectNode().toString()).build(); |
42 | } | 44 | } | ... | ... |
... | @@ -231,6 +231,7 @@ | ... | @@ -231,6 +231,7 @@ |
231 | <feature name="onos-app-demo" version="1.0.0" | 231 | <feature name="onos-app-demo" version="1.0.0" |
232 | description="ONOS demo applications"> | 232 | description="ONOS demo applications"> |
233 | <feature>onos-api</feature> | 233 | <feature>onos-api</feature> |
234 | + <bundle>mvn:org.onlab.onos/onlab-misc/1.0.0-SNAPSHOT</bundle> | ||
234 | <bundle>mvn:org.onlab.onos/onos-app-demo/1.0.0-SNAPSHOT</bundle> | 235 | <bundle>mvn:org.onlab.onos/onos-app-demo/1.0.0-SNAPSHOT</bundle> |
235 | </feature> | 236 | </feature> |
236 | 237 | ... | ... |
-
Please register or login to post a comment