Package com.amazonaws.services.ec2.model.transform

Examples of com.amazonaws.services.ec2.model.transform.BundleTaskErrorStaxUnmarshaller


        for (SpotInstanceRequest spotInstanceRequest : result.getSpotInstanceRequests()) {
          LaunchSpecification launchSpecification = spotInstanceRequest.getLaunchSpecification();
          populateLaunchSpecificationSecurityGroupNames(launchSpecification);
        }
      } else if (response instanceof DescribeInstancesResult) {
        DescribeInstancesResult result = (DescribeInstancesResult)response;
        for (Reservation reservation : result.getReservations()) {
          populateReservationSecurityGroupNames(reservation);
        }
      } else if (response instanceof RunInstancesResult) {
        RunInstancesResult result = (RunInstancesResult)response;
        populateReservationSecurityGroupNames(result.getReservation());
      }
  }
View Full Code Here


     * @param ec2client ec2 client
     * @return list of instances
     */
    public static List<Instance> loadInstances(AmazonEC2Client ec2client) {
        List<Instance> resultList = new ArrayList<Instance>();
        DescribeInstancesResult describeInstancesResult = ec2client.describeInstances();
        List<Reservation> reservations = describeInstancesResult.getReservations();
        for (Reservation reservation : reservations) {
            for (Instance instance : reservation.getInstances()) {
                System.out.println("instance       : " + instance);
                if ("running".equalsIgnoreCase(instance.getState().getName())) {
                    resultList.add(instance);
View Full Code Here

     */
    try {
      /*
       * Get current key pair in Amazon
       */
      DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
      ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(KEY_PAIR_NAME));

      /*
       * If key exists and new key is created, delete old key and replace
       * with new one. Else, do nothing
       */
 
View Full Code Here

        }

        /* Generate key pair in Amazon if necessary */
        try {
            /* Get current key pair in Amazon */
            DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
            ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(keyPairName));

            /* If key exists and new key is created, delete old key and replace
             * with new one. Else, do nothing */
            if (newKey) {
                DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(keyPairName);
View Full Code Here

        }

        /* Generate key pair in Amazon if necessary */
        try {
            /* Get current key pair in Amazon */
            DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
            ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(keyPairName));

            /* If key exists and new key is created, delete old key and replace
             * with new one. Else, do nothing */
            if (newKey) {
                DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(keyPairName);
View Full Code Here

   *
   * @return list of keypairs
   */
  public static List<String> loadKeypairs(){
    List<String> resultList = new ArrayList<String>();
    DescribeKeyPairsResult results = getEC2Client().describeKeyPairs();
    for (KeyPairInfo key : results.getKeyPairs()) {
      resultList.add(key.getKeyName());
    }
    return resultList;
  }
View Full Code Here

     * For backwards compatibility, we preserve the existing List<String> of
     * security group names by explicitly populating it from the full list
     * of security group info.
     */
      if (response instanceof DescribeSpotInstanceRequestsResult) {
        DescribeSpotInstanceRequestsResult result = (DescribeSpotInstanceRequestsResult)response;
        for (SpotInstanceRequest spotInstanceRequest : result.getSpotInstanceRequests()) {
          LaunchSpecification launchSpecification = spotInstanceRequest.getLaunchSpecification();
          populateLaunchSpecificationSecurityGroupNames(launchSpecification);
        }
      } else if (response instanceof RequestSpotInstancesResult) {
        RequestSpotInstancesResult result = (RequestSpotInstancesResult)response;
        for (SpotInstanceRequest spotInstanceRequest : result.getSpotInstanceRequests()) {
          LaunchSpecification launchSpecification = spotInstanceRequest.getLaunchSpecification();
          populateLaunchSpecificationSecurityGroupNames(launchSpecification);
        }
      } else if (response instanceof DescribeInstancesResult) {
        DescribeInstancesResult result = (DescribeInstancesResult)response;
        for (Reservation reservation : result.getReservations()) {
          populateReservationSecurityGroupNames(reservation);
        }
      } else if (response instanceof RunInstancesResult) {
        RunInstancesResult result = (RunInstancesResult)response;
        populateReservationSecurityGroupNames(result.getReservation());
      }
  }
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

    final String imageId = result.getImageId();

    logger.info("register imageId=" + imageId);

    final Image image = waitForImage(imageId);

    return image;

  }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.ec2.model.transform.BundleTaskErrorStaxUnmarshaller

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.