Search in sources :

Example 16 with AmazonEC2AsyncClient

use of com.amazonaws.services.ec2.AmazonEC2AsyncClient in project photon-model by vmware.

the class TestAWSUtils method testResourceNaming.

@Test
public void testResourceNaming() throws Throwable {
    boolean tagFound = false;
    AmazonEC2AsyncClient client = TestUtils.getClient(this.privateKeyId, this.privateKey, this.region, false);
    // create something to name
    AWSNetworkClient svc = new AWSNetworkClient(client);
    String vpcID = svc.createVPC("10.20.0.0/16");
    AWSUtils.tagResourcesWithName(client, TEST_NAME, vpcID);
    List<TagDescription> tags = AWSUtils.getResourceTags(vpcID, client);
    for (TagDescription tagDesc : tags) {
        if (tagDesc.getKey().equalsIgnoreCase(AWS_TAG_NAME)) {
            assertTrue(tagDesc.getValue().equalsIgnoreCase(TEST_NAME));
            tagFound = true;
            break;
        }
    }
    // ensure we found the tag
    assertTrue(tagFound);
    svc.deleteVPC(vpcID);
}
Also used : AWSNetworkClient(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkClient) AmazonEC2AsyncClient(com.amazonaws.services.ec2.AmazonEC2AsyncClient) TagDescription(com.amazonaws.services.ec2.model.TagDescription) Test(org.junit.Test)

Example 17 with AmazonEC2AsyncClient

use of com.amazonaws.services.ec2.AmazonEC2AsyncClient in project photon-model by vmware.

the class TestAWSSetupUtils method checkInstancesStopped.

/**
 * Checks if instances have their status set to stopped.
 *
 * @param client
 * @param host
 * @param instanceIdsToStop
 * @param stopFlags
 * @throws Throwable
 */
public static void checkInstancesStopped(AmazonEC2AsyncClient client, VerificationHost host, List<String> instanceIdsToStop, ArrayList<Boolean> stopFlags) throws Throwable {
    AWSEnumerationAsyncHandler enumerationHandler = new AWSEnumerationAsyncHandler(host, AWSEnumerationAsyncHandler.MODE.CHECK_STOP, null, null, stopFlags, null, null);
    DescribeInstancesRequest request = new DescribeInstancesRequest().withInstanceIds(instanceIdsToStop);
    client.describeInstancesAsync(request, enumerationHandler);
    // Waiting to get a response from AWS before the state computation is done for the list of
    // VMs.
    host.waitFor("Waiting to get response from AWS ", () -> {
        return enumerationHandler.responseReceived;
    });
}
Also used : DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest)

Example 18 with AmazonEC2AsyncClient

use of com.amazonaws.services.ec2.AmazonEC2AsyncClient in project photon-model by vmware.

the class TestAWSSetupUtils method createOrGetDefaultSecurityGroupForGivenVPC.

/**
 * Returns an existing security group for a VPC if it exists otherwise creates a new security group.
 */
public static SecurityGroup createOrGetDefaultSecurityGroupForGivenVPC(AmazonEC2AsyncClient client, String vpcID) {
    List<SecurityGroup> securityGroupsInVPC = client.describeSecurityGroups().getSecurityGroups().stream().filter(sg -> sg.getVpcId().equals(vpcID)).collect(Collectors.toList());
    if (securityGroupsInVPC != null && !securityGroupsInVPC.isEmpty()) {
        for (SecurityGroup sg : securityGroupsInVPC) {
            // Do not use newly provisioned security groups as this could interfere with the cleanup logic of other tests.
            if (!sg.getGroupName().startsWith(AWS_NEW_GROUP_PREFIX)) {
                return sg;
            }
        }
    }
    String securityGroupId = new AWSSecurityGroupClient(client).createDefaultSecurityGroup(vpcID);
    tagResources(client, Arrays.asList(securityGroupId), TAG_KEY_FOR_TEST_RESOURCES, TAG_VALUE_FOR_TEST_RESOURCES + TAG_SG);
    DescribeSecurityGroupsResult result = client.describeSecurityGroups(new DescribeSecurityGroupsRequest().withGroupIds(Arrays.asList(securityGroupId)));
    return result.getSecurityGroups().get(0);
}
Also used : CreateLoadBalancerResult(com.amazonaws.services.elasticloadbalancing.model.CreateLoadBalancerResult) Arrays(java.util.Arrays) ProvisionComputeTaskService(com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService) DescribeSubnetsRequest(com.amazonaws.services.ec2.model.DescribeSubnetsRequest) IpAssignment(com.vmware.photon.controller.model.resources.NetworkInterfaceDescriptionService.IpAssignment) TerminateInstancesResult(com.amazonaws.services.ec2.model.TerminateInstancesResult) VerificationHost(com.vmware.xenon.common.test.VerificationHost) CreateLoadBalancerRequest(com.amazonaws.services.elasticloadbalancing.model.CreateLoadBalancerRequest) AttachInternetGatewayRequest(com.amazonaws.services.ec2.model.AttachInternetGatewayRequest) StopInstancesRequest(com.amazonaws.services.ec2.model.StopInstancesRequest) DescribeSubnetsResult(com.amazonaws.services.ec2.model.DescribeSubnetsResult) InetAddress(java.net.InetAddress) AWSEnumerationAndDeletionAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSEnumerationAndDeletionAdapterService) Utils(com.vmware.xenon.common.Utils) BlockDeviceMapping(com.amazonaws.services.ec2.model.BlockDeviceMapping) LoadBalancerState(com.vmware.photon.controller.model.resources.LoadBalancerService.LoadBalancerState) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) Map(java.util.Map) ImageService(com.vmware.photon.controller.model.resources.ImageService) ServiceDocumentQueryResult(com.vmware.xenon.common.ServiceDocumentQueryResult) ProvisioningUtils(com.vmware.photon.controller.model.tasks.ProvisioningUtils) Path(java.nio.file.Path) AWSComputeStateCreationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSComputeStateCreationAdapterService) EnumSet(java.util.EnumSet) ResourceEnumerationTaskService(com.vmware.photon.controller.model.tasks.ResourceEnumerationTaskService) AWSComputeDescriptionEnumerationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSComputeDescriptionEnumerationAdapterService) SubnetService(com.vmware.photon.controller.model.resources.SubnetService) DeleteVpcRequest(com.amazonaws.services.ec2.model.DeleteVpcRequest) CreateNetworkInterfaceResult(com.amazonaws.services.ec2.model.CreateNetworkInterfaceResult) NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) Set(java.util.Set) SecurityGroup(com.amazonaws.services.ec2.model.SecurityGroup) DeleteNetworkInterfaceRequest(com.amazonaws.services.ec2.model.DeleteNetworkInterfaceRequest) ServiceStats(com.vmware.xenon.common.ServiceStats) URI_PARAM_ENDPOINT(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.URI_PARAM_ENDPOINT) AWSUtils.getRegionId(com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.getRegionId) NetworkInterfaceService(com.vmware.photon.controller.model.resources.NetworkInterfaceService) TagService(com.vmware.photon.controller.model.resources.TagService) AWSUtils.getAWSNonTerminatedInstancesFilter(com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.getAWSNonTerminatedInstancesFilter) ProvisioningUtils.getVMCount(com.vmware.photon.controller.model.tasks.ProvisioningUtils.getVMCount) Assert.assertFalse(org.junit.Assert.assertFalse) DetachNetworkInterfaceRequest(com.amazonaws.services.ec2.model.DetachNetworkInterfaceRequest) Tag(com.amazonaws.services.ec2.model.Tag) UriUtils(com.vmware.xenon.common.UriUtils) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) InstanceTypeList(com.vmware.photon.controller.model.support.InstanceTypeList) DeleteSnapshotRequest(com.amazonaws.services.ec2.model.DeleteSnapshotRequest) TaskState(com.vmware.xenon.common.TaskState) RunInstancesResult(com.amazonaws.services.ec2.model.RunInstancesResult) PRIVATE_KEY_KEY(com.vmware.photon.controller.model.adapterapi.EndpointConfigRequest.PRIVATE_KEY_KEY) CreateSubnetRequest(com.amazonaws.services.ec2.model.CreateSubnetRequest) InstanceNetworkInterface(com.amazonaws.services.ec2.model.InstanceNetworkInterface) NicSpec(com.vmware.photon.controller.model.adapters.awsadapter.TestAWSSetupUtils.AwsNicSpecs.NicSpec) DISK_IOPS(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.DISK_IOPS) ResourcePoolState(com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) SYSTEM(com.vmware.photon.controller.model.resources.TagService.TagState.TagOrigin.SYSTEM) AWSS3StorageEnumerationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSS3StorageEnumerationAdapterService) ArrayList(java.util.ArrayList) AWSEBSStorageEnumerationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSEBSStorageEnumerationAdapterService) SecurityGroupState(com.vmware.photon.controller.model.resources.SecurityGroupService.SecurityGroupState) Rule(com.vmware.photon.controller.model.resources.SecurityGroupService.SecurityGroupState.Rule) URI_PARAM_INSTANCE_TYPE(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.URI_PARAM_INSTANCE_TYPE) USER_DEFINED(com.vmware.photon.controller.model.resources.TagService.TagState.TagOrigin.USER_DEFINED) Query(com.vmware.xenon.services.common.QueryTask.Query) ResourceRemovalTaskState(com.vmware.photon.controller.model.tasks.ResourceRemovalTaskService.ResourceRemovalTaskState) DescribeSecurityGroupsResult(com.amazonaws.services.ec2.model.DescribeSecurityGroupsResult) DescribeSecurityGroupsRequest(com.amazonaws.services.ec2.model.DescribeSecurityGroupsRequest) DescribeVolumesRequest(com.amazonaws.services.ec2.model.DescribeVolumesRequest) Filter(com.amazonaws.services.ec2.model.Filter) Volume(com.amazonaws.services.ec2.model.Volume) CreateSnapshotResult(com.amazonaws.services.ec2.model.CreateSnapshotResult) CreateVpcRequest(com.amazonaws.services.ec2.model.CreateVpcRequest) AmazonEC2Client(com.amazonaws.services.ec2.AmazonEC2Client) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) SecurityGroupService(com.vmware.photon.controller.model.resources.SecurityGroupService) Assert.assertTrue(org.junit.Assert.assertTrue) DetachInternetGatewayRequest(com.amazonaws.services.ec2.model.DetachInternetGatewayRequest) TerminateInstancesRequest(com.amazonaws.services.ec2.model.TerminateInstancesRequest) LocalDateTime(org.joda.time.LocalDateTime) UnknownHostException(java.net.UnknownHostException) NetworkService(com.vmware.photon.controller.model.resources.NetworkService) AttachNetworkInterfaceResult(com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult) Assert.assertNull(org.junit.Assert.assertNull) NetworkInterfaceAttachmentChanges(com.amazonaws.services.ec2.model.NetworkInterfaceAttachmentChanges) Paths(java.nio.file.Paths) DescribeSnapshotsResult(com.amazonaws.services.ec2.model.DescribeSnapshotsResult) AsyncHandler(com.amazonaws.handlers.AsyncHandler) AmazonEC2Exception(com.amazonaws.services.ec2.model.AmazonEC2Exception) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) CreateSnapshotRequest(com.amazonaws.services.ec2.model.CreateSnapshotRequest) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState) Assert(org.junit.Assert) QuerySpecification(com.vmware.xenon.services.common.QueryTask.QuerySpecification) Assert.assertEquals(org.junit.Assert.assertEquals) DISCOVERED(com.vmware.photon.controller.model.resources.TagService.TagState.TagOrigin.DISCOVERED) AmazonEC2AsyncClient(com.amazonaws.services.ec2.AmazonEC2AsyncClient) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) StopInstancesResult(com.amazonaws.services.ec2.model.StopInstancesResult) RegisterInstancesWithLoadBalancerRequest(com.amazonaws.services.elasticloadbalancing.model.RegisterInstancesWithLoadBalancerRequest) QueryTask(com.vmware.xenon.services.common.QueryTask) TimeoutException(java.util.concurrent.TimeoutException) StatsCollectionTaskState(com.vmware.photon.controller.model.tasks.monitoring.StatsCollectionTaskService.StatsCollectionTaskState) ServiceDocument(com.vmware.xenon.common.ServiceDocument) Random(java.util.Random) StatsAggregationTaskService(com.vmware.photon.controller.model.tasks.monitoring.StatsAggregationTaskService) ByteBuffer(java.nio.ByteBuffer) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) EndpointAllocationTaskService(com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService) CreateTagsRequest(com.amazonaws.services.ec2.model.CreateTagsRequest) StatsAggregationTaskState(com.vmware.photon.controller.model.tasks.monitoring.StatsAggregationTaskService.StatsAggregationTaskState) DescribeInstanceStatusRequest(com.amazonaws.services.ec2.model.DescribeInstanceStatusRequest) CreateVolumeRequest(com.amazonaws.services.ec2.model.CreateVolumeRequest) EndpointService(com.vmware.photon.controller.model.resources.EndpointService) ResourcePoolService(com.vmware.photon.controller.model.resources.ResourcePoolService) ProvisionDiskTaskService(com.vmware.photon.controller.model.tasks.ProvisionDiskTaskService) URI(java.net.URI) DeleteSubnetRequest(com.amazonaws.services.ec2.model.DeleteSubnetRequest) StatsCollectionTaskService(com.vmware.photon.controller.model.tasks.monitoring.StatsCollectionTaskService) Reservation(com.amazonaws.services.ec2.model.Reservation) EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) LoadBalancerService(com.vmware.photon.controller.model.resources.LoadBalancerService) EndpointAllocationTaskState(com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService.EndpointAllocationTaskState) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) NetworkInterfaceDescriptionService(com.vmware.photon.controller.model.resources.NetworkInterfaceDescriptionService) DeleteLoadBalancerRequest(com.amazonaws.services.elasticloadbalancing.model.DeleteLoadBalancerRequest) DescribeVolumesResult(com.amazonaws.services.ec2.model.DescribeVolumesResult) TestUtils(com.vmware.photon.controller.model.tasks.TestUtils) DescribeInstancesResult(com.amazonaws.services.ec2.model.DescribeInstancesResult) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Occurance(com.vmware.xenon.services.common.QueryTask.Query.Occurance) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) AmazonElasticLoadBalancingAsyncClient(com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancingAsyncClient) List(java.util.List) Snapshot(com.amazonaws.services.ec2.model.Snapshot) DescribeSnapshotsRequest(com.amazonaws.services.ec2.model.DescribeSnapshotsRequest) TaskOption(com.vmware.photon.controller.model.tasks.TaskOption) DiskService(com.vmware.photon.controller.model.resources.DiskService) NetSpec(com.vmware.photon.controller.model.adapters.awsadapter.TestAWSSetupUtils.AwsNicSpecs.NetSpec) EndpointRemovalTaskState(com.vmware.photon.controller.model.tasks.EndpointRemovalTaskService.EndpointRemovalTaskState) ResourceRemovalTaskService(com.vmware.photon.controller.model.tasks.ResourceRemovalTaskService) DeleteInternetGatewayRequest(com.amazonaws.services.ec2.model.DeleteInternetGatewayRequest) HashMap(java.util.HashMap) CreateNetworkInterfaceRequest(com.amazonaws.services.ec2.model.CreateNetworkInterfaceRequest) AWSEnumerationAndCreationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSEnumerationAndCreationAdapterService) PRIVATE_KEYID_KEY(com.vmware.photon.controller.model.adapterapi.EndpointConfigRequest.PRIVATE_KEYID_KEY) CreateSubnetResult(com.amazonaws.services.ec2.model.CreateSubnetResult) RegisterInstancesWithLoadBalancerResult(com.amazonaws.services.elasticloadbalancing.model.RegisterInstancesWithLoadBalancerResult) ProvisionComputeTaskState(com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState) Level(java.util.logging.Level) HashSet(java.util.HashSet) AttachNetworkInterfaceRequest(com.amazonaws.services.ec2.model.AttachNetworkInterfaceRequest) CreateVolumeResult(com.amazonaws.services.ec2.model.CreateVolumeResult) AWSSecurityGroupClient(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSSecurityGroupClient) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) EndpointType(com.vmware.photon.controller.model.constants.PhotonModelConstants.EndpointType) Subnet(com.amazonaws.services.ec2.model.Subnet) Listener(com.amazonaws.services.elasticloadbalancing.model.Listener) Instance(com.amazonaws.services.ec2.model.Instance) AWSConstants.getQueryResultLimit(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.getQueryResultLimit) ResourceEnumerationTaskState(com.vmware.photon.controller.model.tasks.ResourceEnumerationTaskService.ResourceEnumerationTaskState) Assert.assertNotNull(org.junit.Assert.assertNotNull) Vpc(com.amazonaws.services.ec2.model.Vpc) DescribeInstanceStatusResult(com.amazonaws.services.ec2.model.DescribeInstanceStatusResult) Operation(com.vmware.xenon.common.Operation) RunInstancesRequest(com.amazonaws.services.ec2.model.RunInstancesRequest) DeleteSecurityGroupRequest(com.amazonaws.services.ec2.model.DeleteSecurityGroupRequest) AWS_VPC_ID_FILTER(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_VPC_ID_FILTER) ProvisioningUtils.createServiceURI(com.vmware.photon.controller.model.tasks.ProvisioningUtils.createServiceURI) TimeUnit(java.util.concurrent.TimeUnit) ModifyNetworkInterfaceAttributeRequest(com.amazonaws.services.ec2.model.ModifyNetworkInterfaceAttributeRequest) DeleteVolumeRequest(com.amazonaws.services.ec2.model.DeleteVolumeRequest) ImageState(com.vmware.photon.controller.model.resources.ImageService.ImageState) EndpointRemovalTaskService(com.vmware.photon.controller.model.tasks.EndpointRemovalTaskService) NetworkInterfaceDescription(com.vmware.photon.controller.model.resources.NetworkInterfaceDescriptionService.NetworkInterfaceDescription) AWSEnumerationAdapterService(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSEnumerationAdapterService) Collections(java.util.Collections) AWS_INVALID_VOLUME_ID_ERROR_CODE(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_INVALID_VOLUME_ID_ERROR_CODE) DescribeSecurityGroupsRequest(com.amazonaws.services.ec2.model.DescribeSecurityGroupsRequest) AWSSecurityGroupClient(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSSecurityGroupClient) SecurityGroup(com.amazonaws.services.ec2.model.SecurityGroup) DescribeSecurityGroupsResult(com.amazonaws.services.ec2.model.DescribeSecurityGroupsResult)

Example 19 with AmazonEC2AsyncClient

use of com.amazonaws.services.ec2.AmazonEC2AsyncClient in project photon-model by vmware.

the class TestAWSSetupUtils method tearDownTestVpc.

public static void tearDownTestVpc(AmazonEC2AsyncClient client, VerificationHost host, Map<String, Object> awsTestContext, boolean isMock) {
    // if we feel the need to delete resources on every test run.
    if (!isMock && awsTestContext.containsKey(DELETE_RESOURCES_KEY)) {
        final String vpcId = (String) awsTestContext.get(VPC_KEY);
        final String subnetId = (String) awsTestContext.get(SUBNET_KEY);
        final String internetGatewayId = (String) awsTestContext.get(INTERNET_GATEWAY_KEY);
        final String securityGroupId = (String) awsTestContext.get(SECURITY_GROUP_KEY);
        // clean up VPC and all its dependencies if creating one at setUp
        deleteSecurityGroupUsingEC2Client(client, host, securityGroupId);
        SecurityGroup securityGroup = new AWSSecurityGroupClient(client).getSecurityGroup(AWS_DEFAULT_GROUP_NAME, vpcId);
        if (securityGroup != null) {
            deleteSecurityGroupUsingEC2Client(client, host, securityGroup.getGroupId());
        }
        deleteSubnet(client, subnetId);
        detachInternetGateway(client, vpcId, internetGatewayId);
        deleteInternetGateway(client, internetGatewayId);
        deleteVPC(client, vpcId);
    }
}
Also used : AWSSecurityGroupClient(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSSecurityGroupClient) SecurityGroup(com.amazonaws.services.ec2.model.SecurityGroup)

Example 20 with AmazonEC2AsyncClient

use of com.amazonaws.services.ec2.AmazonEC2AsyncClient in project photon-model by vmware.

the class AWSUtils method getOrCreateDefaultSecurityGroup.

public static List<String> getOrCreateDefaultSecurityGroup(AmazonEC2AsyncClient amazonEC2Client, AWSNicContext nicCtx) {
    AWSSecurityGroupClient client = new AWSSecurityGroupClient(amazonEC2Client);
    // in case no group is configured in the properties, attempt to discover the default one
    if (nicCtx != null && nicCtx.vpc != null) {
        try {
            SecurityGroup group = client.getSecurityGroup(DEFAULT_SECURITY_GROUP_NAME, nicCtx.vpc.getVpcId());
            if (group != null) {
                return Arrays.asList(group.getGroupId());
            }
        } catch (AmazonServiceException t) {
            if (!t.getMessage().contains(DEFAULT_SECURITY_GROUP_NAME)) {
                throw t;
            }
        }
    }
    // if the group doesn't exist an exception is thrown. We won't throw a
    // missing group exception
    // we will continue and create the group
    String groupId = client.createDefaultSecurityGroupWithDefaultRules(nicCtx.vpc);
    return Collections.singletonList(groupId);
}
Also used : AWSSecurityGroupClient(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSSecurityGroupClient) AmazonServiceException(com.amazonaws.AmazonServiceException) SecurityGroup(com.amazonaws.services.ec2.model.SecurityGroup)

Aggregations

AmazonEC2AsyncClient (com.amazonaws.services.ec2.AmazonEC2AsyncClient)18 Operation (com.vmware.xenon.common.Operation)13 DescribeInstancesRequest (com.amazonaws.services.ec2.model.DescribeInstancesRequest)11 Filter (com.amazonaws.services.ec2.model.Filter)11 StatelessService (com.vmware.xenon.common.StatelessService)11 AWSClientManager (com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManager)10 SecurityGroup (com.amazonaws.services.ec2.model.SecurityGroup)9 StopInstancesRequest (com.amazonaws.services.ec2.model.StopInstancesRequest)9 StopInstancesResult (com.amazonaws.services.ec2.model.StopInstancesResult)9 ArrayList (java.util.ArrayList)9 AsyncHandler (com.amazonaws.handlers.AsyncHandler)8 AWSClientManagerFactory (com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManagerFactory)8 ComputeService (com.vmware.photon.controller.model.resources.ComputeService)8 AuthCredentialsServiceState (com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState)8 HashMap (java.util.HashMap)8 List (java.util.List)8 TimeUnit (java.util.concurrent.TimeUnit)8 AmazonEC2Exception (com.amazonaws.services.ec2.model.AmazonEC2Exception)7 DescribeInstancesResult (com.amazonaws.services.ec2.model.DescribeInstancesResult)7 AWSSecurityGroupClient (com.vmware.photon.controller.model.adapters.awsadapter.util.AWSSecurityGroupClient)7