From 44ec84c8aa17939046f6739c8665241b30a3647e Mon Sep 17 00:00:00 2001 From: "ivan@ivan.net.nz" Date: Sat, 28 Nov 2009 23:30:57 +0000 Subject: [PATCH] Initial Server Interface commit git-svn-id: http://jclouds.googlecode.com/svn/trunk@2341 3d8758e0-26b5-11de-8745-db77d3ebf521 --- core/pom.xml | 5 ++++ .../java/org/jclouds/servers/Instance.java | 12 +++++++++ .../java/org/jclouds/servers/Platform.java | 19 +++++++++++++ .../test/java/org/jclouds/servers/Server.java | 27 +++++++++++++++++++ .../org/jclouds/servers/ServerService.java | 19 +++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 core/src/test/java/org/jclouds/servers/Instance.java create mode 100644 core/src/test/java/org/jclouds/servers/Platform.java create mode 100644 core/src/test/java/org/jclouds/servers/Server.java create mode 100644 core/src/test/java/org/jclouds/servers/ServerService.java diff --git a/core/pom.xml b/core/pom.xml index a000e66048..e8ea2dc74e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -114,6 +114,11 @@ gson 1.4 + + com.google.common + google-guava + 1.0-SNAPSHOT + diff --git a/core/src/test/java/org/jclouds/servers/Instance.java b/core/src/test/java/org/jclouds/servers/Instance.java new file mode 100644 index 0000000000..4deb034802 --- /dev/null +++ b/core/src/test/java/org/jclouds/servers/Instance.java @@ -0,0 +1,12 @@ +package org.jclouds.servers; + +import com.google.common.base.Service; + +/** + * @author Ivan Meredith + */ +public interface Instance extends Service { + String getId(); + + String getTag(); +} diff --git a/core/src/test/java/org/jclouds/servers/Platform.java b/core/src/test/java/org/jclouds/servers/Platform.java new file mode 100644 index 0000000000..9234ad3323 --- /dev/null +++ b/core/src/test/java/org/jclouds/servers/Platform.java @@ -0,0 +1,19 @@ +package org.jclouds.servers; + +import java.util.SortedSet; +import java.util.concurrent.Future; + +/** + * @author Ivan Meredith + */ +public interface Platform { + public String getId(); + + public Future createInstance(); + + public Instance createInstanceAndWait(); + + public Instance getInstance(String id); + + public SortedSet listInstances(); +} diff --git a/core/src/test/java/org/jclouds/servers/Server.java b/core/src/test/java/org/jclouds/servers/Server.java new file mode 100644 index 0000000000..6c519af38a --- /dev/null +++ b/core/src/test/java/org/jclouds/servers/Server.java @@ -0,0 +1,27 @@ +package org.jclouds.servers; + +import com.google.common.base.Service; + +import java.util.SortedSet; +import java.util.concurrent.Future; + +/** + * @author Ivan Meredith + */ +public interface Server extends Service { + public String getId(); + + public State rebootAndWait(); + + public Future reboot(); + + public Boolean supportsPlatforms(); + + public Platform createPlatform(String id/*, Archive archive , mount? */); + + public Platform getPlatform(String id); + + public SortedSet listPlatforms(); + + public SortedSet listInstances(/* platform("mybilling-1.0.1").tags("production" */); +} diff --git a/core/src/test/java/org/jclouds/servers/ServerService.java b/core/src/test/java/org/jclouds/servers/ServerService.java new file mode 100644 index 0000000000..c62f10a8db --- /dev/null +++ b/core/src/test/java/org/jclouds/servers/ServerService.java @@ -0,0 +1,19 @@ +package org.jclouds.servers; + +import java.util.SortedSet; +import java.util.concurrent.Future; + +/** + * TODO: better name? + * + * @author Ivan Meredith + */ +public interface ServerService { + public Server createServerAndWait(String name, String profile, String image); + + public Future createServer(String name, String profile, String image); + + public SortedSet listServers(); + + public Server getServer(String id); +}