Package com.elastisys.scale.cloudadapters.aws.commons.requests.ec2

Examples of com.elastisys.scale.cloudadapters.aws.commons.requests.ec2.GetInstances


    // no particular availability zone
    String availabilityZone = null;
    String bootscript = Joiner.on("\n").join(
        provisioningDetails.getBootScript());

    Instance startedInstance = new CreateInstance(awsCredentials(),
        region(), availabilityZone,
        provisioningDetails.getSecurityGroups(),
        provisioningDetails.getKeyPair(),
        provisioningDetails.getSize(), provisioningDetails.getImage(),
        bootscript).call();
View Full Code Here


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

    return new GetEc2Instance(awsCredentials(), region(), instanceId)
        .call();
  }
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

  @Override
  public List<Instance> getInstances(List<Filter> filters) {
    checkArgument(isConfigured(), "can't use client before it's configured");

    List<Instance> instances = new GetInstances(awsCredentials(), region(),
        filters).call();
    return instances;
  }
View Full Code Here

  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()) {
      throw new IllegalArgumentException(String.format(
          "failed to get instance metadata: "
View Full Code Here

  @Override
  public void tagInstance(String instanceId, List<Tag> tags) {
    checkArgument(isConfigured(), "can't use client before it's configured");

    new TagEc2Resource(awsCredentials(), region(), instanceId, tags).call();
  }
View Full Code Here

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

    new TerminateInstance(awsCredentials(), region(), instanceId).call();
  }
View Full Code Here

TOP

Related Classes of com.elastisys.scale.cloudadapters.aws.commons.requests.ec2.GetInstances

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.