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

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


  }

  public void tagDelete(final String resourceId, final String key,
      final String value) {

    final DeleteTagsRequest request = new DeleteTagsRequest();

    final Collection<String> resourceList = new ArrayList<String>(1);
    resourceList.add(resourceId);

    final Collection<Tag> tagList = new ArrayList<Tag>(1);
    tagList.add(new Tag(key, value));

    request.setResources(resourceList);
    request.setTags(tagList);

    logger.info("tag delete request=" + request);

    amazonClient.deleteTags(request);
View Full Code Here


             * computing capacity in AWS datacenters.
             *
             * In this sample, we use the EC2 client to list the availability zones
             * in a region, and then list the instances running in those zones.
             */
            DescribeAvailabilityZonesResult availabilityZonesResult = ec2.describeAvailabilityZones();
            List<AvailabilityZone> availabilityZones = availabilityZonesResult.getAvailabilityZones();
            System.out.println("You have access to " + availabilityZones.size() + " availability zones:");
            for (AvailabilityZone zone : availabilityZones) {
                System.out.println(" - " + zone.getZoneName() + " (" + zone.getRegionName() + ")");
            }

View Full Code Here

    final long timeStart = System.currentTimeMillis();

    final List<String> imageIds = new ArrayList<String>();
    imageIds.add(imageId);

    final DescribeImagesRequest request = new DescribeImagesRequest();
    request.setImageIds(imageIds);

    while (true) {

      final DescribeImagesResult result = amazonClient
          .describeImages(request);
View Full Code Here

    final DescribeImagesRequest request = new DescribeImagesRequest();
    request.setImageIds(imageIds);

    while (true) {

      final DescribeImagesResult result = amazonClient
          .describeImages(request);

      final List<Image> imageList = result.getImages();

      final Image image;

      if (isTimeoutPending(timeStart)) {
        image = newImageWithStatus(State.UNKNOWN.value, "timeout",
View Full Code Here

      if (ami_id != null)
        this.instance = startInstances(ec2client, ami_id, ins_type, invocationContext.getExecutionContext().getNotificationService()).get(0);
      else {

        // already running instance
        DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
        DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

        if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
          throw new GfacException("Instance not found:" + ins_id, FaultCode.InvalidRequest);
        }
View Full Code Here

        Thread.sleep(SLEEP_TIME_SECOND * 1000l);
      } catch (Exception ex) {
        // no op
      }

      DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
      describeInstancesRequest.setInstanceIds(getInstanceIDs(instances));

      DescribeInstancesResult describeInstancesResult = ec2.describeInstances(describeInstancesRequest);
      instances = describeInstancesResult.getReservations().get(0).getInstances();
    }

View Full Code Here

    }

    @Override public List<DiscoveryNode> buildDynamicNodes() {
        List<DiscoveryNode> discoNodes = Lists.newArrayList();

        DescribeInstancesResult descInstances = client.describeInstances(new DescribeInstancesRequest());

        logger.trace("building dynamic unicast discovery nodes...");
        for (Reservation reservation : descInstances.getReservations()) {
            if (!groups.isEmpty()) {
                // lets see if we can filter based on groups
View Full Code Here

    }

    private Instance describeInstance(AmazonEC2Client ec2, String ec2InstanceId) {
        Instance ec2Instance = null;
        {
            DescribeInstancesRequest request = new DescribeInstancesRequest();
            request.setInstanceIds(Collections.singletonList(ec2InstanceId));
            DescribeInstancesResult response = ec2.describeInstances(request);

            List<Reservation> reservations = response.getReservations();
            for (Reservation reservation : reservations) {
                for (Instance i : reservation.getInstances()) {
View Full Code Here

  @Provides
  @Singleton
  @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()) {
View Full Code Here

  @Provides
  @Singleton
  @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()) {
View Full Code Here

TOP

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

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.