diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java index 9cb32fd6b3..a94afa1636 100644 --- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java +++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java @@ -149,7 +149,7 @@ public class EC2ComputeService implements ComputeService { } @Override - public NodeSet runNodes(String tag, int count, Template template) { + public NodeSet runNodesWithTag(String tag, int count, Template template) { checkArgument(tag.indexOf('-') == -1, "tag cannot contain hyphens"); checkArgument(template.getSize() instanceof EC2Size, "unexpected image type. should be EC2Size, was: " + template.getSize().getClass()); @@ -303,7 +303,7 @@ public class EC2ComputeService implements ComputeService { } @Override - public void destroyNodes(String tag) { // TODO parallel + public void destroyNodesWithTag(String tag) { // TODO parallel logger.debug(">> terminating servers by tag(%s)", tag); Set> responses = Sets.newHashSet(); for (final NodeMetadata node : doGetNodes(tag)) { @@ -325,7 +325,7 @@ public class EC2ComputeService implements ComputeService { } @Override - public NodeSet getNodes(String tag) { + public NodeSet getNodesWithTag(String tag) { logger.debug(">> listing servers by tag(%s)", tag); NodeSet nodes = doGetNodes(tag); logger.debug("<< list(%d)", nodes.size()); diff --git a/compute/src/main/java/org/jclouds/compute/ComputeService.java b/compute/src/main/java/org/jclouds/compute/ComputeService.java index c194b0b706..dafe09244b 100644 --- a/compute/src/main/java/org/jclouds/compute/ComputeService.java +++ b/compute/src/main/java/org/jclouds/compute/ComputeService.java @@ -42,7 +42,12 @@ public interface ComputeService { TemplateBuilder templateBuilder(); /** - * all sizes available to the current user by id + * The get sizes command shows you the options including virtual cpu count, memory, and disks. + * cpu count is not a portable quantity across clouds, as they are measured differently. However, + * it is a good indicator of relative speed within a cloud. memory is measured in megabytes and + * disks in gigabytes. + * + * @retun a map of sizes by ID, conceding that in some clouds the "id" is not used. */ Map getSizes(); @@ -58,7 +63,10 @@ public interface ComputeService { Map getNodes(); /** - * all nodes available to the current user by id + * The get locations command returns all the valid locations for nodes. A location has a scope, + * which is typically region or zone. A region is a general area, like eu-west, where a zone is + * similar to a datacenter. If a location has a parent, that implies it is within that location. + * For example a location can be a rack, whose parent is likely to be a zone. */ Map getLocations(); @@ -69,13 +77,13 @@ public interface ComputeService { * * @param tag * - common identifier to group nodes by, cannot contain hyphens - * @param maxNodes + * @param count * - how many to fire up. * @param template * - how to configure the nodes * */ - NodeSet runNodes(String tag, int maxNodes, Template template); + NodeSet runNodesWithTag(String tag, int count, Template template); /** * destroy the node. If it is the only node in a tag set, the dependent resources will also be @@ -86,7 +94,7 @@ public interface ComputeService { /** * destroy the nodes identified by this tag. */ - void destroyNodes(String tag); + void destroyNodesWithTag(String tag); /** * Find a node by its id @@ -98,6 +106,6 @@ public interface ComputeService { * * @param tag */ - NodeSet getNodes(String tag); + NodeSet getNodesWithTag(String tag); } diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index 5ae12d2e82..3b0ea3486d 100644 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -112,7 +112,7 @@ public abstract class BaseComputeServiceLiveTest { @Test(enabled = true) public void testCreate() throws Exception { try { - client.destroyNodes(tag); + client.destroyNodesWithTag(tag); } catch (HttpResponseException e) { // TODO hosting.com throws 400 when we try to delete a vApp } catch (NoSuchElementException e) { @@ -144,7 +144,7 @@ public abstract class BaseComputeServiceLiveTest { // .build(org.jclouds.scriptbuilder.domain.OsFamily.UNIX) .getBytes()); - nodes = Sets.newTreeSet(client.runNodes(tag, 2, template)); + nodes = Sets.newTreeSet(client.runNodesWithTag(tag, 2, template)); assertEquals(nodes.size(), 2); for (NodeMetadata node : nodes) { assertNotNull(node.getId()); @@ -171,7 +171,7 @@ public abstract class BaseComputeServiceLiveTest { @Test(enabled = true, dependsOnMethods = "testCreate") public void testGet() throws Exception { - NodeSet metadataSet = client.getNodes(tag); + NodeSet metadataSet = client.getNodesWithTag(tag); for (NodeMetadata node : nodes) { metadataSet.remove(node); NodeMetadata metadata = client.getNodeMetadata(node); @@ -267,8 +267,8 @@ public abstract class BaseComputeServiceLiveTest { @AfterTest protected void cleanup() throws InterruptedException, ExecutionException, TimeoutException { if (nodes != null) { - client.destroyNodes(tag); - for (NodeMetadata node : client.getNodes(tag)) { + client.destroyNodesWithTag(tag); + for (NodeMetadata node : client.getNodesWithTag(tag)) { assert node.getState() == NodeState.TERMINATED : node; } } diff --git a/rackspace/src/main/java/org/jclouds/rackspace/cloudservers/compute/CloudServersComputeService.java b/rackspace/src/main/java/org/jclouds/rackspace/cloudservers/compute/CloudServersComputeService.java index 22c06879ac..d8aed9a891 100644 --- a/rackspace/src/main/java/org/jclouds/rackspace/cloudservers/compute/CloudServersComputeService.java +++ b/rackspace/src/main/java/org/jclouds/rackspace/cloudservers/compute/CloudServersComputeService.java @@ -155,7 +155,7 @@ public class CloudServersComputeService implements ComputeService { .put(ServerStatus.UNKNOWN, NodeState.UNKNOWN).build(); @Override - public NodeSet runNodes(final String tag, int max, final Template template) { + public NodeSet runNodesWithTag(final String tag, int max, final Template template) { checkArgument(tag.indexOf('-') == -1, "tag cannot contain hyphens"); logger.debug(">> running server image(%s) flavor(%s)", template.getImage().getId(), template .getSize().getId()); @@ -251,7 +251,7 @@ public class CloudServersComputeService implements ComputeService { } @Override - public void destroyNodes(String tag) { // TODO parallel + public void destroyNodesWithTag(String tag) { // TODO parallel logger.debug(">> terminating servers by tag(%s)", tag); Set> responses = Sets.newHashSet(); for (final NodeMetadata node : doGetNodes(tag)) { @@ -273,7 +273,7 @@ public class CloudServersComputeService implements ComputeService { } @Override - public NodeSet getNodes(String tag) { + public NodeSet getNodesWithTag(String tag) { logger.debug(">> listing servers by tag(%s)", tag); NodeSet nodes = doGetNodes(tag); logger.debug("<< list(%d)", nodes.size()); diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeService.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeService.java index 53ee1407c9..c9aba3c404 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeService.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeService.java @@ -139,7 +139,7 @@ public class RimuHostingComputeService implements ComputeService { } @Override - public NodeSet runNodes(final String tag, int max, final Template template) { + public NodeSet runNodesWithTag(final String tag, int max, final Template template) { checkArgument(tag.indexOf('-') == -1, "tag cannot contain hyphens"); logger.debug(">> running server image(%s) flavor(%s)", template.getImage().getId(), template .getSize().getId()); @@ -238,7 +238,7 @@ public class RimuHostingComputeService implements ComputeService { } @Override - public void destroyNodes(String tag) { // TODO parallel + public void destroyNodesWithTag(String tag) { // TODO parallel logger.debug(">> terminating servers by tag(%s)", tag); Set> responses = Sets.newHashSet(); for (final NodeMetadata node : doGetNodes(tag)) { @@ -260,7 +260,7 @@ public class RimuHostingComputeService implements ComputeService { } @Override - public NodeSet getNodes(String tag) { + public NodeSet getNodesWithTag(String tag) { logger.debug(">> listing servers by tag(%s)", tag); NodeSet nodes = doGetNodes(tag); logger.debug("<< list(%d)", nodes.size()); diff --git a/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/compute/ComputeTask.java b/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/compute/ComputeTask.java index 535e15bed9..39c0a0b270 100644 --- a/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/compute/ComputeTask.java +++ b/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/compute/ComputeTask.java @@ -192,7 +192,7 @@ public class ComputeTask extends Task { Template template = createTemplateFromElement(nodeElement, computeService); - NodeMetadata createdNode = Iterables.getOnlyElement(computeService.runNodes(tag, nodeElement + NodeMetadata createdNode = Iterables.getOnlyElement(computeService.runNodesWithTag(tag, nodeElement .getCount(), template)); logNodeDetails(createdNode); @@ -230,12 +230,12 @@ public class ComputeTask extends Task { private void destroy(ComputeService computeService) { log(String.format("destroy tag: %s", nodeElement.getTag())); - computeService.destroyNodes(nodeElement.getTag()); + computeService.destroyNodesWithTag(nodeElement.getTag()); } private void get(ComputeService computeService) { log(String.format("get tag: %s", nodeElement.getTag())); - for (ComputeMetadata node : computeService.getNodes(nodeElement.getTag())) { + for (ComputeMetadata node : computeService.getNodesWithTag(nodeElement.getTag())) { logDetails(computeService, node); } } diff --git a/vcloud/core/src/main/java/org/jclouds/vcloud/compute/VCloudComputeService.java b/vcloud/core/src/main/java/org/jclouds/vcloud/compute/VCloudComputeService.java index ff53708c83..60be167399 100644 --- a/vcloud/core/src/main/java/org/jclouds/vcloud/compute/VCloudComputeService.java +++ b/vcloud/core/src/main/java/org/jclouds/vcloud/compute/VCloudComputeService.java @@ -132,7 +132,7 @@ public class VCloudComputeService implements ComputeService, VCloudComputeClient } @Override - public NodeSet runNodes(final String tag, int max, final Template template) { + public NodeSet runNodesWithTag(final String tag, int max, final Template template) { checkArgument(tag.indexOf('-') == -1, "tag cannot contain hyphens"); checkNotNull(template.getLocation(), "location"); // TODO: find next id @@ -354,7 +354,7 @@ public class VCloudComputeService implements ComputeService, VCloudComputeClient } @Override - public void destroyNodes(String tag) { // TODO parallel + public void destroyNodesWithTag(String tag) { // TODO parallel logger.debug(">> terminating servers by tag(%s)", tag); Set> responses = Sets.newHashSet(); for (final NodeMetadata node : doGetNodes(tag)) { @@ -376,7 +376,7 @@ public class VCloudComputeService implements ComputeService, VCloudComputeClient } @Override - public NodeSet getNodes(String tag) { + public NodeSet getNodesWithTag(String tag) { logger.debug(">> listing servers by tag(%s)", tag); NodeSet nodes = doGetNodes(tag); logger.debug("<< list(%d)", nodes.size());