Search in sources :

Example 1 with CreateNetworkInterfaceRequest

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

the class TestAWSSetupUtils method createNICDirectlyWithEC2Client.

/**
 * Create a new AWS NIC in the default subnet
 */
public static String createNICDirectlyWithEC2Client(AmazonEC2Client client, VerificationHost host, String subnetId) {
    // create the new AWS NIC
    CreateNetworkInterfaceRequest createNewNic = new CreateNetworkInterfaceRequest().withSubnetId(subnetId);
    CreateNetworkInterfaceResult createNewNicResult = client.createNetworkInterface(createNewNic);
    String networkInterfaceID = createNewNicResult.getNetworkInterface().getNetworkInterfaceId();
    tagResources(client, Arrays.asList(networkInterfaceID), TAG_KEY_FOR_TEST_RESOURCES, TAG_VALUE_FOR_TEST_RESOURCES + TAG_NIC);
    return networkInterfaceID;
}
Also used : CreateNetworkInterfaceResult(com.amazonaws.services.ec2.model.CreateNetworkInterfaceResult) CreateNetworkInterfaceRequest(com.amazonaws.services.ec2.model.CreateNetworkInterfaceRequest)

Aggregations

CreateNetworkInterfaceRequest (com.amazonaws.services.ec2.model.CreateNetworkInterfaceRequest)1 CreateNetworkInterfaceResult (com.amazonaws.services.ec2.model.CreateNetworkInterfaceResult)1