当前位置: 首页>>代码示例>>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;未经允许,请勿转载。