mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(ec2) Fix/1031 ec2 describe network interfaces (#1035)
* feat(ec2): add partial DescribeNetworkInterfaces (phases 1-3) Wire DescribeNetworkInterfaces into the EC2 query handler with ENI data derived from running instances. Covers: - Empty response skeleton - Basic ENI mapping (networkInterfaceId, subnetId, vpcId, groupSet, attachment) - Full field coverage (privateIpAddressesSet, EIP association, tagSet, availabilityZone, interfaceType, attachTime, deleteOnTermination) Remaining: filter support, pagination, error handling, Terraform compat validation (phases 4-6 for #1031). * feat(ec2): add filter support for DescribeNetworkInterfaces (phase 4) Support these filter keys: network-interface-id, subnet-id, vpc-id, group-id, status, private-ip-address, description, owner-id, mac-address, private-dns-name, tag:<key>, tag-key. Filters use AND semantics. No-match filters return HTTP 200 with empty networkInterfaceSet. * feat(ec2): add pagination and error handling for DescribeNetworkInterfaces (phases 5-6) - Add NetworkInterfaceListResult record for paginated responses - Implement offset-based MaxResults/NextToken pagination - Add Base64 token encode/decode for pagination cursor - Validate MaxResults range (5-1000) and MaxResults+NetworkInterfaceId conflict - Conditionally emit nextToken in XML response (only when truncated) - Add InvalidNetworkInterfaceID.NotFound for non-existent IDs - Add InvalidNetworkInterfaceID.Malformed for IDs not starting with 'eni-' - Track found IDs via HashSet for accurate NotFound detection * test(ec2): add DescribeNetworkInterfaces pagination, error, and multipage tests - 5 pagination validation tests (MaxResults range, param conflict, invalid token) - 1 pagination success test (MaxResults > available ENIs, no nextToken emitted) - 2 error handling tests (InvalidNetworkInterfaceID.NotFound and .Malformed) - 1 self-contained multipage pagination test (launches 5 extra instances, verifies MaxResults=5 truncation, NextToken continuation, final page cleanup) - All 87 Ec2IntegrationTest tests pass * test(ec2): add SDK and Terraform compat tests for DescribeNetworkInterfaces - Add Ec2NetworkInterfacePaginationTest with 4 scenarios: all 6 ENIs without pagination, MaxResults=5 truncation, NextToken continuation (no overlap between pages), and token re-use stability - Add eni_destroy.bats Terraform compat test verifying destroy succeeds on VPC+subnet+SG now that DescribeNetworkInterfaces is implemented - Add minimal Terraform config (VPC 10.0.0.0/16, subnet, SG) for ENI test * fix(ec2): align DescribeNetworkInterfaces MaxResults errors * test(terraform): make ENI destroy compat test runnable
This commit is contained in:
1 parent
8be5d03bbc
commit
55a90e8299
13 files changed
+1266
-3
No files matched your search
@@ -158,7 +158,8 @@ public class AwsQueryController {
|
||||
"AssociateRouteTable", "DisassociateRouteTable", "CreateRoute", "DeleteRoute",
|
||||
"AllocateAddress", "AssociateAddress", "DisassociateAddress", "ReleaseAddress", "DescribeAddresses",
|
||||
"DescribeAvailabilityZones", "DescribeRegions", "DescribeAccountAttributes",
|
||||
"DescribeInstanceTypes"
|
||||
"DescribeInstanceTypes",
|
||||
"DescribeNetworkInterfaces"
|
||||
);
|
||||
|
||||
private final CloudFormationQueryHandler cloudFormationQueryHandler;
|
||||
|
||||
@@ -2,7 +2,6 @@ package io.github.hectorvent.floci.services.ec2;
|
||||
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.AwsNamespaces;
|
||||
import io.github.hectorvent.floci.core.common.AwsQueryResponse;
|
||||
import io.github.hectorvent.floci.core.common.XmlBuilder;
|
||||
import io.github.hectorvent.floci.services.ec2.model.*;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
@@ -110,6 +109,8 @@ public class Ec2QueryHandler {
|
||||
case "DescribeAccountAttributes" -> handleDescribeAccountAttributes(params, region);
|
||||
// Instance Types
|
||||
case "DescribeInstanceTypes" -> handleDescribeInstanceTypes(params, region);
|
||||
// Network Interfaces
|
||||
case "DescribeNetworkInterfaces" -> handleDescribeNetworkInterfaces(params, region);
|
||||
// Volumes
|
||||
case "CreateVolume" -> handleCreateVolume(params, region);
|
||||
case "DescribeVolumes" -> handleDescribeVolumes(params, region);
|
||||
@@ -154,6 +155,17 @@ public class Ec2QueryHandler {
|
||||
return result;
|
||||
}
|
||||
|
||||
private int parseIntParam(MultivaluedMap<String, String> p, String name, int defaultValue) {
|
||||
String val = p.getFirst(name);
|
||||
if (val == null || val.isEmpty()) return defaultValue;
|
||||
try {
|
||||
return Integer.parseInt(val);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new AwsException("InvalidMaxResults",
|
||||
"The specified value for MaxResults is not valid.", 400);
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, List<String>> getFilters(MultivaluedMap<String, String> p) {
|
||||
Map<String, List<String>> filters = new LinkedHashMap<>();
|
||||
for (int i = 1; ; i++) {
|
||||
@@ -1110,6 +1122,88 @@ public class Ec2QueryHandler {
|
||||
return xmlResponse(xml.build());
|
||||
}
|
||||
|
||||
// ─── Network Interface handlers ───────────────────────────────────────────
|
||||
|
||||
private Response handleDescribeNetworkInterfaces(MultivaluedMap<String, String> p, String region) {
|
||||
List<String> ids = getList(p, "NetworkInterfaceId");
|
||||
Map<String, List<String>> filters = getFilters(p);
|
||||
|
||||
// Phase 5: pagination parameters
|
||||
int maxResults = parseIntParam(p, "MaxResults", 0);
|
||||
String nextToken = p.getFirst("NextToken");
|
||||
|
||||
NetworkInterfaceListResult result = service.describeNetworkInterfaces(region, ids, filters, maxResults, nextToken);
|
||||
List<NetworkInterface> nis = result.networkInterfaces();
|
||||
|
||||
XmlBuilder xml = new XmlBuilder()
|
||||
.start("DescribeNetworkInterfacesResponse", AwsNamespaces.EC2)
|
||||
.elem("requestId", UUID.randomUUID().toString())
|
||||
.start("networkInterfaceSet");
|
||||
for (NetworkInterface ni : nis) {
|
||||
xml.start("item")
|
||||
.elem("networkInterfaceId", ni.getNetworkInterfaceId())
|
||||
.elem("subnetId", ni.getSubnetId())
|
||||
.elem("vpcId", ni.getVpcId())
|
||||
.elem("availabilityZone", ni.getAvailabilityZone())
|
||||
.elem("description", ni.getDescription())
|
||||
.elem("ownerId", ni.getOwnerId())
|
||||
.elem("status", ni.getStatus())
|
||||
.elem("interfaceType", ni.getInterfaceType())
|
||||
.elem("macAddress", ni.getMacAddress())
|
||||
.elem("privateIpAddress", ni.getPrivateIpAddress())
|
||||
.elem("privateDnsName", ni.getPrivateDnsName())
|
||||
.elem("sourceDestCheck", String.valueOf(ni.isSourceDestCheck()))
|
||||
.start("groupSet");
|
||||
for (GroupIdentifier gi : ni.getGroups()) {
|
||||
xml.start("item")
|
||||
.elem("groupId", gi.getGroupId())
|
||||
.elem("groupName", gi.getGroupName())
|
||||
.end("item");
|
||||
}
|
||||
xml.end("groupSet");
|
||||
// Phase 3: tagSet from instance tags
|
||||
xml.raw(tagSetXml(ni.getTagSet()));
|
||||
if (ni.getAttachment() != null) {
|
||||
xml.start("attachment")
|
||||
.elem("attachmentId", ni.getAttachment().getAttachmentId())
|
||||
.elem("deviceIndex", String.valueOf(ni.getAttachment().getDeviceIndex()))
|
||||
.elem("status", ni.getAttachment().getStatus())
|
||||
.elem("attachTime", ni.getAttachment().getAttachTime())
|
||||
.elem("deleteOnTermination", String.valueOf(ni.getAttachment().isDeleteOnTermination()))
|
||||
.elem("instanceId", ni.getAttachment().getInstanceId())
|
||||
.elem("instanceOwnerId", ni.getAttachment().getInstanceOwnerId())
|
||||
.end("attachment");
|
||||
}
|
||||
// Phase 3: privateIpAddressesSet with association
|
||||
if (!ni.getPrivateIpAddresses().isEmpty()) {
|
||||
xml.start("privateIpAddressesSet");
|
||||
for (NetworkInterfacePrivateIpAddress ip : ni.getPrivateIpAddresses()) {
|
||||
xml.start("item")
|
||||
.elem("privateIpAddress", ip.getPrivateIpAddress())
|
||||
.elem("privateDnsName", ip.getPrivateDnsName())
|
||||
.elem("primary", String.valueOf(ip.isPrimary()));
|
||||
if (ip.getAssociation() != null) {
|
||||
xml.start("association")
|
||||
.elem("publicIp", ip.getAssociation().getPublicIp())
|
||||
.elem("allocationId", ip.getAssociation().getAllocationId())
|
||||
.elem("associationId", ip.getAssociation().getAssociationId())
|
||||
.elem("ipOwnerId", ip.getAssociation().getIpOwnerId())
|
||||
.end("association");
|
||||
}
|
||||
xml.end("item");
|
||||
}
|
||||
xml.end("privateIpAddressesSet");
|
||||
}
|
||||
xml.end("item");
|
||||
}
|
||||
xml.end("networkInterfaceSet");
|
||||
if (result.nextToken() != null) {
|
||||
xml.elem("nextToken", result.nextToken());
|
||||
}
|
||||
xml.end("DescribeNetworkInterfacesResponse");
|
||||
return xmlResponse(xml.build());
|
||||
}
|
||||
|
||||
// ─── XML fragment builders ────────────────────────────────────────────────
|
||||
|
||||
private String instanceXml(Instance inst) {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
package io.github.hectorvent.floci.services.ec2;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -24,6 +30,11 @@ import io.github.hectorvent.floci.services.ec2.model.Image;
|
||||
import io.github.hectorvent.floci.services.ec2.model.Instance;
|
||||
import io.github.hectorvent.floci.services.ec2.model.InstanceNetworkInterface;
|
||||
import io.github.hectorvent.floci.services.ec2.model.InstanceState;
|
||||
import io.github.hectorvent.floci.services.ec2.model.NetworkInterface;
|
||||
import io.github.hectorvent.floci.services.ec2.model.NetworkInterfaceAssociation;
|
||||
import io.github.hectorvent.floci.services.ec2.model.NetworkInterfaceAttachment;
|
||||
import io.github.hectorvent.floci.services.ec2.model.NetworkInterfaceListResult;
|
||||
import io.github.hectorvent.floci.services.ec2.model.NetworkInterfacePrivateIpAddress;
|
||||
import io.github.hectorvent.floci.services.ec2.model.InternetGateway;
|
||||
import io.github.hectorvent.floci.services.ec2.model.InternetGatewayAttachment;
|
||||
import io.github.hectorvent.floci.services.ec2.model.IpPermission;
|
||||
@@ -48,6 +59,8 @@ import jakarta.inject.Inject;
|
||||
public class Ec2Service {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(Ec2Service.class);
|
||||
private static final DateTimeFormatter ISO_FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
.withZone(ZoneOffset.UTC);
|
||||
|
||||
private final String accountId;
|
||||
private final EmulatorConfig config;
|
||||
@@ -1405,6 +1418,25 @@ public class Ec2Service {
|
||||
default -> true;
|
||||
};
|
||||
}
|
||||
if (resource instanceof NetworkInterface ni) {
|
||||
return switch (filterName) {
|
||||
case "network-interface-id" -> matchesValue(values, ni.getNetworkInterfaceId());
|
||||
case "subnet-id" -> matchesValue(values, ni.getSubnetId());
|
||||
case "vpc-id" -> matchesValue(values, ni.getVpcId());
|
||||
case "group-id" -> ni.getGroups().stream()
|
||||
.anyMatch(g -> matchesValue(values, g.getGroupId()));
|
||||
case "status" -> matchesValue(values, ni.getStatus());
|
||||
case "private-ip-address" ->
|
||||
matchesValue(values, ni.getPrivateIpAddress()) ||
|
||||
ni.getPrivateIpAddresses().stream()
|
||||
.anyMatch(ip -> matchesValue(values, ip.getPrivateIpAddress()));
|
||||
case "description" -> matchesValue(values, ni.getDescription());
|
||||
case "owner-id" -> matchesValue(values, ni.getOwnerId());
|
||||
case "mac-address" -> matchesValue(values, ni.getMacAddress());
|
||||
case "private-dns-name" -> matchesValue(values, ni.getPrivateDnsName());
|
||||
default -> true;
|
||||
};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1419,6 +1451,7 @@ public class Ec2Service {
|
||||
if (resource instanceof KeyPair kp) return kp.getTags();
|
||||
if (resource instanceof Address addr) return addr.getTags();
|
||||
if (resource instanceof Volume vol) return vol.getTags();
|
||||
if (resource instanceof NetworkInterface ni) return ni.getTagSet();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1468,4 +1501,146 @@ public class Ec2Service {
|
||||
"The volume '" + volumeId + "' does not exist.", 400);
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Network Interfaces ─────────────────────────────────────────────────────
|
||||
|
||||
public NetworkInterfaceListResult describeNetworkInterfaces(String region, List<String> networkInterfaceIds,
|
||||
Map<String, List<String>> filters,
|
||||
int maxResults, String nextToken) {
|
||||
// Validate pagination parameters
|
||||
if (maxResults > 0 && !networkInterfaceIds.isEmpty()) {
|
||||
throw new AwsException("InvalidParameterCombination",
|
||||
"The parameter NetworkInterfaceId cannot be used with the parameter MaxResults.", 400);
|
||||
}
|
||||
if (maxResults > 0 && (maxResults < 5 || maxResults > 1000)) {
|
||||
throw new AwsException("InvalidMaxResults",
|
||||
"Value (" + maxResults + ") for parameter MaxResults is invalid. "
|
||||
+ "Expecting a value between 5 and 1000.", 400);
|
||||
}
|
||||
int offset = decodeToken(nextToken);
|
||||
|
||||
// Phase 6: validate NetworkInterfaceId format
|
||||
for (String id : networkInterfaceIds) {
|
||||
if (!id.startsWith("eni-")) {
|
||||
throw new AwsException("InvalidNetworkInterfaceID.Malformed",
|
||||
"Invalid id: \"" + id + "\" (expecting \"eni-...\")", 400);
|
||||
}
|
||||
}
|
||||
|
||||
ensureDefaultResources(region);
|
||||
List<NetworkInterface> result = new ArrayList<>();
|
||||
Set<String> foundIds = new HashSet<>();
|
||||
for (Instance inst : instances.values()) {
|
||||
if (!inst.getRegion().equals(region)) continue;
|
||||
for (InstanceNetworkInterface eni : inst.getNetworkInterfaces()) {
|
||||
if (!networkInterfaceIds.isEmpty()
|
||||
&& !networkInterfaceIds.contains(eni.getNetworkInterfaceId())) {
|
||||
continue;
|
||||
}
|
||||
foundIds.add(eni.getNetworkInterfaceId());
|
||||
NetworkInterface ni = new NetworkInterface();
|
||||
ni.setNetworkInterfaceId(eni.getNetworkInterfaceId());
|
||||
ni.setSubnetId(eni.getSubnetId());
|
||||
ni.setVpcId(eni.getVpcId());
|
||||
ni.setDescription(eni.getDescription());
|
||||
ni.setOwnerId(eni.getOwnerId());
|
||||
ni.setStatus(eni.getStatus());
|
||||
ni.setMacAddress(eni.getMacAddress());
|
||||
ni.setPrivateIpAddress(eni.getPrivateIpAddress());
|
||||
ni.setPrivateDnsName(eni.getPrivateDnsName());
|
||||
ni.setSourceDestCheck(eni.isSourceDestCheck());
|
||||
ni.setGroups(new ArrayList<>(eni.getGroups()));
|
||||
// Phase 3: availability zone, tags, interface type
|
||||
if (inst.getPlacement() != null) {
|
||||
ni.setAvailabilityZone(inst.getPlacement().getAvailabilityZone());
|
||||
}
|
||||
ni.getTagSet().addAll(inst.getTags());
|
||||
|
||||
NetworkInterfaceAttachment att = new NetworkInterfaceAttachment();
|
||||
att.setAttachmentId(eni.getAttachmentId());
|
||||
att.setDeviceIndex(eni.getDeviceIndex());
|
||||
att.setStatus("attached");
|
||||
att.setInstanceId(inst.getInstanceId());
|
||||
att.setInstanceOwnerId(eni.getOwnerId());
|
||||
// Phase 3: attachTime from instance launchTime, deleteOnTermination
|
||||
if (inst.getLaunchTime() != null) {
|
||||
att.setAttachTime(ISO_FMT.format(inst.getLaunchTime()));
|
||||
}
|
||||
att.setDeleteOnTermination(true);
|
||||
ni.setAttachment(att);
|
||||
|
||||
// Phase 3: privateIpAddressesSet — primary IP
|
||||
NetworkInterfacePrivateIpAddress primaryIp = new NetworkInterfacePrivateIpAddress();
|
||||
primaryIp.setPrivateIpAddress(eni.getPrivateIpAddress());
|
||||
primaryIp.setPrivateDnsName(eni.getPrivateDnsName());
|
||||
primaryIp.setPrimary(true);
|
||||
// Look up EIP association for this instance
|
||||
addressForInstance(inst.getInstanceId()).ifPresent(addr -> {
|
||||
NetworkInterfaceAssociation assoc = new NetworkInterfaceAssociation();
|
||||
assoc.setPublicIp(addr.getPublicIp());
|
||||
assoc.setAllocationId(addr.getAllocationId());
|
||||
assoc.setAssociationId(addr.getAssociationId());
|
||||
assoc.setIpOwnerId(eni.getOwnerId());
|
||||
primaryIp.setAssociation(assoc);
|
||||
});
|
||||
ni.getPrivateIpAddresses().add(primaryIp);
|
||||
|
||||
// Phase 4: apply filters
|
||||
if (!matchesFilters(ni, filters, region)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.add(ni);
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 6: validate requested IDs exist
|
||||
for (String id : networkInterfaceIds) {
|
||||
if (!foundIds.contains(id)) {
|
||||
throw new AwsException("InvalidNetworkInterfaceID.NotFound",
|
||||
"The network interface ID '" + id + "' does not exist", 400);
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 5: pagination
|
||||
if (maxResults > 0) {
|
||||
int total = result.size();
|
||||
int toIndex = Math.min(offset + maxResults, total);
|
||||
List<NetworkInterface> page = (offset < total)
|
||||
? result.subList(offset, toIndex)
|
||||
: Collections.emptyList();
|
||||
String newNextToken = (toIndex < total)
|
||||
? encodeToken(toIndex)
|
||||
: null;
|
||||
return new NetworkInterfaceListResult(new ArrayList<>(page), newNextToken);
|
||||
}
|
||||
|
||||
return new NetworkInterfaceListResult(result, null);
|
||||
}
|
||||
|
||||
// ─── Pagination token encoding / decoding ──────────────────────────────────
|
||||
|
||||
private String encodeToken(int offset) {
|
||||
String json = "{\"offset\":" + offset + "}";
|
||||
return Base64.getEncoder().encodeToString(json.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
private int decodeToken(String token) {
|
||||
if (token == null || token.isEmpty()) return 0;
|
||||
try {
|
||||
String json = new String(Base64.getDecoder().decode(token), StandardCharsets.UTF_8);
|
||||
int start = json.indexOf("\"offset\":") + 9;
|
||||
int end = json.indexOf('}', start);
|
||||
return Integer.parseInt(json.substring(start, end));
|
||||
} catch (Exception e) {
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"Invalid NextToken", 400);
|
||||
}
|
||||
}
|
||||
|
||||
private Optional<Address> addressForInstance(String instanceId) {
|
||||
return addresses.values().stream()
|
||||
.filter(a -> instanceId.equals(a.getInstanceId()) && a.getAssociationId() != null)
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package io.github.hectorvent.floci.services.ec2.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RegisterForReflection
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NetworkInterface {
|
||||
|
||||
private String networkInterfaceId;
|
||||
private String subnetId;
|
||||
private String vpcId;
|
||||
private String description;
|
||||
private String ownerId;
|
||||
private String status = "in-use";
|
||||
private String macAddress;
|
||||
private String privateIpAddress;
|
||||
private String privateDnsName;
|
||||
private boolean sourceDestCheck = true;
|
||||
private String availabilityZone;
|
||||
private String interfaceType = "interface";
|
||||
private List<GroupIdentifier> groups = new ArrayList<>();
|
||||
private NetworkInterfaceAttachment attachment;
|
||||
private List<Tag> tagSet = new ArrayList<>();
|
||||
private List<NetworkInterfacePrivateIpAddress> privateIpAddresses = new ArrayList<>();
|
||||
|
||||
public NetworkInterface() {}
|
||||
|
||||
public String getNetworkInterfaceId() { return networkInterfaceId; }
|
||||
public void setNetworkInterfaceId(String networkInterfaceId) { this.networkInterfaceId = networkInterfaceId; }
|
||||
|
||||
public String getSubnetId() { return subnetId; }
|
||||
public void setSubnetId(String subnetId) { this.subnetId = subnetId; }
|
||||
|
||||
public String getVpcId() { return vpcId; }
|
||||
public void setVpcId(String vpcId) { this.vpcId = vpcId; }
|
||||
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getOwnerId() { return ownerId; }
|
||||
public void setOwnerId(String ownerId) { this.ownerId = ownerId; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getMacAddress() { return macAddress; }
|
||||
public void setMacAddress(String macAddress) { this.macAddress = macAddress; }
|
||||
|
||||
public String getPrivateIpAddress() { return privateIpAddress; }
|
||||
public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; }
|
||||
|
||||
public String getPrivateDnsName() { return privateDnsName; }
|
||||
public void setPrivateDnsName(String privateDnsName) { this.privateDnsName = privateDnsName; }
|
||||
|
||||
public boolean isSourceDestCheck() { return sourceDestCheck; }
|
||||
public void setSourceDestCheck(boolean sourceDestCheck) { this.sourceDestCheck = sourceDestCheck; }
|
||||
|
||||
public List<GroupIdentifier> getGroups() { return groups; }
|
||||
public void setGroups(List<GroupIdentifier> groups) { this.groups = groups; }
|
||||
|
||||
public String getAvailabilityZone() { return availabilityZone; }
|
||||
public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; }
|
||||
|
||||
public String getInterfaceType() { return interfaceType; }
|
||||
public void setInterfaceType(String interfaceType) { this.interfaceType = interfaceType; }
|
||||
|
||||
public NetworkInterfaceAttachment getAttachment() { return attachment; }
|
||||
public void setAttachment(NetworkInterfaceAttachment attachment) { this.attachment = attachment; }
|
||||
|
||||
public List<Tag> getTagSet() { return tagSet; }
|
||||
public void setTagSet(List<Tag> tagSet) { this.tagSet = tagSet; }
|
||||
|
||||
public List<NetworkInterfacePrivateIpAddress> getPrivateIpAddresses() { return privateIpAddresses; }
|
||||
public void setPrivateIpAddresses(List<NetworkInterfacePrivateIpAddress> privateIpAddresses) { this.privateIpAddresses = privateIpAddresses; }
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package io.github.hectorvent.floci.services.ec2.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NetworkInterfaceAssociation {
|
||||
|
||||
private String publicIp;
|
||||
private String allocationId;
|
||||
private String associationId;
|
||||
private String ipOwnerId;
|
||||
private String publicDnsName;
|
||||
private String carrierIp;
|
||||
|
||||
public NetworkInterfaceAssociation() {}
|
||||
|
||||
public String getPublicIp() { return publicIp; }
|
||||
public void setPublicIp(String publicIp) { this.publicIp = publicIp; }
|
||||
|
||||
public String getAllocationId() { return allocationId; }
|
||||
public void setAllocationId(String allocationId) { this.allocationId = allocationId; }
|
||||
|
||||
public String getAssociationId() { return associationId; }
|
||||
public void setAssociationId(String associationId) { this.associationId = associationId; }
|
||||
|
||||
public String getIpOwnerId() { return ipOwnerId; }
|
||||
public void setIpOwnerId(String ipOwnerId) { this.ipOwnerId = ipOwnerId; }
|
||||
|
||||
public String getPublicDnsName() { return publicDnsName; }
|
||||
public void setPublicDnsName(String publicDnsName) { this.publicDnsName = publicDnsName; }
|
||||
|
||||
public String getCarrierIp() { return carrierIp; }
|
||||
public void setCarrierIp(String carrierIp) { this.carrierIp = carrierIp; }
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package io.github.hectorvent.floci.services.ec2.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NetworkInterfaceAttachment {
|
||||
|
||||
private String attachmentId;
|
||||
private int deviceIndex;
|
||||
private String status = "attached";
|
||||
private String instanceId;
|
||||
private String instanceOwnerId;
|
||||
private String attachTime;
|
||||
private boolean deleteOnTermination = true;
|
||||
|
||||
public NetworkInterfaceAttachment() {}
|
||||
|
||||
public String getAttachmentId() { return attachmentId; }
|
||||
public void setAttachmentId(String attachmentId) { this.attachmentId = attachmentId; }
|
||||
|
||||
public int getDeviceIndex() { return deviceIndex; }
|
||||
public void setDeviceIndex(int deviceIndex) { this.deviceIndex = deviceIndex; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getInstanceId() { return instanceId; }
|
||||
public void setInstanceId(String instanceId) { this.instanceId = instanceId; }
|
||||
|
||||
public String getInstanceOwnerId() { return instanceOwnerId; }
|
||||
public void setInstanceOwnerId(String instanceOwnerId) { this.instanceOwnerId = instanceOwnerId; }
|
||||
|
||||
public String getAttachTime() { return attachTime; }
|
||||
public void setAttachTime(String attachTime) { this.attachTime = attachTime; }
|
||||
|
||||
public boolean isDeleteOnTermination() { return deleteOnTermination; }
|
||||
public void setDeleteOnTermination(boolean deleteOnTermination) { this.deleteOnTermination = deleteOnTermination; }
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package io.github.hectorvent.floci.services.ec2.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Result of paginated network interface listing.
|
||||
*
|
||||
* <p>Used by {@code DescribeNetworkInterfaces} to return a page of network interfaces
|
||||
* along with a cursor token for fetching the next page.</p>
|
||||
*
|
||||
* @param networkInterfaces List of network interfaces for this page
|
||||
* @param nextToken Token for next page, or {@code null} if no more pages
|
||||
* @see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html">AWS EC2 DescribeNetworkInterfaces</a>
|
||||
*/
|
||||
public record NetworkInterfaceListResult(
|
||||
List<NetworkInterface> networkInterfaces,
|
||||
String nextToken
|
||||
) {}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package io.github.hectorvent.floci.services.ec2.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NetworkInterfacePrivateIpAddress {
|
||||
|
||||
private String privateIpAddress;
|
||||
private String privateDnsName;
|
||||
private boolean primary;
|
||||
private NetworkInterfaceAssociation association;
|
||||
|
||||
public NetworkInterfacePrivateIpAddress() {}
|
||||
|
||||
public String getPrivateIpAddress() { return privateIpAddress; }
|
||||
public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; }
|
||||
|
||||
public String getPrivateDnsName() { return privateDnsName; }
|
||||
public void setPrivateDnsName(String privateDnsName) { this.privateDnsName = privateDnsName; }
|
||||
|
||||
public boolean isPrimary() { return primary; }
|
||||
public void setPrimary(boolean primary) { this.primary = primary; }
|
||||
|
||||
public NetworkInterfaceAssociation getAssociation() { return association; }
|
||||
public void setAssociation(NetworkInterfaceAssociation association) { this.association = association; }
|
||||
}
|
||||
Reference in new issue
Block a user