Class NodePredicates

java.lang.Object
org.jclouds.compute.predicates.NodePredicates

public class NodePredicates extends Object
Container for node filters (predicates). This class has static methods that create customized predicates to use with ComputeService.
  • Field Details

    • RUNNING

      public static final com.google.common.base.Predicate<NodeMetadata> RUNNING
      Match nodes with State == RUNNING
    • TERMINATED

      public static final com.google.common.base.Predicate<NodeMetadata> TERMINATED
      Match nodes with State == NODE_TERMINATED
    • SUSPENDED

      public static final com.google.common.base.Predicate<NodeMetadata> SUSPENDED
      Match nodes with State == SUSPENDED
  • Constructor Details

    • NodePredicates

      public NodePredicates()
  • Method Details

    • locationId

      public static com.google.common.base.Predicate<ComputeMetadata> locationId(String id)
      Return nodes in the specified location.
      Parameters:
      id - id of the location
      Returns:
      predicate
    • parentLocationId

      public static com.google.common.base.Predicate<ComputeMetadata> parentLocationId(String id)
      Return nodes in the specified parent location.
      Parameters:
      id - id of the location
      Returns:
      predicate
    • withIds

      public static <T extends ComputeMetadata> com.google.common.base.Predicate<T> withIds(String... ids)
      Return nodes with the specific ids Note: returns all nodes, regardless of the state.
      Parameters:
      ids - ids of the resources
      Returns:
      predicate
    • all

      public static com.google.common.base.Predicate<ComputeMetadata> all()
      return everything.
    • inGroup

      public static com.google.common.base.Predicate<NodeMetadata> inGroup(String group)
      Return nodes in the specified group. Note: returns all nodes, regardless of the state.
      Parameters:
      group - group to match the items
      Returns:
      predicate
    • hasGroup

      public static com.google.common.base.Predicate<NodeMetadata> hasGroup()
      Return nodes who have a value for NodeMetadata.getGroup()
    • runningInGroup

      public static com.google.common.base.Predicate<NodeMetadata> runningInGroup(String group)
      Return nodes with specified group that are in the NODE_RUNNING state.
      Parameters:
      group - group to match the items
      Returns:
      predicate