alshabib
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
......@@ -109,7 +109,9 @@
com.google.common.*,
org.onlab.packet.*,
org.onlab.rest.*,
org.onlab.onos.*
org.onlab.onos.*,
org.onlab.util.*,
org.jboss.netty.util.*
</Import-Package>
<Web-ContextPath>${web.context}</Web-ContextPath>
</instructions>
......
package org.onlab.onos.demo;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.Optional;
/**
* Simple demo api interface.
*/
......@@ -11,7 +15,7 @@ public interface DemoAPI {
* Installs intents based on the installation type.
* @param type the installation type.
*/
void setup(InstallType type);
void setup(InstallType type, Optional<JsonNode> runParams);
/**
* Uninstalls all existing intents.
......
......@@ -13,6 +13,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.util.Optional;
/**
* Rest API for demos.
......@@ -33,10 +34,11 @@ public class DemoResource extends BaseResource {
.entity("Expected type field containing either mesh or random.").build();
}
DemoAPI.InstallType type = DemoAPI.InstallType.valueOf(
cfg.get("type").asText().toUpperCase());
DemoAPI demo = get(DemoAPI.class);
demo.setup(type);
demo.setup(type, Optional.ofNullable(cfg.get("runParams")));
return Response.ok(mapper.createObjectNode().toString()).build();
}
......
......@@ -231,6 +231,7 @@
<feature name="onos-app-demo" version="1.0.0"
description="ONOS demo applications">
<feature>onos-api</feature>
<bundle>mvn:org.onlab.onos/onlab-misc/1.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.onlab.onos/onos-app-demo/1.0.0-SNAPSHOT</bundle>
</feature>
......