@Override public boolean apply(ComputeMetadata computeMetadata) { String region = null; String zone = null; Location location = computeMetadata.getLocation(); while (location != null) { switch (location.getScope()) { case ZONE: zone = location.getId(); break; case REGION: region = location.getId(); break; } location = location.getParent(); } if (regions != null && region != null && !regions.contains(region)) return false; if (zones != null && zone != null && !zones.contains(zone)) return false; return true; } };
@Override public boolean apply(ComputeMetadata nodeMetadata) { return id.equals(nodeMetadata.getLocation().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { return id.equals(nodeMetadata.getLocation().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { return id.equals(nodeMetadata.getLocation().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { return id.equals(nodeMetadata.getLocation().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { if (nodeMetadata.getLocation().getParent() == null) return false; return id.equals(nodeMetadata.getLocation().getParent().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { if (nodeMetadata.getLocation().getParent() == null) return false; return id.equals(nodeMetadata.getLocation().getParent().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { if (nodeMetadata.getLocation().getParent() == null) return false; return id.equals(nodeMetadata.getLocation().getParent().getId()); }
@Override public boolean apply(ComputeMetadata nodeMetadata) { if (nodeMetadata.getLocation().getParent() == null) return false; return id.equals(nodeMetadata.getLocation().getParent().getId()); }
return true; if (input.getLocation() == null) return true; input.getLocation().getParent() != null || input.getLocation().getScope() == LocationScope.PROVIDER, "only locations of scope PROVIDER can have a null parent; input: %s", input.getLocation()); return or(predicates.build()).apply(input.getLocation());
return true; if (input.getLocation() == null) return true; input.getLocation().getParent() != null || input.getLocation().getScope() == LocationScope.PROVIDER, "only locations of scope PROVIDER can have a null parent; input: %s", input.getLocation()); return or(predicates.build()).apply(input.getLocation());
return true; if (input.getLocation() == null) return true; input.getLocation().getParent() != null || input.getLocation().getScope() == LocationScope.PROVIDER, "only locations of scope PROVIDER can have a null parent; input: %s", input.getLocation()); return or(predicates.build()).apply(input.getLocation());
private void list(ComputeService computeService) { log("list"); for (ComputeMetadata node : computeService.listNodes()) { log(String.format(" location=%s, id=%s, group=%s", node.getLocation(), node.getProviderId(), node.getName())); } }
@Test(enabled = true, dependsOnMethods = "testSuspendResume") public void testListNodes() throws Exception { for (ComputeMetadata node : client.listNodes()) { assert node.getProviderId() != null : node; assert node.getLocation() != null : node; assertEquals(node.getType(), ComputeType.NODE); } }
@Test(enabled = true, dependsOnMethods = "testSuspendResume") public void testListNodes() throws Exception { for (ComputeMetadata node : client.listNodes()) { assert node.getProviderId() != null : node; assert node.getLocation() != null : node; assertEquals(node.getType(), ComputeType.NODE); } }
@Test(enabled = true, dependsOnMethods = "testGet") public void testReboot() throws Exception { Set<? extends NodeMetadata> rebootNodes = client.rebootNodesMatching(inGroup(group)); for (ComputeMetadata node : rebootNodes) { assertNotNull(node); assert node.getProviderId() != null : node; assert node.getLocation() != null : node; } // validation testGet(); }
public static ComputeMetadataBuilder fromComputeMetadata(ComputeMetadata in) { return new ComputeMetadataBuilder(in.getType()).id(in.getId()).location(in.getLocation()).name(in.getName()) .uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()); } }
public static ComputeMetadataBuilder fromComputeMetadata(ComputeMetadata in) { return new ComputeMetadataBuilder(in.getType()).id(in.getId()).location(in.getLocation()).name(in.getName()) .uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()); } }
public static ComputeMetadataBuilder fromComputeMetadata(ComputeMetadata in) { return new ComputeMetadataBuilder(in.getType()).id(in.getId()).location(in.getLocation()).name(in.getName()) .uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()); } }
public static ComputeMetadataBuilder fromComputeMetadata(ComputeMetadata in) { return new ComputeMetadataBuilder(in.getType()).id(in.getId()).location(in.getLocation()).name(in.getName()) .uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()); } }