Example usage for com.amazonaws.services.ec2.model ModifyInstanceAttributeRequest getGroups

List of usage examples for com.amazonaws.services.ec2.model ModifyInstanceAttributeRequest getGroups

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model ModifyInstanceAttributeRequest getGroups.

Prototype


public java.util.List<String> getGroups() 

Source Link

Document

[EC2-VPC] Changes the security groups of the instance.

Usage

From source file:org.finra.dm.dao.impl.MockEc2OperationsImpl.java

License:Apache License

@Override
public void modifyInstanceAttribute(AmazonEC2Client ec2Client,
        ModifyInstanceAttributeRequest modifyInstanceAttributeRequest) {
    if (modifyInstanceAttributeRequest.getGroups() != null && modifyInstanceAttributeRequest.getGroups().get(0)
            .equals(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION)) {
        throw new AmazonServiceException(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION);
    }/*from  w  ww.j  a v  a  2  s.  c om*/

    if (modifyInstanceAttributeRequest.getGroups() != null && modifyInstanceAttributeRequest.getGroups().get(0)
            .equals(MockAwsOperationsHelper.AMAZON_THROTTLING_EXCEPTION)) {
        AmazonServiceException throttlingException = new AmazonServiceException("test throttling exception");
        throttlingException.setErrorCode("ThrottlingException");

        throw throttlingException;
    }

}