当前位置: 首页>>代码示例>>Java>>正文


Java Subnet.getCidrBlock方法代码示例

本文整理汇总了Java中com.amazonaws.services.ec2.model.Subnet.getCidrBlock方法的典型用法代码示例。如果您正苦于以下问题:Java Subnet.getCidrBlock方法的具体用法?Java Subnet.getCidrBlock怎么用?Java Subnet.getCidrBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.ec2.model.Subnet的用法示例。


在下文中一共展示了Subnet.getCidrBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSubnetState

import com.amazonaws.services.ec2.model.Subnet; //导入方法依赖的package包/类
/**
 * Create SubnetState representing AWS Subnet instance.
 */
private void createSubnetState(Subnet subnet, AWSNetworkContext context, AWSNetworkStage next) {
    SubnetState subnetState = new SubnetState();
    subnetState.id = subnet.getSubnetId();
    subnetState.name = subnet.getSubnetId();
    subnetState.subnetCIDR = subnet.getCidrBlock();
    subnetState.networkLink = context.network.documentSelfLink;
    subnetState.tenantLinks = context.network.tenantLinks;

    sendRequest(
            Operation.createPost(this.getHost(), SubnetService.FACTORY_LINK)
                    .setBody(subnetState)
                    .setCompletion((o, e) -> {
                        if (e != null) {
                            handleStages(context, e);
                            return;
                        }
                        handleStages(context, next);
                    }));
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:23,代码来源:AWSNetworkService.java

示例2: SubnetDTO

import com.amazonaws.services.ec2.model.Subnet; //导入方法依赖的package包/类
public SubnetDTO(final Subnet subnet) {
    this.subnetId = subnet.getSubnetId();
    this.vpcId = subnet.getVpcId();
    this.state = subnet.getState();
    this.availabilityZone = subnet.getAvailabilityZone();
    this.cidrBlock = subnet.getCidrBlock();

    this.tags.addAll(
        subnet.getTags()
            .stream()
            .map(TagDTO::new)
            .collect(Collectors.toList()));

    this.name = subnet.getTags()
        .stream()
        .filter(t -> t.getKey().equals("Name"))
        .findFirst()
        .map(Tag::getValue)
        .orElse("n/a");
}
 
开发者ID:kylesm,项目名称:vpcviewer,代码行数:21,代码来源:SubnetDTO.java

示例3: mapSubnetToSubnetState

import com.amazonaws.services.ec2.model.Subnet; //导入方法依赖的package包/类
/**
 * NOTE: Keep in mind that subnetState.networkLink is not set and it should be updated once
 * valid NetworkState.documentSelfLink is available.
 */
public static SubnetState mapSubnetToSubnetState(Subnet subnet, List<String> tenantLinks,
        String regionId, String parentComputeLink, String endpointLink) {
    if (subnet == null) {
        throw new IllegalArgumentException(
                "Cannot map Subnet to subnet state for null instance");
    }
    SubnetState subnetState = new SubnetState();
    subnetState.id = subnet.getSubnetId();
    subnetState.name = subnet.getSubnetId();
    subnetState.subnetCIDR = subnet.getCidrBlock();
    subnetState.supportPublicIpAddress = subnet.isMapPublicIpOnLaunch();
    subnetState.defaultForZone = subnet.isDefaultForAz();
    subnetState.zoneId = subnet.getAvailabilityZone();
    subnetState.tenantLinks = tenantLinks;
    subnetState.endpointLink = endpointLink;
    if (subnetState.endpointLinks == null) {
        subnetState.endpointLinks = new HashSet<>();
    }
    subnetState.endpointLinks.add(endpointLink);
    subnetState.computeHostLink = parentComputeLink;
    subnetState.customProperties = new HashMap<>();
    subnetState.regionId = regionId;

    if (!subnet.getTags().isEmpty()) {

        // The name of the subnet state is the value of the AWS_TAG_NAME tag
        String nameTag = getTagValue(subnet.getTags(), AWS_TAG_NAME);
        if (!StringUtil.isNullOrEmpty(nameTag)) {
            subnetState.name = nameTag;
        }
    }
    return subnetState;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:38,代码来源:AWSNetworkUtils.java


注:本文中的com.amazonaws.services.ec2.model.Subnet.getCidrBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。