本文整理汇总了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);
}));
}
示例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");
}
示例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;
}