Examples of listNodesDetailsMatching()


Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

  @Override
  public Set<? extends NodeMetadata> getNodes(ClusterSpec clusterSpec)
      throws IOException, InterruptedException {
    ComputeServiceContext computeServiceContext = getCompute().apply(clusterSpec);
    ComputeService computeService = computeServiceContext.getComputeService();
    return computeService.listNodesDetailsMatching(Predicates.in(computeService.listNodes()));
  }
}
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

  @Deprecated
  public Set<? extends NodeMetadata> getNodes(ClusterSpec clusterSpec)
    throws IOException, InterruptedException {
    ComputeService computeService = getCompute().apply(clusterSpec).getComputeService();
    return computeService.listNodesDetailsMatching(
        runningInGroup(clusterSpec.getClusterName()));
  }

  public Set<Cluster.Instance> getInstances(ClusterSpec spec)
      throws IOException, InterruptedException {
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

     * @throws InvalidCredentialsException if the client's credentials are invalid
     */
    public List<JSONObject> getEC2Instances() throws InvalidCredentialsException {
        ComputeService computeService = getComputeServiceContext().getComputeService();
        Set<? extends NodeMetadata> rawComputeNodes = filter(
                computeService.listNodesDetailsMatching(all()), not(TERMINATED));
        List<JSONObject> computeNodes = new ArrayList<>();

        for (NodeMetadata computeNode : rawComputeNodes) {
            computeNodes.add(JSONObject.fromObject(computeNode));
        }
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

      requestResponseMap.put(describeInstancesRequest, describeInstanceResponse);
      requestResponseMap.put(describeSpotInstancesRequest, noSpotInstancesResponse);

      ComputeService listsWithoutImages = requestsSendResponses(requestResponseMap.build());

      NodeMetadata node = Iterables.getOnlyElement(listsWithoutImages.listNodesDetailsMatching(NodePredicates.all()));
      assertEquals(node.getId(), "us-east-1/i-2baa5550");
   }
}
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

    } catch (Throwable t) {
      System.err.println(t.getMessage());
      return null;
    }

    Set<? extends NodeMetadata> nodes = service.listNodesDetailsMatching(new Predicate<ComputeMetadata>() {
      @Override
      public boolean apply(@Nullable ComputeMetadata input) {
        NodeMetadata node = (NodeMetadata) input;
        if (!Strings.isNullOrEmpty(group) && !group.equals(node.getGroup())) {
          return false;
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

         service = getComputeService();
      } catch (Throwable t) {
         System.err.println(t.getMessage());
         return null;
      }
      Set<? extends NodeMetadata> nodeMetaDataSet = service.listNodesDetailsMatching(getComputeFilter());
      if (nodeMetaDataSet != null && !nodeMetaDataSet.isEmpty()) {
         NodeMetadata nodeMetadata = nodeMetaDataSet.toArray(new NodeMetadata[0])[0];

         // If we have multiple nodes we just want the headers, but not full details.
         printNodeInfo(service, nodeMetaDataSet, nodeMetaDataSet.size() == 1, System.out);
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

      requestResponseMap.put(describeInstancesRequest, describeInstanceResponse);
      requestResponseMap.put(describeSpotInstancesRequest, noSpotInstancesResponse);

      ComputeService listsWithoutImages = requestsSendResponses(requestResponseMap.build());

      NodeMetadata node = Iterables.getOnlyElement(listsWithoutImages.listNodesDetailsMatching(NodePredicates.all()));
      assertEquals(node.getId(), "us-east-1/i-2baa5550");
   }
}
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

 
  public Set<? extends NodeMetadata> getNodes(ClusterSpec clusterSpec)
    throws IOException, InterruptedException {
    ComputeService computeService =
      ComputeServiceContextBuilder.build(new ComputeServiceContextFactory(), clusterSpec).getComputeService();
    return computeService.listNodesDetailsMatching(
        runningInGroup(clusterSpec.getClusterName()));
  }
 
  public static Predicate<ComputeMetadata> runningInGroup(final String group) {
    return new Predicate<ComputeMetadata>() {
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

              .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();

      Set<? extends NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);

      ComputeService mock = createMock(ComputeService.class);
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup1).once();
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup2).once();

      replay(mock);
View Full Code Here

Examples of org.jclouds.compute.ComputeService.listNodesDetailsMatching()

      Set<? extends NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);

      ComputeService mock = createMock(ComputeService.class);
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup1).once();
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup2).once();

      replay(mock);

      OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(new
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.