Package com.xerox.amazonws.ec2

Examples of com.xerox.amazonws.ec2.LaunchConfiguration


    public TypicaEc2Connection(String accessId,
                               String secretKey,
                               Ec2ConnectionListener listener,
                               String regionUrl) {
        ec2 = new Jec2(accessId, secretKey);
        this.listener = listener;

        if(regionUrl != null && ec2 != null)
            ec2.setRegionUrl(regionUrl);
    }
View Full Code Here


  private String _keyName;
  private String _keyPath;

  public Ec2Service(String awsAccountId, String accessKeyId, String secretAccessKey, String aim, String keyName,
          String keyPath) {
    _ec2 = new Jec2(accessKeyId, secretAccessKey);
    _awsAccountId = awsAccountId;
    _startAIM = aim;
    _keyName = keyName;
    _keyPath = keyPath;
  }
View Full Code Here

    public TypicaEc2Connection(String accessId,
                               String secretKey,
                               Ec2ConnectionListener listener,
                               String regionUrl) {
        ec2 = new Jec2(accessId, secretKey);
        this.listener = listener;

        if(regionUrl != null && ec2 != null)
            ec2.setRegionUrl(regionUrl);
    }
View Full Code Here

    public List<HostNamePair> createInstances(String ami,
                                              String keypairId,
                                              Ec2Connection.Ec2InstanceType instanceType,
                                              int instanceCount,
                                              List<String> securityGroups) throws Exception {
        LaunchConfiguration launchConfiguration = new LaunchConfiguration(ami);
        launchConfiguration.setInstanceType(InstanceType.valueOf(instanceType.name()));
        launchConfiguration.setKeyName(keypairId);
        launchConfiguration.setMinCount(instanceCount);
        launchConfiguration.setMaxCount(instanceCount);
        if (securityGroups != null && securityGroups.size() > 0) {
            launchConfiguration.setSecurityGroup(securityGroups);
        }

        ReservationDescription reservationDescription = ec2.runInstances(launchConfiguration);

        List<String> instanceIds = new ArrayList<String>();
View Full Code Here

    public List<HostNamePair> createInstances(String ami,
                                              String keypairId,
                                              Ec2Connection.Ec2InstanceType instanceType,
                                              int instanceCount,
                                              List<String> securityGroups) throws Exception {
        LaunchConfiguration launchConfiguration = new LaunchConfiguration(ami);
        launchConfiguration.setInstanceType(InstanceType.valueOf(instanceType.name()));
        launchConfiguration.setKeyName(keypairId);
        launchConfiguration.setMinCount(instanceCount);
        launchConfiguration.setMaxCount(instanceCount);
        if (securityGroups != null && securityGroups.size() > 0) {
            launchConfiguration.setSecurityGroup(securityGroups);
        }

        ReservationDescription reservationDescription = ec2.runInstances(launchConfiguration);

        List<String> instanceIds = new ArrayList<String>();
View Full Code Here

        launchConfiguration.setMaxCount(instanceCount);
        if (securityGroups != null && securityGroups.size() > 0) {
            launchConfiguration.setSecurityGroup(securityGroups);
        }

        ReservationDescription reservationDescription = ec2.runInstances(launchConfiguration);

        List<String> instanceIds = new ArrayList<String>();

        for(ReservationDescription.Instance instance: reservationDescription.getInstances()) {
            String instanceId = instance.getInstanceId();

            if(logger.isInfoEnabled())
                logger.info("Instance " + instanceId + " launched");
View Full Code Here

      }
      // launch master
      List<String> groupSet = new ArrayList<String>();
      groupSet.add(masterGroupName);

      ReservationDescription master = _ec2.runInstances(_startAIM, 1, 1, groupSet, null, _keyName);

      // polling until started wait at least 5 min
      Ec2Instance masterInfo = waitForMaster(master, 5 * 60 * 1000);
      if (masterInfo == null) {
        throw new IOException("Master instance " + master + " did not boot up in time");
View Full Code Here

        launchConfiguration.setMaxCount(instanceCount);
        if (securityGroups != null && securityGroups.size() > 0) {
            launchConfiguration.setSecurityGroup(securityGroups);
        }

        ReservationDescription reservationDescription = ec2.runInstances(launchConfiguration);

        List<String> instanceIds = new ArrayList<String>();

        for(ReservationDescription.Instance instance: reservationDescription.getInstances()) {
            String instanceId = instance.getInstanceId();

            if(logger.isInfoEnabled())
                logger.info("Instance " + instanceId + " launched");
View Full Code Here

TOP

Related Classes of com.xerox.amazonws.ec2.LaunchConfiguration

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.