mirror of https://github.com/apache/cloudstack.git
listPublicIpAddresses by associatedNetworkId
This commit is contained in:
parent
658b5f929b
commit
bc544d31e7
|
|
@ -303,6 +303,7 @@ public class ApiConstants {
|
|||
public static final String FIREWALL_DEVICE_STATE = "fwdevicestate";
|
||||
public static final String FIREWALL_DEVICE_CAPACITY = "fwdevicecapacity";
|
||||
public static final String SERVICE = "service";
|
||||
public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
|
|||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="lists all public IP addresses by physical network id")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
@IdentityMapper(entityTableName="networks")
|
||||
@Parameter(name=ApiConstants.ASSOCIATED_NETWORK_ID, type=CommandType.LONG, description="lists all public IP addresses associated to the network specified")
|
||||
private Long associatedNetworkId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -124,12 +128,15 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
|
|||
public Long getPhysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
}
|
||||
|
||||
public Long getAssociatedNetworkId() {
|
||||
return associatedNetworkId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
@SerializedName("virtualmachinedisplayname") @Param(description="virutal machine display name the ip address is assigned to (not null only for static nat Ip)")
|
||||
private String virtualMachineDisplayName;
|
||||
|
||||
@SerializedName("associatednetworkid") @Param(description="the ID of the Network associated with the IP address")
|
||||
@SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) @Param(description="the ID of the Network associated with the IP address")
|
||||
private IdentityProxy associatedNetworkId = new IdentityProxy("networks");
|
||||
|
||||
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the ID of the Network where ip belongs to")
|
||||
|
|
|
|||
|
|
@ -2045,6 +2045,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
Object keyword = cmd.getKeyword();
|
||||
Long projectId = cmd.getProjectId();
|
||||
Long physicalNetworkId = cmd.getPhysicalNetworkId();
|
||||
Long associatedNetworkId = cmd.getAssociatedNetworkId();
|
||||
|
||||
List<Long> permittedAccounts = new ArrayList<Long>();
|
||||
|
||||
|
|
@ -2115,6 +2116,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
sb.and("vlanDbId", sb.entity().getVlanId(), SearchCriteria.Op.EQ);
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("physicalNetworkId", sb.entity().getPhysicalNetworkId(), SearchCriteria.Op.EQ);
|
||||
sb.and("associatedNetworkId", sb.entity().getAssociatedWithNetworkId(), SearchCriteria.Op.EQ);
|
||||
|
||||
if ((permittedAccounts.isEmpty()) && (domainId != null)) {
|
||||
// if accountId isn't specified, we can do a domain match for the admin case
|
||||
|
|
@ -2181,6 +2183,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
if (physicalNetworkId != null) {
|
||||
sc.setParameters("physicalNetworkId", physicalNetworkId);
|
||||
}
|
||||
|
||||
if (associatedNetworkId != null) {
|
||||
sc.setParameters("associatedNetworkId", associatedNetworkId);
|
||||
}
|
||||
|
||||
return _publicIpAddressDao.search(sc, searchFilter);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue