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

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


    List<Instance> resultList = new ArrayList<Instance>();

    RunInstancesRequest request = new RunInstancesRequest(AMI_ID, number, number);
    request.setInstanceType(type);

    RunInstancesResult result = getEC2Client().runInstances(request);
    resultList.addAll(result.getReservation().getInstances());
    return resultList;
  }
View Full Code Here


    RunInstancesRequest request = new RunInstancesRequest(AMI_ID, number, number);
    request.setInstanceType(type);
    request.setKeyName(keyname);

    RunInstancesResult result = getEC2Client().runInstances(request);
    resultList.addAll(result.getReservation().getInstances());
    return resultList;
  }
View Full Code Here

    // start only 1 instance
    RunInstancesRequest request = new RunInstancesRequest(AMI_ID, 1, 1);
    request.setKeyName(KEY_PAIR_NAME);
    request.setInstanceType(INS_TYPE);

    RunInstancesResult result = ec2.runInstances(request);

    List<Instance> instances = result.getReservation().getInstances();

    while (!allInstancesStateEqual(instances, InstanceStateName.Running)) {

      // instance status should not be Terminated
      if (anyInstancesStateEqual(instances, InstanceStateName.Terminated)) {
View Full Code Here

    return additionalWorkerAllocated;
  }

  private void launchInstance(String instanceId)
  {
    StartInstancesRequest startInstancesRequest = new StartInstancesRequest();
    List<String> instancesIdsToLaunch = new ArrayList<String>();
    instancesIdsToLaunch.add(instanceId);
    startInstancesRequest.setInstanceIds(instancesIdsToLaunch);
    ec2Client.startInstances(startInstancesRequest);
    updateInstanceState(instanceId, "running");
  }
View Full Code Here

  }

  private Image newImageWithStatus(final String state, final String code,
      final String message) {

    final StateReason reason = new StateReason();
    reason.setCode(code);
    reason.setMessage(message);

    final Image image = new Image();
    image.setState(state);
    image.setStateReason(reason);
View Full Code Here

  public void stopInstance() throws ClientProtocolException, IOException
  {
    String instanceId = getInstanceId();
    List<String> instancesId = new ArrayList<String>();
    instancesId.add(instanceId);
    StopInstancesRequest stopInstancesRequest = new StopInstancesRequest(instancesId);
    amazonEC2Client.stopInstances(stopInstancesRequest);
  }
View Full Code Here

    private void addTag(AmazonEC2Client ec2, NetworkInterface o, String key, String value) {
        addTag(ec2, o.getNetworkInterfaceId(), key, value);
    }

    private void addTag(AmazonEC2Client ec2, String id, String key, String value) {
        Tag tag = new Tag(key, value);
        List<Tag> tags = Lists.newArrayList();
        tags.add(tag);

        CreateTagsRequest request = new CreateTagsRequest();
        request.setResources(Collections.singletonList(id));
View Full Code Here

    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 create request=" + request);
View Full Code Here

    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);
View Full Code Here

   *
   * @param instanceIds
   */
  public static void terminateInstances(List<String> instanceIds) {
    // terminate
    TerminateInstancesRequest request = new TerminateInstancesRequest(instanceIds);
    getEC2Client().terminateInstances(request);
  }
View Full Code Here

TOP

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

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.