當前位置: 首頁>>代碼示例>>Java>>正文


Java AttachNetworkInterfaceResult類代碼示例

本文整理匯總了Java中com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult的典型用法代碼示例。如果您正苦於以下問題:Java AttachNetworkInterfaceResult類的具體用法?Java AttachNetworkInterfaceResult怎麽用?Java AttachNetworkInterfaceResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AttachNetworkInterfaceResult類屬於com.amazonaws.services.ec2.model包,在下文中一共展示了AttachNetworkInterfaceResult類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addNICDirectlyWithEC2Client

import com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult; //導入依賴的package包/類
/**
 * Attach a provided AWS NIC to a given AWS VM with deviceIndex = number of NICs + 1
 * returns the attachment ID of the newly created and attached NIC. This is necessary for
 * removing it later for the goals of the test. The NIC is as well configured to be deleted on
 * instance termination for sanity purposes.
 */
public static String addNICDirectlyWithEC2Client(ComputeState vm, AmazonEC2Client client,
        VerificationHost host, String newNicId) {

    // attach the new AWS NIC to the AWS VM
    AttachNetworkInterfaceRequest attachNewNic = new AttachNetworkInterfaceRequest()
            .withInstanceId(vm.id)
            .withDeviceIndex(vm.networkInterfaceLinks.size())
            .withNetworkInterfaceId(newNicId);

    AttachNetworkInterfaceResult attachmetnResult = client.attachNetworkInterface(attachNewNic);
    String attachmentId = attachmetnResult.getAttachmentId();

    // ensure the new NIC is deleted when the VM is terminated
    NetworkInterfaceAttachmentChanges attachTerm = new NetworkInterfaceAttachmentChanges()
            .withAttachmentId(attachmentId)
            .withDeleteOnTermination(true);
    ModifyNetworkInterfaceAttributeRequest setDeleteOnTerm = new ModifyNetworkInterfaceAttributeRequest()
            .withAttachment(attachTerm)
            .withNetworkInterfaceId(newNicId);
    client.modifyNetworkInterfaceAttribute(setDeleteOnTerm);
    host.log("Created new NIC with id: %s to vm id: %s with attachment id: %s", newNicId,
            vm.id, attachmentId);
    return attachmentId;
}
 
開發者ID:vmware,項目名稱:photon-model,代碼行數:31,代碼來源:TestAWSSetupUtils.java

示例2: attach

import com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult; //導入依賴的package包/類
@Override
public AttachNetworkInterfaceResult attach(AttachNetworkInterfaceRequest
        request, ResultCapture<AttachNetworkInterfaceResult> extractor) {

    ActionResult result = resource.performAction("Attach", request,
            extractor);

    if (result == null) return null;
    return (AttachNetworkInterfaceResult) result.getData();
}
 
開發者ID:awslabs,項目名稱:aws-sdk-java-resources,代碼行數:11,代碼來源:NetworkInterfaceImpl.java

示例3: attachNetworkInterface

import com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult; //導入依賴的package包/類
@Override
public AttachNetworkInterfaceResult attachNetworkInterface(AttachNetworkInterfaceRequest attachNetworkInterfaceRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:5,代碼來源:AmazonEC2Mock.java

示例4: attach

import com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult; //導入依賴的package包/類
/**
 * Performs the <code>Attach</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>NetworkInterface</code> resource, and any conflicting parameter
 * value set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>NetworkInterfaceId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The response of the low-level client operation associated with
 *         this resource action.
 * @see AttachNetworkInterfaceRequest
 */
AttachNetworkInterfaceResult attach(AttachNetworkInterfaceRequest request);
 
開發者ID:awslabs,項目名稱:aws-sdk-java-resources,代碼行數:22,代碼來源:NetworkInterface.java


注:本文中的com.amazonaws.services.ec2.model.AttachNetworkInterfaceResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。