Package com.amazonaws.services.ec2.model

Examples of com.amazonaws.services.ec2.model.Filter


        Optional<Object> alreadySent = Optional.fromNullable(
                execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS));

        if (alreadySent.isPresent()) {
            DescribeSpotInstanceRequestsRequest describeRequest = new DescribeSpotInstanceRequestsRequest()
                    .withFilters(new Filter()
                        .withName("launch-group").withValues(businessKey)
                        .withName("state").withValues("open", "active"));
            Stopwatch stopwatch = new Stopwatch().start();
            while (stopwatch.elapsedTime(TimeUnit.MINUTES) < 2) {
                DescribeSpotInstanceRequestsResult result = client.describeSpotInstanceRequests(describeRequest);
View Full Code Here


  private List<Instance> listGroupInstances(AutoScalingGroup autoScalingGroup) {
    List<String> instanceIds = Lists.transform(
        autoScalingGroup.getInstances(),
        AwsAutoScalingFunctions.toAutoScalingInstanceId());
    GetInstances listInstances = new GetInstances(getAwsCredentials(),
        getRegion(), new Filter("instance-id", instanceIds));
    return listInstances.call();
  }
View Full Code Here

//        manifestLocation.append("-????.??.?.*");
        manifestLocation.append("-2014.03.?.*");

        return new DescribeImagesRequest().
                withOwners("amazon").
                withFilters(new Filter().withName("image-type").withValues("machine"),
                            new Filter().withName("virtualization-type").withValues(imageInfo.getVirtualizationType()),
                            new Filter().withName("architecture").withValues(imageInfo.getArchitecture()),
                            new Filter().withName("root-device-type").withValues(imageInfo.getRootDeviceType()),
                            new Filter().withName("manifest-location").withValues(manifestLocation.toString()));

    }
View Full Code Here

                }
            }
            try {
                AmazonEC2Client ec2Client = awsStackUtil.createEC2Client(awsInfra.getRegion(), awsCredential);
                DescribeInstancesRequest instancesRequest = new DescribeInstancesRequest()
                        .withFilters(new Filter().withName("tag:" + INSTANCE_TAG_NAME).withValues(resource.getResourceName()));
                instancesResult = ec2Client.describeInstances(instancesRequest);
            } catch (Exception ex) {
                LOGGER.error(ex.getMessage(), ex);
                instancesResult = new DescribeInstancesResult();
            }
View Full Code Here

      final String key = termArray[0];
      final String valuesText = termArray[1];

      final String[] valueArray = valuesText.split(valueSplit);

      final Filter filter = new Filter(key, Arrays.asList(valueArray));

      filterList.add(filter);

    }
View Full Code Here

  public List<Machine> listMachines() throws ScalingGroupException {
    checkState(isConfigured(), "attempt to use unconfigured ScalingGroup");

    try {
      // filter instances on scaling group tag
      Filter filter = new Filter().withName(
          Constants.SCALING_GROUP_TAG_FILTER_KEY).withValues(
          getScalingGroupName());
      List<Instance> instances = this.client.getInstances(asList(filter));
      return Lists.transform(instances, new InstanceToMachine());
    } catch (Exception e) {
View Full Code Here

  @Override
  public Instance getInstanceMetadata(String instanceId) {
    checkArgument(isConfigured(), "can't use client before it's configured");

    Filter filter = new Filter().withName("instance-id").withValues(
        instanceId);
    List<Instance> instances = new GetInstances(awsCredentials(), region(),
        filter).call();

    if (instances.isEmpty()) {
View Full Code Here

  @Named("beanstalk.env.id")
  public String getEnvId(@Named("aws.instance.id") String instanceId, AmazonEC2 ec2) {
    DescribeInstancesRequest request = new DescribeInstancesRequest()
        .withInstanceIds(instanceId)
        .withFilters(
            new Filter("instance-state-name").withValues("running"));

    for (Reservation r : ec2.describeInstances(request).getReservations()) {
      for (Instance i : r.getInstances()) {
        for (Tag t : i.getTags()) {
          if ("elasticbeanstalk:environment-id".equals(t.getKey())) {
View Full Code Here

  @Named("beanstalk.env.name")
  public String getEnvName(@Named("aws.instance.id") String instanceId, AmazonEC2 ec2) {
    DescribeInstancesRequest request = new DescribeInstancesRequest()
        .withInstanceIds(instanceId)
        .withFilters(
            new Filter("instance-state-name").withValues("running"));

    for (Reservation r : ec2.describeInstances(request).getReservations()) {
      for (Instance i : r.getInstances()) {
        for (Tag t : i.getTags()) {
          if ("elasticbeanstalk:environment-name".equals(t.getKey())) {
View Full Code Here

        Optional<Object> alreadySent = Optional.fromNullable(
                execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS));

        if (alreadySent.isPresent()) {
            DescribeSpotInstanceRequestsRequest describeRequest = new DescribeSpotInstanceRequestsRequest()
                    .withFilters(new Filter()
                        .withName("launch-group").withValues(businessKey)
                        .withName("state").withValues("open", "active"));
            Stopwatch stopwatch = new Stopwatch().start();
            while (stopwatch.elapsedTime(TimeUnit.MINUTES) < 2) {
                DescribeSpotInstanceRequestsResult result = client.describeSpotInstanceRequests(describeRequest);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.ec2.model.Filter

Copyright © 2018 www.massapicom. 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.